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)
92 #define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
93 #define WTERMSIG(s) ((s) & 0x7f)
94 #define WSTOPSIG(s) WEXITSTATUS(s)
95 #define WIFEXITED(s) (!WTERMSIG(s))
96 #define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
97 #define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
99 int posix_memalign (void **, size_t, size_t);
100 int setenv (const char *, const char *, int);
101 int unsetenv (const char *);
102 int mkstemp (char *);
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 *);
119 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
121 int posix_openpt (int);
126 long a64l (const char *);
127 void setkey (const char *);
128 double drand48 (void);
129 double erand48 (unsigned short [3]);
130 long int lrand48 (void);
131 long int nrand48 (unsigned short [3]);
133 long jrand48 (unsigned short [3]);
135 unsigned short *seed48 (unsigned short [3]);
136 void lcong48 (unsigned short [7]);
139 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
141 char *mktemp (char *);
142 void *valloc (size_t);
143 void *memalign(size_t, size_t);
144 #define WCOREDUMP(s) ((s) & 0x80)
145 #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 *);
156 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
157 #define mkstemp64 mkstemp