142008Sbostic /*- 242008Sbostic * Copyright (c) 1990 The Regents of the University of California. 342008Sbostic * All rights reserved. 442008Sbostic * 542008Sbostic * %sccs.include.redist.c% 642008Sbostic * 7*51837Sbostic * @(#)stdlib.h 5.16 (Berkeley) 12/06/91 842008Sbostic */ 942008Sbostic 1042008Sbostic #ifndef _STDLIB_H_ 1142008Sbostic #define _STDLIB_H_ 1246622Sbostic #include <sys/types.h> 1342008Sbostic 1450458Sbostic #ifdef _SIZE_T_ 1550458Sbostic typedef _SIZE_T_ size_t; 1650458Sbostic #undef _SIZE_T_ 1750458Sbostic #endif 1850458Sbostic 1942008Sbostic #ifdef _WCHAR_T_ 2042008Sbostic typedef _WCHAR_T_ wchar_t; 2142008Sbostic #undef _WCHAR_T_ 2242008Sbostic #endif 2342008Sbostic 2442008Sbostic typedef struct { 2542008Sbostic int quot; /* quotient */ 2642008Sbostic int rem; /* remainder */ 2742008Sbostic } div_t; 2850458Sbostic 2942008Sbostic typedef struct { 3042008Sbostic long quot; /* quotient */ 3142008Sbostic long rem; /* remainder */ 3242008Sbostic } ldiv_t; 3342008Sbostic 3442008Sbostic #define EXIT_FAILURE 1 3542008Sbostic #define EXIT_SUCCESS 0 3642008Sbostic 3746622Sbostic #define RAND_MAX 0x7fffffff 3842008Sbostic 3942008Sbostic #define MB_CUR_MAX 1 /* XXX */ 4042008Sbostic 4146283Sbostic #include <sys/cdefs.h> 4242008Sbostic 4346283Sbostic __BEGIN_DECLS 4446283Sbostic void abort __P((void)); 4546283Sbostic int abs __P((int)); 4646404Sdonn int atexit __P((void (*)(void))); 4746515Sdonn double atof __P((const char *)); 4846515Sdonn int atoi __P((const char *)); 4946515Sdonn long atol __P((const char *)); 5046515Sdonn void *bsearch __P((const void *, const void *, size_t, 5146515Sdonn size_t, int (*)(const void *, const void *))); 5246515Sdonn void *calloc __P((size_t, size_t)); 5346515Sdonn div_t div __P((int, int)); 5446515Sdonn void exit __P((int)); 5546515Sdonn void free __P((void *)); 5646515Sdonn char *getenv __P((const char *)); 5746283Sbostic long labs __P((long)); 5846515Sdonn ldiv_t ldiv __P((long, long)); 5946515Sdonn void *malloc __P((size_t)); 6046515Sdonn void qsort __P((void *, size_t, size_t, 6146515Sdonn int (*)(const void *, const void *))); 6246283Sbostic int rand __P((void)); 6346515Sdonn void *realloc __P((void *, size_t)); 6446515Sdonn void srand __P((unsigned)); 6546515Sdonn double strtod __P((const char *, char **)); 6646515Sdonn long strtol __P((const char *, char **, int)); 6742200Sbostic unsigned long 6846515Sdonn strtoul __P((const char *, char **, int)); 6946515Sdonn int system __P((const char *)); 7042008Sbostic 7150458Sbostic /* These are currently just stubs. */ 7246515Sdonn int mblen __P((const char *, size_t)); 7346515Sdonn size_t mbstowcs __P((wchar_t *, const char *, size_t)); 7446515Sdonn int wctomb __P((char *, wchar_t)); 7546515Sdonn int mbtowc __P((wchar_t *, const char *, size_t)); 7646515Sdonn size_t wcstombs __P((char *, const wchar_t *, size_t)); 7746446Sdonn 7842444Sbostic #ifndef _ANSI_SOURCE 7946515Sdonn void cfree __P((void *)); 8046515Sdonn int putenv __P((const char *)); 8146515Sdonn int setenv __P((const char *, const char *, int)); 8250458Sbostic #endif 8342200Sbostic 8446515Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 8550458Sbostic extern char *optarg; /* getopt(3) external variables */ 86*51837Sbostic extern int opterr, optind, optopt; 8746556Sdonn int getopt __P((int, char * const *, const char *)); 8850458Sbostic 8950458Sbostic extern char *suboptarg; /* getsubopt(3) external variable */ 9046625Sbostic int getsubopt __P((char **, char * const *, char **)); 9150458Sbostic 9250458Sbostic void *alloca __P((size_t)); /* built-in for gcc */ 9349988Sbostic int heapsort __P((void *, size_t, size_t, 9449988Sbostic int (*)(const void *, const void *))); 9546515Sdonn char *initstate __P((unsigned, char *, int)); 9650482Sbostic int radixsort __P((const u_char **, int, const u_char *, u_int)); 9746515Sdonn long random __P((void)); 9846515Sdonn char *setstate __P((char *)); 9946515Sdonn void srandom __P((unsigned)); 10046515Sdonn void unsetenv __P((const char *)); 10150458Sbostic #endif 10246283Sbostic __END_DECLS 10342200Sbostic 10442008Sbostic #endif /* _STDLIB_H_ */ 105