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 XE_LIB int fprintf(FILE*, const char*, ...);
60 XE_LIB int printf(const char*, ...);
61
62 /*
63 * fopen -- opens the file specified by name and associates a
64 * stream with it.
65 * @param name -- file name
66 * @param mode -- file mode
67 */
68 XE_LIB FILE* fopen(const char* name, const char* mode);
69 /*
70 * fread -- reads data from the given stream
71 * into the array pointed to by ptr
72 * @param ptr -- pointer to a block of mem with
73 * size of sz*nmemb
74 * @param sz -- the size in bytes of each element
75 * to be read
76 * @param nmemb -- number of elements, each one
77 * with a size of size bytes
78 * @param stream -- pointer to a FILE object
79 */
80 XE_LIB size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream);
81
82 /*
83 * fwrite -- writes up to count items,
84 * each of size bytes in length, from buffer
85 * to the output stream
86 * @param ptr -- pointer to a block of mem with
87 * size of sz*nmemb holding the data
88 * @param sz -- the size in bytes of each element
89 * to be read
90 * @param nmemb -- number of elements, each one
91 * with a size of size bytes
92 * @param stream -- pointer to a FILE object
93 */
94 XE_LIB size_t fwrite(void* ptr, size_t sz, size_t nmemb, FILE* stream);
95
96 /*
97 * ftell -- returns the current file position of the
98 * specified stream with respect to the starting of
99 * the file
100 * @param fp -- pointer to FILE structure
101 */
102 XE_LIB long ftell(FILE * fp);
103
104 /*
105 * fseek -- moves or changes the position of
106 * the file pointer which is being used to
107 * read the file, to a specified byte
108 * offset position
109 * @param fp -- pointer to FILE structure
110 * @param offset -- offset in bytes
111 * @param pos -- position mode
112 */
113 XE_LIB int fseek(FILE * fp, long int offset, int pos);
114
115 /*
116 * fgetc -- reads a single character from the
117 * input stream at the current position
118 * and increases the file pointer.
119 * @param fp -- pointer to FILE structure
120 */
121 XE_LIB int fgetc(FILE * fp);
122
123 /*
124 * fclose -- closes a file
125 * @param fp -- pointer to FILE structure
126 */
127 XE_LIB int fclose(FILE * fp);
128
129 XE_LIB int fflush(FILE * stream);
130
131 XE_LIB int fputc(int c, FILE* stream);
132
133 XE_LIB int fputs(const char* s, FILE* stream);
134
135 XE_LIB int puts(const char* s);
136
137 XE_LIB int vfprintf(FILE * stream, const char* format, va_list arg);
138 XE_LIB int vsnprintf(char* output, size_t sz, const char* format, va_list ap);
139 XE_LIB int vsprintf(char* output, const char* format, va_list list);
140 XE_LIB int vprintf(const char* format, va_list list);
141
142 XE_LIB int sprintf(char* str, const char* string, ...);
143 XE_LIB int snprintf(char* output, size_t sz, const char* format, ...);
144
145 XE_LIB int printf(const char* format, ...);
146 /* getchar -- read a single character
147 * from stdin
148 */
149 XE_LIB int getchar();
150
151 XE_LIB int remove(const char* pathname);
152
153 XE_LIB int rename(const char* oldpath, const char* newpath);
154
155 XE_LIB int putchar(int c);
156
157 XE_LIB int scanf(const char* format, ...);
158
159 XE_LIB int sscanf(const char* str, const char* format, ...);
160#ifdef __cplusplus
161}
162#endif
163
164#endif
int putchar(int)
Definition stdio.cpp:240
AU_EXTERN AU_EXPORT void printf(const char *format,...)
Definition stdio.cpp:121
int getchar()
Definition stdio.cpp:406
struct _IO_FILE_ FILE
XE_LIB int vprintf(const char *format, va_list list)
Definition stdio.cpp:374
XE_LIB int remove(const char *pathname)
Definition stdio.cpp:252
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:157
XE_LIB int rename(const char *oldpath, const char *newpath)
Definition stdio.cpp:256
XE_LIB int fflush(FILE *stream)
Definition stdio.cpp:331
XE_LIB long ftell(FILE *fp)
Definition stdio.cpp:170
XE_LIB int sscanf(const char *str, const char *format,...)
Definition stdio.cpp:418
XE_LIB FILE * fopen(const char *name, const char *mode)
Definition stdio.cpp:44
XE_LIB int fclose(FILE *fp)
Definition stdio.cpp:226
XE_LIB int scanf(const char *format,...)
Definition stdio.cpp:413
XE_LIB int fseek(FILE *fp, long int offset, int pos)
Definition stdio.cpp:183
XE_LIB int fputc(int c, FILE *stream)
Definition stdio.cpp:144
XE_LIB int fprintf(FILE *, const char *,...)
Definition stdio.cpp:384
XE_LIB size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
Definition stdio.cpp:95
XE_LIB int puts(const char *s)
Definition stdio.cpp:244
XE_LIB int sprintf(char *str, const char *string,...)
Definition utprint.c:870
XE_LIB int fgetc(FILE *fp)
Definition stdio.cpp:213
XE_LIB int vfprintf(FILE *stream, const char *format, va_list arg)
Definition stdio.cpp:340
XE_LIB int vsprintf(char *output, const char *format, va_list list)
Definition stdio.cpp:364
XEProcessList * list
Definition main.cpp:27
#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