14 #define NULL ((void*)0)
18 #define __NEED_wchar_t
20 #include <bits/alltypes.h>
22 int atoi (const char *);
23 long atol (const char *);
24 long long atoll (const char *);
25 double atof (const char *);
27 float strtof (const char *__restrict, char **__restrict);
28 double strtod (const char *__restrict, char **__restrict);
29 long double strtold (const char *__restrict, char **__restrict);
31 long strtol (const char *__restrict, char **__restrict, int);
32 unsigned long strtoul (const char *__restrict, char **__restrict, int);
33 long long strtoll (const char *__restrict, char **__restrict, int);
34 unsigned long long strtoull (const char *__restrict, char **__restrict, int);
37 void srand (unsigned);
39 void *malloc (size_t);
40 void *calloc (size_t, size_t);
41 void *realloc (void *, size_t);
43 void *aligned_alloc(size_t alignment, size_t size);
45 _Noreturn void abort (void);
46 int atexit (void (*) (void));
47 _Noreturn void exit (int);
48 _Noreturn void _Exit (int);
49 int at_quick_exit (void (*) (void));
50 _Noreturn void quick_exit (int);
52 char *getenv (const char *);
54 int system (const char *);
56 void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
57 void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
61 long long llabs (long long);
63 typedef struct { int quot, rem; } div_t;
64 typedef struct { long quot, rem; } ldiv_t;
65 typedef struct { long long quot, rem; } lldiv_t;
68 ldiv_t ldiv (long, long);
69 lldiv_t lldiv (long long, long long);
71 int mblen (const char *, size_t);
72 int mbtowc (wchar_t *__restrict, const char *__restrict, size_t);
73 int wctomb (char *, wchar_t);
74 size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t);
75 size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t);
77 #define EXIT_FAILURE 1
78 #define EXIT_SUCCESS 0
80 #define MB_CUR_MAX ((size_t)+4)
82 #define RAND_MAX (0x7fffffff)
85 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
86 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
87 || defined(_BSD_SOURCE)
90 #define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
91 #define WTERMSIG(s) ((s) & 0x7f)
92 #define WSTOPSIG(s) WEXITSTATUS(s)
93 #define WCOREDUMP(s) ((s) & 0x80)
94 #define WIFEXITED(s) (!WTERMSIG(s))
95 #define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
96 #define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
97 #define WIFCONTINUED(s) ((s) == 0xffff)
100 int posix_memalign (void **, size_t, size_t);
101 int setenv (const char *, const char *, int);
102 int unsetenv (const char *);
103 int mkstemp (char *);
104 char *mkdtemp (char *);
105 int getsubopt (char **, char *const *, char **);
106 int rand_r (unsigned *);
111 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
112 || defined(_BSD_SOURCE)
113 char *realpath (const char *__restrict, char *__restrict);
114 long int random (void);
115 void srandom (unsigned int);
116 char *initstate (unsigned int, char *, size_t);
117 char *setstate (char *);
120 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
122 int posix_openpt (int);
127 long a64l (const char *);
128 void setkey (const char *);
129 double drand48 (void);
130 double erand48 (unsigned short [3]);
131 long int lrand48 (void);
132 long int nrand48 (unsigned short [3]);
134 long jrand48 (unsigned short [3]);
136 unsigned short *seed48 (unsigned short [3]);
137 void lcong48 (unsigned short [7]);
140 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
142 char *mktemp (char *);
143 void *valloc (size_t);
144 void *memalign(size_t, size_t);
149 int ptsname_r(int, char *, size_t);
150 char *ecvt(double, int, int *, int *);
151 char *fcvt(double, int, int *, int *);
152 char *gcvt(double, int, char *);
155 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
156 #define mkstemp64 mkstemp