386 byte sex; really should be ENDIAN et al someday...
[unix-history] / usr / src / include / stdlib.h
CommitLineData
1cc1b02a
KB
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
6670c0eb 7 * @(#)stdlib.h 5.3 (Berkeley) %G%
1cc1b02a
KB
8 */
9
10#ifndef _STDLIB_H_
11#define _STDLIB_H_
fac5dcaf 12#include <machine/machtypes.h>
1cc1b02a
KB
13
14#ifdef _SIZE_T_
15typedef _SIZE_T_ size_t;
16#undef _SIZE_T_
17#endif
18
19#ifdef _WCHAR_T_
20typedef _WCHAR_T_ wchar_t;
21#undef _WCHAR_T_
22#endif
23
24typedef struct {
25 int quot; /* quotient */
26 int rem; /* remainder */
27} div_t;
28typedef struct {
29 long quot; /* quotient */
30 long rem; /* remainder */
31} ldiv_t;
32
33#define EXIT_FAILURE 1
34#define EXIT_SUCCESS 0
35
36#define RAND_MAX 0x7ffffffff
37
38#define MB_CUR_MAX 1 /* XXX */
39
6670c0eb 40#if __STDC__ || c_plusplus
1cc1b02a
KB
41
42void abort(void);
43int abs(int);
44int atexit(void (*_func)(void));
45double atof(const char *_nptr);
46int atoi(const char *_nptr);
47long atol(const char *_nptr);
48void *bsearch(const void *_key, const void *_base, size_t _nmemb,
49 size_t _size, int (*_compar)(const void *, const void *));
50void *calloc(size_t _nmemb, size_t _size);
51div_t div(int _numer, int _denom);
52void exit(int _status);
53void free(void *_ptr);
54char *getenv(const char *_string);
55long labs(long);
56ldiv_t ldiv(long _numer, long _denom);
57void *malloc(size_t _size);
58void qsort(void *_base, size_t _nmemb, size_t _size,
59 int (*_compar)(const void *, const void *));
60int rand(void);
61void *realloc(void *_ptr, size_t _size);
62void srand(unsigned _seed);
63long strtol(const char *_nptr, char **_endptr, int _base);
fac5dcaf
KB
64unsigned long
65 strtoul(const char *_nptr, char **_endptr, int _base);
1cc1b02a
KB
66int system(const char *_string);
67
6670c0eb 68#ifndef _ANSI_SOURCE
fac5dcaf
KB
69void cfree(void *_ptr);
70int putenv(const char *_string);
71int setenv(const char *_string, const char *_value, int _overwrite);
72#endif
73
74#ifdef NOT_YET_IMPLEMENTED
75int mblen(const char *_s, size_t _n);
76size_t mbstowcs(wchar_t *_pwcs, const char *_s, size_t _n);
77int wctomb(char *_s, wchar_t _wchar);
78int mbtowc(wchar_t *_pwc, const char *_s, size_t _n);
79double strtod(const char *_nptr, char **_endptr);
80size_t wcstombs(char *_s, const wchar_t *_pwcs, size_t _n);
81#endif
82
6670c0eb 83#else
1cc1b02a
KB
84
85void abort();
86int abs();
87int atexit();
88double atof();
89int atoi();
90long atol();
91void *bsearch();
92void *calloc();
93div_t div();
94void exit();
95void free();
96char *getenv();
97long labs();
98ldiv_t ldiv();
99void *malloc();
100void qsort();
101int rand();
102void *realloc();
103void srand();
104long strtol();
fac5dcaf
KB
105unsigned long
106 strtoul();
1cc1b02a
KB
107int system();
108
6670c0eb 109#ifndef _ANSI_SOURCE
fac5dcaf
KB
110void cfree();
111int putenv();
112int setenv();
113#endif
1cc1b02a
KB
114
115#ifdef NOT_YET_IMPLEMENTED
fac5dcaf
KB
116int mblen();
117size_t mbstowcs();
118int wctomb();
119int mbtowc();
120double strtod();
121size_t wcstombs();
1cc1b02a
KB
122#endif
123
6670c0eb 124#endif
fac5dcaf 125
1cc1b02a 126#endif /* _STDLIB_H_ */