added std libs
This commit is contained in:
11
stdarg.h
Normal file
11
stdarg.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#ifndef _STDARG_H
|
||||||
|
#define _STDARG_H
|
||||||
|
|
||||||
|
typedef char *va_list;
|
||||||
|
|
||||||
|
/* only correct for i386 */
|
||||||
|
#define va_start(ap,last) ap=(char *)&(last);
|
||||||
|
#define va_arg(ap,type) (ap-=sizeof (type), *(type *)(ap))
|
||||||
|
#define va_end(ap)
|
||||||
|
|
||||||
|
#endif
|
||||||
9
stddef.h
Normal file
9
stddef.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef _STDDEF_H
|
||||||
|
#define _STDDEF_H
|
||||||
|
|
||||||
|
/* TCC include file */
|
||||||
|
#define NULL ((void *)0)
|
||||||
|
|
||||||
|
typedef unsigned int size_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
15
tcclib.h
15
tcclib.h
@ -4,10 +4,8 @@
|
|||||||
* only for your convenience so that you do not need to put the whole
|
* only for your convenience so that you do not need to put the whole
|
||||||
* glibc include files on your floppy disk
|
* glibc include files on your floppy disk
|
||||||
*/
|
*/
|
||||||
#define NULL 0
|
#include <stddef.h>
|
||||||
typedef unsigned int size_t;
|
#include <stdarg.h>
|
||||||
typedef struct __FILE FILE;
|
|
||||||
typedef void *va_list;
|
|
||||||
|
|
||||||
/* stdlib.h */
|
/* stdlib.h */
|
||||||
void *calloc(size_t nmemb, size_t size);
|
void *calloc(size_t nmemb, size_t size);
|
||||||
@ -19,6 +17,7 @@ long int strtol(const char *nptr, char **endptr, int base);
|
|||||||
unsigned long int strtoul(const char *nptr, char **endptr, int base);
|
unsigned long int strtoul(const char *nptr, char **endptr, int base);
|
||||||
|
|
||||||
/* stdio.h */
|
/* stdio.h */
|
||||||
|
typedef struct __FILE FILE;
|
||||||
#define EOF (-1)
|
#define EOF (-1)
|
||||||
FILE *fopen(const char *path, const char *mode);
|
FILE *fopen(const char *path, const char *mode);
|
||||||
FILE *fdopen(int fildes, const char *mode);
|
FILE *fdopen(int fildes, const char *mode);
|
||||||
@ -47,6 +46,8 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
|||||||
int vasprintf(char **strp, const char *format, va_list ap);
|
int vasprintf(char **strp, const char *format, va_list ap);
|
||||||
int vdprintf(int d, const char *format, va_list ap);
|
int vdprintf(int d, const char *format, va_list ap);
|
||||||
|
|
||||||
|
void perror(const char *s);
|
||||||
|
|
||||||
/* string.h */
|
/* string.h */
|
||||||
char *strcat(char *dest, const char *src);
|
char *strcat(char *dest, const char *src);
|
||||||
char *strchr(const char *s, int c);
|
char *strchr(const char *s, int c);
|
||||||
@ -55,3 +56,9 @@ char *strcpy(char *dest, const char *src);
|
|||||||
void *memcpy(void *dest, const void *src, size_t n);
|
void *memcpy(void *dest, const void *src, size_t n);
|
||||||
void *memset(void *s, int c, size_t n);
|
void *memset(void *s, int c, size_t n);
|
||||||
char *strdup(const char *s);
|
char *strdup(const char *s);
|
||||||
|
|
||||||
|
/* dlfcn.h */
|
||||||
|
void *dlopen(const char *filename, int flag);
|
||||||
|
const char *dlerror(void);
|
||||||
|
void *dlsym(void *handle, char *symbol);
|
||||||
|
int dlclose(void *handle);
|
||||||
|
|||||||
Reference in New Issue
Block a user