xref: /csrg-svn/include/stdlib.h (revision 46446)
142008Sbostic /*-
242008Sbostic  * Copyright (c) 1990 The Regents of the University of California.
342008Sbostic  * All rights reserved.
442008Sbostic  *
542008Sbostic  * %sccs.include.redist.c%
642008Sbostic  *
7*46446Sdonn  *	@(#)stdlib.h	5.7 (Berkeley) 02/18/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 
4046283Sbostic #include <sys/cdefs.h>
4142008Sbostic 
4246283Sbostic __BEGIN_DECLS
4346283Sbostic void	 abort __P((void));
4446283Sbostic int	 abs __P((int));
4546404Sdonn int	 atexit __P((void (*)(void)));
4646283Sbostic double	 atof __P((const char *_nptr));
4746283Sbostic int	 atoi __P((const char *_nptr));
4846283Sbostic long	 atol __P((const char *_nptr));
4946283Sbostic void	*bsearch __P((const void *_key, const void *_base, size_t _nmemb,
5046283Sbostic 	    size_t _size, int (*_compar)(const void *, const void *)));
5146283Sbostic void	*calloc __P((size_t _nmemb, size_t _size));
5246283Sbostic div_t	 div __P((int _numer, int _denom));
5346283Sbostic void	 exit __P((int _status));
5446283Sbostic void	 free __P((void *_ptr));
5546283Sbostic char	*getenv __P((const char *_string));
5646283Sbostic long	 labs __P((long));
5746283Sbostic ldiv_t	 ldiv __P((long _numer, long _denom));
5846283Sbostic void	*malloc __P((size_t _size));
5946283Sbostic void	 qsort __P((void *_base, size_t _nmemb, size_t _size,
6046283Sbostic 	    int (*_compar)(const void *, const void *)));
6146283Sbostic int	 rand __P((void));
6246283Sbostic void	*realloc __P((void *_ptr, size_t _size));
6346283Sbostic void	 srand __P((unsigned _seed));
6446283Sbostic long	 strtol __P((const char *_nptr, char **_endptr, int _base));
6542200Sbostic unsigned long
6646283Sbostic 	 strtoul __P((const char *_nptr, char **_endptr, int _base));
6746283Sbostic int	 system __P((const char *_string));
6842008Sbostic 
69*46446Sdonn /* these are currently just stubs */
70*46446Sdonn int	mblen __P((const char *_s, size_t _n));
71*46446Sdonn size_t	mbstowcs __P((wchar_t *_pwcs, const char *_s, size_t _n));
72*46446Sdonn int	wctomb __P((char *_s, wchar_t _wchar));
73*46446Sdonn int	mbtowc __P((wchar_t *_pwc, const char *_s, size_t _n));
74*46446Sdonn size_t	wcstombs __P((char *_s, const wchar_t *_pwcs, size_t _n));
75*46446Sdonn 
7642444Sbostic #ifndef _ANSI_SOURCE
7746283Sbostic void	 cfree __P((void *_ptr));
7846283Sbostic int	putenv __P((const char *_string));
7946283Sbostic int	setenv __P((const char *_string, const char *_value, int _overwrite));
8042200Sbostic #endif
8142200Sbostic 
8242200Sbostic #ifdef NOT_YET_IMPLEMENTED
8346283Sbostic double	strtod __P((const char *_nptr, char **_endptr));
8442200Sbostic #endif
8546283Sbostic __END_DECLS
8642200Sbostic 
8742008Sbostic #endif /* _STDLIB_H_ */
88