8 #if __STDC_VERSION__ >= 199901L
9 #define __restrict restrict
10 #elif !defined(__GNUC__)
18 #define NULL ((void*)0)
22 #define __NEED_wchar_t
24 #include <bits/alltypes.h>
26 int atoi (const char *);
27 long atol (const char *);
28 long long atoll (const char *);
29 double atof (const char *);
31 float strtof (const char *__restrict, char **__restrict);
32 double strtod (const char *__restrict, char **__restrict);
33 long double strtold (const char *__restrict, char **__restrict);
35 long strtol (const char *__restrict, char **__restrict, int);
36 unsigned long strtoul (const char *__restrict, char **__restrict, int);
37 long long strtoll (const char *__restrict, char **__restrict, int);
38 unsigned long long strtoull (const char *__restrict, char **__restrict, int);
41 void srand (unsigned);
43 void *malloc (size_t);
44 void *calloc (size_t, size_t);
45 void *realloc (void *, size_t);
47 void *aligned_alloc(size_t alignment, size_t size);
50 int atexit (void (*) (void));
53 int at_quick_exit (void (*) (void));
54 void quick_exit (int);
56 char *getenv (const char *);
58 int system (const char *);
60 void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
61 void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
65 long long llabs (long long);
67 typedef struct { int quot, rem; } div_t;
68 typedef struct { long quot, rem; } ldiv_t;
69 typedef struct { long long quot, rem; } lldiv_t;
72 ldiv_t ldiv (long, long);
73 lldiv_t lldiv (long long, long long);
75 int mblen (const char *, size_t);
76 int mbtowc (wchar_t *__restrict, const char *__restrict, size_t);
77 int wctomb (char *, wchar_t);
78 size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t);
79 size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t);
81 #define EXIT_FAILURE 1
82 #define EXIT_SUCCESS 0
84 #define MB_CUR_MAX ((size_t)+4)
86 #define RAND_MAX (0x7fffffff)
89 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
90 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
91 || defined(_BSD_SOURCE)
94 #define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
95 #define WTERMSIG(s) ((s) & 0x7f)
96 #define WSTOPSIG(s) WEXITSTATUS(s)
97 #define WCOREDUMP(s) ((s) & 0x80)
98 #define WIFEXITED(s) (!WTERMSIG(s))
99 #define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
100 #define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
101 #define WIFCONTINUED(s) ((s) == 0xffff)
104 int posix_memalign (void **, size_t, size_t);
105 int setenv (const char *, const char *, int);
106 int unsetenv (const char *);
107 int mkstemp (char *);
108 char *mkdtemp (char *);
109 int getsubopt (char **, char *const *, char **);
110 int rand_r (unsigned *);
115 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
116 || defined(_BSD_SOURCE)
117 char *realpath (const char *__restrict, char *__restrict);
118 long int random (void);
119 void srandom (unsigned int);
120 char *initstate (unsigned int, char *, size_t);
121 char *setstate (char *);
124 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
126 int posix_openpt (int);
131 long a64l (const char *);
132 void setkey (const char *);
133 double drand48 (void);
134 double erand48 (unsigned short [3]);
135 long int lrand48 (void);
136 long int nrand48 (unsigned short [3]);
138 long jrand48 (unsigned short [3]);
140 unsigned short *seed48 (unsigned short [3]);
141 void lcong48 (unsigned short [7]);
144 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
146 char *mktemp (char *);
147 void *valloc (size_t);
148 void *memalign(size_t, size_t);
153 int ptsname_r(int, char *, size_t);
154 char *ecvt(double, int, int *, int *);
155 char *fcvt(double, int, int *, int *);
156 char *gcvt(double, int, char *);
159 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
160 #define mkstemp64 mkstemp