142008Sbostic /*- 242008Sbostic * Copyright (c) 1990 The Regents of the University of California. 342008Sbostic * All rights reserved. 442008Sbostic * 542008Sbostic * %sccs.include.redist.c% 642008Sbostic * 7*49988Sbostic * @(#)stdlib.h 5.13 (Berkeley) 06/04/91 842008Sbostic */ 942008Sbostic 1042008Sbostic #ifndef _STDLIB_H_ 1142008Sbostic #define _STDLIB_H_ 1246622Sbostic #include <sys/types.h> 1342008Sbostic 1442008Sbostic #ifdef _WCHAR_T_ 1542008Sbostic typedef _WCHAR_T_ wchar_t; 1642008Sbostic #undef _WCHAR_T_ 1742008Sbostic #endif 1842008Sbostic 1942008Sbostic typedef struct { 2042008Sbostic int quot; /* quotient */ 2142008Sbostic int rem; /* remainder */ 2242008Sbostic } div_t; 2342008Sbostic typedef struct { 2442008Sbostic long quot; /* quotient */ 2542008Sbostic long rem; /* remainder */ 2642008Sbostic } ldiv_t; 2742008Sbostic 2842008Sbostic #define EXIT_FAILURE 1 2942008Sbostic #define EXIT_SUCCESS 0 3042008Sbostic 3146622Sbostic #define RAND_MAX 0x7fffffff 3242008Sbostic 3342008Sbostic #define MB_CUR_MAX 1 /* XXX */ 3442008Sbostic 3546283Sbostic #include <sys/cdefs.h> 3642008Sbostic 3746283Sbostic __BEGIN_DECLS 3846283Sbostic void abort __P((void)); 3946283Sbostic int abs __P((int)); 4046404Sdonn int atexit __P((void (*)(void))); 4146515Sdonn double atof __P((const char *)); 4246515Sdonn int atoi __P((const char *)); 4346515Sdonn long atol __P((const char *)); 4446515Sdonn void *bsearch __P((const void *, const void *, size_t, 4546515Sdonn size_t, int (*)(const void *, const void *))); 4646515Sdonn void *calloc __P((size_t, size_t)); 4746515Sdonn div_t div __P((int, int)); 4846515Sdonn void exit __P((int)); 4946515Sdonn void free __P((void *)); 5046515Sdonn char *getenv __P((const char *)); 5146283Sbostic long labs __P((long)); 5246515Sdonn ldiv_t ldiv __P((long, long)); 5346515Sdonn void *malloc __P((size_t)); 5446515Sdonn void qsort __P((void *, size_t, size_t, 5546515Sdonn int (*)(const void *, const void *))); 5646283Sbostic int rand __P((void)); 5746515Sdonn void *realloc __P((void *, size_t)); 5846515Sdonn void srand __P((unsigned)); 5946515Sdonn double strtod __P((const char *, char **)); 6046515Sdonn long strtol __P((const char *, char **, int)); 6142200Sbostic unsigned long 6246515Sdonn strtoul __P((const char *, char **, int)); 6346515Sdonn int system __P((const char *)); 6442008Sbostic 6546446Sdonn /* these are currently just stubs */ 6646515Sdonn int mblen __P((const char *, size_t)); 6746515Sdonn size_t mbstowcs __P((wchar_t *, const char *, size_t)); 6846515Sdonn int wctomb __P((char *, wchar_t)); 6946515Sdonn int mbtowc __P((wchar_t *, const char *, size_t)); 7046515Sdonn size_t wcstombs __P((char *, const wchar_t *, size_t)); 7146446Sdonn 7242444Sbostic #ifndef _ANSI_SOURCE 7346515Sdonn void cfree __P((void *)); 7446515Sdonn int putenv __P((const char *)); 7546515Sdonn int setenv __P((const char *, const char *, int)); 7646515Sdonn #endif /* not ANSI */ 7742200Sbostic 7846515Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 7946515Sdonn void *alloca __P((size_t)); /* built-in for gcc */ 8047458Sdonn extern char *optarg; /* getopt(3) external variables */ 8147458Sdonn extern int optind; 8247458Sdonn extern int opterr; 8346556Sdonn int getopt __P((int, char * const *, const char *)); 8447458Sdonn extern char *suboptarg; /* getsubopt(3) external variable */ 8546625Sbostic int getsubopt __P((char **, char * const *, char **)); 86*49988Sbostic int heapsort __P((void *, size_t, size_t, 87*49988Sbostic int (*)(const void *, const void *))); 8846515Sdonn char *initstate __P((unsigned, char *, int)); 8946515Sdonn int radixsort __P((const u_char **, int, const u_char *, u_char)); 9046515Sdonn long random __P((void)); 9146515Sdonn char *setstate __P((char *)); 9246515Sdonn void srandom __P((unsigned)); 9346515Sdonn void unsetenv __P((const char *)); 9446515Sdonn #endif /* neither ANSI nor POSIX */ 9546515Sdonn 9646283Sbostic __END_DECLS 9742200Sbostic 9842008Sbostic #endif /* _STDLIB_H_ */ 99