]>
git.saurik.com Git - apple/libc.git/blob - include/stdlib.h
08c9bc7e79887872feb183038ea2bba93e8ebab0
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1990, 1993
27 * The Regents of the University of California. All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
32 * 1. Redistributions of source code must retain the above copyright
33 * notice, this list of conditions and the following disclaimer.
34 * 2. Redistributions in binary form must reproduce the above copyright
35 * notice, this list of conditions and the following disclaimer in the
36 * documentation and/or other materials provided with the distribution.
37 * 3. All advertising materials mentioning features or use of this software
38 * must display the following acknowledgement:
39 * This product includes software developed by the University of
40 * California, Berkeley and its contributors.
41 * 4. Neither the name of the University nor the names of its contributors
42 * may be used to endorse or promote products derived from this software
43 * without specific prior written permission.
45 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57 * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
63 #include <machine/ansi.h>
64 #include <machine/types.h>
66 #ifndef _BSD_SIZE_T_DEFINED_
67 #define _BSD_SIZE_T_DEFINED_
68 typedef _BSD_SIZE_T_
size_t;
71 #if !defined(_ANSI_SOURCE)
72 #ifndef _BSD_RUNE_T_DEFINED_
73 #define _BSD_RUNE_T_DEFINED_
74 typedef _BSD_WCHAR_T_ rune_t
;
78 #ifndef _BSD_WCHAR_T_DEFINED_
79 #define _BSD_WCHAR_T_DEFINED_
80 typedef _BSD_WCHAR_T_
wchar_t;
84 int quot
; /* quotient */
85 int rem
; /* remainder */
89 long quot
; /* quotient */
90 long rem
; /* remainder */
97 #define EXIT_FAILURE 1
98 #define EXIT_SUCCESS 0
100 #define RAND_MAX 0x7fffffff
102 extern int __mb_cur_max
;
103 #define MB_CUR_MAX __mb_cur_max
105 #include <sys/cdefs.h>
112 int atexit
__P((void (*)(void)));
113 double atof
__P((const char *));
114 int atoi
__P((const char *));
115 long atol
__P((const char *));
116 void *bsearch
__P((const void *, const void *, size_t,
117 size_t, int (*)(const void *, const void *)));
118 void *calloc
__P((size_t, size_t));
123 void free
__P((void *));
124 char *getenv
__P((const char *));
128 ldiv
__P((long, long));
129 void *malloc
__P((size_t));
130 void qsort
__P((void *, size_t, size_t,
131 int (*)(const void *, const void *)));
132 int rand
__P((void));
133 void *realloc
__P((void *, size_t));
134 void srand
__P((unsigned));
135 double strtod
__P((const char *, char **));
136 long strtol
__P((const char *, char **, int));
138 strtoul
__P((const char *, char **, int));
139 int system
__P((const char *));
141 /* These are currently just stubs. */
142 int mblen
__P((const char *, size_t));
143 size_t mbstowcs
__P((wchar_t *, const char *, size_t));
144 int wctomb
__P((char *, wchar_t));
145 int mbtowc
__P((wchar_t *, const char *, size_t));
146 size_t wcstombs
__P((char *, const wchar_t *, size_t));
149 int putenv
__P((const char *));
150 int setenv
__P((const char *, const char *, int));
153 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
154 double drand48
__P((void));
155 double erand48
__P((unsigned short[3]));
156 long jrand48
__P((unsigned short[3]));
157 void lcong48
__P((unsigned short[7]));
158 long lrand48
__P((void));
159 long mrand48
__P((void));
160 long nrand48
__P((unsigned short[3]));
162 *seed48
__P((unsigned short[3]));
163 void srand48
__P((long));
165 void *alloca
__P((size_t)); /* built-in for gcc */
166 /* getcap(3) functions */
168 arc4random
__P((void));
169 void arc4random_addrandom
__P((unsigned char *dat
, int datlen
));
170 void arc4random_stir
__P((void));
171 char *getbsize
__P((int *, long *));
172 char *cgetcap
__P((char *, char *, int));
173 int cgetclose
__P((void));
174 int cgetent
__P((char **, char **, char *));
175 int cgetfirst
__P((char **, char **));
176 int cgetmatch
__P((char *, char *));
177 int cgetnext
__P((char **, char **));
178 int cgetnum
__P((char *, char *, long *));
179 int cgetset
__P((char *));
180 int cgetstr
__P((char *, char *, char **));
181 int cgetustr
__P((char *, char *, char **));
183 int daemon
__P((int, int));
184 char *devname
__P((int, int));
185 int getloadavg
__P((double [], int));
187 long a64l
__P((const char *));
188 char *l64a
__P((long));
190 char *group_from_gid
__P((unsigned long, int));
191 int heapsort
__P((void *, size_t, size_t,
192 int (*)(const void *, const void *)));
193 char *initstate
__P((unsigned long, char *, long));
194 int mergesort
__P((void *, size_t, size_t,
195 int (*)(const void *, const void *)));
196 int radixsort
__P((const unsigned char **, int, const unsigned char *,
198 int sradixsort
__P((const unsigned char **, int, const unsigned char *,
200 int rand_r
__P((unsigned *));
201 long random
__P((void));
202 void *reallocf
__P((void *, size_t));
203 char *realpath
__P((const char *, char resolved_path
[]));
204 char *setstate
__P((char *));
205 void srandom
__P((unsigned long));
206 char *user_from_uid
__P((unsigned long, int));
207 #ifndef __STRICT_ANSI__
209 strtoll(const char *, char **, int);
211 strtoull(const char *, char **, int);
213 strtoq
__P((const char *, char **, int));
215 strtouq
__P((const char *, char **, int));
217 void unsetenv
__P((const char *));
221 #endif /* _STDLIB_H_ */