|
102 | 102 | \rSec2[cstdlib.syn]{Header \tcode{<cstdlib>} synopsis} |
103 | 103 |
|
104 | 104 | \indexheader{cstdlib}% |
105 | | -\indexlibraryglobal{EXIT_FAILURE}% |
106 | | -\indexlibraryglobal{EXIT_SUCCESS}% |
107 | | -\indexlibraryglobal{MB_CUR_MAX}% |
108 | | -\indexlibraryglobal{NULL}% |
109 | | -\indexlibraryglobal{RAND_MAX}% |
110 | | -\indexlibraryglobal{_Exit}% |
111 | | -\indexlibraryglobal{abort}% |
112 | | -\indexlibraryglobal{abs}% |
113 | | -\indexlibraryglobal{aligned_alloc}% |
114 | | -\indexlibraryglobal{at_quick_exit}% |
115 | | -\indexlibraryglobal{atexit}% |
116 | | -\indexlibraryglobal{atof}% |
117 | | -\indexlibraryglobal{atoi}% |
118 | | -\indexlibraryglobal{atol}% |
119 | | -\indexlibraryglobal{atoll}% |
120 | | -\indexlibraryglobal{bsearch}% |
121 | | -\indexlibraryglobal{calloc}% |
122 | | -\indexlibraryglobal{div}% |
123 | | -\indexlibraryglobal{div_t}% |
124 | | -\indexlibraryglobal{exit}% |
125 | | -\indexlibraryglobal{free}% |
126 | | -\indexlibraryglobal{getenv}% |
127 | | -\indexlibraryglobal{labs}% |
128 | | -\indexlibraryglobal{ldiv}% |
129 | | -\indexlibraryglobal{ldiv_t}% |
130 | | -\indexlibraryglobal{llabs}% |
131 | | -\indexlibraryglobal{lldiv}% |
132 | | -\indexlibraryglobal{lldiv_t}% |
133 | | -\indexlibraryglobal{malloc}% |
134 | | -\indexlibraryglobal{mblen}% |
135 | | -\indexlibraryglobal{mbstowcs}% |
136 | | -\indexlibraryglobal{mbtowc}% |
137 | | -\indexlibraryglobal{qsort}% |
138 | | -\indexlibraryglobal{quick_exit}% |
139 | | -\indexlibraryglobal{rand}% |
140 | | -\indexlibraryglobal{realloc}% |
141 | | -\indexlibraryglobal{size_t}% |
142 | | -\indexlibraryglobal{srand}% |
143 | | -\indexlibraryglobal{strtod}% |
144 | | -\indexlibraryglobal{strtof}% |
145 | | -\indexlibraryglobal{strtol}% |
146 | | -\indexlibraryglobal{strtold}% |
147 | | -\indexlibraryglobal{strtoll}% |
148 | | -\indexlibraryglobal{strtoul}% |
149 | | -\indexlibraryglobal{strtoull}% |
150 | | -\indexlibraryglobal{system}% |
151 | | -\indexlibraryglobal{wcstombs}% |
152 | | -\indexlibraryglobal{wctomb}% |
153 | 105 | \begin{codeblock} |
154 | 106 | namespace std { |
155 | | - using size_t = @\seebelow@; // freestanding |
156 | | - using div_t = @\seebelow@; // freestanding |
157 | | - using ldiv_t = @\seebelow@; // freestanding |
158 | | - using lldiv_t = @\seebelow@; // freestanding |
| 107 | + using @\libglobal{size_t}@ = @\seebelow@; // freestanding |
| 108 | + using @\libglobal{div_t}@ = @\seebelow@; // freestanding |
| 109 | + using @\libglobal{ldiv_t}@ = @\seebelow@; // freestanding |
| 110 | + using @\libglobal{lldiv_t}@ = @\seebelow@; // freestanding |
159 | 111 | } |
160 | 112 |
|
161 | | -#define NULL @\seebelow@ // freestanding |
162 | | -#define EXIT_FAILURE @\seebelow@ // freestanding |
163 | | -#define EXIT_SUCCESS @\seebelow@ // freestanding |
164 | | -#define RAND_MAX @\seebelow@ |
165 | | -#define MB_CUR_MAX @\seebelow@ |
| 113 | +#define @\libmacro{NULL}@ @\seebelow@ // freestanding |
| 114 | +#define @\libmacro{EXIT_FAILURE}@ @\seebelow@ // freestanding |
| 115 | +#define @\libmacro{EXIT_SUCCESS}@ @\seebelow@ // freestanding |
| 116 | +#define @\libmacro{RAND_MAX}@ @\seebelow@ |
| 117 | +#define @\libmacro{MB_CUR_MAX}@ @\seebelow@ |
166 | 118 |
|
167 | 119 | namespace std { |
168 | 120 | // Exposition-only function type aliases |
|
181 | 133 | [[noreturn]] void _Exit(int status) noexcept; // freestanding |
182 | 134 | [[noreturn]] void quick_exit(int status) noexcept; // freestanding |
183 | 135 |
|
184 | | - char* getenv(const char* name); |
185 | | - int system(const char* string); |
| 136 | + char* @\libglobal{getenv}@(const char* name); |
| 137 | + int @\libglobal{system}@(const char* string); |
186 | 138 |
|
187 | 139 | // \ref{c.malloc}, C library memory allocation |
188 | 140 | void* aligned_alloc(size_t alignment, size_t size); |
189 | 141 | void* calloc(size_t nmemb, size_t size); |
190 | 142 | void free(void* ptr); |
191 | | - void free_sized(void* ptr, size_t size); |
192 | | - void free_aligned_sized(void* ptr, size_t alignment, size_t size); |
| 143 | + void @\libglobal{free_sized}@(void* ptr, size_t size); |
| 144 | + void @\libglobal{free_aligned_sized}@(void* ptr, size_t alignment, size_t size); |
193 | 145 | void* malloc(size_t size); |
194 | 146 | void* realloc(void* ptr, size_t size); |
195 | | - size_t memalignment(const void* p); // freestanding |
196 | | - |
197 | | - double atof(const char* nptr); |
198 | | - int atoi(const char* nptr); |
199 | | - long int atol(const char* nptr); |
200 | | - long long int atoll(const char* nptr); |
201 | | - double strtod(const char* nptr, char** endptr); |
202 | | - int strfromd(char* s, size_t n, const char* format, double fp); |
203 | | - int strfromf(char* s, size_t n, const char* format, float fp); |
204 | | - int strfroml(char* s, size_t n, const char* format, long double fp); |
205 | | - float strtof(const char* nptr, char** endptr); |
206 | | - long double strtold(const char* nptr, char** endptr); |
207 | | - long int strtol(const char* nptr, char** endptr, int base); |
208 | | - long long int strtoll(const char* nptr, char** endptr, int base); |
209 | | - unsigned long int strtoul(const char* nptr, char** endptr, int base); |
210 | | - unsigned long long int strtoull(const char* nptr, char** endptr, int base); |
| 147 | + size_t @\libglobal{memalignment}@(const void* p); // freestanding |
| 148 | + |
| 149 | + double @\libglobal{atof}@(const char* nptr); |
| 150 | + int @\libglobal{atoi}@(const char* nptr); |
| 151 | + long int @\libglobal{atol}@(const char* nptr); |
| 152 | + long long int @\libglobal{atoll}@(const char* nptr); |
| 153 | + double @\libglobal{strtod}@(const char* nptr, char** endptr); |
| 154 | + int @\libglobal{strfromd}@(char* s, size_t n, const char* format, double fp); |
| 155 | + int @\libglobal{strfromf}@(char* s, size_t n, const char* format, float fp); |
| 156 | + int @\libglobal{strfroml}@(char* s, size_t n, const char* format, long double fp); |
| 157 | + float @\libglobal{strtof}@(const char* nptr, char** endptr); |
| 158 | + long double @\libglobal{strtold}@(const char* nptr, char** endptr); |
| 159 | + long int @\libglobal{strtol}@(const char* nptr, char** endptr, int base); |
| 160 | + long long int @\libglobal{strtoll}@(const char* nptr, char** endptr, int base); |
| 161 | + unsigned long int @\libglobal{strtoul}@(const char* nptr, char** endptr, int base); |
| 162 | + unsigned long long int @\libglobal{strtoull}@(const char* nptr, char** endptr, int base); |
211 | 163 |
|
212 | 164 | // \ref{c.mb.wcs}, multibyte / wide string and character conversion functions |
213 | 165 | int mblen(const char* s, size_t n); |
|
238 | 190 | constexpr long long int abs(long long int j); // freestanding |
239 | 191 | constexpr @\placeholder{floating-point-type}@ abs(@\placeholder{floating-point-type}@ j); // freestanding-deleted |
240 | 192 |
|
241 | | - constexpr long int labs(long int j); // freestanding |
242 | | - constexpr long long int llabs(long long int j); // freestanding |
| 193 | + constexpr long int @\libglobal{labs}@(long int j); // freestanding |
| 194 | + constexpr long long int @\libglobal{llabs}@(long long int j); // freestanding |
243 | 195 |
|
244 | | - constexpr div_t div(int numer, int denom); // freestanding |
| 196 | + constexpr div_t @\libglobal{div}@(int numer, int denom); // freestanding |
245 | 197 | constexpr ldiv_t div(long int numer, long int denom); // freestanding; see \ref{library.c} |
246 | 198 | constexpr lldiv_t div(long long int numer, long long int denom); // freestanding; see \ref{library.c} |
247 | | - constexpr ldiv_t ldiv(long int numer, long int denom); // freestanding |
248 | | - constexpr lldiv_t lldiv(long long int numer, long long int denom); // freestanding |
| 199 | + constexpr ldiv_t @\libglobal{ldiv}@(long int numer, long int denom); // freestanding |
| 200 | + constexpr lldiv_t @\libglobal{lldiv}@(long long int numer, long long int denom); // freestanding |
249 | 201 | } |
250 | 202 | \end{codeblock} |
251 | 203 |
|
|
0 commit comments