142008Sbostic /*- 261068Sbostic * Copyright (c) 1990, 1993 361068Sbostic * The Regents of the University of California. All rights reserved. 442008Sbostic * 542008Sbostic * %sccs.include.redist.c% 642008Sbostic * 7*69551Smckusick * @(#)stdlib.h 8.5 (Berkeley) 05/19/95 842008Sbostic */ 942008Sbostic 1042008Sbostic #ifndef _STDLIB_H_ 1142008Sbostic #define _STDLIB_H_ 1260461Selan 1356904Sbostic #include <machine/ansi.h> 1442008Sbostic 1554254Sbostic #ifdef _BSD_SIZE_T_ 1654254Sbostic typedef _BSD_SIZE_T_ size_t; 1754254Sbostic #undef _BSD_SIZE_T_ 1850458Sbostic #endif 1950458Sbostic 2054254Sbostic #ifdef _BSD_WCHAR_T_ 2160543Sbostic #ifndef _ANSI_SOURCE 2260461Selan typedef _BSD_WCHAR_T_ rune_t; 2360543Sbostic #endif 2454254Sbostic typedef _BSD_WCHAR_T_ wchar_t; 2554254Sbostic #undef _BSD_WCHAR_T_ 2642008Sbostic #endif 2742008Sbostic 2842008Sbostic typedef struct { 2942008Sbostic int quot; /* quotient */ 3042008Sbostic int rem; /* remainder */ 3142008Sbostic } div_t; 3250458Sbostic 3342008Sbostic typedef struct { 3442008Sbostic long quot; /* quotient */ 3542008Sbostic long rem; /* remainder */ 3642008Sbostic } ldiv_t; 3742008Sbostic 3864836Storek #ifndef NULL 3964836Storek #define NULL 0 4064836Storek #endif 4164836Storek 4242008Sbostic #define EXIT_FAILURE 1 4342008Sbostic #define EXIT_SUCCESS 0 4442008Sbostic 4546622Sbostic #define RAND_MAX 0x7fffffff 4642008Sbostic 4760461Selan extern int __mb_cur_max; 4860461Selan #define MB_CUR_MAX __mb_cur_max 4942008Sbostic 5046283Sbostic #include <sys/cdefs.h> 5142008Sbostic 5246283Sbostic __BEGIN_DECLS 5352805Storek __dead void 5452805Storek abort __P((void)); 5552805Storek __pure int 5652805Storek abs __P((int)); 5746404Sdonn int atexit __P((void (*)(void))); 5846515Sdonn double atof __P((const char *)); 5946515Sdonn int atoi __P((const char *)); 6046515Sdonn long atol __P((const char *)); 6146515Sdonn void *bsearch __P((const void *, const void *, size_t, 6246515Sdonn size_t, int (*)(const void *, const void *))); 6346515Sdonn void *calloc __P((size_t, size_t)); 6452805Storek __pure div_t 6552805Storek div __P((int, int)); 6652805Storek __dead void 6752805Storek exit __P((int)); 6846515Sdonn void free __P((void *)); 6946515Sdonn char *getenv __P((const char *)); 7052805Storek __pure long 7152805Storek labs __P((long)); 7252805Storek __pure ldiv_t 7352805Storek ldiv __P((long, long)); 7446515Sdonn void *malloc __P((size_t)); 7546515Sdonn void qsort __P((void *, size_t, size_t, 7646515Sdonn int (*)(const void *, const void *))); 7746283Sbostic int rand __P((void)); 7846515Sdonn void *realloc __P((void *, size_t)); 7946515Sdonn void srand __P((unsigned)); 8046515Sdonn double strtod __P((const char *, char **)); 8146515Sdonn long strtol __P((const char *, char **, int)); 8242200Sbostic unsigned long 8346515Sdonn strtoul __P((const char *, char **, int)); 8446515Sdonn int system __P((const char *)); 8542008Sbostic 8650458Sbostic /* These are currently just stubs. */ 8746515Sdonn int mblen __P((const char *, size_t)); 8846515Sdonn size_t mbstowcs __P((wchar_t *, const char *, size_t)); 8946515Sdonn int wctomb __P((char *, wchar_t)); 9046515Sdonn int mbtowc __P((wchar_t *, const char *, size_t)); 9146515Sdonn size_t wcstombs __P((char *, const wchar_t *, size_t)); 9246446Sdonn 9342444Sbostic #ifndef _ANSI_SOURCE 9446515Sdonn int putenv __P((const char *)); 9546515Sdonn int setenv __P((const char *, const char *, int)); 9650458Sbostic #endif 9742200Sbostic 9846515Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 9959426Sbostic void *alloca __P((size_t)); /* built-in for gcc */ 10055867Sbostic /* getcap(3) functions */ 10161038Smckusick char *getbsize __P((int *, long *)); 10255867Sbostic char *cgetcap __P((char *, char *, int)); 10355867Sbostic int cgetclose __P((void)); 10455867Sbostic int cgetent __P((char **, char **, char *)); 10555867Sbostic int cgetfirst __P((char **, char **)); 10655867Sbostic int cgetmatch __P((char *, char *)); 10755867Sbostic int cgetnext __P((char **, char **)); 10855867Sbostic int cgetnum __P((char *, char *, long *)); 10955867Sbostic int cgetset __P((char *)); 11055867Sbostic int cgetstr __P((char *, char *, char **)); 11155867Sbostic int cgetustr __P((char *, char *, char **)); 11255867Sbostic 11359426Sbostic int daemon __P((int, int)); 11461038Smckusick char *devname __P((int, int)); 11559339Sbostic int getloadavg __P((double [], int)); 11659426Sbostic 11759426Sbostic char *group_from_gid __P((unsigned long, int)); 11849988Sbostic int heapsort __P((void *, size_t, size_t, 11949988Sbostic int (*)(const void *, const void *))); 120*69551Smckusick char *initstate __P((unsigned long, char *, long)); 12156966Sbostic int mergesort __P((void *, size_t, size_t, 12256966Sbostic int (*)(const void *, const void *))); 12356904Sbostic int radixsort __P((const unsigned char **, int, const unsigned char *, 12456904Sbostic unsigned)); 12556904Sbostic int sradixsort __P((const unsigned char **, int, const unsigned char *, 12656904Sbostic unsigned)); 12746515Sdonn long random __P((void)); 12866119Sbostic char *realpath __P((const char *, char resolved_path[])); 12946515Sdonn char *setstate __P((char *)); 130*69551Smckusick void srandom __P((unsigned long)); 13159426Sbostic char *user_from_uid __P((unsigned long, int)); 13256904Sbostic #ifndef __STRICT_ANSI__ 13354418Sbostic long long 13454418Sbostic strtoq __P((const char *, char **, int)); 13554418Sbostic unsigned long long 13654418Sbostic strtouq __P((const char *, char **, int)); 13756904Sbostic #endif 13846515Sdonn void unsetenv __P((const char *)); 13950458Sbostic #endif 14046283Sbostic __END_DECLS 14142200Sbostic 14242008Sbostic #endif /* _STDLIB_H_ */ 143