meta: move photon/libc to root
This commit is contained in:
67
libc/include/stdio.h
Normal file
67
libc/include/stdio.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef STDIO_H_
|
||||
#define STDIO_H_
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/_fconst.h>
|
||||
|
||||
#if defined(__FILENAME_MAX)
|
||||
#define FILENAME_MAX __FILENAME_MAX
|
||||
#else
|
||||
#define FILENAME_MAX 1024
|
||||
#endif
|
||||
|
||||
#define BUFSIZ __FIO_BUFSZ
|
||||
|
||||
#define SEEK_SET __SEEK_SET
|
||||
#define SEEK_CUR __SEEK_CUR
|
||||
#define SEEK_END __SEEK_END
|
||||
|
||||
#define EOF -1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct __io_file FILE;
|
||||
|
||||
extern FILE *__get_stdio_file(int);
|
||||
|
||||
#define stdin (__get_stdio_file(0))
|
||||
#define stdout (__get_stdio_file(1))
|
||||
#define stderr (__get_stdio_file(2))
|
||||
|
||||
extern FILE *fopen(const char *path, const char *mode);
|
||||
extern FILE *freopen(const char *path, const char *mode, FILE *fp);
|
||||
extern FILE *fdopen(int fd, const char *mode);
|
||||
extern int fclose(FILE *fp);
|
||||
extern int fflush(FILE *fp);
|
||||
extern size_t fread(void *ptr, size_t size, size_t count, FILE *fp);
|
||||
extern size_t fwrite(const void *ptr, size_t size, size_t count, FILE *fp);
|
||||
|
||||
extern int fileno(FILE *fp);
|
||||
extern int fputs(const char *str, FILE *fp);
|
||||
extern int fputc(int c, FILE *fp);
|
||||
extern int fgetc(FILE *fp);
|
||||
extern char *fgets(char *restrict str, int count, FILE *restrict fp);
|
||||
extern int putchar(int c);
|
||||
|
||||
extern int ungetc(int c, FILE *fp);
|
||||
|
||||
extern int printf(const char *restrict format, ...);
|
||||
extern int fprintf(FILE *fp, const char *restrict format, ...);
|
||||
extern int sprintf(char *buf, const char *restrict format, ...);
|
||||
extern int snprintf(char *buf, size_t sz, const char *restrict format, ...);
|
||||
|
||||
extern int vprintf(const char *restrict format, va_list arg);
|
||||
extern int vfprintf(FILE *fp, const char *restrict format, va_list arg);
|
||||
extern int vsprintf(char *buf, const char *restrict format, va_list arg);
|
||||
extern int vsnprintf(char *buf, size_t sz, const char *restrict format, va_list arg);
|
||||
|
||||
extern void perror(const char *s);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user