12 #pragma mark - definitions & types - 43 #define EXIT_FAILURE 1 46 #define EXIT_SUCCESS 0 51 #define RAND_MAX (0x7fffffff) 55 #define MB_CUR_MAX sizeof(wchar_t) 57 #pragma mark - runtime - 62 int atexit(
void (*)(
void));
75 #ifndef DISABLE_UNIMPLEMENTED_LIBC_APIS 80 #ifndef DISABLE_UNIMPLEMENTED_LIBC_APIS 85 #pragma mark - Multibyte APIs - 87 #ifndef DISABLE_UNIMPLEMENTED_LIBC_APIS 88 int mblen(
const char*,
size_t);
89 int mbtowc(
wchar_t* __restrict,
const char* __restrict,
size_t);
90 int wctomb(
char*,
wchar_t);
91 size_t mbstowcs(
wchar_t* __restrict,
const char* __restrict,
size_t);
92 size_t wcstombs(
char* __restrict,
const wchar_t* __restrict,
size_t);
95 #pragma mark - ascii-to-x - 113 int atoi(
const char* str);
131 long atol(
const char* str);
149 long long atoll(
const char* str);
173 double atof(
const char* str);
175 #pragma mark - str-to-x - 216 float strtof(
const char* __restrict str,
char** __restrict str_end);
257 double strtod(
const char* __restrict str,
char** __restrict str_end);
302 long strtol(
const char* __restrict str,
char** __restrict str_end,
int base);
345 unsigned long strtoul(
const char* __restrict str,
char** __restrict str_end,
int base);
390 long long strtoll(
const char* __restrict str,
char** __restrict str_end,
int base);
434 unsigned long long strtoull(
const char* __restrict str,
char** __restrict str_end,
int base);
437 long double strtold(
const char* __restrict,
char** __restrict);
439 #pragma mark - math - 472 long long llabs(
long long n);
576 #pragma mark - random number generation - 578 int rand_r(
unsigned int* ctx);
608 void srand(
unsigned seed);
610 #pragma mark - sorting - 636 int heapsort(
void* vbase,
size_t nmemb,
size_t size,
int (*compar)(
const void*,
const void*));
670 int (*compar)(
void*,
const void*,
const void*));
693 void*
bsearch(
const void* key,
const void* ptr,
size_t count,
size_t size,
694 int (*comp)(
const void*,
const void*));
719 int (*
cmp)(
void*,
const void*,
const void*));
739 void qsort(
void* a,
size_t n,
size_t es,
int (*compar)(
const void*,
const void*));
741 #pragma mark - memory - 756 void*
malloc(
size_t size);
776 void free(
void* ptr);
789 void*
calloc(
size_t num,
size_t size);
814 void*
realloc(
void* ptr,
size_t size);
834 void*
reallocf(
void* ptr,
size_t size);
836 #ifdef _POSIX_MEMALIGN_VISIBLE 852 int posix_memalign(
void** memptr,
size_t alignment,
size_t size);
ldiv_t ldiv(long x, long y)
Computes both the quotient and the remainder of the division of the numerator x by the denominator y.
int mblen(const char *, size_t)
long long strtoll(const char *__restrict str, char **__restrict str_end, int base)
Interprets an long long value in a byte string pointed to by str.
int abs(int n)
Computes the absolute value of an integer number.
long atol(const char *str)
Interprets a Long value in a byte string pointed to by str.
unsigned long long strtoull(const char *__restrict str, char **__restrict str_end, int base)
Interprets an unsigned long long value in a byte string pointed to by str.
void free(void *ptr)
Deallocates allocated memory space.
__attribute__((noreturn, weak)) void __assert_fail(const char *expr
intmax_t imaxabs(intmax_t j)
Computes the absolute value of an intmax_t number.
char * getenv(const char *)
int cxa_atexit(void(*)(void *), void *, void *)
void _Exit(int) __attribute__((noreturn))
Division type for long integers.
void * calloc(size_t num, size_t size)
Allocates memory for an array of given number objects of size and initializes all bytes in the alloca...
long long atoll(const char *str)
Interprets a Long Long value in a byte string pointed to by str.
void abort(void) __attribute__((noreturn))
float strtof(const char *__restrict str, char **__restrict str_end)
Interprets a floating-point value in a byte string pointed to by str.
long labs(long n)
Computes the absolute value of an long number.
unsigned long strtoul(const char *__restrict str, char **__restrict str_end, int base)
Interprets an unsigned long value in a byte string pointed to by str.
void qsort_r(void *a, size_t n, size_t es, void *thunk, int(*cmp)(void *, const void *, const void *))
Sorts the given array pointed to by ptr in ascending order.
void * bsearch(const void *key, const void *ptr, size_t count, size_t size, int(*comp)(const void *, const void *))
Finds an element equal to element pointed to by key in an array pointed to by ptr.
size_t wcstombs(char *__restrict, const wchar_t *__restrict, size_t)
lldiv_t lldiv(long long x, long long y)
Computes both the quotient and the remainder of the division of the numerator x by the denominator y.
Division type for long long integers.
int rand_r(unsigned int *ctx)
int wctomb(char *, wchar_t)
void * realloc(void *ptr, size_t size)
Reallocates the given area of memory.
void qsort(void *a, size_t n, size_t es, int(*compar)(const void *, const void *))
Sorts the given array pointed to by ptr in ascending order.
long strtol(const char *__restrict str, char **__restrict str_end, int base)
Interprets an long value in a byte string pointed to by str.
double atof(const char *str)
Interprets a floating-point value in a byte string pointed to by str.
int atexit(void(*)(void))
long double strtold(const char *__restrict, char **__restrict)
int mbtowc(wchar_t *__restrict, const char *__restrict, size_t)
size_t mbstowcs(wchar_t *__restrict, const char *__restrict, size_t)
int rand(void)
Returns a pseudo-random integer value between 0 and.
div_t div(int x, int y)
Computes both the quotient and the remainder of the division of the numerator x by the denominator y.
void * malloc(size_t size)
Allocates size bytes of uninitialized storage.
void quick_exit(int) __attribute__((noreturn))
void * reallocf(void *ptr, size_t size)
Reallocates the given area of memory.
void exit(int) __attribute__((noreturn))
int cmp(Bigint *a, Bigint *b)
int heapsort(void *vbase, size_t nmemb, size_t size, int(*compar)(const void *, const void *))
Sorts the given array pointed to by vbase in ascending order.
Division type for integers.
int atoi(const char *str)
Interprets an integer value in a byte string pointed to by str.
Division type for maximal integer storage.
void srand(unsigned seed)
Seeds the pseudo-random number generator used by.
imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom)
Computes both the quotient and the remainder of the division of the numerator x by the denominator y.
long long llabs(long long n)
Computes the absolute value of an long long number.
int at_quick_exit(void(*)(void))
double strtod(const char *__restrict str, char **__restrict str_end)
Interprets a floating-point value in a byte string pointed to by str.
int heapsort_r(void *vbase, size_t nmemb, size_t size, void *thunk, int(*compar)(void *, const void *, const void *))
Sorts the given array pointed to by vbase in ascending order.