Iros
 
Loading...
Searching...
No Matches
stdlib.h
Go to the documentation of this file.
1#pragma once
2
3#include <ccpp/bits/config.h>
4#include <ccpp/bits/null.h>
5#include <ccpp/bits/size_t.h>
6
7#ifdef __CCPP_COMPAT
8#include <alloca.h>
9#endif
10
12
13#define EXIT_SUCCESS 0
14#define EXIT_FAILURE 1
15
16__CCPP_NORETURN void abort(void);
17
18__CCPP_NORETURN void exit(int __exit_code);
19int atexit(void (*__handler)(void));
20
21#ifdef __CCPP_C11
22__CCPP_NORETURN void quick_exit(int __exit_code);
23int at_quick_exit(void (*__handler)(void));
24#endif
25
26#ifdef __CCPP_C99
27__CCPP_NORETURN void _Exit(int __exit_code);
28#endif
29
30typedef struct {
31 int quot;
32 int rem;
33} div_t;
34
35typedef struct {
36 long quot;
37 long rem;
38} ldiv_t;
39
40#ifdef __CCPP_C99
41typedef struct {
42 long long quot;
43 long long rem;
44} lldiv_t;
45#endif
46
47div_t div(int __x, int __y);
48ldiv_t ldiv(long __x, long __y);
49#ifdef __CCPP_C99
50lldiv_t lldiv(long long __x, long long __y);
51#endif
52
53int abs(int __value);
54long labs(long __value);
55#ifdef __CCPP_C99
56long long llabs(long long __value);
57#endif
58
59void* malloc(size_t __size);
60void* calloc(size_t __count, size_t __size);
61void* realloc(void* __pointer, size_t __new_size);
62void free(void* __pointer);
63
64#ifdef __CCPP_C11
65void* aligned_alloc(size_t __alignment, size_t __size);
66#endif
67
68int system(char const* __command);
69char* getenv(char const* __name);
70
71int atoi(char const* __string);
72long atol(char const* __string);
73#ifdef __CCPP_C99
74long long atoll(char const* __string);
75#endif
76
77long strtol(char const* __CCPP_RESTRICT __string, char** __CCPP_RESTRICT __end, int __radix);
78#ifdef __CCPP_C99
79long long strtoll(char const* __CCPP_RESTRICT __string, char** __CCPP_RESTRICT __end, int __radix);
80#endif
81
82unsigned long strtoul(char const* __CCPP_RESTRICT __string, char** __CCPP_RESTRICT __end, int __radix);
83#ifdef __CCPP_C99
84unsigned long long strtoull(char const* __CCPP_RESTRICT __string, char** __CCPP_RESTRICT __end, int __radix);
85#endif
86
87double atof(char const* __string);
88
89#ifdef __CCPP_C99
90float strtof(char const* __CCPP_RESTRICT __string, char** __CCPP_RESTRICT __end);
91#endif
92double strtod(char const* __CCPP_RESTRICT __string, char** __CCPP_RESTRICT __end);
93#ifdef __CCPP_C99
94long double strtold(char const* __CCPP_RESTRICT __string, char** __CCPP_RESTRICT __end);
95#endif
96
97#define RAND_MAX 32767
98int rand(void);
99void srand(unsigned __seed);
100
101void qsort(void* __ptr, size_t __count, size_t __size, int (*__comp)(void const*, void const*));
102void* bsearch(void const* __key, void const* __ptr, size_t __count, size_t __size,
103 int (*__comp)(void const*, void const*));
104
auto aligned_alloc(size_t alignment, size_t size) -> void *
Definition aligned_alloc.cpp:8
auto atoll(char const *string) -> long long
Definition atoll.cpp:4
#define __CCPP_NORETURN
Definition config.h:54
#define __CCPP_RESTRICT
Definition config.h:62
#define __CCPP_END_DECLARATIONS
Definition config.h:8
#define __CCPP_BEGIN_DECLARATIONS
Definition config.h:7
void * bsearch(void const *__key, void const *__ptr, size_t __count, size_t __size, int(*__comp)(void const *, void const *))
void srand(unsigned __seed)
__CCPP_NORETURN void exit(int __exit_code)
Definition exit.cpp:5
long atol(char const *__string)
Definition atol.cpp:4
void qsort(void *__ptr, size_t __count, size_t __size, int(*__comp)(void const *, void const *))
int atoi(char const *__string)
Definition atoi.cpp:4
int abs(int __value)
__CCPP_NORETURN void abort(void)
Definition abort.cpp:6
int atexit(void(*__handler)(void))
ldiv_t ldiv(long __x, long __y)
double atof(char const *__string)
int system(char const *__command)
div_t div(int __x, int __y)
void * realloc(void *__pointer, size_t __new_size)
Definition realloc.cpp:6
long strtol(char const *__CCPP_RESTRICT __string, char **__CCPP_RESTRICT __end, int __radix)
void * malloc(size_t __size)
Definition malloc.cpp:5
unsigned long strtoul(char const *__CCPP_RESTRICT __string, char **__CCPP_RESTRICT __end, int __radix)
void free(void *__pointer)
Definition free.cpp:7
char * getenv(char const *__name)
Definition getenv.cpp:3
int rand(void)
void * calloc(size_t __count, size_t __size)
Definition calloc.cpp:7
long labs(long __value)
double strtod(char const *__CCPP_RESTRICT __string, char **__CCPP_RESTRICT __end)
auto strtoll(char const *__restrict string, char **__restrict end, int radix) -> long long
Definition strtoll.cpp:4
auto strtoull(char const *__restrict string, char **__restrict end, int radix) -> unsigned long long
Definition strtoull.cpp:4
Definition stdlib.h:30
int quot
Definition stdlib.h:31
int rem
Definition stdlib.h:32
Definition stdlib.h:35
long rem
Definition stdlib.h:37
long quot
Definition stdlib.h:36