1989-05-16 13:13:53 +00:00
|
|
|
/*
|
|
|
|
* stdio.h - input/output definitions
|
|
|
|
*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
#ifndef _STDIO_H
|
1989-12-18 14:00:32 +00:00
|
|
|
#define _STDIO_H
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
#include <stddef.h>
|
2019-06-15 11:07:10 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <ack/config.h>
|
2007-04-24 19:42:24 +00:00
|
|
|
|
2019-06-15 11:07:10 +00:00
|
|
|
/* Public stdio entry points. */
|
|
|
|
|
|
|
|
typedef struct FILE FILE;
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2019-06-15 11:07:10 +00:00
|
|
|
#define EOF (-1)
|
1989-09-29 15:46:33 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
#define SEEK_END 2
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
typedef long int fpos_t;
|
1989-09-29 15:46:33 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
extern int remove(const char *_filename);
|
|
|
|
extern int rename(const char *_old, const char *_new);
|
|
|
|
extern FILE *tmpfile(void);
|
|
|
|
extern char *tmpnam(char *_s);
|
|
|
|
extern int fclose(FILE *_stream);
|
|
|
|
extern int fflush(FILE *_stream);
|
|
|
|
extern FILE *fopen(const char *_filename, const char *_mode);
|
|
|
|
extern FILE *freopen(const char *_filename, const char *_mode, FILE *_stream);
|
|
|
|
extern void setbuf(FILE *_stream, char *_buf);
|
|
|
|
extern int setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
|
|
|
|
extern int fprintf(FILE *_stream, const char *_format, ...);
|
|
|
|
extern int fscanf(FILE *_stream, const char *_format, ...);
|
2019-06-15 11:07:10 +00:00
|
|
|
extern int vfscanf(FILE *_stream, const char *_format, va_list ap);
|
2007-04-24 19:42:24 +00:00
|
|
|
extern int printf(const char *_format, ...);
|
|
|
|
extern int scanf(const char *_format, ...);
|
|
|
|
extern int sprintf(char *_s, const char *_format, ...);
|
2013-05-29 16:10:58 +00:00
|
|
|
extern int snprintf(char *_s, size_t _len, const char *_format, ...);
|
2007-04-24 19:42:24 +00:00
|
|
|
extern int sscanf(const char *_s, const char *_format, ...);
|
|
|
|
extern int vfprintf(FILE *_stream, const char *_format, char *_arg);
|
|
|
|
extern int vprintf(const char *_format, char *_arg);
|
2019-06-15 11:07:10 +00:00
|
|
|
extern int vsprintf(char *_s, const char *_format, va_list ap);
|
|
|
|
extern int vsnprintf(char *_s, size_t _len, const char *_format, va_list ap);
|
2007-04-24 19:42:24 +00:00
|
|
|
extern int fgetc(FILE *_stream);
|
|
|
|
extern char *fgets(char *_s, int _n, FILE *_stream);
|
|
|
|
extern int fputc(int _c, FILE *_stream);
|
|
|
|
extern int fputs(const char *_s, FILE *_stream);
|
|
|
|
extern int getc(FILE *_stream);
|
|
|
|
extern int getchar(void);
|
|
|
|
extern char *gets(char *_s);
|
|
|
|
extern int putc(int _c, FILE *_stream);
|
|
|
|
extern int putchar(int _c);
|
|
|
|
extern int puts(const char *_s);
|
|
|
|
extern int ungetc(int _c, FILE *_stream);
|
|
|
|
extern size_t fread(void *_ptr, size_t _size, size_t _nmemb, FILE *_stream);
|
|
|
|
extern size_t fwrite(const void *_ptr, size_t _size, size_t _nmemb, FILE *_stream);
|
|
|
|
extern int fgetpos(FILE *_stream, fpos_t *_pos);
|
|
|
|
extern int fseek(FILE *_stream, long _offset, int _whence);
|
|
|
|
extern int fsetpos(FILE *_stream, fpos_t *_pos);
|
|
|
|
extern long ftell(FILE *_stream);
|
|
|
|
extern void rewind(FILE *_stream);
|
|
|
|
extern void clearerr(FILE *_stream);
|
|
|
|
extern int feof(FILE *_stream);
|
|
|
|
extern int ferror(FILE *_stream);
|
|
|
|
extern void perror(const char *_s);
|
|
|
|
|
2019-06-15 20:22:01 +00:00
|
|
|
#define getchar() getc(stdin)
|
|
|
|
#define putchar(c) putc(c, stdout)
|
|
|
|
|
|
|
|
/* Internal function used in several places which is approximately itoa(). */
|
2019-06-15 11:53:20 +00:00
|
|
|
extern char *_i_compute(unsigned long val, int base, char *s, int nrdigits);
|
2019-06-24 18:52:56 +00:00
|
|
|
extern void itoa(long val, char* buffer, int radix);
|
2019-06-15 11:53:20 +00:00
|
|
|
|
2019-06-15 11:07:10 +00:00
|
|
|
#if ACKCONF_WANT_EMULATED_FILE
|
|
|
|
#include <ack/emufile.h>
|
|
|
|
#else
|
|
|
|
#include <ack/file.h>
|
|
|
|
#endif
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#endif /* _STDIO_H */
|