MyOS Libc
stdio.h
1 #ifndef STDIO_H
2 #define STDIO_H
3 
4 #include <stdarg.h>
5 #include <stddef.h>
6 
7 #define FILE int //We're using pointers to FILE even though it's an int so we can expand to a struct if needed
8 #define SEEK_CUR 1
9 #define SEEK_END 2
10 #define SEEK_SET 3
11 #define EOF -1
12 
13 #define stdin __stdio_stdin
14 #define stdout __stdio_stdout
15 #define stderr __stdio_stderr
16 
17 extern FILE* __stdio_stdin;
18 extern FILE* __stdio_stdout;
19 extern FILE* __stdio_stderr;
20 
21 FILE* fopen(char* filename,char* mode);
22 int fgetc(FILE* stream);
23 int getc(FILE* stream);
24 char* fgets(char* str,int count,FILE* stream);
25 char* gets(char* str);
26 size_t fread(void* buffer,size_t size,size_t count,FILE* stream);
27 int fputc(int c,FILE* stream);
28 int putc(int c,FILE *stream);
29 int fputs(const char* s,FILE* stream);
30 size_t fwrite(void* buffer_ptr,size_t size,size_t count,FILE* stream);
31 int puts(const char* s);
32 int fprintf(FILE* stream,const char* format,...);
33 int vfprintf(FILE* stream,const char* format,va_list arg);
34 int printf(const char* format,...);
35 int fseek(FILE* stream,long offset,int origin);
36 long ftell(FILE* stream);
37 int fclose(FILE* file);
38 int feof(FILE* stream);
39 int ferror(FILE* stream);
40 int fflush(FILE *stream); // GCC required
41 void setbuf(FILE *restrict stream, char *restrict buf); // GCC required
42 void rescan_vfs();
43 
44 #endif