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