Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | /*- |
2 | * Copyright (c) 1990 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 3. All advertising materials mentioning features or use of this software | |
14 | * must display the following acknowledgement: | |
15 | * This product includes software developed by the University of | |
16 | * California, Berkeley and its contributors. | |
17 | * 4. Neither the name of the University nor the names of its contributors | |
18 | * may be used to endorse or promote products derived from this software | |
19 | * without specific prior written permission. | |
20 | * | |
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
31 | * SUCH DAMAGE. | |
32 | * | |
33 | * @(#)stdlib.h 5.13 (Berkeley) 6/4/91 | |
34 | * | |
35 | * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE | |
36 | * -------------------- ----- ---------------------- | |
37 | * CURRENT PATCH LEVEL: 1 00145 | |
38 | * -------------------- ----- ---------------------- | |
39 | * | |
40 | * 20 Apr 93 Richard Murphey stddef.h patch for XFree86 | |
41 | */ | |
42 | ||
43 | #ifndef _STDLIB_H_ | |
44 | #define _STDLIB_H_ | |
45 | #include <sys/types.h> | |
46 | ||
47 | #ifdef _WCHAR_T_ | |
48 | typedef _WCHAR_T_ wchar_t; | |
49 | #undef _WCHAR_T_ | |
50 | #endif | |
51 | ||
52 | typedef struct { | |
53 | int quot; /* quotient */ | |
54 | int rem; /* remainder */ | |
55 | } div_t; | |
56 | typedef struct { | |
57 | long quot; /* quotient */ | |
58 | long rem; /* remainder */ | |
59 | } ldiv_t; | |
60 | ||
61 | #define EXIT_FAILURE 1 | |
62 | #define EXIT_SUCCESS 0 | |
63 | ||
64 | #define RAND_MAX 0x7fffffff | |
65 | ||
66 | #define MB_CUR_MAX 1 /* XXX */ | |
67 | ||
68 | #include <sys/cdefs.h> | |
69 | ||
70 | __BEGIN_DECLS | |
71 | void abort __P((void)); | |
72 | int abs __P((int)); | |
73 | int atexit __P((void (*)(void))); | |
74 | double atof __P((const char *)); | |
75 | int atoi __P((const char *)); | |
76 | long atol __P((const char *)); | |
77 | void *bsearch __P((const void *, const void *, size_t, | |
78 | size_t, int (*)(const void *, const void *))); | |
79 | void *calloc __P((size_t, size_t)); | |
80 | div_t div __P((int, int)); | |
81 | void exit __P((int)); | |
82 | void free __P((void *)); | |
83 | char *getenv __P((const char *)); | |
84 | long labs __P((long)); | |
85 | ldiv_t ldiv __P((long, long)); | |
86 | void *malloc __P((size_t)); | |
87 | void qsort __P((void *, size_t, size_t, | |
88 | int (*)(const void *, const void *))); | |
89 | int rand __P((void)); | |
90 | void *realloc __P((void *, size_t)); | |
91 | void srand __P((unsigned)); | |
92 | double strtod __P((const char *, char **)); | |
93 | long strtol __P((const char *, char **, int)); | |
94 | unsigned long | |
95 | strtoul __P((const char *, char **, int)); | |
96 | int system __P((const char *)); | |
97 | ||
98 | /* these are currently just stubs */ | |
99 | int mblen __P((const char *, size_t)); | |
100 | size_t mbstowcs __P((wchar_t *, const char *, size_t)); | |
101 | int wctomb __P((char *, wchar_t)); | |
102 | int mbtowc __P((wchar_t *, const char *, size_t)); | |
103 | size_t wcstombs __P((char *, const wchar_t *, size_t)); | |
104 | ||
5f6c1647 PR |
105 | /* don't ask me where to put these -- MB XXX */ |
106 | double drand48 __P((void)); | |
107 | double erand48 __P((unsigned short[3])); | |
108 | long lrand48 __P((void)); | |
109 | long nrand48 __P((unsigned short[3])); | |
110 | long mrand48 __P((void)); | |
111 | long jrand48 __P((unsigned short[3])); | |
112 | void srand48 __P((long)); | |
113 | unsigned short *seed48 __P((unsigned short[3])); | |
114 | void lcong48 __P((unsigned short[7])); | |
115 | ||
15637ed4 RG |
116 | #ifndef _ANSI_SOURCE |
117 | void cfree __P((void *)); | |
118 | int putenv __P((const char *)); | |
119 | int setenv __P((const char *, const char *, int)); | |
120 | #endif /* not ANSI */ | |
121 | ||
122 | #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) | |
123 | #ifndef alloca | |
124 | void *alloca __P((size_t)); | |
125 | #endif | |
126 | extern char *optarg; /* getopt(3) external variables */ | |
127 | extern int optind; | |
128 | extern int opterr; | |
129 | int getopt __P((int, char * const *, const char *)); | |
130 | extern char *suboptarg; /* getsubopt(3) external variable */ | |
131 | int getsubopt __P((char **, char * const *, char **)); | |
132 | int heapsort __P((void *, size_t, size_t, | |
133 | int (*)(const void *, const void *))); | |
134 | char *initstate __P((unsigned, char *, int)); | |
135 | int radixsort __P((const u_char **, int, const u_char *, u_char)); | |
136 | long random __P((void)); | |
137 | char *setstate __P((char *)); | |
138 | void srandom __P((unsigned)); | |
139 | void unsetenv __P((const char *)); | |
140 | #endif /* neither ANSI nor POSIX */ | |
141 | ||
142 | __END_DECLS | |
143 | ||
144 | #endif /* _STDLIB_H_ */ |