From Jason Turner

[cstdlib.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjsgz8l2l/{from.md → to.md} +105 -0
tmp/tmpjsgz8l2l/{from.md → to.md} RENAMED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Header `<cstdlib>` synopsis <a id="cstdlib.syn">[[cstdlib.syn]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ using size_t = see below;
6
+ using div_t = see below;
7
+ using ldiv_t = see below;
8
+ using lldiv_t = see below;
9
+ }
10
+
11
+ #define NULL see below
12
+ #define EXIT_FAILURE see below
13
+ #define EXIT_SUCCESS see below
14
+ #define RAND_MAX see below
15
+ #define MB_CUR_MAX see below
16
+
17
+ namespace std {
18
+ // Exposition-only function type aliases
19
+ extern "C" using c-atexit-handler = void(); // exposition only
20
+ extern "C++" using atexit-handler = void(); // exposition only
21
+ extern "C" using c-compare-pred = int(const void*, const void*); // exposition only
22
+ extern "C++" using compare-pred = int(const void*, const void*); // exposition only
23
+
24
+ // [support.start.term], start and termination
25
+ [[noreturn]] void abort() noexcept;
26
+ int atexit(c-atexit-handler* func) noexcept;
27
+ int atexit(atexit-handler* func) noexcept;
28
+ int at_quick_exit(c-atexit-handler* func) noexcept;
29
+ int at_quick_exit(atexit-handler* func) noexcept;
30
+ [[noreturn]] void exit(int status);
31
+ [[noreturn]] void _Exit(int status) noexcept;
32
+ [[noreturn]] void quick_exit(int status) noexcept;
33
+
34
+ char* getenv(const char* name);
35
+ int system(const char* string);
36
+
37
+ // [c.malloc], C library memory allocation
38
+ void* aligned_alloc(size_t alignment, size_t size);
39
+ void* calloc(size_t nmemb, size_t size);
40
+ void free(void* ptr);
41
+ void* malloc(size_t size);
42
+ void* realloc(void* ptr, size_t size);
43
+
44
+ double atof(const char* nptr);
45
+ int atoi(const char* nptr);
46
+ long int atol(const char* nptr);
47
+ long long int atoll(const char* nptr);
48
+ double strtod(const char* nptr, char** endptr);
49
+ float strtof(const char* nptr, char** endptr);
50
+ long double strtold(const char* nptr, char** endptr);
51
+ long int strtol(const char* nptr, char** endptr, int base);
52
+ long long int strtoll(const char* nptr, char** endptr, int base);
53
+ unsigned long int strtoul(const char* nptr, char** endptr, int base);
54
+ unsigned long long int strtoull(const char* nptr, char** endptr, int base);
55
+
56
+ // [c.mb.wcs], multibyte / wide string and character conversion functions
57
+ int mblen(const char* s, size_t n);
58
+ int mbtowc(wchar_t* pwc, const char* s, size_t n);
59
+ int wctomb(char* s, wchar_t wchar);
60
+ size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n);
61
+ size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);
62
+
63
+ // [alg.c.library], C standard library algorithms
64
+ void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
65
+ c-compare-pred* compar);
66
+ void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
67
+ compare-pred* compar);
68
+ void qsort(void* base, size_t nmemb, size_t size, c-compare-pred* compar);
69
+ void qsort(void* base, size_t nmemb, size_t size, compare-pred* compar);
70
+
71
+ // [c.math.rand], low-quality random number generation
72
+ int rand();
73
+ void srand(unsigned int seed);
74
+
75
+ // [c.math.abs], absolute values
76
+ int abs(int j);
77
+ long int abs(long int j);
78
+ long long int abs(long long int j);
79
+ float abs(float j);
80
+ double abs(double j);
81
+ long double abs(long double j);
82
+
83
+ long int labs(long int j);
84
+ long long int llabs(long long int j);
85
+
86
+ div_t div(int numer, int denom);
87
+ ldiv_t div(long int numer, long int denom); // see [library.c]
88
+ lldiv_t div(long long int numer, long long int denom); // see [library.c]
89
+ ldiv_t ldiv(long int numer, long int denom);
90
+ lldiv_t lldiv(long long int numer, long long int denom);
91
+ }
92
+ ```
93
+
94
+ The contents and meaning of the header `<cstdlib>` are the same as the C
95
+ standard library header `<stdlib.h>`, except that it does not declare
96
+ the type `wchar_t`, and except as noted in [[support.types.nullptr]],
97
+ [[support.types.layout]], [[support.start.term]], [[c.malloc]],
98
+ [[c.mb.wcs]], [[alg.c.library]], [[c.math.rand]], and [[c.math.abs]].
99
+
100
+ [*Note 1*: Several functions have additional overloads in this
101
+ International Standard, but they have the same behavior as in the C
102
+ standard library ([[library.c]]). — *end note*]
103
+
104
+ ISO C 7.22
105
+