/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/*
* ISO C Standard: 4.10 GENERAL UTILITIES <stdlib.h>
*/
#ifndef _STDLIB_H
#include <features.h>
/* Get size_t, wchar_t and NULL from <stddef.h>. */
#define __need_size_t
#ifndef __need_malloc_and_calloc
# define __need_wchar_t
# define __need_NULL
#endif
#include <stddef.h>
__BEGIN_DECLS
#ifndef __need_malloc_and_calloc
#define _STDLIB_H 1
/* Returned by `div'. */
typedef struct
{
int quot; /* Quotient. */
int rem; /* Remainder. */
} div_t;
/* Returned by `ldiv'. */
typedef struct
{
long int quot; /* Quotient. */
long int rem; /* Remainder. */
} ldiv_t;
#ifdef __USE_ISOC9X
/* Returned by `lldiv'. */
__extension__ typedef struct
{
long long int quot; /* Quotient. */
long long int rem; /* Remainder. */
} lldiv_t;
#endif
/* The largest number rand will return (same as INT_MAX). */
#define RAND_MAX 2147483647
/* We define these the same for all machines.
Changes from this to the outside world should be done in `_exit'. */
#define EXIT_FAILURE 1 /* Failing exit status. */
#define EXIT_SUCCESS 0 /* Successful exit status. */
/* Maximum length of a multibyte character in the current locale. */
#define MB_CUR_MAX (__ctype_get_mb_cur_max ())
extern int __ctype_get_mb_cur_max __P ((void));
/* Convert a string to a floating-point number. */
extern double atof __P ((__const char *__nptr));
/* Convert a string to an integer. */
extern int atoi __P ((__const char *__nptr));
/* Convert a string to a long integer. */
extern long int atol __P ((__const char *__nptr));
#if defined __USE_ISOC9X || (defined __GNUC__ && defined __USE_MISC)
/* These functions will part of the standard C library in ISO C 9X. */
__extension__ extern long long int atoll __P ((__const char *__nptr));
#endif
/* Convert a string to a floating-point number. */
extern double strtod __P ((__const char *__restrict __nptr,
char **__restrict __endptr));
#ifdef __USE_ISOC9X
/* Likewise for `float' and `long double' sizes of floating-point numbers. */
extern float strtof __P ((__const char *__restrict __nptr,
char **__restrict __endptr));
extern __long_double_t strtold __P ((__const char *__restrict __nptr,
char **__restrict __endptr));
#endif
/* Convert a string to a long integer. */
extern long int strtol __P ((__const char *__restrict __nptr,
char **__restrict __endptr, int __base));
/* Convert a string to an unsigned long integer. */
extern unsigned long