xref: /csrg-svn/include/stdlib.h (revision 52805)
142008Sbostic /*-
242008Sbostic  * Copyright (c) 1990 The Regents of the University of California.
342008Sbostic  * All rights reserved.
442008Sbostic  *
542008Sbostic  * %sccs.include.redist.c%
642008Sbostic  *
7*52805Storek  *	@(#)stdlib.h	5.17 (Berkeley) 03/02/92
842008Sbostic  */
942008Sbostic 
1042008Sbostic #ifndef _STDLIB_H_
1142008Sbostic #define _STDLIB_H_
1246622Sbostic #include <sys/types.h>
1342008Sbostic 
1450458Sbostic #ifdef	_SIZE_T_
1550458Sbostic typedef	_SIZE_T_	size_t;
1650458Sbostic #undef	_SIZE_T_
1750458Sbostic #endif
1850458Sbostic 
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;
2850458Sbostic 
2942008Sbostic typedef struct {
3042008Sbostic 	long quot;		/* quotient */
3142008Sbostic 	long rem;		/* remainder */
3242008Sbostic } ldiv_t;
3342008Sbostic 
3442008Sbostic #define	EXIT_FAILURE	1
3542008Sbostic #define	EXIT_SUCCESS	0
3642008Sbostic 
3746622Sbostic #define	RAND_MAX	0x7fffffff
3842008Sbostic 
3942008Sbostic #define	MB_CUR_MAX	1	/* XXX */
4042008Sbostic 
4146283Sbostic #include <sys/cdefs.h>
4242008Sbostic 
4346283Sbostic __BEGIN_DECLS
44*52805Storek __dead void
45*52805Storek 	 abort __P((void));
46*52805Storek __pure int
47*52805Storek 	 abs __P((int));
4846404Sdonn int	 atexit __P((void (*)(void)));
4946515Sdonn double	 atof __P((const char *));
5046515Sdonn int	 atoi __P((const char *));
5146515Sdonn long	 atol __P((const char *));
5246515Sdonn void	*bsearch __P((const void *, const void *, size_t,
5346515Sdonn 	    size_t, int (*)(const void *, const void *)));
5446515Sdonn void	*calloc __P((size_t, size_t));
55*52805Storek __pure div_t
56*52805Storek 	 div __P((int, int));
57*52805Storek __dead void
58*52805Storek 	 exit __P((int));
5946515Sdonn void	 free __P((void *));
6046515Sdonn char	*getenv __P((const char *));
61*52805Storek __pure long
62*52805Storek 	 labs __P((long));
63*52805Storek __pure ldiv_t
64*52805Storek 	 ldiv __P((long, long));
6546515Sdonn void	*malloc __P((size_t));
6646515Sdonn void	 qsort __P((void *, size_t, size_t,
6746515Sdonn 	    int (*)(const void *, const void *)));
6846283Sbostic int	 rand __P((void));
6946515Sdonn void	*realloc __P((void *, size_t));
7046515Sdonn void	 srand __P((unsigned));
7146515Sdonn double	 strtod __P((const char *, char **));
7246515Sdonn long	 strtol __P((const char *, char **, int));
7342200Sbostic unsigned long
7446515Sdonn 	 strtoul __P((const char *, char **, int));
7546515Sdonn int	 system __P((const char *));
7642008Sbostic 
7750458Sbostic /* These are currently just stubs. */
7846515Sdonn int	 mblen __P((const char *, size_t));
7946515Sdonn size_t	 mbstowcs __P((wchar_t *, const char *, size_t));
8046515Sdonn int	 wctomb __P((char *, wchar_t));
8146515Sdonn int	 mbtowc __P((wchar_t *, const char *, size_t));
8246515Sdonn size_t	 wcstombs __P((char *, const wchar_t *, size_t));
8346446Sdonn 
8442444Sbostic #ifndef _ANSI_SOURCE
8546515Sdonn void	 cfree __P((void *));
8646515Sdonn int	 putenv __P((const char *));
8746515Sdonn int	 setenv __P((const char *, const char *, int));
8850458Sbostic #endif
8942200Sbostic 
9046515Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
9150458Sbostic extern char *optarg;			/* getopt(3) external variables */
9251837Sbostic extern int opterr, optind, optopt;
9346556Sdonn int	 getopt __P((int, char * const *, const char *));
9450458Sbostic 
9550458Sbostic extern char *suboptarg;			/* getsubopt(3) external variable */
9646625Sbostic int	 getsubopt __P((char **, char * const *, char **));
9750458Sbostic 
9850458Sbostic void	*alloca __P((size_t));	/* built-in for gcc */
9949988Sbostic int	 heapsort __P((void *, size_t, size_t,
10049988Sbostic 	    int (*)(const void *, const void *)));
10146515Sdonn char	*initstate __P((unsigned, char *, int));
10250482Sbostic int	 radixsort __P((const u_char **, int, const u_char *, u_int));
10346515Sdonn long	 random __P((void));
10446515Sdonn char	*setstate __P((char *));
10546515Sdonn void	 srandom __P((unsigned));
10646515Sdonn void	 unsetenv __P((const char *));
10750458Sbostic #endif
10846283Sbostic __END_DECLS
10942200Sbostic 
11042008Sbostic #endif /* _STDLIB_H_ */
111