History

added std libs

bellard committed 25 years ago

Commit b536ac31 parent 507a2213 files · +31 −4Browse files

Unified · Split

3 files
  1. stdarg.h +11 −0
  2. stddef.h +9 −0
  3. tcclib.h +11 −4
stdarg.h+11−0
@@ -0,0 +1,11 @@
1#ifndef _STDARG_H
2#define _STDARG_H
3
4typedef char *va_list;
5
6/* only correct for i386 */
7#define va_start(ap,last) ap=(char *)&(last);
8#define va_arg(ap,type) (ap-=sizeof (type), *(type *)(ap))
9#define va_end(ap)
10
11#endif
stddef.h+9−0
@@ -0,0 +1,9 @@
1#ifndef _STDDEF_H
2#define _STDDEF_H
3
4/* TCC include file */
5#define NULL ((void *)0)
6
7typedef unsigned int size_t;
8
9#endif
tcclib.h+11−4
@@ -4,10 +4,8 @@ · 3 unmodified lines
4 * only for your convenience so that you do not need to put the whole4 * only for your convenience so that you do not need to put the whole
5 * glibc include files on your floppy disk 5 * glibc include files on your floppy disk
6 */6 */
7#define NULL 07#include <stddef.h>
8typedef unsigned int size_t;8#include <stdarg.h>
9typedef struct __FILE FILE;
10typedef void *va_list;
11 9
12/* stdlib.h */10/* stdlib.h */
13void *calloc(size_t nmemb, size_t size);11void *calloc(size_t nmemb, size_t size);
@@ -19,6 +17,7 @@ long int strtol(const char *nptr, char **endptr, int base); · 5 unmodified lines
19unsigned long int strtoul(const char *nptr, char **endptr, int base);17unsigned long int strtoul(const char *nptr, char **endptr, int base);
20 18
21/* stdio.h */19/* stdio.h */
20typedef struct __FILE FILE;
22#define EOF (-1)21#define EOF (-1)
23FILE *fopen(const char *path, const char *mode);22FILE *fopen(const char *path, const char *mode);
24FILE *fdopen(int fildes, const char *mode);23FILE *fdopen(int fildes, const char *mode);
@@ -47,6 +46,8 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap); · 22 unmodified lines
47int vasprintf(char **strp, const char *format, va_list ap);46int vasprintf(char **strp, const char *format, va_list ap);
48int vdprintf(int d, const char *format, va_list ap);47int vdprintf(int d, const char *format, va_list ap);
49 48
49void perror(const char *s);
50
50/* string.h */51/* string.h */
51char *strcat(char *dest, const char *src);52char *strcat(char *dest, const char *src);
52char *strchr(const char *s, int c);53char *strchr(const char *s, int c);
@@ -55,3 +56,9 @@ char *strcpy(char *dest, const char *src); · 2 unmodified lines
55void *memcpy(void *dest, const void *src, size_t n);56void *memcpy(void *dest, const void *src, size_t n);
56void *memset(void *s, int c, size_t n);57void *memset(void *s, int c, size_t n);
57char *strdup(const char *s);58char *strdup(const char *s);
59
60/* dlfcn.h */
61void *dlopen(const char *filename, int flag);
62const char *dlerror(void);
63void *dlsym(void *handle, char *symbol);
64int dlclose(void *handle);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t