2018-10-22 13:57:25 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-02-24 15:19:32 +01:00
|
|
|
#define _STDIO_H // Make GMP believe we exist.
|
|
|
|
|
|
2019-05-28 11:53:16 +02:00
|
|
|
#include <limits.h>
|
|
|
|
|
#include <stdarg.h>
|
2018-10-31 02:09:11 +01:00
|
|
|
#include <sys/cdefs.h>
|
2018-10-31 17:50:43 +01:00
|
|
|
#include <sys/types.h>
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2019-11-08 21:39:31 +01:00
|
|
|
#define FILENAME_MAX 1024
|
2019-03-27 01:40:55 +01:00
|
|
|
#define BUFSIZ 1024
|
|
|
|
|
|
2018-10-31 02:09:11 +01:00
|
|
|
__BEGIN_DECLS
|
2019-05-28 11:53:16 +02:00
|
|
|
#ifndef EOF
|
|
|
|
|
# define EOF (-1)
|
2018-10-31 02:09:11 +01:00
|
|
|
#endif
|
|
|
|
|
|
2018-10-31 17:50:43 +01:00
|
|
|
#define SEEK_SET 0
|
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
|
#define SEEK_END 2
|
|
|
|
|
|
2018-11-11 10:11:09 +01:00
|
|
|
#define _IOFBF 0
|
|
|
|
|
#define _IOLBF 1
|
|
|
|
|
#define _IONBF 2
|
2018-11-08 01:23:23 +01:00
|
|
|
|
2019-05-29 07:20:04 -04:00
|
|
|
#define L_tmpnam 256
|
|
|
|
|
|
2018-10-31 02:09:11 +01:00
|
|
|
struct __STDIO_FILE {
|
|
|
|
|
int fd;
|
2018-10-31 17:50:43 +01:00
|
|
|
int eof;
|
2018-11-07 10:23:16 +01:00
|
|
|
int error;
|
2018-11-11 10:11:09 +01:00
|
|
|
int mode;
|
2019-06-03 19:52:31 +02:00
|
|
|
pid_t popen_child;
|
2018-11-11 10:11:09 +01:00
|
|
|
char* buffer;
|
|
|
|
|
size_t buffer_size;
|
|
|
|
|
size_t buffer_index;
|
2019-03-27 12:53:05 +01:00
|
|
|
int have_ungotten;
|
2019-03-27 01:40:55 +01:00
|
|
|
char ungotten;
|
2018-11-11 10:11:09 +01:00
|
|
|
char default_buffer[BUFSIZ];
|
2018-10-31 02:09:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct __STDIO_FILE FILE;
|
|
|
|
|
|
|
|
|
|
extern FILE* stdin;
|
|
|
|
|
extern FILE* stdout;
|
|
|
|
|
extern FILE* stderr;
|
|
|
|
|
|
2019-12-27 22:50:14 +01:00
|
|
|
typedef long fpos_t;
|
2019-02-25 10:05:32 +01:00
|
|
|
|
|
|
|
|
int fseek(FILE*, long offset, int whence);
|
|
|
|
|
int fgetpos(FILE*, fpos_t*);
|
|
|
|
|
int fsetpos(FILE*, const fpos_t*);
|
|
|
|
|
long ftell(FILE*);
|
2018-10-31 17:50:43 +01:00
|
|
|
char* fgets(char* buffer, int size, FILE*);
|
2019-02-24 15:19:32 +01:00
|
|
|
int fputc(int ch, FILE*);
|
2018-10-31 17:50:43 +01:00
|
|
|
int fileno(FILE*);
|
|
|
|
|
int fgetc(FILE*);
|
|
|
|
|
int getc(FILE*);
|
2019-11-16 04:39:36 -06:00
|
|
|
int getc_unlocked(FILE* stream);
|
2018-10-31 17:50:43 +01:00
|
|
|
int getchar();
|
2019-06-16 13:13:57 +01:00
|
|
|
ssize_t getdelim(char**, size_t*, int, FILE*);
|
|
|
|
|
ssize_t getline(char**, size_t*, FILE*);
|
2019-02-03 04:32:31 +01:00
|
|
|
int ungetc(int c, FILE*);
|
2019-02-25 10:05:32 +01:00
|
|
|
int remove(const char* pathname);
|
2018-11-05 19:01:22 +01:00
|
|
|
FILE* fdopen(int fd, const char* mode);
|
2019-05-28 11:53:16 +02:00
|
|
|
FILE* fopen(const char* pathname, const char* mode);
|
|
|
|
|
FILE* freopen(const char* pathname, const char* mode, FILE*);
|
2019-11-16 04:39:36 -06:00
|
|
|
void flockfile(FILE* filehandle);
|
|
|
|
|
void funlockfile(FILE* filehandle);
|
2018-10-31 17:50:43 +01:00
|
|
|
int fclose(FILE*);
|
2018-10-31 19:49:22 +01:00
|
|
|
void rewind(FILE*);
|
|
|
|
|
void clearerr(FILE*);
|
2018-11-07 10:23:16 +01:00
|
|
|
int ferror(FILE*);
|
2018-10-31 19:49:22 +01:00
|
|
|
int feof(FILE*);
|
2018-11-05 14:56:05 +01:00
|
|
|
int fflush(FILE*);
|
2018-10-31 17:50:43 +01:00
|
|
|
size_t fread(void* ptr, size_t size, size_t nmemb, FILE*);
|
|
|
|
|
size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE*);
|
2019-02-01 16:03:21 +01:00
|
|
|
int vprintf(const char* fmt, va_list);
|
2018-11-17 00:11:08 +01:00
|
|
|
int vfprintf(FILE*, const char* fmt, va_list);
|
|
|
|
|
int vsprintf(char* buffer, const char* fmt, va_list);
|
2019-01-23 06:35:34 +01:00
|
|
|
int vsnprintf(char* buffer, size_t, const char* fmt, va_list);
|
2018-10-31 02:09:11 +01:00
|
|
|
int fprintf(FILE*, const char* fmt, ...);
|
2018-10-22 13:57:25 +02:00
|
|
|
int printf(const char* fmt, ...);
|
2019-01-14 20:00:42 +01:00
|
|
|
int dbgprintf(const char* fmt, ...);
|
2019-07-21 19:45:31 +02:00
|
|
|
void dbgputch(char);
|
2019-07-21 21:43:37 +02:00
|
|
|
int dbgputstr(const char*, ssize_t);
|
2018-10-22 13:57:25 +02:00
|
|
|
int sprintf(char* buffer, const char* fmt, ...);
|
2019-01-23 06:35:34 +01:00
|
|
|
int snprintf(char* buffer, size_t, const char* fmt, ...);
|
2018-10-22 13:57:25 +02:00
|
|
|
int putchar(int ch);
|
2018-11-07 10:23:16 +01:00
|
|
|
int putc(int ch, FILE*);
|
|
|
|
|
int puts(const char*);
|
|
|
|
|
int fputs(const char*, FILE*);
|
2018-10-26 14:56:21 +02:00
|
|
|
void perror(const char*);
|
2019-02-25 10:05:32 +01:00
|
|
|
int scanf(const char* fmt, ...);
|
2019-05-28 11:53:16 +02:00
|
|
|
int sscanf(const char* str, const char* fmt, ...);
|
2018-11-05 16:40:48 +01:00
|
|
|
int fscanf(FILE*, const char* fmt, ...);
|
2019-03-20 15:29:04 +01:00
|
|
|
int vfscanf(FILE*, const char*, va_list);
|
|
|
|
|
int vsscanf(const char*, const char*, va_list);
|
2018-11-11 10:11:09 +01:00
|
|
|
int setvbuf(FILE*, char* buf, int mode, size_t);
|
|
|
|
|
void setbuf(FILE*, char* buf);
|
2018-11-11 15:36:40 +01:00
|
|
|
void setlinebuf(FILE*);
|
2019-02-08 02:38:21 +01:00
|
|
|
int rename(const char* oldpath, const char* newpath);
|
2019-02-25 10:05:32 +01:00
|
|
|
FILE* tmpfile();
|
2019-02-26 12:57:02 +01:00
|
|
|
char* tmpnam(char*);
|
|
|
|
|
FILE* popen(const char* command, const char* type);
|
|
|
|
|
int pclose(FILE*);
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2018-10-31 02:09:11 +01:00
|
|
|
__END_DECLS
|