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