xref: /titanic_50/usr/src/lib/libbc/inc/5include/stdlib.h (revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*      Copyright (c) 1988 AT&T */
28 /*        All Rights Reserved   */
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * stdlib.h
34  */
35 
36 #ifndef	__stdlib_h
37 #define	__stdlib_h
38 
39 #include <sys/stdtypes.h>	/* to get size_t */
40 
41 #define	EXIT_SUCCESS	0
42 #define	EXIT_FAILURE	1
43 #define	RAND_MAX	0x7fff
44 
45 #ifndef NULL
46 #define	NULL		0
47 #endif
48 
49 extern unsigned int _mb_cur_max;
50 
51 #define MB_CUR_MAX	_mb_cur_max
52 
53 /* declaration of various libc functions */
54 extern void	abort(/* void */);
55 extern int	abs(/* int j */);
56 extern double	atof(/* const char *nptr */);
57 extern int	atoi(/* const char *nptr */);
58 extern long int	atol(/* const char *nptr */);
59 extern void *	bsearch(/* const void *key, const void *base, size_t nmemb,
60 		    size_t size, int (*compar)(const void *, const void *) */);
61 extern void *	calloc(/* size_t nmemb, size_t size */);
62 extern void	exit(/* int status */);
63 extern void	free(/* void *ptr */);
64 extern char *	getenv(/* const char *name */);
65 extern void *	malloc(/* size_t size */);
66 extern void	qsort(/* void *base, size_t nmemb, size_t size,
67 		    int (*compar)(const void *, const void *) */);
68 extern int	rand(/* void */);
69 extern void *	realloc(/* void *ptr, size_t size */);
70 extern void	srand(/* unsigned int seed */);
71 
72 extern int 	mbtowc(/* wchar_t *pwc, const char *s, size_t n */);
73 extern int 	wctomb(/* char *s, wchar_t wchar */);
74 extern size_t 	mbstowcs(/* wchar_t *pwcs, const char *s, size_t n */);
75 extern size_t 	wcstombs(/* char *s, const wchar_t *pwcs, size_t n */);
76 #define	mblen(s, n)	mbtowc((wchar_t *)0, s, n)
77 
78 #endif
79