21 #define fclose _fclose
23 #define fwrite _fwrite
26 #define rewind _rewind
27 #define fileno _fileno
28 #define freopen _freopen
29 #define fseeko _fseeko
30 #define ftello _ftello
33 #define putchar _putchar
36 #define getchar _getchar
39 #define ferror _ferror
40 #define clearerr _clearerr
41 #define fflush _fflush
42 #define setvbuf _setvbuf
43 #define setbuf _setbuf
46 #define putc(c, stream) fputc(c, stream)
47 #define getc(stream) fgetc(stream)
52 #define getc_unlocked(stream) _fgetc(stream)
53 #define getchar_unlocked() _getchar()
54 #define putc_unlocked(c, stream) _fputc(c, stream)
55 #define putchar_unlocked(c) _putchar(c)
56 #define fputc_unlocked(c, stream) _fputc(c, stream)
57 #define fgetc_unlocked(stream) _fgetc(stream)
58 #define fgets_unlocked(s, size, stream) _fgets(s, size, stream)
59 #define fputs_unlocked(s, stream) _fputs(s, stream)
60 #define fread_unlocked(p, size, n, stream) _fread(p, size, n, stream)
61 #define fwrite_unlocked(p, size, n, stream) _fwrite(p, size, n, stream)
62 #define feof_unlocked(stream) _feof(stream)
63 #define ferror_unlocked(stream) _ferror(stream)
64 #define clearerr_unlocked(stream) _clearerr(stream)
65 #define fflush_unlocked(stream) _fflush(stream)
66 #define fileno_unlocked(stream) _fileno(stream)
68 #define flockfile(stream) ((void) (stream))
69 #define funlockfile(stream) ((void) (stream))
70 #define ftrylockfile(stream) (0)
72 #define __SIZEOF_FILE sizeof(__FILE)
75 char __size[__SIZEOF_FILE];
90 FILE *
fopen(
const char *pathname,
const char *mode);
146 size_t fread(
void *ptr,
size_t size,
size_t nmemb,
FILE *stream);
159 size_t fwrite(
const void *ptr,
size_t size,
size_t nmemb,
FILE *stream);
198 int rename(
const char *oldpath,
const char *newpath);
205 int remove(
const char *pathname);
214 int printf(
const char *format, ...);
224 int fprintf(
FILE *stream,
const char *format, ...);
234 int dprintf(
int fd,
const char *format, ...);
244 int sprintf(
char *str,
const char *format, ...);
255 int snprintf(
char *str,
size_t size,
const char *format, ...);
264 int vprintf(
const char *format, va_list ap);
274 int vfprintf(
FILE *stream,
const char *format, va_list ap);
284 int vdprintf(
int fd,
const char *format, va_list ap);
295 int vsprintf(
char *str,
const char *format, va_list ap);
307 int vsnprintf(
char *str,
size_t size,
const char *format, va_list ap);
317 int sscanf(
const char *str,
const char *format, ...);
327 int vsscanf(
const char *str,
const char *format, va_list ap);
int remove(const char *pathname)
Delete a file or an empty directory.
Definition: file.c:397
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
Read nmemb items of data, each size bytes long, from the stream pointed to by stream,...
int vdprintf(int fd, const char *format, va_list ap)
Format and print data to a file with argument list.
Definition: printf.c:452
FILE * freopen(const char *pathname, const char *mode, FILE *stream)
Point a stream that is already open at another file, which is how a program replaces one of the stand...
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
Write nmemb items of data, each size bytes long, to the stream pointed to by stream,...
char * fgets(char *s, int size, FILE *stream)
Read a line from the stream, the newline included, and terminate it.
int vsnprintf(char *str, size_t size, const char *format, va_list ap)
Format and print data to a buffer with limited size and argument list.
int sprintf(char *str, const char *format,...)
Format and print data to a buffer.
void setbuf(FILE *stream, char *buf)
Ask the stream to buffer what is written to it, the way setvbuf() does, without reporting whether it ...
#define getchar
Read a character from the standard input.
Definition: stdio.h:36
FILE * fopen(const char *pathname, const char *mode)
Open the file whose name is the string pointed to by pathname and associate a stream with it.
int ferror(FILE *stream)
Tell whether the stream has failed.
int rename(const char *oldpath, const char *newpath)
Change the name or the location of a file.
Definition: file.c:387
long ftell(FILE *stream)
Obtain the current value of the file position indicator.
int fseek(FILE *stream, long offset, int whence)
Set the file position indicator for the stream pointed to by stream.
int dprintf(int fd, const char *format,...)
Format and print data to a file.
Definition: printf.c:457
int fputs(const char *s, FILE *stream)
Write a string to the stream, without its terminating null byte.
Definition: wrapper.c:263
int fclose(FILE *stream)
Close the given file stream.
off_t ftello(FILE *stream)
Report where a stream is, as an off_t.
int fseeko(FILE *stream, off_t offset, int whence)
Reposition a stream, with the offset given as an off_t.
int printf(const char *format,...)
Format and print data to the standard output.
Definition: printf.c:473
int feof(FILE *stream)
Tell whether the end of the stream has been reached.
void rewind(FILE *stream)
Set the file position indicator to the beginning of the file.
int vprintf(const char *format, va_list ap)
Format and print data to the standard output with argument list.
Definition: printf.c:468
int vsprintf(char *str, const char *format, va_list ap)
Format and print data to a buffer with argument list.
int fgetc(FILE *stream)
Read a character from the stream.
FILE * fdopen(int fd, const char *mode)
Put a stream on a descriptor that is already open.
Definition: wrapper.c:68
int vsscanf(const char *str, const char *format, va_list ap)
Read from the string what the format says is in it, taking the places to put it from a variable argum...
void clearerr(FILE *stream)
Clear the end of file and the error state of the stream.
int fputc(int c, FILE *stream)
Write a character to the stream.
Definition: wrapper.c:271
int puts(const char *s)
Write a string and a newline to the standard output.
int snprintf(char *str, size_t size, const char *format,...)
Format and print data to a buffer with limited buffer size.
int vfprintf(FILE *stream, const char *format, va_list ap)
Format and print data to a file with argument list.
Definition: printf.c:484
int fprintf(FILE *stream, const char *format,...)
Format and print data to a file.
Definition: printf.c:491
int fflush(FILE *stream)
Hand over what the stream is holding. Tenok does not buffer, so there is never anything to hand over.
int sscanf(const char *str, const char *format,...)
Read from the string what the format says is in it. Only the string half of scanf is here: the stream...
int putchar(int c)
Write a character to the standard output.
int setvbuf(FILE *stream, char *buf, int mode, size_t size)
Ask the stream to buffer what is written to it. Tenok reaches the device on the call that writes,...
int fileno(FILE *stream)
Examine the argument stream and returns the integer file descriptor used to implement this stream.