xref: /csrg-svn/include/stdlib.h (revision 46283)
142008Sbostic /*-
242008Sbostic  * Copyright (c) 1990 The Regents of the University of California.
342008Sbostic  * All rights reserved.
442008Sbostic  *
542008Sbostic  * %sccs.include.redist.c%
642008Sbostic  *
7*46283Sbostic  *	@(#)stdlib.h	5.5 (Berkeley) 02/05/91
842008Sbostic  */
942008Sbostic 
1042008Sbostic #ifndef _STDLIB_H_
1142008Sbostic #define _STDLIB_H_
1245833Sbostic #include <machine/types.h>
1342008Sbostic 
1442008Sbostic #ifdef	_SIZE_T_
1542008Sbostic typedef	_SIZE_T_	size_t;
1642008Sbostic #undef	_SIZE_T_
1742008Sbostic #endif
1842008Sbostic 
1942008Sbostic #ifdef	_WCHAR_T_
2042008Sbostic typedef	_WCHAR_T_	wchar_t;
2142008Sbostic #undef	_WCHAR_T_
2242008Sbostic #endif
2342008Sbostic 
2442008Sbostic typedef struct {
2542008Sbostic 	int quot;		/* quotient */
2642008Sbostic 	int rem;		/* remainder */
2742008Sbostic } div_t;
2842008Sbostic typedef struct {
2942008Sbostic 	long quot;		/* quotient */
3042008Sbostic 	long rem;		/* remainder */
3142008Sbostic } ldiv_t;
3242008Sbostic 
3342008Sbostic #define	EXIT_FAILURE	1
3442008Sbostic #define	EXIT_SUCCESS	0
3542008Sbostic 
3642008Sbostic #define	RAND_MAX	0x7ffffffff
3742008Sbostic 
3842008Sbostic #define	MB_CUR_MAX	1	/* XXX */
3942008Sbostic 
40*46283Sbostic #include <sys/cdefs.h>
4142008Sbostic 
42*46283Sbostic __BEGIN_DECLS
43*46283Sbostic void	 abort __P((void));
44*46283Sbostic int	 abs __P((int));
45*46283Sbostic int	 atexit __P((void (*_func)(void)));
46*46283Sbostic double	 atof __P((const char *_nptr));
47*46283Sbostic int	 atoi __P((const char *_nptr));
48*46283Sbostic long	 atol __P((const char *_nptr));
49*46283Sbostic void	*bsearch __P((const void *_key, const void *_base, size_t _nmemb,
50*46283Sbostic 	    size_t _size, int (*_compar)(const void *, const void *)));
51*46283Sbostic void	*calloc __P((size_t _nmemb, size_t _size));
52*46283Sbostic div_t	 div __P((int _numer, int _denom));
53*46283Sbostic void	 exit __P((int _status));
54*46283Sbostic void	 free __P((void *_ptr));
55*46283Sbostic char	*getenv __P((const char *_string));
56*46283Sbostic long	 labs __P((long));
57*46283Sbostic ldiv_t	 ldiv __P((long _numer, long _denom));
58*46283Sbostic void	*malloc __P((size_t _size));
59*46283Sbostic void	 qsort __P((void *_base, size_t _nmemb, size_t _size,
60*46283Sbostic 	    int (*_compar)(const void *, const void *)));
61*46283Sbostic int	 rand __P((void));
62*46283Sbostic void	*realloc __P((void *_ptr, size_t _size));
63*46283Sbostic void	 srand __P((unsigned _seed));
64*46283Sbostic long	 strtol __P((const char *_nptr, char **_endptr, int _base));
6542200Sbostic unsigned long
66*46283Sbostic 	 strtoul __P((const char *_nptr, char **_endptr, int _base));
67*46283Sbostic int	 system __P((const char *_string));
6842008Sbostic 
6942444Sbostic #ifndef _ANSI_SOURCE
70*46283Sbostic void	 cfree __P((void *_ptr));
71*46283Sbostic int	putenv __P((const char *_string));
72*46283Sbostic int	setenv __P((const char *_string, const char *_value, int _overwrite));
7342200Sbostic #endif
7442200Sbostic 
7542200Sbostic #ifdef NOT_YET_IMPLEMENTED
76*46283Sbostic int	mblen __P((const char *_s, size_t _n));
77*46283Sbostic size_t	mbstowcs __P((wchar_t *_pwcs, const char *_s, size_t _n));
78*46283Sbostic int	wctomb __P((char *_s, wchar_t _wchar));
79*46283Sbostic int	mbtowc __P((wchar_t *_pwc, const char *_s, size_t _n));
80*46283Sbostic double	strtod __P((const char *_nptr, char **_endptr));
81*46283Sbostic size_t	wcstombs __P((char *_s, const wchar_t *_pwcs, size_t _n));
8242200Sbostic #endif
83*46283Sbostic __END_DECLS
8442200Sbostic 
8542008Sbostic #endif /* _STDLIB_H_ */
86