]>
git.saurik.com Git - apple/xnu.git/blob - bsd/include/stdlib.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1990, 1993
24 * The Regents of the University of California. All rights reserved.
26 * Redistribution and use in source and binary forms, with or without
27 * modification, are permitted provided that the following conditions
29 * 1. Redistributions of source code must retain the above copyright
30 * notice, this list of conditions and the following disclaimer.
31 * 2. Redistributions in binary form must reproduce the above copyright
32 * notice, this list of conditions and the following disclaimer in the
33 * documentation and/or other materials provided with the distribution.
34 * 3. All advertising materials mentioning features or use of this software
35 * must display the following acknowledgement:
36 * This product includes software developed by the University of
37 * California, Berkeley and its contributors.
38 * 4. Neither the name of the University nor the names of its contributors
39 * may be used to endorse or promote products derived from this software
40 * without specific prior written permission.
42 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
43 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * @(#)stdlib.h 8.5 (Berkeley) 5/19/95
60 #include <machine/ansi.h>
62 #ifndef _BSD_SIZE_T_DEFINED_
63 #define _BSD_SIZE_T_DEFINED_
64 typedef _BSD_SIZE_T_
size_t;
67 #ifndef _BSD_WCHAR_T_DEFINED_
68 #define _BSD_WCHAR_T_DEFINED_
70 typedef _BSD_WCHAR_T_ rune_t
;
72 typedef _BSD_WCHAR_T_
wchar_t;
76 int quot
; /* quotient */
77 int rem
; /* remainder */
81 long quot
; /* quotient */
82 long rem
; /* remainder */
89 #define EXIT_FAILURE 1
90 #define EXIT_SUCCESS 0
92 #define RAND_MAX 0x7fffffff
94 extern int __mb_cur_max
;
95 #define MB_CUR_MAX __mb_cur_max
97 #include <sys/cdefs.h>
104 int atexit
__P((void (*)(void)));
105 double atof
__P((const char *));
106 int atoi
__P((const char *));
107 long atol
__P((const char *));
108 void *bsearch
__P((const void *, const void *, size_t,
109 size_t, int (*)(const void *, const void *)));
110 void *calloc
__P((size_t, size_t));
115 void free
__P((void *));
116 char *getenv
__P((const char *));
120 ldiv
__P((long, long));
121 void *malloc
__P((size_t));
122 void qsort
__P((void *, size_t, size_t,
123 int (*)(const void *, const void *)));
124 int rand
__P((void));
125 void *realloc
__P((void *, size_t));
126 void srand
__P((unsigned));
127 double strtod
__P((const char *, char **));
128 long strtol
__P((const char *, char **, int));
130 strtoul
__P((const char *, char **, int));
131 int system
__P((const char *));
133 /* These are currently just stubs. */
134 int mblen
__P((const char *, size_t));
135 size_t mbstowcs
__P((wchar_t *, const char *, size_t));
136 int wctomb
__P((char *, wchar_t));
137 int mbtowc
__P((wchar_t *, const char *, size_t));
138 size_t wcstombs
__P((char *, const wchar_t *, size_t));
141 int putenv
__P((const char *));
142 int setenv
__P((const char *, const char *, int));
145 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
146 void *alloca
__P((size_t)); /* built-in for gcc */
147 /* getcap(3) functions */
148 char *getbsize
__P((int *, long *));
149 char *cgetcap
__P((char *, char *, int));
150 int cgetclose
__P((void));
151 int cgetent
__P((char **, char **, char *));
152 int cgetfirst
__P((char **, char **));
153 int cgetmatch
__P((char *, char *));
154 int cgetnext
__P((char **, char **));
155 int cgetnum
__P((char *, char *, long *));
156 int cgetset
__P((char *));
157 int cgetstr
__P((char *, char *, char **));
158 int cgetustr
__P((char *, char *, char **));
160 int daemon
__P((int, int));
161 char *devname
__P((int, int));
162 int getloadavg
__P((double [], int));
164 char *group_from_gid
__P((unsigned long, int));
165 int heapsort
__P((void *, size_t, size_t,
166 int (*)(const void *, const void *)));
167 char *initstate
__P((unsigned long, char *, long));
168 int mergesort
__P((void *, size_t, size_t,
169 int (*)(const void *, const void *)));
170 int radixsort
__P((const unsigned char **, int, const unsigned char *,
172 int sradixsort
__P((const unsigned char **, int, const unsigned char *,
174 long random
__P((void));
175 char *realpath
__P((const char *, char resolved_path
[]));
176 char *setstate
__P((char *));
177 void srandom
__P((unsigned long));
178 char *user_from_uid
__P((unsigned long, int));
179 #ifndef __STRICT_ANSI__
181 strtoq
__P((const char *, char **, int));
183 strtouq
__P((const char *, char **, int));
185 void unsetenv
__P((const char *));
189 #endif /* _STDLIB_H_ */