00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _STDLIB_H_
00038 #define _STDLIB_H_
00039
00040 #include <sys/cdefs.h>
00041 #include <sys/_types.h>
00042
00043 #if __BSD_VISIBLE
00044 #ifndef _RUNE_T_DECLARED
00045 typedef __rune_t rune_t;
00046 #define _RUNE_T_DECLARED
00047 #endif
00048 #endif
00049
00050 #ifndef _SIZE_T_DECLARED
00051 #if 1
00052 #include <stddef.h>
00053 #else
00054 typedef __size_t size_t;
00055 #endif
00056 #define _SIZE_T_DECLARED
00057 #endif
00058
00059 #ifdef HAVE_WCHAR
00060 #ifndef __cplusplus
00061 #ifndef _WCHAR_T_DECLARED
00062 typedef __wchar_t wchar_t;
00063 #define _WCHAR_T_DECLARED
00064 #endif
00065 #endif
00066 #endif
00067
00068 typedef struct {
00069 int quot;
00070 int rem;
00071 } div_t;
00072
00073 typedef struct {
00074 long quot;
00075 long rem;
00076 } ldiv_t;
00077
00078 #ifndef NULL
00079 #define NULL 0
00080 #endif
00081
00082 #define EXIT_FAILURE 1
00083 #define EXIT_SUCCESS 0
00084
00085 #define RAND_MAX 0x7fffffff
00086
00087 extern int __mb_cur_max;
00088 #define MB_CUR_MAX __mb_cur_max
00089
00090 __BEGIN_DECLS
00091 void abort(void) __dead2;
00092 int abs(int) __pure2;
00093 int atexit(void (*)(void));
00094 double atof(const char *);
00095 int atoi(const char *);
00096 long atol(const char *);
00097 void *bsearch(const void *, const void *, size_t,
00098 size_t, int (*)(const void *, const void *));
00099 void *calloc(size_t, size_t);
00100 div_t div(int, int) __pure2;
00101 void exit(int) __dead2;
00102 void free(void *);
00103 char *getenv(const char *);
00104 long labs(long) __pure2;
00105 ldiv_t ldiv(long, long) __pure2;
00106 void *malloc(size_t);
00107 #ifdef HAVE_WCHAR
00108 int mblen(const char *, size_t);
00109 size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
00110 int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
00111 #endif
00112 void qsort(void *, size_t, size_t,
00113 int (*)(const void *, const void *));
00114 int rand(void);
00115 void *realloc(void *, size_t);
00116 void srand(unsigned);
00117 double strtod(const char * __restrict, char ** __restrict);
00118 float strtof(const char * __restrict, char ** __restrict);
00119 long strtol(const char * __restrict, char ** __restrict, int);
00120 long double
00121 strtold(const char * __restrict, char ** __restrict);
00122 unsigned long
00123 strtoul(const char * __restrict, char ** __restrict, int);
00124 #ifdef HAVE_OS
00125 int system(const char *);
00126 #endif
00127 #ifdef HAVE_WCHAR
00128 int wctomb(char *, wchar_t);
00129 size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
00130 #endif
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 #if __ISO_C_VISIBLE >= 1999
00143 #ifdef __LONG_LONG_SUPPORTED
00144
00145 typedef struct {
00146 long long quot;
00147 long long rem;
00148 } lldiv_t;
00149
00150
00151 long long
00152 atoll(const char *);
00153
00154 long long
00155 llabs(long long) __pure2;
00156
00157 lldiv_t lldiv(long long, long long) __pure2;
00158
00159 long long
00160 strtoll(const char * __restrict, char ** __restrict, int);
00161
00162 unsigned long long
00163 strtoull(const char * __restrict, char ** __restrict, int);
00164 #endif
00165
00166 void _Exit(int) __dead2;
00167 #endif
00168
00169
00170
00171
00172
00173
00174 #if __POSIX_VISIBLE
00175
00176 int rand_r(unsigned *);
00177 int setenv(const char *, const char *, int);
00178 void unsetenv(const char *);
00179 #endif
00180
00181
00182
00183
00184
00185
00186
00187 #if __XSI_VISIBLE
00188
00189
00190 double drand48(void);
00191
00192 double erand48(unsigned short[3]);
00193
00194
00195 #ifndef _GETSUBOPT_DECLARED
00196 int getsubopt(char **, char *const *, char **);
00197 #define _GETSUBOPT_DECLARED
00198 #endif
00199 int grantpt(int);
00200 char *initstate(unsigned long , char *, long);
00201 long jrand48(unsigned short[3]);
00202
00203 void lcong48(unsigned short[7]);
00204 long lrand48(void);
00205 #ifndef _MKSTEMP_DECLARED
00206 int mkstemp(char *);
00207 #define _MKSTEMP_DECLARED
00208 #endif
00209 #ifndef _MKTEMP_DECLARED
00210 char *mktemp(char *);
00211 #define _MKTEMP_DECLARED
00212 #endif
00213 long mrand48(void);
00214 long nrand48(unsigned short[3]);
00215 int posix_openpt(int);
00216 char *ptsname(int);
00217 int putenv(const char *);
00218 long random(void);
00219 char *realpath(const char *, char resolved_path[]);
00220 unsigned short
00221 *seed48(unsigned short[3]);
00222 #ifndef _SETKEY_DECLARED
00223 int setkey(const char *);
00224 #define _SETKEY_DECLARED
00225 #endif
00226 char *setstate( char *);
00227 void srand48(long);
00228 void srandom(unsigned long);
00229 int unlockpt(int);
00230 #endif
00231
00232 #if __BSD_VISIBLE
00233 extern const char *_malloc_options;
00234 extern void (*_malloc_message)(const char *, const char *, const char *,
00235 const char *);
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246 #if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
00247 #undef alloca
00248 #define alloca(sz) __builtin_alloca(sz)
00249 #elif defined(lint)
00250 void *alloca(size_t);
00251 #endif
00252
00253 __uint32_t
00254 arc4random(void);
00255 void arc4random_addrandom(unsigned char *dat, int datlen);
00256 void arc4random_stir(void);
00257 char *getbsize(int *, long *);
00258
00259 char *cgetcap(char *, const char *, int);
00260 int cgetclose(void);
00261 int cgetent(char **, char **, const char *);
00262 int cgetfirst(char **, char **);
00263 int cgetmatch(const char *, const char *);
00264 int cgetnext(char **, char **);
00265 int cgetnum(char *, const char *, long *);
00266 int cgetset(const char *);
00267 int cgetstr(char *, const char *, char **);
00268 int cgetustr(char *, const char *, char **);
00269
00270 int daemon(int, int);
00271 char *devname(int, int);
00272 char *devname_r(int, int, char *, int);
00273 int getloadavg(double [], int);
00274 __const char *
00275 getprogname(void);
00276
00277 int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
00278 int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
00279 void qsort_r(void *, size_t, size_t, void *,
00280 int (*)(void *, const void *, const void *));
00281 int radixsort(const unsigned char **, int, const unsigned char *,
00282 unsigned);
00283 void *reallocf(void *, size_t);
00284 void setprogname(const char *);
00285 int sradixsort(const unsigned char **, int, const unsigned char *,
00286 unsigned);
00287 void sranddev(void);
00288 void srandomdev(void);
00289
00290 #endif
00291 __END_DECLS
00292
00293 #endif