xref: /csrg-svn/include/stdlib.h (revision 42008)
1*42008Sbostic /*-
2*42008Sbostic  * Copyright (c) 1990 The Regents of the University of California.
3*42008Sbostic  * All rights reserved.
4*42008Sbostic  *
5*42008Sbostic  * %sccs.include.redist.c%
6*42008Sbostic  *
7*42008Sbostic  *	@(#)stdlib.h	5.1 (Berkeley) 05/15/90
8*42008Sbostic  */
9*42008Sbostic 
10*42008Sbostic #ifndef _STDLIB_H_
11*42008Sbostic #define _STDLIB_H_
12*42008Sbostic #include <machine/x3j11.h>
13*42008Sbostic 
14*42008Sbostic #ifdef	_SIZE_T_
15*42008Sbostic typedef	_SIZE_T_	size_t;
16*42008Sbostic #undef	_SIZE_T_
17*42008Sbostic #endif
18*42008Sbostic 
19*42008Sbostic #ifdef	_WCHAR_T_
20*42008Sbostic typedef	_WCHAR_T_	wchar_t;
21*42008Sbostic #undef	_WCHAR_T_
22*42008Sbostic #endif
23*42008Sbostic 
24*42008Sbostic typedef struct {
25*42008Sbostic 	int quot;		/* quotient */
26*42008Sbostic 	int rem;		/* remainder */
27*42008Sbostic } div_t;
28*42008Sbostic typedef struct {
29*42008Sbostic 	long quot;		/* quotient */
30*42008Sbostic 	long rem;		/* remainder */
31*42008Sbostic } ldiv_t;
32*42008Sbostic 
33*42008Sbostic #define	EXIT_FAILURE	1
34*42008Sbostic #define	EXIT_SUCCESS	0
35*42008Sbostic 
36*42008Sbostic #define	RAND_MAX	0x7ffffffff
37*42008Sbostic 
38*42008Sbostic #define	MB_CUR_MAX	1	/* XXX */
39*42008Sbostic 
40*42008Sbostic #ifdef __STDC__
41*42008Sbostic 
42*42008Sbostic void	 abort(void);
43*42008Sbostic int	 abs(int);
44*42008Sbostic int	 atexit(void (*_func)(void));
45*42008Sbostic double	 atof(const char *_nptr);
46*42008Sbostic int	 atoi(const char *_nptr);
47*42008Sbostic long	 atol(const char *_nptr);
48*42008Sbostic void	*bsearch(const void *_key, const void *_base, size_t _nmemb,
49*42008Sbostic 	    size_t _size, int (*_compar)(const void *, const void *));
50*42008Sbostic void	*calloc(size_t _nmemb, size_t _size);
51*42008Sbostic div_t	 div(int _numer, int _denom);
52*42008Sbostic void	 exit(int _status);
53*42008Sbostic void	 free(void *_ptr);
54*42008Sbostic char	*getenv(const char *_string);
55*42008Sbostic long	 labs(long);
56*42008Sbostic ldiv_t	 ldiv(long _numer, long _denom);
57*42008Sbostic void	*malloc(size_t _size);
58*42008Sbostic void	 qsort(void *_base, size_t _nmemb, size_t _size,
59*42008Sbostic 	    int (*_compar)(const void *, const void *));
60*42008Sbostic int	 rand(void);
61*42008Sbostic void	*realloc(void *_ptr, size_t _size);
62*42008Sbostic void	 srand(unsigned _seed);
63*42008Sbostic long	 strtol(const char *_nptr, char **_endptr, int _base);
64*42008Sbostic u_long	 strtoul(const char *_nptr, char **_endptr, int _base);
65*42008Sbostic int	 system(const char *_string);
66*42008Sbostic 
67*42008Sbostic #else /* !__STDC__ */
68*42008Sbostic 
69*42008Sbostic void	 abort();
70*42008Sbostic int	 abs();
71*42008Sbostic int	 atexit();
72*42008Sbostic double	 atof();
73*42008Sbostic int	 atoi();
74*42008Sbostic long	 atol();
75*42008Sbostic void	*bsearch();
76*42008Sbostic void	*calloc();
77*42008Sbostic div_t	 div();
78*42008Sbostic void	 exit();
79*42008Sbostic void	 free();
80*42008Sbostic char	*getenv();
81*42008Sbostic long	 labs();
82*42008Sbostic ldiv_t	 ldiv();
83*42008Sbostic void	*malloc();
84*42008Sbostic void	 qsort();
85*42008Sbostic int	 rand();
86*42008Sbostic void	*realloc();
87*42008Sbostic void	 srand();
88*42008Sbostic long	 strtol();
89*42008Sbostic u_long	 strtoul();
90*42008Sbostic int	 system();
91*42008Sbostic 
92*42008Sbostic #endif /* __STDC__ */
93*42008Sbostic 
94*42008Sbostic #ifdef NOT_YET_IMPLEMENTED
95*42008Sbostic int	mblen(const char *_s, size_t _n);
96*42008Sbostic size_t	mbstowcs(wchar_t *_pwcs, const char *_s, size_t _n);
97*42008Sbostic int	wctomb(char *_s, wchar_t _wchar);
98*42008Sbostic int	mbtowc(wchar_t *_pwc, const char *_s, size_t _n);
99*42008Sbostic double	strtod(const char *_nptr, char **_endptr);
100*42008Sbostic size_t	wcstombs(char *_s, const wchar_t *_pwcs, size_t _n);
101*42008Sbostic #endif
102*42008Sbostic 
103*42008Sbostic #endif /* _STDLIB_H_ */
104