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