2011-02-12 05:22:29 +00:00
|
|
|
#ifndef _STDLIB_H
|
|
|
|
#define _STDLIB_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef NULL
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define NULL 0
|
|
|
|
#else
|
|
|
|
#define NULL ((void*)0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __NEED_size_t
|
|
|
|
#define __NEED_wchar_t
|
|
|
|
|
|
|
|
#include <bits/alltypes.h>
|
|
|
|
|
|
|
|
int atoi (const char *);
|
|
|
|
long atol (const char *);
|
|
|
|
long long atoll (const char *);
|
|
|
|
double atof (const char *);
|
|
|
|
|
|
|
|
float strtof (const char *, char **);
|
|
|
|
double strtod (const char *, char **);
|
|
|
|
long double strtold (const char *, char **);
|
|
|
|
|
|
|
|
long strtol (const char *, char **, int);
|
|
|
|
unsigned long strtoul (const char *, char **, int);
|
|
|
|
long long strtoll (const char *, char **, int);
|
|
|
|
unsigned long long strtoull (const char *, char **, int);
|
|
|
|
|
|
|
|
int rand (void);
|
|
|
|
void srand (unsigned);
|
|
|
|
|
|
|
|
void *malloc (size_t);
|
|
|
|
void *calloc (size_t, size_t);
|
|
|
|
void *realloc (void *, size_t);
|
|
|
|
void free (void *);
|
|
|
|
|
|
|
|
void abort (void);
|
|
|
|
int atexit (void (*) (void));
|
|
|
|
void exit (int);
|
|
|
|
void _Exit (int);
|
|
|
|
|
|
|
|
char *getenv (const char *);
|
|
|
|
|
|
|
|
int system (const char *);
|
|
|
|
|
|
|
|
void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
|
|
|
|
void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
|
|
|
|
|
|
|
|
int abs (int);
|
|
|
|
long labs (long);
|
|
|
|
long long llabs (long long);
|
|
|
|
|
|
|
|
typedef struct { int quot, rem; } div_t;
|
|
|
|
typedef struct { long quot, rem; } ldiv_t;
|
|
|
|
typedef struct { long long quot, rem; } lldiv_t;
|
|
|
|
|
2011-02-14 10:10:10 +00:00
|
|
|
div_t div (int, int);
|
|
|
|
ldiv_t ldiv (long, long);
|
|
|
|
lldiv_t lldiv (long long, long long);
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
int mblen (const char *, size_t);
|
|
|
|
int mbtowc (wchar_t *, const char *, size_t);
|
|
|
|
int wctomb (char *, wchar_t);
|
|
|
|
size_t mbstowcs (wchar_t *, const char *, size_t);
|
|
|
|
size_t wcstombs (char *, const wchar_t *, size_t);
|
|
|
|
|
2011-02-15 22:33:52 +00:00
|
|
|
#define EXIT_FAILURE 1
|
|
|
|
#define EXIT_SUCCESS 0
|
|
|
|
|
2011-02-16 00:15:45 +00:00
|
|
|
#define MB_CUR_MAX ((size_t)+4)
|
2011-02-14 10:10:10 +00:00
|
|
|
|
|
|
|
#define RAND_MAX (0x7fffffff)
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
|
|
|
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
|
|
|
|
|
|
|
#ifndef WEXITSTATUS
|
|
|
|
#include <bits/wexitstatus.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int posix_memalign (void **, size_t, size_t);
|
|
|
|
int setenv (const char *, const char *, int);
|
|
|
|
int unsetenv (const char *);
|
|
|
|
int mkstemp (char *);
|
|
|
|
char *mkdtemp (char *);
|
2011-02-12 05:22:29 +00:00
|
|
|
int getsubopt (char **, char *const *, char **);
|
2011-02-14 10:10:10 +00:00
|
|
|
int rand_r (unsigned *);
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2011-02-14 10:10:10 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2011-02-14 10:10:10 +00:00
|
|
|
|
|
|
|
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
|
|
|
int putenv (char *);
|
2011-02-12 05:22:29 +00:00
|
|
|
int posix_openpt (int);
|
|
|
|
int grantpt (int);
|
|
|
|
int unlockpt (int);
|
|
|
|
char *ptsname (int);
|
2011-02-14 10:10:10 +00:00
|
|
|
char *realpath (const char *, char *);
|
|
|
|
char *l64a (long);
|
|
|
|
long a64l (const char *);
|
|
|
|
void setkey (const char *);
|
|
|
|
long int random (void);
|
|
|
|
void srandom (unsigned int);
|
|
|
|
char *initstate (unsigned int, char *, size_t);
|
|
|
|
char *setstate (char *);
|
|
|
|
double drand48 (void);
|
|
|
|
double erand48 (unsigned short [3]);
|
|
|
|
long int lrand48 (void);
|
|
|
|
long int nrand48 (unsigned short [3]);
|
|
|
|
long mrand48 (void);
|
|
|
|
long jrand48 (unsigned short [3]);
|
|
|
|
void srand48 (long);
|
|
|
|
unsigned short *seed48 (unsigned short [3]);
|
|
|
|
void lcong48 (unsigned short [7]);
|
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
2011-02-14 10:10:10 +00:00
|
|
|
#if defined(_GNU_SOURCE)
|
|
|
|
char *mktemp (char *);
|
|
|
|
void *valloc (size_t);
|
|
|
|
void *memalign(size_t, size_t);
|
2011-03-30 18:14:26 +00:00
|
|
|
int clearenv(void);
|
2011-02-14 10:10:10 +00:00
|
|
|
#endif
|
2011-02-12 05:22:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|