-traditional and -iwithprefix options
[tinycc.git] / tcclib.h
Commit [+]AuthorDateLineData
aca44291 bellard2001-11-06 01:20:38 +00001/* 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 */
59b27e85 bellard2002-08-18 13:25:12 +00007#ifndef _TCCLIB_H
8#define _TCCLIB_H
b0b2d5d2 bellard2001-12-17 21:57:01 +00009
b536ac30 bellard2001-11-11 02:54:21 +000010#include <stddef.h>
11#include <stdarg.h>
aca44291 bellard2001-11-06 01:20:38 +000012
13/* stdlib.h */
14void *calloc(size_t nmemb, size_t size);
15void *malloc(size_t size);
16void free(void *ptr);
17void *realloc(void *ptr, size_t size);
18int atoi(const char *nptr);
19long int strtol(const char *nptr, char **endptr, int base);
20unsigned long int strtoul(const char *nptr, char **endptr, int base);
859da934 Shinichiro Hamaji2009-04-18 23:55:51 +090021void exit(int);
aca44291 bellard2001-11-06 01:20:38 +000022
23/* stdio.h */
b536ac30 bellard2001-11-11 02:54:21 +000024typedef struct __FILE FILE;
aca44291 bellard2001-11-06 01:20:38 +000025#define EOF (-1)
eb0e3e70 bellard2001-11-11 18:01:29 +000026extern FILE *stdin;
27extern FILE *stdout;
28extern FILE *stderr;
aca44291 bellard2001-11-06 01:20:38 +000029FILE *fopen(const char *path, const char *mode);
30FILE *fdopen(int fildes, const char *mode);
31FILE *freopen(const char *path, const char *mode, FILE *stream);
32int fclose(FILE *stream);
33size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
34size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream);
35int fgetc(FILE *stream);
36char *fgets(char *s, int size, FILE *stream);
37int getc(FILE *stream);
38int getchar(void);
39char *gets(char *s);
40int ungetc(int c, FILE *stream);
41int fflush(FILE *stream);
3c372b4c seyko2015-04-10 06:44:34 +030042int putchar (int c);
aca44291 bellard2001-11-06 01:20:38 +000043
44int printf(const char *format, ...);
45int fprintf(FILE *stream, const char *format, ...);
46int sprintf(char *str, const char *format, ...);
47int snprintf(char *str, size_t size, const char *format, ...);
48int asprintf(char **strp, const char *format, ...);
59b27e85 bellard2002-08-18 13:25:12 +000049int dprintf(int fd, const char *format, ...);
aca44291 bellard2001-11-06 01:20:38 +000050int vprintf(const char *format, va_list ap);
51int vfprintf(FILE *stream, const char *format, va_list ap);
52int vsprintf(char *str, const char *format, va_list ap);
53int vsnprintf(char *str, size_t size, const char *format, va_list ap);
54int vasprintf(char **strp, const char *format, va_list ap);
59b27e85 bellard2002-08-18 13:25:12 +000055int vdprintf(int fd, const char *format, va_list ap);
aca44291 bellard2001-11-06 01:20:38 +000056
b536ac30 bellard2001-11-11 02:54:21 +000057void perror(const char *s);
58
aca44291 bellard2001-11-06 01:20:38 +000059/* string.h */
60char *strcat(char *dest, const char *src);
61char *strchr(const char *s, int c);
62char *strrchr(const char *s, int c);
63char *strcpy(char *dest, const char *src);
64void *memcpy(void *dest, const void *src, size_t n);
59b27e85 bellard2002-08-18 13:25:12 +000065void *memmove(void *dest, const void *src, size_t n);
aca44291 bellard2001-11-06 01:20:38 +000066void *memset(void *s, int c, size_t n);
67char *strdup(const char *s);
3c372b4c seyko2015-04-10 06:44:34 +030068size_t strlen(const char *s);
b536ac30 bellard2001-11-11 02:54:21 +000069
70/* dlfcn.h */
eb0e3e70 bellard2001-11-11 18:01:29 +000071#define RTLD_LAZY 0x001
72#define RTLD_NOW 0x002
73#define RTLD_GLOBAL 0x100
74
b536ac30 bellard2001-11-11 02:54:21 +000075void *dlopen(const char *filename, int flag);
76const char *dlerror(void);
77void *dlsym(void *handle, char *symbol);
78int dlclose(void *handle);
59b27e85 bellard2002-08-18 13:25:12 +000079
80#endif /* _TCCLIB_H */