2 * stdlib.h - standard library
4 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
5 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 /* $Id: stdlib.h,v 1.6 1994/06/24 11:41:26 ceriel Exp $ */
9 #if !defined(_STDLIB_H)
12 #define NULL ((void *)0)
14 #define EXIT_FAILURE 1
15 #define EXIT_SUCCESS 0
16 #define RAND_MAX 32767
19 typedef struct { int quot, rem; } div_t;
20 typedef struct { long quot, rem; } ldiv_t;
24 typedef unsigned int size_t; /* type returned by sizeof */
27 #if !defined(_WCHAR_T)
32 double atof(const char *_nptr);
33 int atoi(const char *_nptr);
34 long atol(const char *_nptr);
35 double strtod(const char *_nptr, char **_endptr);
36 long strtol(const char *_nptr, char **_endptr, int _base);
37 unsigned long int strtoul(const char *_nptr, char **_endptr, int _base);
39 void srand(unsigned int _seed);
40 void *calloc(size_t _nmemb, size_t _size);
41 void free(void *_ptr);
42 void *malloc(size_t _size);
43 void *realloc(void *_ptr, size_t _size);
45 int atexit(void (*_func)(void));
46 void exit(int _status);
47 char *getenv(const char *_name);
48 int system(const char *_string);
49 void *bsearch(const void *_key, const void *_base,
50 size_t _nmemb, size_t _size,
51 int (*_compar)(const void *, const void *));
52 void qsort(void *_base, size_t _nmemb, size_t _size,
53 int (*_compar)(const void *, const void *));
55 div_t div(int _numer, int _denom);
57 ldiv_t ldiv(long _numer, long _denom);
58 int mblen(const char *_s, size_t _n);
59 int mbtowc(wchar_t *_pwc, const char *_s, size_t _n);
60 int wctomb(char *_s, wchar_t _wchar);
61 size_t mbstowcs(wchar_t *_pwcs, const char *_s, size_t _n);
62 size_t wcstombs(char *_s, const wchar_t *_pwcs, size_t _n);
64 #endif /* _STDLIB_H */