#ifndef __STDLIB_H #define __STDLIB_H #pragma lib "/$M/lib/ape/libap.a" #include #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 #define MB_CUR_MAX 3 #define RAND_MAX 32767 typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; #ifdef __cplusplus extern "C" { #endif extern double atof(const char *nptr); extern int atoi(const char *nptr); extern long int atol(const char *nptr); extern double strtod(const char *nptr, char **endptr); extern long int strtol(const char *nptr, char **endptr, int base); extern unsigned long int strtoul(const char *nptr, char **endptr, int base); extern int rand(void); extern void srand(unsigned int seed); extern void *calloc(size_t nmemb, size_t size); extern void free(void *ptr); extern void *malloc(size_t size); extern void *realloc(void *ptr, size_t size); extern void abort(void); extern int atexit(void (*func)(void)); extern void exit(int status); extern char *getenv(const char *name); extern int system(const char *string); extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); extern void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); extern int abs(int j); extern div_t div(int numer, int denom); extern long int labs(long int j); extern ldiv_t ldiv(long int numer, long int denom); extern int mblen(const char *, size_t); extern int mbtowc(wchar_t *, const char *, size_t); extern int wctomb(char *, wchar_t); extern size_t mbstowcs(wchar_t *, const char *, size_t); extern size_t wcstombs(char *, const wchar_t *, size_t); #ifdef __cplusplus } #endif #endif /* __STDLIB_H */