api: add stdarg .. sys/uio
[libc-test] / src / api / stdlib.c
1 #include <stdlib.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
6 {
7 C(EXIT_FAILURE)
8 C(EXIT_SUCCESS)
9 C(RAND_MAX)
10 C(MB_CUR_MAX)
11 {void *x=NULL;}
12 T(div_t)
13 T(ldiv_t)
14 T(lldiv_t)
15 T(size_t)
16 T(wchar_t)
17 #ifdef _POSIX_C_SOURCE
18 C(WEXITSTATUS(0))
19 C(WIFEXITED(0))
20 C(WIFSIGNALED(0))
21 C(WIFSTOPPED(0))
22 C(WNOHANG)
23 C(WSTOPSIG(0))
24 C(WTERMSIG(0))
25 C(WUNTRACED)
26 #endif
27 void(*p__Exit)(int) = _Exit;
28 void(*p_abort)(void) = abort;
29 int(*p_abs)(int) = abs;
30 int(*p_atexit)(void(*)(void)) = atexit;
31 double(*p_atof)(const char*) = atof;
32 int(*p_atoi)(const char*) = atoi;
33 long(*p_atol)(const char*) = atol;
34 long long(*p_atoll)(const char*) = atoll;
35 void*(*p_bsearch)(const void*,const void*,size_t,size_t,int(*)(const void*,const void*)) = bsearch;
36 void*(*p_calloc)(size_t,size_t) = calloc;
37 div_t(*p_div)(int,int) = div;
38 void(*p_exit)(int) = exit;
39 void(*p_free)(void*) = free;
40 char*(*p_getenv)(const char*) = getenv;
41 int(*p_getsubopt)(char**,char*const*,char**) = getsubopt;
42 long(*p_labs)(long) = labs;
43 ldiv_t(*p_ldiv)(long,long) = ldiv;
44 long long(*p_llabs)(long long) = llabs;
45 lldiv_t(*p_lldiv)(long long,long long) = lldiv;
46 void*(*p_malloc)(size_t) = malloc;
47 int(*p_mblen)(const char*,size_t) = mblen;
48 size_t(*p_mbstowcs)(wchar_t*restrict,const char*restrict,size_t) = mbstowcs;
49 int(*p_mbtowc)(wchar_t*restrict,const char*restrict,size_t) = mbtowc;
50 int(*p_posix_memalign)(void**,size_t,size_t) = posix_memalign;
51 void(*p_qsort)(void*,size_t,size_t,int(*)(const void*,const void*)) = qsort;
52 int(*p_rand)(void) = rand;
53 void*(*p_realloc)(void*,size_t) = realloc;
54 void(*p_srand)(unsigned) = srand;
55 double(*p_strtod)(const char*restrict,char**restrict) = strtod;
56 float(*p_strtof)(const char*restrict,char**restrict) = strtof;
57 long(*p_strtol)(const char*restrict,char**restrict,int) = strtol;
58 long double(*p_strtold)(const char*restrict,char**restrict) = strtold;
59 long long(*p_strtoll)(const char*restrict,char**restrict,int) = strtoll;
60 unsigned long(*p_strtoul)(const char*restrict,char**restrict,int) = strtoul;
61 unsigned long long(*p_strtoull)(const char*restrict,char**restrict,int) = strtoull;
62 int(*p_system)(const char*) = system;
63 size_t(*p_wcstombs)(char*restrict,const wchar_t*restrict,size_t) = wcstombs;
64 int(*p_wctomb)(char*,wchar_t) = wctomb;
65 #ifdef _POSIX_C_SOURCE
66 char*(*p_mkdtemp)(char*) = mkdtemp;
67 int(*p_mkstemp)(char*) = mkstemp;
68 int(*p_setenv)(const char*,const char*,int) = setenv;
69 int(*p_unsetenv)(const char*) = unsetenv;
70 #endif
71 #ifdef _XOPEN_SOURCE
72 long(*p_a64l)(const char*) = a64l;
73 double(*p_drand48)(void) = drand48;
74 double(*p_erand48)(unsigned short[]) = erand48;
75 int(*p_grantpt)(int) = grantpt;
76 char*(*p_initstate)(unsigned,char*,size_t) = initstate;
77 long(*p_jrand48)(unsigned short[]) = jrand48;
78 char*(*p_l64a)(long) = l64a;
79 void(*p_lcong48)(unsigned short[]) = lcong48;
80 long(*p_lrand48)(void) = lrand48;
81 long(*p_mrand48)(void) = mrand48;
82 long(*p_nrand48)(unsigned short[]) = nrand48;
83 char*(*p_ptsname)(int) = ptsname;
84 int(*p_putenv)(char*) = putenv;
85 long(*p_random)(void) = random;
86 char*(*p_realpath)(const char*restrict,char*restrict) = realpath;
87 unsigned short*(*p_seed48)(unsigned short[]) = seed48;
88 void(*p_setkey)(const char*) = setkey;
89 char*(*p_setstate)(char*) = setstate;
90 void(*p_srand48)(long) = srand48;
91 void(*p_srandom)(unsigned) = srandom;
92 int(*p_unlockpt)(int) = unlockpt;
93 #endif
94 }
95
96 #ifdef _XOPEN_SOURCE
97 #include <fcntl.h>
98 static void g()
99 {
100 int(*p_posix_openpt)(int) = posix_openpt;
101 }
102 #endif
103