#include <sys/types.h>
#include <sys/cdefs.h>
Go to the source code of this file.
|
FILE * | fopen (const char *path, const char *mode) |
|
int | fclose (FILE *fh) |
|
int | feof (FILE *fh) |
|
int | fflush (FILE *fh) |
|
size_t | fread (void *buf, size_t size, size_t nmemb, FILE *fh) |
|
size_t | fwrite (const void *buf, size_t size, size_t nmemb, FILE *fh) |
|
int | fputc (int ch, FILE *fh) |
|
int | fputs (const char *str, FILE *fh) |
|
int | fgetc (FILE *fh) |
|
char * | fgets (char *str, int size, FILE *fh) |
|
int | puts (const char *str) |
|
int | printf (const char *fmt,...) |
|
int | fprintf (FILE *stream, const char *fmt,...) |
|
int | sprintf (char *str, const char *fmt,...) |
|
int | snprintf (char *str, size_t size, const char *fmt,...) __printflike(3 |
|
◆ FILE
◆ EOF
◆ FOPEN_MAX
◆ getc
#define getc |
( |
|
_fh | ) |
fgetc(_fh) |
◆ SEEK_CUR
◆ SEEK_END
◆ SEEK_SET
◆ FILE
◆ fclose()
Definition at line 86 of file file.c.
87{
89
91
92 return status;
93}
void _free_file(FILE *fh)
◆ feof()
◆ fflush()
◆ fgetc()
Definition at line 157 of file file.c.
158{
159 char ch;
160 if (
fread(&ch, 1, 1, fh) == 1)
161 return ch;
163}
size_t fread(void *buf, size_t size, size_t nmemb, FILE *fh)
◆ fgets()
char * fgets |
( |
char * |
str, |
|
|
int |
size, |
|
|
FILE * |
fh |
|
) |
| |
Definition at line 166 of file file.c.
167{
168 int i;
169
170 for (i = 0; i < (
size - 1); i++) {
174 if (ch == '\b') {
175 if (i > 0)
176 i -= 1;
177 i -= 1;
178 continue;
179 }
180 str[i] = (char)ch;
181 if (ch == '\n') {
182 str[i + 1] = '\0';
183 return str;
184 }
185 }
186
187 str[
size - 1] =
'\0';
188 return str;
189}
◆ fopen()
FILE * fopen |
( |
const char * |
path, |
|
|
const char * |
mode |
|
) |
| |
Definition at line 66 of file file.c.
67{
70
71
73 if (fd == 0)
75
79
80
81
82 return fh;
83}
uint64_t OSOpen(const char *path, uint64_t flags)
◆ fprintf()
int fprintf |
( |
FILE * |
stream, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 224 of file printf.c.
225{
226 int ret;
228
232
233 return ret;
234}
static int kvprintf(char const *fmt, void(*func)(int, void *), void *handle, va_list ap)
static void fileputc(int c, void *handle)
#define va_start(ap, last)
__builtin_va_list va_list
◆ fputc()
int fputc |
( |
int |
ch, |
|
|
FILE * |
fh |
|
) |
| |
Definition at line 124 of file file.c.
125{
126 if (
fwrite(&ch, 1, 1, fh) == 1)
127 return ch;
129}
size_t fwrite(const void *buf, size_t size, size_t nmemb, FILE *fh)
◆ fputs()
int fputs |
( |
const char * |
str, |
|
|
FILE * |
fh |
|
) |
| |
Definition at line 132 of file file.c.
133{
135 if (status > 0)
136 return status;
137
139}
size_t strlen(const char *str)
◆ fread()
Definition at line 110 of file file.c.
111{
113
114}
int OSRead(uint64_t fd, void *addr, uint64_t off, uint64_t length)
◆ fwrite()
Definition at line 117 of file file.c.
118{
120
121}
int OSWrite(uint64_t fd, const void *addr, uint64_t off, uint64_t length)
◆ printf()
int printf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 212 of file printf.c.
213{
214 int ret;
216
220
221 return ret;
222}
◆ puts()
int puts |
( |
const char * |
str | ) |
|
Definition at line 142 of file file.c.
143{
144 int status, status2;
146 if (status < 0)
148
150 if (status2 < 0)
152
153 return status;
154}
int fputs(const char *str, FILE *fh)
int fputc(int ch, FILE *fh)
◆ snprintf()
int snprintf |
( |
char * |
str, |
|
|
size_t |
size, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ sprintf()
int sprintf |
( |
char * |
str, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 256 of file printf.c.
257{
258 int ret;
261
265
269
271
272 return ret;
273}
static void strputc(int c, void *handle)
◆ stderr
◆ stdin
◆ stdout