XenevaOS
Loading...
Searching...
No Matches
stdio.h
Go to the documentation of this file.
1
30#ifndef __STDIO_H__
31#define __STDIO_H__
32
33#include <stdint.h>
34#include <_xeneva.h>
35#include <stdarg.h>
36
37#ifdef __cplusplus
39#endif
40
41 typedef struct _IO_FILE_ {
42 unsigned char* base;
43 unsigned char* pos;
44 unsigned char* ptr;
46 int eof;
47 int size;
50
51#define SEEK_SET 0
52#define SEEK_CUR 1
53#define SEEK_END 2
54
55#define stdin (FILE*)(1)
56#define stdout (FILE*)(1+1)
57#define stderr (FILE*)(2+1)
58
59
60 XE_LIB int fprintf(FILE*, const char*, ...);
61 XE_LIB int printf(const char*, ...);
62
63 /*
64 * fopen -- opens the file specified by name and associates a
65 * stream with it.
66 * @param name -- file name
67 * @param mode -- file mode
68 */
69 XE_LIB FILE* fopen(const char* name, const char* mode);
70 /*
71 * fread -- reads data from the given stream
72 * into the array pointed to by ptr
73 * @param ptr -- pointer to a block of mem with
74 * size of sz*nmemb
75 * @param sz -- the size in bytes of each element
76 * to be read
77 * @param nmemb -- number of elements, each one
78 * with a size of size bytes
79 * @param stream -- pointer to a FILE object
80 */
81 XE_LIB size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream);
82
83 /*
84 * fwrite -- writes up to count items,
85 * each of size bytes in length, from buffer
86 * to the output stream
87 * @param ptr -- pointer to a block of mem with
88 * size of sz*nmemb holding the data
89 * @param sz -- the size in bytes of each element
90 * to be read
91 * @param nmemb -- number of elements, each one
92 * with a size of size bytes
93 * @param stream -- pointer to a FILE object
94 */
95 XE_LIB size_t fwrite(void* ptr, size_t sz, size_t nmemb, FILE* stream);
96
97 /*
98 * ftell -- returns the current file position of the
99 * specified stream with respect to the starting of
100 * the file
101 * @param fp -- pointer to FILE structure
102 */
103 XE_LIB long ftell(FILE* fp);
104
105 /*
106 * fseek -- moves or changes the position of
107 * the file pointer which is being used to
108 * read the file, to a specified byte
109 * offset position
110 * @param fp -- pointer to FILE structure
111 * @param offset -- offset in bytes
112 * @param pos -- position mode
113 */
114 XE_LIB int fseek(FILE* fp, long int offset, int pos);
115
116 /*
117 * fgetc -- reads a single character from the
118 * input stream at the current position
119 * and increases the file pointer.
120 * @param fp -- pointer to FILE structure
121 */
122 XE_LIB int fgetc(FILE *fp);
123
124 /*
125 * fclose -- closes a file
126 * @param fp -- pointer to FILE structure
127 */
128 XE_LIB int fclose(FILE* fp);
129
130 XE_LIB int fflush(FILE* stream);
131
132 XE_LIB int fputc(int c, FILE* stream);
133
134 XE_LIB int fputs(const char* s, FILE* stream);
135
136 XE_LIB int puts(const char *s);
137
138 XE_LIB int vfprintf(FILE* stream, const char* format, va_list arg);
139 XE_LIB int vsnprintf(char* output, size_t sz, const char* format, va_list ap);
140 XE_LIB int vsprintf(char* output, const char* format, va_list list);
141 XE_LIB int vprintf(const char* format, va_list list);
142
143 XE_LIB int sprintf(char* str, const char* string, ...);
144 XE_LIB int snprintf(char* output, size_t sz, const char* format, ...);
145
146 XE_LIB int printf(const char* format, ...);
147 /* getchar -- read a single character
148 * from stdin
149 */
150 XE_LIB int getchar();
151
152 XE_LIB int remove(const char* pathname);
153
154 XE_LIB int rename(const char* oldpath, const char* newpath);
155
156 XE_LIB int putchar(int c);
157
158 XE_LIB int scanf(const char* format, ...);
159
160 XE_LIB int sscanf(const char* str, const char* format, ...);
161#ifdef __cplusplus
162}
163#endif
164
165#endif
int putchar(int)
Definition stdio.cpp:249
AU_EXTERN AU_EXPORT void printf(const char *format,...)
Definition stdio.cpp:121
int getchar()
Definition stdio.cpp:369
struct _IO_FILE_ FILE
XE_LIB int vprintf(const char *format, va_list list)
Definition stdio.cpp:336
XE_LIB int remove(const char *pathname)
Definition stdio.cpp:259
XE_LIB size_t fwrite(void *ptr, size_t sz, size_t nmemb, FILE *stream)
Definition stdio.cpp:124
XE_LIB int fputs(const char *s, FILE *stream)
Definition stdio.cpp:159
XE_LIB int rename(const char *oldpath, const char *newpath)
Definition stdio.cpp:263
XE_LIB int fflush(FILE *stream)
Definition stdio.cpp:243
XE_LIB long ftell(FILE *fp)
Definition stdio.cpp:172
XE_LIB int sscanf(const char *str, const char *format,...)
Definition stdio.cpp:381
XE_LIB FILE * fopen(const char *name, const char *mode)
Definition stdio.cpp:42
XE_LIB int fclose(FILE *fp)
Definition stdio.cpp:229
XE_LIB int scanf(const char *format,...)
Definition stdio.cpp:376
XE_LIB int fseek(FILE *fp, long int offset, int pos)
Definition stdio.cpp:185
XE_LIB int fputc(int c, FILE *stream)
Definition stdio.cpp:146
XE_LIB int fprintf(FILE *, const char *,...)
Definition stdio.cpp:347
XE_LIB size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
Definition stdio.cpp:93
XE_LIB int puts(const char *s)
Definition stdio.cpp:253
XE_LIB int sprintf(char *str, const char *string,...)
Definition utprint.c:870
XE_LIB int fgetc(FILE *fp)
Definition stdio.cpp:216
XE_LIB int vfprintf(FILE *stream, const char *format, va_list arg)
Definition stdio.cpp:302
XE_LIB int vsprintf(char *output, const char *format, va_list list)
Definition stdio.cpp:326
#define XE_LIB
Definition _xeneva.h:55
#define XE_EXTERN
Definition _xeneva.h:50
char * va_list
Definition acmsvcex.h:186
#define vsnprintf
Definition acwin.h:188
#define snprintf
Definition acwin.h:186
Definition stdio.h:41
unsigned char * ptr
Definition stdio.h:44
int eof
Definition stdio.h:46
int size
Definition stdio.h:47
int _file_num
Definition stdio.h:45
int curr_pos
Definition stdio.h:48
unsigned char * pos
Definition stdio.h:43
unsigned char * base
Definition stdio.h:42