13 #define NULL ((void*)0)
17 #define __NEED_wchar_t
19 #include <bits/alltypes.h>
21 int atoi (const char *);
22 long atol (const char *);
23 long long atoll (const char *);
24 double atof (const char *);
26 float strtof (const char *__restrict, char **__restrict);
27 double strtod (const char *__restrict, char **__restrict);
28 long double strtold (const char *__restrict, char **__restrict);
30 long strtol (const char *__restrict, char **__restrict, int);
31 unsigned long strtoul (const char *__restrict, char **__restrict, int);
32 long long strtoll (const char *__restrict, char **__restrict, int);
33 unsigned long long strtoull (const char *__restrict, char **__restrict, int);
36 void srand (unsigned);
38 void *malloc (size_t);
39 void *calloc (size_t, size_t);
40 void *realloc (void *, size_t);
42 void *aligned_alloc(size_t alignment, size_t size);
44 _Noreturn void abort (void);
45 int atexit (void (*) (void));
46 _Noreturn void exit (int);
47 _Noreturn void _Exit (int);
48 int at_quick_exit (void (*) (void));
49 _Noreturn void quick_exit (int);
51 char *getenv (const char *);
53 int system (const char *);
55 void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
56 void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
60 long long llabs (long long);
62 typedef struct { int quot, rem; } div_t;
63 typedef struct { long quot, rem; } ldiv_t;
64 typedef struct { long long quot, rem; } lldiv_t;
67 ldiv_t ldiv (long, long);
68 lldiv_t lldiv (long long, long long);
70 int mblen (const char *, size_t);
71 int mbtowc (wchar_t *__restrict, const char *__restrict, size_t);
72 int wctomb (char *, wchar_t);
73 size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t);
74 size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t);
76 #define EXIT_FAILURE 1
77 #define EXIT_SUCCESS 0
79 #define MB_CUR_MAX ((size_t)+4)
81 #define RAND_MAX (0x7fffffff)
84 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
85 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
86 || defined(_BSD_SOURCE)
91 #define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
92 #define WTERMSIG(s) ((s) & 0x7f)
93 #define WSTOPSIG(s) WEXITSTATUS(s)
94 #define WIFEXITED(s) (!WTERMSIG(s))
95 #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
96 #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
98 int posix_memalign (void **, size_t, size_t);
99 int setenv (const char *, const char *, int);
100 int unsetenv (const char *);
101 int mkstemp (char *);
102 int mkostemp (char *, int);
103 char *mkdtemp (char *);
104 int getsubopt (char **, char *const *, char **);
105 int rand_r (unsigned *);
110 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
111 || defined(_BSD_SOURCE)
112 char *realpath (const char *__restrict, char *__restrict);
113 long int random (void);
114 void srandom (unsigned int);
115 char *initstate (unsigned int, char *, size_t);
116 char *setstate (char *);
118 int posix_openpt (int);
123 long a64l (const char *);
124 void setkey (const char *);
125 double drand48 (void);
126 double erand48 (unsigned short [3]);
127 long int lrand48 (void);
128 long int nrand48 (unsigned short [3]);
130 long jrand48 (unsigned short [3]);
132 unsigned short *seed48 (unsigned short [3]);
133 void lcong48 (unsigned short [7]);
136 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
138 char *mktemp (char *);
139 int mkstemps (char *, int);
140 int mkostemps (char *, int, int);
141 void *valloc (size_t);
142 void *memalign(size_t, size_t);
143 int getloadavg(double *, int);
145 #define WCOREDUMP(s) ((s) & 0x80)
146 #define WIFCONTINUED(s) ((s) == 0xffff)
150 int ptsname_r(int, char *, size_t);
151 char *ecvt(double, int, int *, int *);
152 char *fcvt(double, int, int *, int *);
153 char *gcvt(double, int, char *);
154 struct __locale_struct;
155 float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *);
156 double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *);
157 long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *);
160 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
161 #define mkstemp64 mkstemp
162 #define mkostemp64 mkostemp
163 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
164 #define mkstemps64 mkstemps
165 #define mkostemps64 mkostemps