142008Sbostic /*- 242008Sbostic * Copyright (c) 1990 The Regents of the University of California. 342008Sbostic * All rights reserved. 442008Sbostic * 542008Sbostic * %sccs.include.redist.c% 642008Sbostic * 7*46515Sdonn * @(#)stdlib.h 5.8 (Berkeley) 02/22/91 842008Sbostic */ 942008Sbostic 1042008Sbostic #ifndef _STDLIB_H_ 1142008Sbostic #define _STDLIB_H_ 1245833Sbostic #include <machine/types.h> 1342008Sbostic 1442008Sbostic #ifdef _SIZE_T_ 1542008Sbostic typedef _SIZE_T_ size_t; 1642008Sbostic #undef _SIZE_T_ 1742008Sbostic #endif 1842008Sbostic 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; 2842008Sbostic typedef struct { 2942008Sbostic long quot; /* quotient */ 3042008Sbostic long rem; /* remainder */ 3142008Sbostic } ldiv_t; 3242008Sbostic 3342008Sbostic #define EXIT_FAILURE 1 3442008Sbostic #define EXIT_SUCCESS 0 3542008Sbostic 3642008Sbostic #define RAND_MAX 0x7ffffffff 3742008Sbostic 3842008Sbostic #define MB_CUR_MAX 1 /* XXX */ 3942008Sbostic 4046283Sbostic #include <sys/cdefs.h> 4142008Sbostic 4246283Sbostic __BEGIN_DECLS 4346283Sbostic void abort __P((void)); 4446283Sbostic int abs __P((int)); 4546404Sdonn int atexit __P((void (*)(void))); 46*46515Sdonn double atof __P((const char *)); 47*46515Sdonn int atoi __P((const char *)); 48*46515Sdonn long atol __P((const char *)); 49*46515Sdonn void *bsearch __P((const void *, const void *, size_t, 50*46515Sdonn size_t, int (*)(const void *, const void *))); 51*46515Sdonn void *calloc __P((size_t, size_t)); 52*46515Sdonn div_t div __P((int, int)); 53*46515Sdonn void exit __P((int)); 54*46515Sdonn void free __P((void *)); 55*46515Sdonn char *getenv __P((const char *)); 5646283Sbostic long labs __P((long)); 57*46515Sdonn ldiv_t ldiv __P((long, long)); 58*46515Sdonn void *malloc __P((size_t)); 59*46515Sdonn void qsort __P((void *, size_t, size_t, 60*46515Sdonn int (*)(const void *, const void *))); 6146283Sbostic int rand __P((void)); 62*46515Sdonn void *realloc __P((void *, size_t)); 63*46515Sdonn void srand __P((unsigned)); 64*46515Sdonn double strtod __P((const char *, char **)); 65*46515Sdonn long strtol __P((const char *, char **, int)); 6642200Sbostic unsigned long 67*46515Sdonn strtoul __P((const char *, char **, int)); 68*46515Sdonn int system __P((const char *)); 6942008Sbostic 7046446Sdonn /* these are currently just stubs */ 71*46515Sdonn int mblen __P((const char *, size_t)); 72*46515Sdonn size_t mbstowcs __P((wchar_t *, const char *, size_t)); 73*46515Sdonn int wctomb __P((char *, wchar_t)); 74*46515Sdonn int mbtowc __P((wchar_t *, const char *, size_t)); 75*46515Sdonn size_t wcstombs __P((char *, const wchar_t *, size_t)); 7646446Sdonn 7742444Sbostic #ifndef _ANSI_SOURCE 78*46515Sdonn void cfree __P((void *)); 79*46515Sdonn int putenv __P((const char *)); 80*46515Sdonn int setenv __P((const char *, const char *, int)); 81*46515Sdonn #endif /* not ANSI */ 8242200Sbostic 83*46515Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 84*46515Sdonn void *alloca __P((size_t)); /* built-in for gcc */ 85*46515Sdonn int getopt __P((int, const char * const *, const char *)); 86*46515Sdonn char *initstate __P((unsigned, char *, int)); 87*46515Sdonn int radixsort __P((const u_char **, int, const u_char *, u_char)); 88*46515Sdonn long random __P((void)); 89*46515Sdonn char *setstate __P((char *)); 90*46515Sdonn void srandom __P((unsigned)); 91*46515Sdonn void unsetenv __P((const char *)); 92*46515Sdonn #endif /* neither ANSI nor POSIX */ 93*46515Sdonn 9446283Sbostic __END_DECLS 9542200Sbostic 9642008Sbostic #endif /* _STDLIB_H_ */ 97