| 1 | /*- | 
|---|
| 2 | * Copyright (c) 1990, 1993 | 
|---|
| 3 | *      The Regents of the University of California.  All rights reserved. | 
|---|
| 4 | * | 
|---|
| 5 | * Redistribution and use in source and binary forms, with or without | 
|---|
| 6 | * modification, are permitted provided that the following conditions | 
|---|
| 7 | * are met: | 
|---|
| 8 | * 1. Redistributions of source code must retain the above copyright | 
|---|
| 9 | *    notice, this list of conditions and the following disclaimer. | 
|---|
| 10 | * 2. Redistributions in binary form must reproduce the above copyright | 
|---|
| 11 | *    notice, this list of conditions and the following disclaimer in the | 
|---|
| 12 | *    documentation and/or other materials provided with the distribution. | 
|---|
| 13 | * 3. All advertising materials mentioning features or use of this software | 
|---|
| 14 | *    must display the following acknowledgement: | 
|---|
| 15 | *      This product includes software developed by the University of | 
|---|
| 16 | *      California, Berkeley and its contributors. | 
|---|
| 17 | * 4. Neither the name of the University nor the names of its contributors | 
|---|
| 18 | *    may be used to endorse or promote products derived from this software | 
|---|
| 19 | *    without specific prior written permission. | 
|---|
| 20 | * | 
|---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | 
|---|
| 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 
|---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 
|---|
| 24 | * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 
|---|
| 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 
|---|
| 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 
|---|
| 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 
|---|
| 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 
|---|
| 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 
|---|
| 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 
|---|
| 31 | * SUCH DAMAGE. | 
|---|
| 32 | * | 
|---|
| 33 | *      @(#)stdlib.h    8.5 (Berkeley) 5/19/95 | 
|---|
| 34 | * $FreeBSD: src/include/stdlib.h,v 1.48 2003/03/12 20:29:58 das Exp $ | 
|---|
| 35 | */ | 
|---|
| 36 |  | 
|---|
| 37 | /** @file | 
|---|
| 38 | * FreeBSD 5.1 | 
|---|
| 39 | * @changed bird: EMXifications and OS2ifications. | 
|---|
| 40 | */ | 
|---|
| 41 |  | 
|---|
| 42 | #ifndef _STDLIB_H_ | 
|---|
| 43 | #define _STDLIB_H_ | 
|---|
| 44 |  | 
|---|
| 45 | #include <sys/cdefs.h> | 
|---|
| 46 | #include <sys/_types.h> | 
|---|
| 47 |  | 
|---|
| 48 | #if __BSD_VISIBLE | 
|---|
| 49 | #ifndef _RUNE_T_DECLARED | 
|---|
| 50 | typedef __rune_t        rune_t; | 
|---|
| 51 | #define _RUNE_T_DECLARED | 
|---|
| 52 | #endif | 
|---|
| 53 | #endif | 
|---|
| 54 |  | 
|---|
| 55 | #if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird: emx */ | 
|---|
| 56 | typedef __size_t        size_t; | 
|---|
| 57 | #define _SIZE_T_DECLARED | 
|---|
| 58 | #define _SIZE_T                         /* bird: emx */ | 
|---|
| 59 | #endif | 
|---|
| 60 |  | 
|---|
| 61 | #ifndef __cplusplus | 
|---|
| 62 | #if !defined(_WCHAR_T_DECLARED) && !defined(_WCHAR_T) /* bird: emx */ | 
|---|
| 63 | typedef __wchar_t       wchar_t; | 
|---|
| 64 | #define _WCHAR_T_DECLARED | 
|---|
| 65 | #define _WCHAR_T                        /* bird: emx */ | 
|---|
| 66 | #endif | 
|---|
| 67 | #endif | 
|---|
| 68 |  | 
|---|
| 69 | typedef struct _div_t {                 /* bird: emx (tag) */ | 
|---|
| 70 | int     quot;           /* quotient */ | 
|---|
| 71 | int     rem;            /* remainder */ | 
|---|
| 72 | } div_t; | 
|---|
| 73 |  | 
|---|
| 74 | typedef struct _ldiv_t {                /* bird: emx (tag) */ | 
|---|
| 75 | long    quot; | 
|---|
| 76 | long    rem; | 
|---|
| 77 | } ldiv_t; | 
|---|
| 78 |  | 
|---|
| 79 | #ifndef NULL | 
|---|
| 80 | #define NULL    0 | 
|---|
| 81 | #endif | 
|---|
| 82 |  | 
|---|
| 83 | #define EXIT_FAILURE    1 | 
|---|
| 84 | #define EXIT_SUCCESS    0 | 
|---|
| 85 |  | 
|---|
| 86 | #define RAND_MAX        0x7fff /* bird: emx, old value 0x7fffffff */ | 
|---|
| 87 |  | 
|---|
| 88 | extern int _mb_cur_max;                 /* bird: one underscore, not two for us. */ | 
|---|
| 89 | #define MB_CUR_MAX      _mb_cur_max     /* bird: one underscore, not two for us. */ | 
|---|
| 90 |  | 
|---|
| 91 | __BEGIN_DECLS | 
|---|
| 92 | void     abort(void) __dead2; | 
|---|
| 93 | #ifndef _ABS_DECLARED                   /* bird: emx, also math.h */ | 
|---|
| 94 | int      abs(int) __pure2; | 
|---|
| 95 | #if !defined (__GNUC__) || __GNUC__ >= 2 | 
|---|
| 96 | extern __inline__ int abs(int _n) { return (_n < 0 ? -_n : _n); } | 
|---|
| 97 | #endif | 
|---|
| 98 | #define _ABS_DECLARED | 
|---|
| 99 | #endif | 
|---|
| 100 | int      atexit(void (*)(void)); | 
|---|
| 101 | double   atof(const char *); | 
|---|
| 102 | int      atoi(const char *); | 
|---|
| 103 | long     atol(const char *); | 
|---|
| 104 | void    *bsearch(const void *, const void *, size_t, | 
|---|
| 105 | size_t, int (*)(const void *, const void *)); | 
|---|
| 106 | void    *calloc(size_t, size_t); | 
|---|
| 107 | div_t    div(int, int) __pure2; | 
|---|
| 108 | void     exit(int) __dead2; | 
|---|
| 109 | void     free(void *); | 
|---|
| 110 | char    *getenv(const char *); | 
|---|
| 111 | #ifndef _LABS_DECLARED                  /* bird: emx, also math.h */ | 
|---|
| 112 | long     labs(long) __pure2; | 
|---|
| 113 | #if !defined (__GNUC__) || __GNUC__ >= 2 | 
|---|
| 114 | extern __inline__ long labs(long _n) { return (_n < 0 ? -_n : _n); } | 
|---|
| 115 | #endif | 
|---|
| 116 | #define _LABS_DECLARED | 
|---|
| 117 | #endif | 
|---|
| 118 | ldiv_t   ldiv(long, long) __pure2; | 
|---|
| 119 | void    *malloc(size_t); | 
|---|
| 120 | int      mblen(const char *, size_t); | 
|---|
| 121 | size_t   mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); | 
|---|
| 122 | int      mbtowc(wchar_t * __restrict, const char * __restrict, size_t); | 
|---|
| 123 | void     qsort(void *, size_t, size_t, | 
|---|
| 124 | int (*)(const void *, const void *)); | 
|---|
| 125 | int      rand(void); | 
|---|
| 126 | void    *realloc(void *, size_t); | 
|---|
| 127 | void     srand(unsigned); | 
|---|
| 128 | double   strtod(const char * __restrict, char ** __restrict); | 
|---|
| 129 | float    strtof(const char * __restrict, char ** __restrict); | 
|---|
| 130 | long     strtol(const char * __restrict, char ** __restrict, int); | 
|---|
| 131 | long double | 
|---|
| 132 | strtold(const char * __restrict, char ** __restrict); | 
|---|
| 133 | unsigned long | 
|---|
| 134 | strtoul(const char * __restrict, char ** __restrict, int); | 
|---|
| 135 | int      system(const char *); | 
|---|
| 136 | int      wctomb(char *, wchar_t); | 
|---|
| 137 | size_t   wcstombs(char * __restrict, const wchar_t * __restrict, size_t); | 
|---|
| 138 |  | 
|---|
| 139 | /* | 
|---|
| 140 | * Functions added in C99 which we make conditionally available in the | 
|---|
| 141 | * BSD^C89 namespace if the compiler supports `long long'. | 
|---|
| 142 | * The #if test is more complicated than it ought to be because | 
|---|
| 143 | * __BSD_VISIBLE implies __ISO_C_VISIBLE == 1999 *even if* `long long' | 
|---|
| 144 | * is not supported in the compilation environment (which therefore means | 
|---|
| 145 | * that it can't really be ISO C99). | 
|---|
| 146 | * | 
|---|
| 147 | * (The only other extension made by C99 in thie header is _Exit().) | 
|---|
| 148 | */ | 
|---|
| 149 | #if __ISO_C_VISIBLE >= 1999 | 
|---|
| 150 | #ifdef __LONG_LONG_SUPPORTED | 
|---|
| 151 | /* LONGLONG */ | 
|---|
| 152 | typedef struct _lldiv_t {               /* bird: emx (tag) */ | 
|---|
| 153 | long long quot; | 
|---|
| 154 | long long rem; | 
|---|
| 155 | } lldiv_t; | 
|---|
| 156 |  | 
|---|
| 157 | /* LONGLONG */ | 
|---|
| 158 | long long | 
|---|
| 159 | atoll(const char *); | 
|---|
| 160 | /* LONGLONG */ | 
|---|
| 161 | long long | 
|---|
| 162 | llabs(long long) __pure2; | 
|---|
| 163 | /* LONGLONG */ | 
|---|
| 164 | /** @todo lldiv_t        lldiv(long long, long long) __pure2; */ | 
|---|
| 165 | /* LONGLONG */ | 
|---|
| 166 | long long | 
|---|
| 167 | strtoll(const char * __restrict, char ** __restrict, int); | 
|---|
| 168 | /* LONGLONG */ | 
|---|
| 169 | unsigned long long | 
|---|
| 170 | strtoull(const char * __restrict, char ** __restrict, int); | 
|---|
| 171 | #endif /* __LONG_LONG_SUPPORTED */ | 
|---|
| 172 |  | 
|---|
| 173 | void     _Exit(int) __dead2; | 
|---|
| 174 | #endif /* __ISO_C_VISIBLE >= 1999 */ | 
|---|
| 175 |  | 
|---|
| 176 | /* | 
|---|
| 177 | * Extensions made by POSIX relative to C.  We don't know yet which edition | 
|---|
| 178 | * of POSIX made these extensions, so assume they've always been there until | 
|---|
| 179 | * research can be done. | 
|---|
| 180 | */ | 
|---|
| 181 | #if __POSIX_VISIBLE /* >= ??? */ | 
|---|
| 182 | int      posix_memalign(void **, size_t, size_t); /* bird: we implement this. */ | 
|---|
| 183 | /** @todo int    rand_r(unsigned *);    */              /* (TSF) */ | 
|---|
| 184 | int      setenv(const char *, const char *, int); | 
|---|
| 185 | int      unsetenv(const char *);        /* bird: standard saith shall return int. */ | 
|---|
| 186 | #endif | 
|---|
| 187 |  | 
|---|
| 188 | /* | 
|---|
| 189 | * The only changes to the XSI namespace in revision 6 were the deletion | 
|---|
| 190 | * of the ttyslot() and valloc() functions, which FreeBSD never declared | 
|---|
| 191 | * in this header.  For revision 7, ecvt(), fcvt(), and gcvt(), which | 
|---|
| 192 | * FreeBSD also does not have, and mktemp(), are to be deleted. | 
|---|
| 193 | */ | 
|---|
| 194 | #if __XSI_VISIBLE | 
|---|
| 195 | /* XXX XSI requires pollution from <sys/wait.h> here.  We'd rather not. */ | 
|---|
| 196 | /* long  a64l(const char *); */ | 
|---|
| 197 | double   drand48(void); | 
|---|
| 198 | /* char *ecvt(double, int, int * __restrict, int * __restrict); */ | 
|---|
| 199 | double   erand48(unsigned short[3]); | 
|---|
| 200 | /* char *fcvt(double, int, int * __restrict, int * __restrict); */ | 
|---|
| 201 | /* char *gcvt(double, int, int * __restrict, int * __restrict); */ | 
|---|
| 202 | #ifndef _GETSUBOPT_DECLARED | 
|---|
| 203 | /** @todo int    getsubopt(char **, char *const *, char **); */ | 
|---|
| 204 | #define _GETSUBOPT_DECLARED | 
|---|
| 205 | #endif | 
|---|
| 206 | /** @todo int    grantpt(int); */ | 
|---|
| 207 | char    *initstate(unsigned long /* XSI requires u_int */, char *, long); | 
|---|
| 208 | long     jrand48(unsigned short[3]); | 
|---|
| 209 | /* char *l64a(long); */ | 
|---|
| 210 | void     lcong48(unsigned short[7]); | 
|---|
| 211 | long     lrand48(void); | 
|---|
| 212 | #ifndef _MKSTEMP_DECLARED | 
|---|
| 213 | int      mkstemp(char *); | 
|---|
| 214 | #define _MKSTEMP_DECLARED | 
|---|
| 215 | #endif | 
|---|
| 216 | #ifndef _MKTEMP_DECLARED | 
|---|
| 217 | char    *mktemp(char *); | 
|---|
| 218 | #define _MKTEMP_DECLARED | 
|---|
| 219 | #endif | 
|---|
| 220 | long     mrand48(void); | 
|---|
| 221 | long     nrand48(unsigned short[3]); | 
|---|
| 222 | /** @todo int    posix_openpt(int); */ | 
|---|
| 223 | /** @todo char  *ptsname(int); */ | 
|---|
| 224 | int      putenv(const char *); | 
|---|
| 225 | long     random(void); | 
|---|
| 226 | char    *realpath(const char *, char resolved_path[]); | 
|---|
| 227 | unsigned short | 
|---|
| 228 | *seed48(unsigned short[3]); | 
|---|
| 229 | #ifndef _SETKEY_DECLARED | 
|---|
| 230 | /** @todo int    setkey(const char *); */ | 
|---|
| 231 | #define _SETKEY_DECLARED | 
|---|
| 232 | #endif | 
|---|
| 233 | char    *setstate(/* const */ char *); | 
|---|
| 234 | void     srand48(long); | 
|---|
| 235 | void     srandom(unsigned long); | 
|---|
| 236 | /** @todo int    unlockpt(int); */ | 
|---|
| 237 | #endif /* __XSI_VISIBLE */ | 
|---|
| 238 |  | 
|---|
| 239 | #if __BSD_VISIBLE | 
|---|
| 240 | extern const char *_malloc_options; | 
|---|
| 241 | extern void (*_malloc_message)(const char *, const char *, const char *, | 
|---|
| 242 | const char *); | 
|---|
| 243 |  | 
|---|
| 244 | void    *alloca(size_t);                /* built-in for gcc */ | 
|---|
| 245 | /** @todo __uint32_t | 
|---|
| 246 | arc4random(void); */ | 
|---|
| 247 | /** @todo void   arc4random_addrandom(unsigned char *dat, int datlen); */ | 
|---|
| 248 | /** @todo void   arc4random_stir(void); */ | 
|---|
| 249 | char    *getbsize(int *, long *); | 
|---|
| 250 | /* getcap(3) functions */ | 
|---|
| 251 | /** @todo char  *cgetcap(char *, const char *, int); */ | 
|---|
| 252 | /** @todo int    cgetclose(void); */ | 
|---|
| 253 | /** @todo int    cgetent(char **, char **, const char *); */ | 
|---|
| 254 | /** @todo int    cgetfirst(char **, char **); */ | 
|---|
| 255 | /** @todo int    cgetmatch(const char *, const char *); */ | 
|---|
| 256 | /** @todo int    cgetnext(char **, char **); */ | 
|---|
| 257 | /** @todo int    cgetnum(char *, const char *, long *); */ | 
|---|
| 258 | /** @todo int    cgetset(const char *); */ | 
|---|
| 259 | /** @todo int    cgetstr(char *, const char *, char **); */ | 
|---|
| 260 | /** @todo int    cgetustr(char *, const char *, char **); */ | 
|---|
| 261 |  | 
|---|
| 262 | /** @todo int    daemon(int, int); */ | 
|---|
| 263 | /** @todo char  *devname(int, int); */ | 
|---|
| 264 | /** @todo int    getloadavg(double [], int); */ | 
|---|
| 265 | __const char * | 
|---|
| 266 | getprogname(void); | 
|---|
| 267 |  | 
|---|
| 268 | int      heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); | 
|---|
| 269 | int      mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); | 
|---|
| 270 | void     qsort_r(void *, size_t, size_t, void *, | 
|---|
| 271 | int (*)(void *, const void *, const void *)); | 
|---|
| 272 | int      radixsort(const unsigned char **, int, const unsigned char *, | 
|---|
| 273 | unsigned); | 
|---|
| 274 | void    *reallocf(void *, size_t); | 
|---|
| 275 | void     setprogname(const char *); | 
|---|
| 276 | int      sradixsort(const unsigned char **, int, const unsigned char *, | 
|---|
| 277 | unsigned); | 
|---|
| 278 | /** @todo void   sranddev(void); */ | 
|---|
| 279 | void     srandomdev(void); | 
|---|
| 280 |  | 
|---|
| 281 | /* Deprecated interfaces, to be removed in FreeBSD 6.0. */ | 
|---|
| 282 | /** @todo __int64_t | 
|---|
| 283 | strtoq(const char *, char **, int); */ | 
|---|
| 284 | /** @todo __uint64_t | 
|---|
| 285 | strtouq(const char *, char **, int); */ | 
|---|
| 286 | #endif /* __BSD_VISIBLE */ | 
|---|
| 287 |  | 
|---|
| 288 |  | 
|---|
| 289 |  | 
|---|
| 290 | /* bird: EMX/PC stuff - start  */ | 
|---|
| 291 |  | 
|---|
| 292 | #include <malloc.h> | 
|---|
| 293 |  | 
|---|
| 294 | #if !defined (_MAX_PATH) | 
|---|
| 295 | #define _MAX_PATH   260 | 
|---|
| 296 | #define _MAX_DRIVE    3 | 
|---|
| 297 | #define _MAX_DIR    256 | 
|---|
| 298 | #define _MAX_FNAME  256 | 
|---|
| 299 | #define _MAX_EXT    256 | 
|---|
| 300 | #endif | 
|---|
| 301 |  | 
|---|
| 302 | #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) || defined(__USE_EMX) | 
|---|
| 303 |  | 
|---|
| 304 | #if !defined (OS2_MODE) | 
|---|
| 305 | #define DOS_MODE 0 | 
|---|
| 306 | #define OS2_MODE 1 | 
|---|
| 307 | #endif | 
|---|
| 308 |  | 
|---|
| 309 | #ifndef _INTPTR_T_DECLARED | 
|---|
| 310 | typedef __intptr_t      intptr_t; | 
|---|
| 311 | typedef __uintptr_t     uintptr_t; | 
|---|
| 312 | #define _INTPTR_T_DECLARED | 
|---|
| 313 | #endif | 
|---|
| 314 |  | 
|---|
| 315 | #if !defined(_MODE_T_DECLARED) && !defined(_MODE_T) /* bird: emx */ | 
|---|
| 316 | typedef __mode_t        mode_t; | 
|---|
| 317 | #define _MODE_T_DECLARED | 
|---|
| 318 | #define _MODE_T                         /* bird: emx */ | 
|---|
| 319 | #endif | 
|---|
| 320 |  | 
|---|
| 321 | /* declare _errno to be compatible with MS/VAC/WATCOM */ | 
|---|
| 322 | #if !defined (_ERRNO) | 
|---|
| 323 | #define _ERRNO | 
|---|
| 324 | extern int * _errno(void); | 
|---|
| 325 | #define errno (* _errno()) | 
|---|
| 326 | #endif /* bird: emx */ | 
|---|
| 327 |  | 
|---|
| 328 | #if !defined (_ULDIV_T) | 
|---|
| 329 | #define _ULDIV_T | 
|---|
| 330 | typedef struct | 
|---|
| 331 | { | 
|---|
| 332 | unsigned long quot; | 
|---|
| 333 | unsigned long rem; | 
|---|
| 334 | } _uldiv_t; | 
|---|
| 335 |  | 
|---|
| 336 | #if __ISO_C_VISIBLE >= 1999 && defined(__LONG_LONG_SUPPORTED) | 
|---|
| 337 | typedef struct _lldiv_t _lldiv_t; | 
|---|
| 338 | #else | 
|---|
| 339 | typedef struct | 
|---|
| 340 | { | 
|---|
| 341 | long long quot; | 
|---|
| 342 | long long rem; | 
|---|
| 343 | } _lldiv_t; | 
|---|
| 344 | #endif | 
|---|
| 345 | typedef struct | 
|---|
| 346 | { | 
|---|
| 347 | unsigned long long quot; | 
|---|
| 348 | unsigned long long rem; | 
|---|
| 349 | } _ulldiv_t; | 
|---|
| 350 | #endif | 
|---|
| 351 |  | 
|---|
| 352 | extern char **environ; | 
|---|
| 353 |  | 
|---|
| 354 | extern __const__ unsigned char _osminor; | 
|---|
| 355 | extern __const__ unsigned char _osmajor; | 
|---|
| 356 |  | 
|---|
| 357 | /* No DOS support ... */ | 
|---|
| 358 | #define _osmode OS2_MODE | 
|---|
| 359 |  | 
|---|
| 360 | unsigned alarm (unsigned); | 
|---|
| 361 | int brk(const void *); | 
|---|
| 362 | int chdir (__const__ char *); | 
|---|
| 363 | char *gcvt (double, int, char *); /* this is rubbish standardwise */ | 
|---|
| 364 | char *getcwd (char *, size_t); | 
|---|
| 365 | int getpagesize (void); | 
|---|
| 366 | char *getwd (char *); | 
|---|
| 367 | int     mkdir(const char *, mode_t); | 
|---|
| 368 | void perror (__const__ char *); | 
|---|
| 369 | int rmdir (__const__ char *); | 
|---|
| 370 | void *sbrk(intptr_t); | 
|---|
| 371 | unsigned sleep (unsigned); | 
|---|
| 372 | long ulimit (int, ...); | 
|---|
| 373 |  | 
|---|
| 374 | char *itoa (int, char *, int); | 
|---|
| 375 | char *ltoa (long, char *, int); | 
|---|
| 376 | char *ultoa (unsigned long, char *, int); | 
|---|
| 377 | char *lltoa (long long, char *, int); | 
|---|
| 378 | char *ulltoa (unsigned long long, char *, int); | 
|---|
| 379 |  | 
|---|
| 380 | #endif | 
|---|
| 381 |  | 
|---|
| 382 |  | 
|---|
| 383 | #if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) || defined (_WITH_UNDERSCORE) || defined(__USE_EMX) | 
|---|
| 384 |  | 
|---|
| 385 | extern char **_environ; | 
|---|
| 386 | extern __const__ char * __const__ _sys_errlist[]; | 
|---|
| 387 | extern __const__ int _sys_nerr; | 
|---|
| 388 |  | 
|---|
| 389 | unsigned _alarm (unsigned); | 
|---|
| 390 | int _brk(const void *); | 
|---|
| 391 | int _chdir (__const__ char *); | 
|---|
| 392 | char *_gcvt (double, int, char *); | 
|---|
| 393 | char *_getcwd (char *, size_t); | 
|---|
| 394 | int _getpagesize (void); | 
|---|
| 395 | char *_getwd (char *); | 
|---|
| 396 | int _mkdir (__const__ char *, long); | 
|---|
| 397 | int _putenv (__const__ char *); | 
|---|
| 398 | int _rmdir (__const__ char *); | 
|---|
| 399 | void *_sbrk(intptr_t); | 
|---|
| 400 | unsigned _sleep (unsigned); | 
|---|
| 401 | void _swab (__const__ void *, void *, size_t); | 
|---|
| 402 | long _ulimit (int, ...); | 
|---|
| 403 |  | 
|---|
| 404 | int _abspath (char *, __const__ char *, int); | 
|---|
| 405 | long long _atoll (__const__ char *); | 
|---|
| 406 | long double _atofl (__const__ char *); | 
|---|
| 407 | int _chdir2 (__const__ char *); | 
|---|
| 408 | int _chdrive (char); | 
|---|
| 409 | int _core (int); | 
|---|
| 410 | void _defext (char *, __const__ char *); | 
|---|
| 411 | void _envargs (int *, char ***, __const__ char *); | 
|---|
| 412 | int _execname (char *, size_t); | 
|---|
| 413 | void _exit (int) __attribute__ ((__noreturn__)); | 
|---|
| 414 | int _filesys (__const__ char *, char *, size_t); | 
|---|
| 415 | char **_fnexplode (__const__ char *); | 
|---|
| 416 | void _fnexplodefree (char **); | 
|---|
| 417 | char _fngetdrive (__const__ char *); | 
|---|
| 418 | int _fnisabs (__const__ char *); | 
|---|
| 419 | int _fnisrel (__const__ char *); | 
|---|
| 420 | void _fnlwr (char *); | 
|---|
| 421 | void _fnlwr2 (char *, __const__ char *); | 
|---|
| 422 | char *_fnslashify (char *); | 
|---|
| 423 | int _fullpath (char *, __const__ char *, int); | 
|---|
| 424 | int _getcwd1 (char *, char); | 
|---|
| 425 | char *_getcwd2 (char *, int); | 
|---|
| 426 | char _getdrive (void); | 
|---|
| 427 | char *_getext (__const__ char *); | 
|---|
| 428 | char *_getext2 (__const__ char *); | 
|---|
| 429 | char *_getname (__const__ char *); | 
|---|
| 430 | int _getsockhandle (int); | 
|---|
| 431 | int _gettid (void); | 
|---|
| 432 | char *_getvol (char); | 
|---|
| 433 | char *_itoa (int, char *, int); | 
|---|
| 434 | _lldiv_t _lldiv (long long, long long); | 
|---|
| 435 | char *_lltoa (long long, char *, int); | 
|---|
| 436 | _uldiv_t _uldiv (unsigned long, unsigned long); | 
|---|
| 437 | _ulldiv_t _ulldiv (unsigned long long, unsigned long long); | 
|---|
| 438 | char *_itoa (int, char *, int); | 
|---|
| 439 | char *_ltoa (long, char *, int); | 
|---|
| 440 | char *_ultoa (unsigned long, char *, int); | 
|---|
| 441 | char *_lltoa (long long, char *, int); | 
|---|
| 442 | char *_ulltoa (unsigned long long, char *, int); | 
|---|
| 443 | void _makepath (char *, __const__ char *, __const__ char *, | 
|---|
| 444 | __const__ char *, __const__ char *); | 
|---|
| 445 | int _path (char *, __const__ char *); | 
|---|
| 446 | int _read_kbd (int, int, int); | 
|---|
| 447 | void _remext (char *); | 
|---|
| 448 | void _rfnlwr (void); | 
|---|
| 449 | void _response (int *, char ***); | 
|---|
| 450 | void _scrsize (int *); | 
|---|
| 451 | void _searchenv (__const__ char *, __const__ char *, char *); | 
|---|
| 452 | void _sfnlwr (__const__ char *); | 
|---|
| 453 | unsigned _sleep2 (unsigned); | 
|---|
| 454 | char ** _splitargs (char *, int *); | 
|---|
| 455 | void _splitpath (__const__ char *, char *, char *, char *, char *); | 
|---|
| 456 | float _strtof (__const__ char *, char **); | 
|---|
| 457 | long double _strtold (__const__ char *, char **); | 
|---|
| 458 | long long _strtoll (__const__ char *, char **, int); | 
|---|
| 459 | unsigned long long _strtoull (__const__ char *, char **, int); | 
|---|
| 460 | char _swchar (void); | 
|---|
| 461 | void _wildcard (int *, char ***); | 
|---|
| 462 |  | 
|---|
| 463 | int _beginthread (void (*)(void *), void *, unsigned, void *); | 
|---|
| 464 | void _endthread (void); | 
|---|
| 465 | void **_threadstore (void); | 
|---|
| 466 |  | 
|---|
| 467 | int _setenv(const char *envname, const char *envval, int overwrite); | 
|---|
| 468 | int _unsetenv(const char *name); | 
|---|
| 469 |  | 
|---|
| 470 | #endif | 
|---|
| 471 |  | 
|---|
| 472 | __END_DECLS | 
|---|
| 473 |  | 
|---|
| 474 | /* bird: EMX/PC stuff - start  */ | 
|---|
| 475 |  | 
|---|
| 476 | #endif /* !_STDLIB_H_ */ | 
|---|
| 477 |  | 
|---|