| 1 | /*
|
|---|
| 2 | * SPDX-FileCopyrightText: 2005 Martin Decky
|
|---|
| 3 | *
|
|---|
| 4 | * SPDX-License-Identifier: BSD-3-Clause
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | /** @addtogroup libc
|
|---|
| 8 | * @{
|
|---|
| 9 | */
|
|---|
| 10 | /** @file
|
|---|
| 11 | */
|
|---|
| 12 |
|
|---|
| 13 | #ifndef _LIBC_STDLIB_H_
|
|---|
| 14 | #define _LIBC_STDLIB_H_
|
|---|
| 15 |
|
|---|
| 16 | #include <_bits/size_t.h>
|
|---|
| 17 | #include <_bits/wchar_t.h>
|
|---|
| 18 | #include <_bits/uchar.h>
|
|---|
| 19 | #include <_bits/decls.h>
|
|---|
| 20 | #include <bsearch.h>
|
|---|
| 21 | #include <malloc.h>
|
|---|
| 22 | #include <qsort.h>
|
|---|
| 23 |
|
|---|
| 24 | #define EXIT_SUCCESS 0
|
|---|
| 25 | #define EXIT_FAILURE 1
|
|---|
| 26 |
|
|---|
| 27 | #define RAND_MAX 714025
|
|---|
| 28 |
|
|---|
| 29 | #define MB_CUR_MAX 4
|
|---|
| 30 |
|
|---|
| 31 | __C_DECLS_BEGIN;
|
|---|
| 32 |
|
|---|
| 33 | /** Type returned by the div function */
|
|---|
| 34 | typedef struct {
|
|---|
| 35 | /** Quotient */
|
|---|
| 36 | int quot;
|
|---|
| 37 | /** Remainder */
|
|---|
| 38 | int rem;
|
|---|
| 39 | } div_t;
|
|---|
| 40 |
|
|---|
| 41 | /** Type returned by the ldiv function */
|
|---|
| 42 | typedef struct {
|
|---|
| 43 | /** Quotient */
|
|---|
| 44 | long quot;
|
|---|
| 45 | /** Remainder */
|
|---|
| 46 | long rem;
|
|---|
| 47 | } ldiv_t;
|
|---|
| 48 |
|
|---|
| 49 | /** Type returned by the lldiv function */
|
|---|
| 50 | typedef struct {
|
|---|
| 51 | /** Quotient */
|
|---|
| 52 | long long quot;
|
|---|
| 53 | /** Remainder */
|
|---|
| 54 | long long rem;
|
|---|
| 55 | } lldiv_t;
|
|---|
| 56 |
|
|---|
| 57 | extern long double strtold(const char *, char **);
|
|---|
| 58 |
|
|---|
| 59 | extern int rand(void);
|
|---|
| 60 | extern void srand(unsigned int);
|
|---|
| 61 |
|
|---|
| 62 | extern void abort(void) __attribute__((noreturn));
|
|---|
| 63 | extern int atexit(void (*)(void));
|
|---|
| 64 | extern void exit(int) __attribute__((noreturn));
|
|---|
| 65 | extern void _Exit(int) __attribute__((noreturn));
|
|---|
| 66 | extern int at_quick_exit(void (*)(void));
|
|---|
| 67 | extern void quick_exit(int);
|
|---|
| 68 |
|
|---|
| 69 | extern char *getenv(const char *);
|
|---|
| 70 | extern int system(const char *);
|
|---|
| 71 |
|
|---|
| 72 | extern int abs(int);
|
|---|
| 73 | extern long labs(long);
|
|---|
| 74 | extern long long llabs(long long);
|
|---|
| 75 |
|
|---|
| 76 | extern int atoi(const char *);
|
|---|
| 77 | extern long atol(const char *);
|
|---|
| 78 | extern long long atoll(const char *);
|
|---|
| 79 |
|
|---|
| 80 | extern long strtol(const char *__restrict__, char **__restrict__, int);
|
|---|
| 81 | extern long long strtoll(const char *__restrict__, char **__restrict__, int);
|
|---|
| 82 | extern unsigned long strtoul(const char *__restrict__, char **__restrict__, int);
|
|---|
| 83 | extern unsigned long long strtoull(const char *__restrict__, char **__restrict__, int);
|
|---|
| 84 |
|
|---|
| 85 | extern div_t div(int, int);
|
|---|
| 86 | extern ldiv_t ldiv(long, long);
|
|---|
| 87 | extern lldiv_t lldiv(long long, long long);
|
|---|
| 88 |
|
|---|
| 89 | __C_DECLS_END;
|
|---|
| 90 |
|
|---|
| 91 | #endif
|
|---|
| 92 |
|
|---|
| 93 | /** @}
|
|---|
| 94 | */
|
|---|