libc: add a range of header files
This commit is contained in:
@@ -3,8 +3,13 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define EOF -1
|
||||
#define EOF -1
|
||||
|
||||
#define _IONBF 0
|
||||
#define _IOFBF 1
|
||||
#define _IOLBF 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -13,6 +18,13 @@ extern "C" {
|
||||
struct __opaque_file;
|
||||
typedef struct __opaque_file FILE;
|
||||
|
||||
#define stdin (__libc_file_stdin())
|
||||
#define stdout (__libc_file_stdout())
|
||||
#define stderr (__libc_file_stderr())
|
||||
|
||||
extern int printf(const char *format, ...);
|
||||
extern int vprintf(const char *format, va_list arg);
|
||||
extern int fprintf(FILE *stream, const char *format, ...);
|
||||
extern int snprintf(char *buffer, size_t count, const char *format, ...);
|
||||
extern int vsnprintf(
|
||||
char *buffer,
|
||||
@@ -24,7 +36,7 @@ extern FILE *fopen(const char *path, const char *mode);
|
||||
extern int fclose(FILE *stream);
|
||||
|
||||
extern int feof(FILE *stream);
|
||||
extern int ferr(FILE *stream);
|
||||
extern int ferror(FILE *stream);
|
||||
|
||||
extern size_t fread(void *buf, size_t size, size_t count, FILE *stream);
|
||||
extern size_t fwrite(const void *buf, size_t size, size_t count, FILE *stream);
|
||||
@@ -44,6 +56,24 @@ static inline int putc(int c, FILE *stream)
|
||||
extern char *fgets(char *restrict str, int count, FILE *restrict stream);
|
||||
extern int fputs(const char *restrict str, FILE *restrict stream);
|
||||
|
||||
extern long ftell(FILE *stream);
|
||||
extern int fseek(FILE *stream, long offset, int origin);
|
||||
|
||||
extern int sscanf(
|
||||
const char *restrict buffer,
|
||||
const char *restrict format,
|
||||
...);
|
||||
|
||||
extern int setvbuf(
|
||||
FILE *restrict stream,
|
||||
char *restrict buf,
|
||||
int mode,
|
||||
size_t size);
|
||||
|
||||
extern FILE *__libc_file_stdin(void);
|
||||
extern FILE *__libc_file_stdout(void);
|
||||
extern FILE *__libc_file_stderr(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user