59 lines
1.1 KiB
C
59 lines
1.1 KiB
C
#ifndef _FAKELIBC_STDIO_H
|
|
#define _FAKELIBC_STDIO_H
|
|
|
|
struct FILE_internals {};
|
|
|
|
typedef struct FILE_internals FILE;
|
|
|
|
#define EXIT_FAILURE 1
|
|
#define EXIT_SUCCESS 0
|
|
|
|
#ifdef __MAC
|
|
extern FILE* __stderrp;
|
|
extern FILE* __stdinp;
|
|
extern FILE* __stdoutp;
|
|
#define stderr __stderrp
|
|
#define stdin __stdinp
|
|
#define stdout __stdoutp
|
|
#endif
|
|
|
|
extern FILE* stderr;
|
|
extern FILE* stdin;
|
|
extern FILE* stdout;
|
|
|
|
#define EOF ((int)-1)
|
|
|
|
int printf(const char* fmt, ...);
|
|
int sprintf(char *buf, const char* fmt, ...);
|
|
int fprintf(FILE* f, const char* fmt, ...);
|
|
|
|
FILE* fopen(const char* name, const char* mode);
|
|
int fclose(FILE* f);
|
|
int fflush(FILE* f);
|
|
|
|
long fread(void* buffer, long size, long count, FILE* f);
|
|
long fwrite(void* buffer, long size, long count, FILE* f);
|
|
|
|
char* fgets(char*, int, FILE*);
|
|
|
|
int fputs(const char*, FILE*);
|
|
int fputc(int, FILE*);
|
|
|
|
void perror(const char*);
|
|
|
|
int putc(int c, FILE* f);
|
|
|
|
int putchar(int c);
|
|
|
|
int fseek(FILE* f, long offset, int wh);
|
|
#define SEEK_SET 0
|
|
#define SEEK_CUR 1
|
|
#define SEEK_END 2
|
|
|
|
long ftell(FILE* f);
|
|
|
|
long getline(char** linevar, long *nvar, FILE* f);
|
|
|
|
/* From ifndef at top of file: */
|
|
#endif
|