Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
stdio.h
Go to the documentation of this file.
1 
4 #ifndef __STDIO_H__
5 #define __STDIO_H__
6 
7 #include <pthread.h>
8 #include <stdarg.h>
9 #include <stddef.h>
10 #include <stdint.h>
11 #include <sys/reent.h>
12 #include <sys/types.h>
13 
14 #define SEEK_SET 0
15 #define SEEK_CUR 1
16 #define SEEK_END 2
17 
18 #define fopen _fopen
19 #define fclose _fclose
20 #define fread _fread
21 #define fwrite _fwrite
22 #define fseek _fseek
23 #define fileno _fileno
24 
25 #define __SIZEOF_FILE sizeof(__FILE)
26 
27 typedef union {
28  char __size[__SIZEOF_FILE];
29  uint32_t __align;
30 } FILE;
31 
32 extern FILE *stdin;
33 extern FILE *stdout;
34 extern FILE *stderr;
35 
43 FILE *fopen(const char *pathname, const char *mode);
44 
50 int fclose(FILE *stream);
51 
61 size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
62 
73 size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
74 
83 int fseek(FILE *stream, long offset, int whence);
84 
91 int fileno(FILE *stream);
92 
100 int printf(const char *format, ...);
101 
110 int fprintf(FILE *stream, const char *format, ...);
111 
120 int dprintf(int fd, const char *format, ...);
121 
130 int sprintf(char *str, const char *format, ...);
131 
141 int snprintf(char *str, size_t size, const char *format, ...);
142 
150 int vprintf(const char *format, va_list ap);
151 
160 int vfprintf(FILE *stream, const char *format, va_list ap);
161 
170 int vdprintf(int fd, const char *format, va_list ap);
171 
181 int vsprintf(char *str, const char *format, va_list ap);
182 
193 int vsnprintf(char *str, size_t size, const char *format, va_list ap);
194 
195 #endif
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:270
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,...
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.
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 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:281
int fclose(FILE *stream)
Close the given file stream.
int printf(const char *format,...)
Format and print data to the standard output.
Definition: printf.c:297
int vprintf(const char *format, va_list ap)
Format and print data to the standard output with argument list.
Definition: printf.c:292
int vsprintf(char *str, const char *format, va_list ap)
Format and print data to a buffer with argument list.
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:308
int fprintf(FILE *stream, const char *format,...)
Format and print data to a file.
Definition: printf.c:320
int fileno(FILE *stream)
Examine the argument stream and returns the integer file descriptor used to implement this stream.
Definition: stdio.h:27