3a87245eb4272ff29c0bf18bbedbefd3827b755e
[gnulib.git] / lib / stdlib.in.h
1 /* A GNU-like <stdlib.h>.
2
3    Copyright (C) 1995, 2001-2004, 2006-2010 Free Software Foundation, Inc.
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21
22 #if defined __need_malloc_and_calloc
23 /* Special invocation convention inside glibc header files.  */
24
25 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
26
27 #else
28 /* Normal invocation convention.  */
29
30 #ifndef _GL_STDLIB_H
31
32 /* The include_next requires a split double-inclusion guard.  */
33 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
34
35 #ifndef _GL_STDLIB_H
36 #define _GL_STDLIB_H
37
38 /* NetBSD 5.0 mis-defines NULL.  */
39 #include <stddef.h>
40
41 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
42 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
43 # include <sys/loadavg.h>
44 #endif
45
46 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
47    from <stdlib.h> if _REENTRANT is defined.  Include it always.  */
48 #if @HAVE_RANDOM_H@
49 # include <random.h>
50 #endif
51
52 #if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
53     || defined GNULIB_POSIXCHECK
54 # include <stdint.h>
55 #endif
56
57 #if !@HAVE_STRUCT_RANDOM_DATA@
58 struct random_data
59 {
60   int32_t *fptr;                /* Front pointer.  */
61   int32_t *rptr;                /* Rear pointer.  */
62   int32_t *state;               /* Array of state values.  */
63   int rand_type;                /* Type of random number generator.  */
64   int rand_deg;                 /* Degree of random number generator.  */
65   int rand_sep;                 /* Distance between front and rear.  */
66   int32_t *end_ptr;             /* Pointer behind state table.  */
67 };
68 #endif
69
70 #if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
71 /* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
72 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
73 /* But avoid namespace pollution on glibc systems.  */
74 # include <unistd.h>
75 #endif
76
77 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
78
79 /* The definition of _GL_ARG_NONNULL is copied here.  */
80
81 /* The definition of _GL_WARN_ON_USE is copied here.  */
82
83
84 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
85 #ifndef EXIT_SUCCESS
86 # define EXIT_SUCCESS 0
87 #endif
88 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
89    with proper operation of xargs.  */
90 #ifndef EXIT_FAILURE
91 # define EXIT_FAILURE 1
92 #elif EXIT_FAILURE != 1
93 # undef EXIT_FAILURE
94 # define EXIT_FAILURE 1
95 #endif
96
97
98 #if @GNULIB_ATOLL@
99 /* Parse a signed decimal integer.
100    Returns the value of the integer.  Errors are not detected.  */
101 # if !@HAVE_ATOLL@
102 _GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
103 # endif
104 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
105 _GL_CXXALIASWARN (atoll);
106 #elif defined GNULIB_POSIXCHECK
107 # undef atoll
108 # if HAVE_RAW_DECL_ATOLL
109 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
110                  "use gnulib module atoll for portability");
111 # endif
112 #endif
113
114 #if @GNULIB_CALLOC_POSIX@
115 # if !@HAVE_CALLOC_POSIX@
116 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
117 #   undef calloc
118 #   define calloc rpl_calloc
119 #  endif
120 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
121 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
122 # else
123 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
124 # endif
125 _GL_CXXALIASWARN (calloc);
126 #elif defined GNULIB_POSIXCHECK
127 # undef calloc
128 /* Assume calloc is always declared.  */
129 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
130                  "use gnulib module calloc-posix for portability");
131 #endif
132
133 #if @GNULIB_CANONICALIZE_FILE_NAME@
134 # if @REPLACE_CANONICALIZE_FILE_NAME@
135 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
136 #   define canonicalize_file_name rpl_canonicalize_file_name
137 #  endif
138 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
139                                                   _GL_ARG_NONNULL ((1)));
140 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
141 # else
142 #  if !@HAVE_CANONICALIZE_FILE_NAME@
143 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
144                                                   _GL_ARG_NONNULL ((1)));
145 #  endif
146 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
147 # endif
148 _GL_CXXALIASWARN (canonicalize_file_name);
149 #elif defined GNULIB_POSIXCHECK
150 # undef canonicalize_file_name
151 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
152 _GL_WARN_ON_USE (canonicalize_file_name, "canonicalize_file_name is unportable - "
153                  "use gnulib module canonicalize-lgpl for portability");
154 # endif
155 #endif
156
157 #if @GNULIB_GETLOADAVG@
158 /* Store max(NELEM,3) load average numbers in LOADAVG[].
159    The three numbers are the load average of the last 1 minute, the last 5
160    minutes, and the last 15 minutes, respectively.
161    LOADAVG is an array of NELEM numbers.  */
162 # if !@HAVE_DECL_GETLOADAVG@
163 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
164                                    _GL_ARG_NONNULL ((1)));
165 # endif
166 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
167 _GL_CXXALIASWARN (getloadavg);
168 #elif defined GNULIB_POSIXCHECK
169 # undef getloadavg
170 # if HAVE_RAW_DECL_GETLOADAVG
171 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
172                  "use gnulib module getloadavg for portability");
173 # endif
174 #endif
175
176 #if @GNULIB_GETSUBOPT@
177 /* Assuming *OPTIONP is a comma separated list of elements of the form
178    "token" or "token=value", getsubopt parses the first of these elements.
179    If the first element refers to a "token" that is member of the given
180    NULL-terminated array of tokens:
181      - It replaces the comma with a NUL byte, updates *OPTIONP to point past
182        the first option and the comma, sets *VALUEP to the value of the
183        element (or NULL if it doesn't contain an "=" sign),
184      - It returns the index of the "token" in the given array of tokens.
185    Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
186    For more details see the POSIX:2001 specification.
187    http://www.opengroup.org/susv3xsh/getsubopt.html */
188 # if !@HAVE_GETSUBOPT@
189 _GL_FUNCDECL_SYS (getsubopt, int,
190                   (char **optionp, char *const *tokens, char **valuep)
191                   _GL_ARG_NONNULL ((1, 2, 3)));
192 # endif
193 _GL_CXXALIAS_SYS (getsubopt, int,
194                   (char **optionp, char *const *tokens, char **valuep));
195 _GL_CXXALIASWARN (getsubopt);
196 #elif defined GNULIB_POSIXCHECK
197 # undef getsubopt
198 # if HAVE_RAW_DECL_GETSUBOPT
199 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
200                  "use gnulib module getsubopt for portability");
201 # endif
202 #endif
203
204 #if @GNULIB_GRANTPT@
205 /* Change the ownership and access permission of the slave side of the
206    pseudo-terminal whose master side is specified by FD.  */
207 # if !@HAVE_GRANTPT@
208 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
209 # endif
210 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
211 _GL_CXXALIASWARN (grantpt);
212 #elif defined GNULIB_POSIXCHECK
213 # undef grantpt
214 # if HAVE_RAW_DECL_GRANTPT
215 _GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
216                  "use gnulib module grantpt for portability");
217 # endif
218 #endif
219
220 #if @GNULIB_MALLOC_POSIX@
221 # if !@HAVE_MALLOC_POSIX@
222 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
223 #   undef malloc
224 #   define malloc rpl_malloc
225 #  endif
226 _GL_FUNCDECL_RPL (malloc, void *, (size_t size));
227 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
228 # else
229 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
230 # endif
231 _GL_CXXALIASWARN (malloc);
232 #elif defined GNULIB_POSIXCHECK
233 # undef malloc
234 /* Assume malloc is always declared.  */
235 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
236                  "use gnulib module malloc-posix for portability");
237 #endif
238
239 #if @GNULIB_MKDTEMP@
240 /* Create a unique temporary directory from TEMPLATE.
241    The last six characters of TEMPLATE must be "XXXXXX";
242    they are replaced with a string that makes the directory name unique.
243    Returns TEMPLATE, or a null pointer if it cannot get a unique name.
244    The directory is created mode 700.  */
245 # if !@HAVE_MKDTEMP@
246 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
247 # endif
248 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
249 _GL_CXXALIASWARN (mkdtemp);
250 #elif defined GNULIB_POSIXCHECK
251 # undef mkdtemp
252 # if HAVE_RAW_DECL_MKDTEMP
253 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
254                  "use gnulib module mkdtemp for portability");
255 # endif
256 #endif
257
258 #if @GNULIB_MKOSTEMP@
259 /* Create a unique temporary file from TEMPLATE.
260    The last six characters of TEMPLATE must be "XXXXXX";
261    they are replaced with a string that makes the file name unique.
262    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
263    and O_TEXT, O_BINARY (defined in "binary-io.h").
264    The file is then created, with the specified flags, ensuring it didn't exist
265    before.
266    The file is created read-write (mask at least 0600 & ~umask), but it may be
267    world-readable and world-writable (mask 0666 & ~umask), depending on the
268    implementation.
269    Returns the open file descriptor if successful, otherwise -1 and errno
270    set.  */
271 # if !@HAVE_MKOSTEMP@
272 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
273                                  _GL_ARG_NONNULL ((1)));
274 # endif
275 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
276 _GL_CXXALIASWARN (mkostemp);
277 #elif defined GNULIB_POSIXCHECK
278 # undef mkostemp
279 # if HAVE_RAW_DECL_MKOSTEMP
280 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
281                  "use gnulib module mkostemp for portability");
282 # endif
283 #endif
284
285 #if @GNULIB_MKOSTEMPS@
286 /* Create a unique temporary file from TEMPLATE.
287    The last six characters of TEMPLATE before a suffix of length
288    SUFFIXLEN must be "XXXXXX";
289    they are replaced with a string that makes the file name unique.
290    The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
291    and O_TEXT, O_BINARY (defined in "binary-io.h").
292    The file is then created, with the specified flags, ensuring it didn't exist
293    before.
294    The file is created read-write (mask at least 0600 & ~umask), but it may be
295    world-readable and world-writable (mask 0666 & ~umask), depending on the
296    implementation.
297    Returns the open file descriptor if successful, otherwise -1 and errno
298    set.  */
299 # if !@HAVE_MKOSTEMPS@
300 _GL_FUNCDECL_SYS (mkostemps, int,
301                   (char * /*template*/, int /*suffixlen*/, int /*flags*/)
302                   _GL_ARG_NONNULL ((1)));
303 # endif
304 _GL_CXXALIAS_SYS (mkostemps, int,
305                   (char * /*template*/, int /*suffixlen*/, int /*flags*/));
306 _GL_CXXALIASWARN (mkostemps);
307 #elif defined GNULIB_POSIXCHECK
308 # undef mkostemps
309 # if HAVE_RAW_DECL_MKOSTEMPS
310 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
311                  "use gnulib module mkostemps for portability");
312 # endif
313 #endif
314
315 #if @GNULIB_MKSTEMP@
316 /* Create a unique temporary file from TEMPLATE.
317    The last six characters of TEMPLATE must be "XXXXXX";
318    they are replaced with a string that makes the file name unique.
319    The file is then created, ensuring it didn't exist before.
320    The file is created read-write (mask at least 0600 & ~umask), but it may be
321    world-readable and world-writable (mask 0666 & ~umask), depending on the
322    implementation.
323    Returns the open file descriptor if successful, otherwise -1 and errno
324    set.  */
325 # if @REPLACE_MKSTEMP@
326 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
327 #   define mkstemp rpl_mkstemp
328 #  endif
329 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
330 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
331 # else
332 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
333 # endif
334 _GL_CXXALIASWARN (mkstemp);
335 #elif defined GNULIB_POSIXCHECK
336 # undef mkstemp
337 # if HAVE_RAW_DECL_MKSTEMP
338 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
339                  "use gnulib module mkstemp for portability");
340 # endif
341 #endif
342
343 #if @GNULIB_MKSTEMPS@
344 /* Create a unique temporary file from TEMPLATE.
345    The last six characters of TEMPLATE prior to a suffix of length
346    SUFFIXLEN must be "XXXXXX";
347    they are replaced with a string that makes the file name unique.
348    The file is then created, ensuring it didn't exist before.
349    The file is created read-write (mask at least 0600 & ~umask), but it may be
350    world-readable and world-writable (mask 0666 & ~umask), depending on the
351    implementation.
352    Returns the open file descriptor if successful, otherwise -1 and errno
353    set.  */
354 # if !@HAVE_MKSTEMPS@
355 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
356                                  _GL_ARG_NONNULL ((1)));
357 # endif
358 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
359 _GL_CXXALIASWARN (mkstemps);
360 #elif defined GNULIB_POSIXCHECK
361 # undef mkstemps
362 # if HAVE_RAW_DECL_MKSTEMPS
363 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
364                  "use gnulib module mkstemps for portability");
365 # endif
366 #endif
367
368 #if @GNULIB_PTSNAME@
369 /* Return the pathname of the pseudo-terminal slave associated with
370    the master FD is open on, or NULL on errors.  */
371 # if !@HAVE_PTSNAME@
372 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
373 # endif
374 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
375 _GL_CXXALIASWARN (ptsname);
376 #elif defined GNULIB_POSIXCHECK
377 # undef ptsname
378 # if HAVE_RAW_DECL_PTSNAME
379 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
380                  "use gnulib module ptsname for portability");
381 # endif
382 #endif
383
384 #if @GNULIB_PUTENV@
385 # if @REPLACE_PUTENV@
386 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
387 #   undef putenv
388 #   define putenv rpl_putenv
389 #  endif
390 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
391 _GL_CXXALIAS_RPL (putenv, int, (char *string));
392 # else
393 _GL_CXXALIAS_SYS (putenv, int, (char *string));
394 # endif
395 _GL_CXXALIASWARN (putenv);
396 #endif
397
398
399 #if @GNULIB_RANDOM_R@
400 # if !@HAVE_RANDOM_R@
401 #  ifndef RAND_MAX
402 #   define RAND_MAX 2147483647
403 #  endif
404 # endif
405 #endif
406
407 #if @GNULIB_RANDOM_R@
408 # if !@HAVE_RANDOM_R@
409 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
410                                  _GL_ARG_NONNULL ((1, 2)));
411 # endif
412 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
413 _GL_CXXALIASWARN (random_r);
414 #elif defined GNULIB_POSIXCHECK
415 # undef random_r
416 # if HAVE_RAW_DECL_RANDOM_R
417 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
418                  "use gnulib module random_r for portability");
419 # endif
420 #endif
421
422 #if @GNULIB_RANDOM_R@
423 # if !@HAVE_RANDOM_R@
424 _GL_FUNCDECL_SYS (srandom_r, int,
425                   (unsigned int seed, struct random_data *rand_state)
426                   _GL_ARG_NONNULL ((2)));
427 # endif
428 _GL_CXXALIAS_SYS (srandom_r, int,
429                   (unsigned int seed, struct random_data *rand_state));
430 _GL_CXXALIASWARN (srandom_r);
431 #elif defined GNULIB_POSIXCHECK
432 # undef srandom_r
433 # if HAVE_RAW_DECL_SRANDOM_R
434 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
435                  "use gnulib module random_r for portability");
436 # endif
437 #endif
438
439 #if @GNULIB_RANDOM_R@
440 # if !@HAVE_RANDOM_R@
441 _GL_FUNCDECL_SYS (initstate_r, int,
442                   (unsigned int seed, char *buf, size_t buf_size,
443                    struct random_data *rand_state)
444                   _GL_ARG_NONNULL ((2, 4)));
445 # endif
446 _GL_CXXALIAS_SYS (initstate_r, int,
447                   (unsigned int seed, char *buf, size_t buf_size,
448                    struct random_data *rand_state));
449 _GL_CXXALIASWARN (initstate_r);
450 #elif defined GNULIB_POSIXCHECK
451 # undef initstate_r
452 # if HAVE_RAW_DECL_INITSTATE_R
453 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
454                  "use gnulib module random_r for portability");
455 # endif
456 #endif
457
458 #if @GNULIB_RANDOM_R@
459 # if !@HAVE_RANDOM_R@
460 _GL_FUNCDECL_SYS (setstate_r, int,
461                   (char *arg_state, struct random_data *rand_state)
462                   _GL_ARG_NONNULL ((1, 2)));
463 # endif
464 _GL_CXXALIAS_SYS (setstate_r, int,
465                   (char *arg_state, struct random_data *rand_state));
466 _GL_CXXALIASWARN (setstate_r);
467 #elif defined GNULIB_POSIXCHECK
468 # undef setstate_r
469 # if HAVE_RAW_DECL_SETSTATE_R
470 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
471                  "use gnulib module random_r for portability");
472 # endif
473 #endif
474
475
476 #if @GNULIB_REALLOC_POSIX@
477 # if !@HAVE_REALLOC_POSIX@
478 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
479 #   undef realloc
480 #   define realloc rpl_realloc
481 #  endif
482 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
483 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
484 # else
485 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
486 # endif
487 _GL_CXXALIASWARN (realloc);
488 #elif defined GNULIB_POSIXCHECK
489 # undef realloc
490 /* Assume realloc is always declared.  */
491 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
492                  "use gnulib module realloc-posix for portability");
493 #endif
494
495 #if @GNULIB_REALPATH@
496 # if @REPLACE_REALPATH@
497 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
498 #   define realpath rpl_realpath
499 #  endif
500 _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
501                                     _GL_ARG_NONNULL ((1)));
502 _GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
503 # else
504 #  if !@HAVE_REALPATH@
505 _GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
506                                     _GL_ARG_NONNULL ((1)));
507 #  endif
508 _GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
509 # endif
510 _GL_CXXALIASWARN (realpath);
511 #elif defined GNULIB_POSIXCHECK
512 # undef realpath
513 # if HAVE_RAW_DECL_REALPATH
514 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
515                  "canonicalize or canonicalize-lgpl for portability");
516 # endif
517 #endif
518
519 #if @GNULIB_RPMATCH@
520 /* Test a user response to a question.
521    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
522 # if !@HAVE_RPMATCH@
523 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
524 # endif
525 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
526 _GL_CXXALIASWARN (rpmatch);
527 #elif defined GNULIB_POSIXCHECK
528 # undef rpmatch
529 # if HAVE_RAW_DECL_RPMATCH
530 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
531                  "use gnulib module rpmatch for portability");
532 # endif
533 #endif
534
535 #if @GNULIB_SETENV@
536 /* Set NAME to VALUE in the environment.
537    If REPLACE is nonzero, overwrite an existing value.  */
538 # if @REPLACE_SETENV@
539 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
540 #   undef setenv
541 #   define setenv rpl_setenv
542 #  endif
543 _GL_FUNCDECL_RPL (setenv, int,
544                   (const char *name, const char *value, int replace)
545                   _GL_ARG_NONNULL ((1)));
546 _GL_CXXALIAS_RPL (setenv, int,
547                   (const char *name, const char *value, int replace));
548 # else
549 #  if !@HAVE_SETENV@
550 _GL_FUNCDECL_SYS (setenv, int,
551                   (const char *name, const char *value, int replace)
552                   _GL_ARG_NONNULL ((1)));
553 #  endif
554 _GL_CXXALIAS_SYS (setenv, int,
555                   (const char *name, const char *value, int replace));
556 # endif
557 _GL_CXXALIASWARN (setenv);
558 #elif defined GNULIB_POSIXCHECK
559 # undef setenv
560 # if HAVE_RAW_DECL_SETENV
561 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
562                  "use gnulib module setenv for portability");
563 # endif
564 #endif
565
566 #if @GNULIB_STRTOD@
567  /* Parse a double from STRING, updating ENDP if appropriate.  */
568 # if @REPLACE_STRTOD@
569 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
570 #   define strtod rpl_strtod
571 #  endif
572 _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
573                                   _GL_ARG_NONNULL ((1)));
574 _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
575 # else
576 #  if !@HAVE_STRTOD@
577 _GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
578                                   _GL_ARG_NONNULL ((1)));
579 #  endif
580 _GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
581 # endif
582 _GL_CXXALIASWARN (strtod);
583 #elif defined GNULIB_POSIXCHECK
584 # undef strtod
585 # if HAVE_RAW_DECL_STRTOD
586 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
587                  "use gnulib module strtod for portability");
588 # endif
589 #endif
590
591 #if @GNULIB_STRTOLL@
592 /* Parse a signed integer whose textual representation starts at STRING.
593    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
594    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
595    "0x").
596    If ENDPTR is not NULL, the address of the first byte after the integer is
597    stored in *ENDPTR.
598    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
599    to ERANGE.  */
600 # if !@HAVE_STRTOLL@
601 _GL_FUNCDECL_SYS (strtoll, long long,
602                   (const char *string, char **endptr, int base)
603                   _GL_ARG_NONNULL ((1)));
604 # endif
605 _GL_CXXALIAS_SYS (strtoll, long long,
606                   (const char *string, char **endptr, int base));
607 _GL_CXXALIASWARN (strtoll);
608 #elif defined GNULIB_POSIXCHECK
609 # undef strtoll
610 # if HAVE_RAW_DECL_STRTOLL
611 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
612                  "use gnulib module strtoll for portability");
613 # endif
614 #endif
615
616 #if @GNULIB_STRTOULL@
617 /* Parse an unsigned integer whose textual representation starts at STRING.
618    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
619    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
620    "0x").
621    If ENDPTR is not NULL, the address of the first byte after the integer is
622    stored in *ENDPTR.
623    Upon overflow, the return value is ULLONG_MAX, and errno is set to
624    ERANGE.  */
625 # if !@HAVE_STRTOULL@
626 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
627                   (const char *string, char **endptr, int base)
628                   _GL_ARG_NONNULL ((1)));
629 # endif
630 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
631                   (const char *string, char **endptr, int base));
632 _GL_CXXALIASWARN (strtoull);
633 #elif defined GNULIB_POSIXCHECK
634 # undef strtoull
635 # if HAVE_RAW_DECL_STRTOULL
636 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
637                  "use gnulib module strtoull for portability");
638 # endif
639 #endif
640
641 #if @GNULIB_UNLOCKPT@
642 /* Unlock the slave side of the pseudo-terminal whose master side is specified
643    by FD, so that it can be opened.  */
644 # if !@HAVE_UNLOCKPT@
645 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
646 # endif
647 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
648 _GL_CXXALIASWARN (unlockpt);
649 #elif defined GNULIB_POSIXCHECK
650 # undef unlockpt
651 # if HAVE_RAW_DECL_UNLOCKPT
652 _GL_WARN_ON_USE (ptsname, "unlockpt is not portable - "
653                  "use gnulib module unlockpt for portability");
654 # endif
655 #endif
656
657 #if @GNULIB_UNSETENV@
658 /* Remove the variable NAME from the environment.  */
659 # if @REPLACE_UNSETENV@
660 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
661 #   undef unsetenv
662 #   define unsetenv rpl_unsetenv
663 #  endif
664 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
665 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
666 # else
667 #  if !@HAVE_UNSETENV@
668 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
669 #  endif
670 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
671 # endif
672 _GL_CXXALIASWARN (unsetenv);
673 #elif defined GNULIB_POSIXCHECK
674 # undef unsetenv
675 # if HAVE_RAW_DECL_UNSETENV
676 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
677                  "use gnulib module unsetenv for portability");
678 # endif
679 #endif
680
681
682 #endif /* _GL_STDLIB_H */
683 #endif /* _GL_STDLIB_H */
684 #endif