add quad constants
[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 *
3d2899e6 7 * @(#)stdlib.h 5.18 (Berkeley) %G%
1cc1b02a
KB
8 */
9
10#ifndef _STDLIB_H_
11#define _STDLIB_H_
f5e55301 12#include <sys/types.h>
1cc1b02a 13
3d2899e6
KB
14#ifdef _BSD_SIZE_T_
15typedef _BSD_SIZE_T_ size_t;
16#undef _BSD_SIZE_T_
5c02aa20
KB
17#endif
18
3d2899e6
KB
19#ifdef _BSD_WCHAR_T_
20typedef _BSD_WCHAR_T_ wchar_t;
21#undef _BSD_WCHAR_T_
1cc1b02a
KB
22#endif
23
24typedef struct {
25 int quot; /* quotient */
26 int rem; /* remainder */
27} div_t;
5c02aa20 28
1cc1b02a
KB
29typedef struct {
30 long quot; /* quotient */
31 long rem; /* remainder */
32} ldiv_t;
33
34#define EXIT_FAILURE 1
35#define EXIT_SUCCESS 0
36
f5e55301 37#define RAND_MAX 0x7fffffff
1cc1b02a
KB
38
39#define MB_CUR_MAX 1 /* XXX */
40
9992a62a
KB
41#include <sys/cdefs.h>
42
43__BEGIN_DECLS
10fb5e70
CT
44__dead void
45 abort __P((void));
46__pure int
47 abs __P((int));
11e892b9 48int atexit __P((void (*)(void)));
993000f1
DS
49double atof __P((const char *));
50int atoi __P((const char *));
51long atol __P((const char *));
52void *bsearch __P((const void *, const void *, size_t,
53 size_t, int (*)(const void *, const void *)));
54void *calloc __P((size_t, size_t));
10fb5e70
CT
55__pure div_t
56 div __P((int, int));
57__dead void
58 exit __P((int));
993000f1
DS
59void free __P((void *));
60char *getenv __P((const char *));
10fb5e70
CT
61__pure long
62 labs __P((long));
63__pure ldiv_t
64 ldiv __P((long, long));
993000f1
DS
65void *malloc __P((size_t));
66void qsort __P((void *, size_t, size_t,
67 int (*)(const void *, const void *)));
9992a62a 68int rand __P((void));
993000f1
DS
69void *realloc __P((void *, size_t));
70void srand __P((unsigned));
71double strtod __P((const char *, char **));
72long strtol __P((const char *, char **, int));
fac5dcaf 73unsigned long
993000f1
DS
74 strtoul __P((const char *, char **, int));
75int system __P((const char *));
1cc1b02a 76
5c02aa20 77/* These are currently just stubs. */
993000f1
DS
78int mblen __P((const char *, size_t));
79size_t mbstowcs __P((wchar_t *, const char *, size_t));
80int wctomb __P((char *, wchar_t));
81int mbtowc __P((wchar_t *, const char *, size_t));
82size_t wcstombs __P((char *, const wchar_t *, size_t));
b0aa9dc4 83
6670c0eb 84#ifndef _ANSI_SOURCE
993000f1
DS
85void cfree __P((void *));
86int putenv __P((const char *));
87int setenv __P((const char *, const char *, int));
5c02aa20 88#endif
993000f1
DS
89
90#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
5c02aa20 91extern char *optarg; /* getopt(3) external variables */
91ff65ad 92extern int opterr, optind, optopt;
83265d28 93int getopt __P((int, char * const *, const char *));
5c02aa20
KB
94
95extern char *suboptarg; /* getsubopt(3) external variable */
f7c699ab 96int getsubopt __P((char **, char * const *, char **));
5c02aa20
KB
97
98void *alloca __P((size_t)); /* built-in for gcc */
d052fbea
KB
99int heapsort __P((void *, size_t, size_t,
100 int (*)(const void *, const void *)));
993000f1 101char *initstate __P((unsigned, char *, int));
65c76a10 102int radixsort __P((const u_char **, int, const u_char *, u_int));
993000f1
DS
103long random __P((void));
104char *setstate __P((char *));
105void srandom __P((unsigned));
106void unsetenv __P((const char *));
5c02aa20 107#endif
9992a62a 108__END_DECLS
fac5dcaf 109
1cc1b02a 110#endif /* _STDLIB_H_ */