2017-10-21 23:40:19 +00:00
|
|
|
/****************************************************************
|
|
|
|
*
|
|
|
|
* stdlib.h - standard library functions
|
|
|
|
*
|
|
|
|
* February 1989
|
|
|
|
* Mike Westerfield
|
|
|
|
*
|
|
|
|
* Copyright 1989
|
|
|
|
* Byte Works, Inc.
|
|
|
|
*
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef __stdlib__
|
|
|
|
#define __stdlib__
|
|
|
|
|
|
|
|
#ifndef NULL
|
|
|
|
#define NULL (void *) 0L
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __size_t__
|
|
|
|
#define __size_t__ 1
|
|
|
|
typedef unsigned long size_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define RAND_MAX 32767
|
|
|
|
#define EXIT_FAILURE (-1)
|
|
|
|
#define EXIT_SUCCESS 0
|
2021-08-22 20:14:29 +00:00
|
|
|
#define MB_CUR_MAX 1UL
|
2017-10-21 23:40:19 +00:00
|
|
|
|
|
|
|
typedef struct {int quot,rem;} div_t;
|
|
|
|
typedef struct {long quot,rem;} ldiv_t;
|
2021-02-17 20:57:18 +00:00
|
|
|
#if defined(__ORCAC_HAS_LONG_LONG__) || __STDC_VERSION__ >= 199901L
|
|
|
|
typedef struct {long long quot,rem;} lldiv_t;
|
|
|
|
#endif
|
2017-10-21 23:40:19 +00:00
|
|
|
|
|
|
|
#ifndef __KeepNamespacePure__
|
|
|
|
#define clalloc(x,y) calloc((x),(y))
|
|
|
|
#define cfree(x) free(x)
|
|
|
|
#define mlalloc(x) malloc(x)
|
|
|
|
#define relalloc(x,y) realloc((x),(y))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int abs(int);
|
|
|
|
void abort(void);
|
2020-01-13 00:37:50 +00:00
|
|
|
void *aligned_alloc(size_t, size_t);
|
2017-10-21 23:40:19 +00:00
|
|
|
int atexit(void (*__func)(void));
|
2020-01-24 00:46:22 +00:00
|
|
|
int at_quick_exit(void (*__func)(void));
|
2017-10-21 23:40:19 +00:00
|
|
|
double atof(const char *);
|
|
|
|
int atoi(const char *);
|
|
|
|
long atol(const char *);
|
2021-02-17 20:57:18 +00:00
|
|
|
#if defined(__ORCAC_HAS_LONG_LONG__) || __STDC_VERSION__ >= 199901L
|
|
|
|
long long atoll(const char *);
|
|
|
|
#endif
|
2017-10-21 23:40:19 +00:00
|
|
|
void *bsearch(const void *, const void *, size_t, size_t, int (*__compar)(const void *, const void *));
|
|
|
|
void *calloc(size_t, size_t);
|
|
|
|
div_t div(int, int);
|
|
|
|
void exit(int);
|
|
|
|
void _exit(int);
|
2018-09-10 04:24:47 +00:00
|
|
|
void _Exit(int);
|
2017-10-21 23:40:19 +00:00
|
|
|
void free(void *);
|
|
|
|
char *getenv(const char *);
|
|
|
|
long labs(long);
|
|
|
|
ldiv_t ldiv(long, long);
|
2021-02-17 20:57:18 +00:00
|
|
|
#if defined(__ORCAC_HAS_LONG_LONG__) || __STDC_VERSION__ >= 199901L
|
|
|
|
long long llabs(long long);
|
|
|
|
lldiv_t lldiv(long long, long long);
|
|
|
|
#endif
|
2017-10-21 23:40:19 +00:00
|
|
|
void *malloc(size_t);
|
2021-09-30 23:41:17 +00:00
|
|
|
int mblen(const char *, size_t);
|
2017-10-21 23:40:19 +00:00
|
|
|
void qsort(void *, size_t, size_t, int (*__compar)(const void *, const void *));
|
2020-01-24 00:46:22 +00:00
|
|
|
void quick_exit(int);
|
2017-10-21 23:40:19 +00:00
|
|
|
int rand(void);
|
|
|
|
void *realloc(void *, size_t);
|
|
|
|
void srand(unsigned);
|
|
|
|
double strtod(const char *, char **);
|
2021-11-21 20:38:30 +00:00
|
|
|
float strtof(const char *, char **);
|
|
|
|
long double strtold(const char *, char **);
|
2017-10-21 23:40:19 +00:00
|
|
|
long strtol(const char *, char **, int);
|
|
|
|
unsigned long strtoul(const char *, char **, int);
|
2021-02-17 20:57:18 +00:00
|
|
|
#if defined(__ORCAC_HAS_LONG_LONG__) || __STDC_VERSION__ >= 199901L
|
|
|
|
long long strtoll(const char * restrict, char ** restrict, int);
|
|
|
|
unsigned long long strtoull(const char * restrict, char ** restrict, int);
|
|
|
|
#endif
|
2017-10-21 23:40:19 +00:00
|
|
|
int system(const char *);
|
|
|
|
|
|
|
|
#endif
|