1 /* Simple libc header for TCC
3 * Add any function you want from the libc there. This file is here
4 * only for your convenience so that you do not need to put the whole
5 * glibc include files on your floppy disk
11 void *calloc(size_t nmemb
, size_t size
);
12 void *malloc(size_t size
);
14 void *realloc(void *ptr
, size_t size
);
15 int atoi(const char *nptr
);
16 long int strtol(const char *nptr
, char **endptr
, int base
);
17 unsigned long int strtoul(const char *nptr
, char **endptr
, int base
);
20 typedef struct __FILE
FILE;
22 FILE *fopen(const char *path
, const char *mode
);
23 FILE *fdopen(int fildes
, const char *mode
);
24 FILE *freopen(const char *path
, const char *mode
, FILE *stream
);
25 int fclose(FILE *stream
);
26 size_t fread(void *ptr
, size_t size
, size_t nmemb
, FILE *stream
);
27 size_t fwrite(void *ptr
, size_t size
, size_t nmemb
, FILE *stream
);
28 int fgetc(FILE *stream
);
29 char *fgets(char *s
, int size
, FILE *stream
);
30 int getc(FILE *stream
);
33 int ungetc(int c
, FILE *stream
);
34 int fflush(FILE *stream
);
36 int printf(const char *format
, ...);
37 int fprintf(FILE *stream
, const char *format
, ...);
38 int sprintf(char *str
, const char *format
, ...);
39 int snprintf(char *str
, size_t size
, const char *format
, ...);
40 int asprintf(char **strp
, const char *format
, ...);
41 int dprintf(int d
, const char *format
, ...);
42 int vprintf(const char *format
, va_list ap
);
43 int vfprintf(FILE *stream
, const char *format
, va_list ap
);
44 int vsprintf(char *str
, const char *format
, va_list ap
);
45 int vsnprintf(char *str
, size_t size
, const char *format
, va_list ap
);
46 int vasprintf(char **strp
, const char *format
, va_list ap
);
47 int vdprintf(int d
, const char *format
, va_list ap
);
49 void perror(const char *s
);
52 char *strcat(char *dest
, const char *src
);
53 char *strchr(const char *s
, int c
);
54 char *strrchr(const char *s
, int c
);
55 char *strcpy(char *dest
, const char *src
);
56 void *memcpy(void *dest
, const void *src
, size_t n
);
57 void *memset(void *s
, int c
, size_t n
);
58 char *strdup(const char *s
);
61 void *dlopen(const char *filename
, int flag
);
62 const char *dlerror(void);
63 void *dlsym(void *handle
, char *symbol
);
64 int dlclose(void *handle
);