2018-10-22 13:57:25 +02:00
|
|
|
#pragma once
|
|
|
|
|
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-11-17 00:11:08 +01:00
|
|
|
#include <stdarg.h>
|
2018-11-11 10:11:09 +01:00
|
|
|
#include <limits.h>
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2018-10-31 02:09:11 +01:00
|
|
|
__BEGIN_DECLS
|
2018-11-08 01:23:23 +01:00
|
|
|
#ifndef EOF
|
2018-10-31 02:09:11 +01:00
|
|
|
#define EOF (-1)
|
|
|
|
#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
|
|
|
|
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;
|
|
|
|
char* buffer;
|
|
|
|
size_t buffer_size;
|
|
|
|
size_t buffer_index;
|
|
|
|
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;
|
|
|
|
|
2018-10-31 17:50:43 +01:00
|
|
|
char* fgets(char* buffer, int size, FILE*);
|
|
|
|
int fileno(FILE*);
|
|
|
|
int fgetc(FILE*);
|
|
|
|
int getc(FILE*);
|
|
|
|
int getchar();
|
2018-11-05 19:01:22 +01:00
|
|
|
FILE* fdopen(int fd, const char* mode);
|
2018-10-31 17:50:43 +01:00
|
|
|
FILE* fopen(const char* pathname, const char* mode);
|
|
|
|
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*);
|
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);
|
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 14:21:51 +01:00
|
|
|
int sys_printf(const char* fmt, ...);
|
2018-10-22 13:57:25 +02:00
|
|
|
int sprintf(char* buffer, const char* fmt, ...);
|
|
|
|
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*);
|
2018-10-31 17:50:43 +01:00
|
|
|
int sscanf (const char* buf, const char* fmt, ...);
|
2018-11-05 16:40:48 +01:00
|
|
|
int fscanf(FILE*, const char* fmt, ...);
|
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*);
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2018-10-31 02:09:11 +01:00
|
|
|
__END_DECLS
|
2018-10-22 13:57:25 +02:00
|
|
|
|