2014-10-14 19:39:26 +00:00
|
|
|
|
|
|
|
#ifndef __STDIO_H__
|
|
|
|
#define __STDIO_H__
|
|
|
|
|
2014-10-15 01:00:14 +00:00
|
|
|
#include <sys/types.h>
|
2023-08-23 02:03:53 +00:00
|
|
|
#include <sys/cdefs.h>
|
2014-10-15 01:00:14 +00:00
|
|
|
|
|
|
|
typedef struct FILE {
|
|
|
|
int in_use;
|
|
|
|
uint64_t fd; /* Kernel File Descriptor */
|
|
|
|
fpos_t offset;
|
|
|
|
} FILE;
|
|
|
|
|
|
|
|
#define SEEK_SET 0
|
|
|
|
#define SEEK_CUR 1
|
|
|
|
#define SEEK_END 2
|
|
|
|
|
|
|
|
#define EOF (-1)
|
|
|
|
|
|
|
|
extern FILE *stdin;
|
|
|
|
extern FILE *stdout;
|
|
|
|
extern FILE *stderr;
|
|
|
|
|
|
|
|
#define FOPEN_MAX 16
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2015-01-23 20:39:35 +00:00
|
|
|
int puts(const char *str);
|
|
|
|
#define getc(_fh) fgetc(_fh)
|
|
|
|
|
2014-12-06 02:33:29 +00:00
|
|
|
int printf(const char *fmt, ...);
|
|
|
|
int fprintf(FILE *stream, const char *fmt, ...);
|
2015-01-28 19:35:47 +00:00
|
|
|
int sprintf(char *str, const char *fmt, ...);
|
2023-08-23 02:03:53 +00:00
|
|
|
int snprintf(char *str, size_t size, const char *fmt, ...) __printflike(3, 4);;
|
2014-12-06 02:33:29 +00:00
|
|
|
|
2014-10-14 19:39:26 +00:00
|
|
|
#endif /* __STDIO_H__ */
|
|
|
|
|