Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / libcc.ansi / headers / stdlib.h
1 /*
2  * stdlib.h - standard library
3  *
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".
6  */
7 /* $Id: stdlib.h,v 1.6 1994/06/24 11:41:26 ceriel Exp $ */
8
9 #if     !defined(_STDLIB_H)
10 #define _STDLIB_H
11
12 #define NULL            ((void *)0)
13
14 #define EXIT_FAILURE    1
15 #define EXIT_SUCCESS    0
16 #define RAND_MAX        32767
17 #define MB_CUR_MAX      1
18
19 typedef struct { int quot, rem; } div_t;
20 typedef struct { long quot, rem; } ldiv_t;
21
22 #if     !defined(_SIZE_T)
23 #define _SIZE_T
24 typedef unsigned int    size_t;         /* type returned by sizeof */
25 #endif  /* _SIZE_T */
26
27 #if     !defined(_WCHAR_T)
28 #define _WCHAR_T
29 typedef char    wchar_t;
30 #endif  /* _WCHAR_T */
31
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);
38 int             rand(void);
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);
44 void            abort(void);
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 *));
54 int             abs(int _j);
55 div_t           div(int _numer, int _denom);
56 long            labs(long _j);
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);
63
64 #endif  /* _STDLIB_H */