update
[tinycc.git] / tcclib.h
blobf70297d793c72737a7f6e3c3af3a4af849faa66c
1 /* Simple libc header for TCC
2 *
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
6 */
8 #include <stddef.h>
9 #include <stdarg.h>
11 /* stdlib.h */
12 void *calloc(size_t nmemb, size_t size);
13 void *malloc(size_t size);
14 void free(void *ptr);
15 void *realloc(void *ptr, size_t size);
16 int atoi(const char *nptr);
17 long int strtol(const char *nptr, char **endptr, int base);
18 unsigned long int strtoul(const char *nptr, char **endptr, int base);
20 /* stdio.h */
21 typedef struct __FILE FILE;
22 #define EOF (-1)
23 extern FILE *stdin;
24 extern FILE *stdout;
25 extern FILE *stderr;
26 FILE *fopen(const char *path, const char *mode);
27 FILE *fdopen(int fildes, const char *mode);
28 FILE *freopen(const char *path, const char *mode, FILE *stream);
29 int fclose(FILE *stream);
30 size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
31 size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream);
32 int fgetc(FILE *stream);
33 char *fgets(char *s, int size, FILE *stream);
34 int getc(FILE *stream);
35 int getchar(void);
36 char *gets(char *s);
37 int ungetc(int c, FILE *stream);
38 int fflush(FILE *stream);
40 int printf(const char *format, ...);
41 int fprintf(FILE *stream, const char *format, ...);
42 int sprintf(char *str, const char *format, ...);
43 int snprintf(char *str, size_t size, const char *format, ...);
44 int asprintf(char **strp, const char *format, ...);
45 int dprintf(int d, const char *format, ...);
46 int vprintf(const char *format, va_list ap);
47 int vfprintf(FILE *stream, const char *format, va_list ap);
48 int vsprintf(char *str, const char *format, va_list ap);
49 int vsnprintf(char *str, size_t size, const char *format, va_list ap);
50 int vasprintf(char **strp, const char *format, va_list ap);
51 int vdprintf(int d, const char *format, va_list ap);
53 void perror(const char *s);
55 /* string.h */
56 char *strcat(char *dest, const char *src);
57 char *strchr(const char *s, int c);
58 char *strrchr(const char *s, int c);
59 char *strcpy(char *dest, const char *src);
60 void *memcpy(void *dest, const void *src, size_t n);
61 void *memset(void *s, int c, size_t n);
62 char *strdup(const char *s);
64 /* dlfcn.h */
65 #define RTLD_LAZY 0x001
66 #define RTLD_NOW 0x002
67 #define RTLD_GLOBAL 0x100
69 void *dlopen(const char *filename, int flag);
70 const char *dlerror(void);
71 void *dlsym(void *handle, char *symbol);
72 int dlclose(void *handle);