2020-03-31 16:21:07 +01:00
|
|
|
#ifndef STDIO_H_
|
|
|
|
|
#define STDIO_H_
|
|
|
|
|
|
2020-04-03 19:21:22 +01:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <stddef.h>
|
2020-03-31 16:21:07 +01:00
|
|
|
#include <sys/_fconst.h>
|
|
|
|
|
|
|
|
|
|
#if defined(__FILENAME_MAX)
|
|
|
|
|
#define FILENAME_MAX __FILENAME_MAX
|
|
|
|
|
#else
|
|
|
|
|
#define FILENAME_MAX 1024
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-05-11 22:06:28 +01:00
|
|
|
#define BUFSIZ __FIO_BUFSZ
|
|
|
|
|
|
2020-03-31 16:21:07 +01:00
|
|
|
#define SEEK_SET __SEEK_SET
|
|
|
|
|
#define SEEK_CUR __SEEK_CUR
|
|
|
|
|
#define SEEK_END __SEEK_END
|
|
|
|
|
|
2020-04-01 11:58:54 +01:00
|
|
|
#define EOF -1
|
|
|
|
|
|
2020-03-31 16:21:07 +01:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
typedef struct __io_file FILE;
|
|
|
|
|
|
2020-11-05 21:23:34 +00:00
|
|
|
extern FILE *__get_stdio_file(int);
|
|
|
|
|
|
|
|
|
|
#define stdin (__get_stdio_file(0))
|
2021-12-25 22:04:19 +00:00
|
|
|
#define stdout (__get_stdio_file(1))
|
|
|
|
|
#define stderr (__get_stdio_file(2))
|
2020-03-31 16:21:07 +01:00
|
|
|
|
2020-05-13 20:37:03 +01:00
|
|
|
extern FILE *fopen(const char *path, const char *mode);
|
|
|
|
|
extern FILE *freopen(const char *path, const char *mode, FILE *fp);
|
|
|
|
|
extern FILE *fdopen(int fd, const char *mode);
|
|
|
|
|
extern int fclose(FILE *fp);
|
|
|
|
|
extern int fflush(FILE *fp);
|
2020-07-16 14:02:51 +01:00
|
|
|
extern size_t fread(void *ptr, size_t size, size_t count, FILE *fp);
|
|
|
|
|
extern size_t fwrite(const void *ptr, size_t size, size_t count, FILE *fp);
|
2020-05-13 20:37:03 +01:00
|
|
|
|
2020-03-31 18:36:58 +01:00
|
|
|
extern int fileno(FILE *fp);
|
2020-04-01 11:58:54 +01:00
|
|
|
extern int fputs(const char *str, FILE *fp);
|
2020-07-07 18:53:54 +01:00
|
|
|
extern int fputc(int c, FILE *fp);
|
2020-07-16 14:02:51 +01:00
|
|
|
extern int fgetc(FILE *fp);
|
2022-05-11 22:06:28 +01:00
|
|
|
extern char *fgets(char *restrict str, int count, FILE *restrict fp);
|
2020-08-09 15:22:23 +01:00
|
|
|
extern int putchar(int c);
|
2020-07-16 14:02:51 +01:00
|
|
|
|
|
|
|
|
extern int ungetc(int c, FILE *fp);
|
2020-04-03 19:21:22 +01:00
|
|
|
|
|
|
|
|
extern int printf(const char *restrict format, ...);
|
|
|
|
|
extern int fprintf(FILE *fp, const char *restrict format, ...);
|
|
|
|
|
extern int sprintf(char *buf, const char *restrict format, ...);
|
|
|
|
|
extern int snprintf(char *buf, size_t sz, const char *restrict format, ...);
|
|
|
|
|
|
|
|
|
|
extern int vprintf(const char *restrict format, va_list arg);
|
|
|
|
|
extern int vfprintf(FILE *fp, const char *restrict format, va_list arg);
|
|
|
|
|
extern int vsprintf(char *buf, const char *restrict format, va_list arg);
|
|
|
|
|
extern int vsnprintf(char *buf, size_t sz, const char *restrict format, va_list arg);
|
2020-03-31 18:36:58 +01:00
|
|
|
|
2022-05-17 21:45:37 +01:00
|
|
|
extern void perror(const char *s);
|
|
|
|
|
|
2020-03-31 16:21:07 +01:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|