Mercurial > hg > octave-shane > gnulib-hg
annotate lib/stdlib.in.h @ 12476:4d9ecf602cb6
getsubopt: work around cygwin bug
On cygwin, compiling with -DGNULIB_POSIXCHECK failed because
the getsubopt link warning definition interfered with the
inclusion of the system header. The fix, as always in these
types of problems, is to ensure that system headers are
completely included before doing any overrides.
* lib/stdlib.in.h (includes): Move unistd inclusion sooner, to
avoid conflicting with system getsubopt.
* doc/posix-functions/getsubopt.texi (getsubopt): Document the
bug.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Mon, 21 Dec 2009 11:14:18 -0700 |
parents | f7842310a565 |
children | 9bd9b7a4b42b |
rev | line source |
---|---|
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* A GNU-like <stdlib.h>. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2 |
11086
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
3 Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc. |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9263
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9263
diff
changeset
|
7 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9263
diff
changeset
|
8 (at your option) any later version. |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 GNU General Public License for more details. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU General Public License |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9263
diff
changeset
|
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
18 #if __GNUC__ >= 3 |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10001
diff
changeset
|
19 @PRAGMA_SYSTEM_HEADER@ |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10375
diff
changeset
|
20 #endif |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
10001
diff
changeset
|
21 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 #if defined __need_malloc_and_calloc |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 /* Special invocation convention inside glibc header files. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 #else |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 /* Normal invocation convention. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 #ifndef _GL_STDLIB_H |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 /* The include_next requires a split double-inclusion guard. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 #ifndef _GL_STDLIB_H |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 #define _GL_STDLIB_H |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 |
11832
ff3dd373542b
stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents:
11086
diff
changeset
|
38 /* NetBSD 5.0 mis-defines NULL. */ |
ff3dd373542b
stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents:
11086
diff
changeset
|
39 #include <stddef.h> |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
41 /* Solaris declares getloadavg() in <sys/loadavg.h>. */ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
42 #if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
43 # include <sys/loadavg.h> |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
44 #endif |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
45 |
11086
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
46 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included |
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
47 from <stdlib.h> if _REENTRANT is defined. Include it always. */ |
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
48 #if @HAVE_RANDOM_H@ |
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
49 # include <random.h> |
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
50 #endif |
77f9dee073d2
Avoid redefining 'struct random_data' on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
10975
diff
changeset
|
51 |
10719
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
52 #if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ |
10711
e161b51e4184
Use stdint.h, for int32_t.
Simon Josefsson <simon@josefsson.org>
parents:
10704
diff
changeset
|
53 # include <stdint.h> |
e161b51e4184
Use stdint.h, for int32_t.
Simon Josefsson <simon@josefsson.org>
parents:
10704
diff
changeset
|
54 #endif |
e161b51e4184
Use stdint.h, for int32_t.
Simon Josefsson <simon@josefsson.org>
parents:
10704
diff
changeset
|
55 |
10719
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
56 #if !@HAVE_STRUCT_RANDOM_DATA@ |
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
57 struct random_data |
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
58 { |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
59 int32_t *fptr; /* Front pointer. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
60 int32_t *rptr; /* Rear pointer. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
61 int32_t *state; /* Array of state values. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
62 int rand_type; /* Type of random number generator. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
63 int rand_deg; /* Degree of random number generator. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
64 int rand_sep; /* Distance between front and rear. */ |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
65 int32_t *end_ptr; /* Pointer behind state table. */ |
10719
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
66 }; |
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
67 #endif |
620520e8b04c
stdlib: Provide struct random_data.
Simon Josefsson <simon@josefsson.org>
parents:
10711
diff
changeset
|
68 |
12476
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
69 #if @GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK |
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
70 /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */ |
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
71 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */ |
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
72 # include <unistd.h> |
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
73 #endif |
4d9ecf602cb6
getsubopt: work around cygwin bug
Eric Blake <ebb9@byu.net>
parents:
12422
diff
changeset
|
74 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
75 /* The definition of GL_LINK_WARNING is copied here. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
76 |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
77 /* The definition of _GL_ARG_NONNULL is copied here. */ |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
78 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
79 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
80 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
81 #ifndef EXIT_SUCCESS |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
82 # define EXIT_SUCCESS 0 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
83 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
84 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
85 with proper operation of xargs. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
86 #ifndef EXIT_FAILURE |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
87 # define EXIT_FAILURE 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
88 #elif EXIT_FAILURE != 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
89 # undef EXIT_FAILURE |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
90 # define EXIT_FAILURE 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
91 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
92 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
93 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
94 #ifdef __cplusplus |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
95 extern "C" { |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
96 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
97 |
11997 | 98 #if @GNULIB_ATOLL@ |
99 # if !@HAVE_ATOLL@ | |
100 /* Parse a signed decimal integer. | |
101 Returns the value of the integer. Errors are not detected. */ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
102 extern long long atoll (const char *string) _GL_ARG_NONNULL ((1)); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
103 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
104 #elif defined GNULIB_POSIXCHECK |
11997 | 105 # undef atoll |
106 # define atoll(s) \ | |
107 (GL_LINK_WARNING ("atoll is unportable - " \ | |
108 "use gnulib module atoll for portability"), \ | |
109 atoll (s)) | |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
110 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
111 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
112 #if @GNULIB_CALLOC_POSIX@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
113 # if !@HAVE_CALLOC_POSIX@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
114 # undef calloc |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
115 # define calloc rpl_calloc |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
116 extern void * calloc (size_t nmemb, size_t size); |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
117 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
118 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
119 # undef calloc |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
120 # define calloc(n,s) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
121 (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 "use gnulib module calloc-posix for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 calloc (n, s)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
124 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
125 |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
126 #if @GNULIB_CANONICALIZE_FILE_NAME@ |
12018
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
127 # if @REPLACE_CANONICALIZE_FILE_NAME@ |
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
128 # define canonicalize_file_name rpl_canonicalize_file_name |
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
129 # endif |
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
130 # if !@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
131 extern char *canonicalize_file_name (const char *name) _GL_ARG_NONNULL ((1)); |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
132 # endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
133 #elif defined GNULIB_POSIXCHECK |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
134 # undef canonicalize_file_name |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
135 # define canonicalize_file_name(n) \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
136 (GL_LINK_WARNING ("canonicalize_file_name is unportable - " \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
137 "use gnulib module canonicalize-lgpl for portability"), \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
138 canonicalize_file_name (n)) |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
139 #endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
140 |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
141 #if @GNULIB_GETLOADAVG@ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
142 # if !@HAVE_DECL_GETLOADAVG@ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
143 /* Store max(NELEM,3) load average numbers in LOADAVG[]. |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
144 The three numbers are the load average of the last 1 minute, the last 5 |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
145 minutes, and the last 15 minutes, respectively. |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
146 LOADAVG is an array of NELEM numbers. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
147 extern int getloadavg (double loadavg[], int nelem) _GL_ARG_NONNULL ((1)); |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
148 # endif |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
149 #elif defined GNULIB_POSIXCHECK |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
150 # undef getloadavg |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
151 # define getloadavg(l,n) \ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
152 (GL_LINK_WARNING ("getloadavg is not portable - " \ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
153 "use gnulib module getloadavg for portability"), \ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
154 getloadavg (l, n)) |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
155 #endif |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
156 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
157 #if @GNULIB_GETSUBOPT@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
158 /* Assuming *OPTIONP is a comma separated list of elements of the form |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
159 "token" or "token=value", getsubopt parses the first of these elements. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
160 If the first element refers to a "token" that is member of the given |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
161 NULL-terminated array of tokens: |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
162 - It replaces the comma with a NUL byte, updates *OPTIONP to point past |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
163 the first option and the comma, sets *VALUEP to the value of the |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
164 element (or NULL if it doesn't contain an "=" sign), |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
165 - It returns the index of the "token" in the given array of tokens. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
166 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
167 For more details see the POSIX:2001 specification. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
168 http://www.opengroup.org/susv3xsh/getsubopt.html */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
169 # if !@HAVE_GETSUBOPT@ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
170 extern int getsubopt (char **optionp, char *const *tokens, char **valuep) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
171 _GL_ARG_NONNULL ((1, 2, 3)); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
172 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
174 # undef getsubopt |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
175 # define getsubopt(o,t,v) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
176 (GL_LINK_WARNING ("getsubopt is unportable - " \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
177 "use gnulib module getsubopt for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
178 getsubopt (o, t, v)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
179 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
180 |
11997 | 181 #if @GNULIB_MALLOC_POSIX@ |
182 # if !@HAVE_MALLOC_POSIX@ | |
183 # undef malloc | |
184 # define malloc rpl_malloc | |
185 extern void * malloc (size_t size); | |
186 # endif | |
187 #elif defined GNULIB_POSIXCHECK | |
188 # undef malloc | |
189 # define malloc(s) \ | |
190 (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ | |
191 "use gnulib module malloc-posix for portability"), \ | |
192 malloc (s)) | |
193 #endif | |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
194 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
195 #if @GNULIB_MKDTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
196 # if !@HAVE_MKDTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
197 /* Create a unique temporary directory from TEMPLATE. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
198 The last six characters of TEMPLATE must be "XXXXXX"; |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
199 they are replaced with a string that makes the directory name unique. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
200 Returns TEMPLATE, or a null pointer if it cannot get a unique name. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
201 The directory is created mode 700. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
202 extern char * mkdtemp (char * /*template*/) _GL_ARG_NONNULL ((1)); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
203 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
204 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
205 # undef mkdtemp |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
206 # define mkdtemp(t) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
207 (GL_LINK_WARNING ("mkdtemp is unportable - " \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
208 "use gnulib module mkdtemp for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
209 mkdtemp (t)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
210 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
211 |
11882 | 212 #if @GNULIB_MKOSTEMP@ |
213 # if !@HAVE_MKOSTEMP@ | |
214 /* Create a unique temporary file from TEMPLATE. | |
215 The last six characters of TEMPLATE must be "XXXXXX"; | |
216 they are replaced with a string that makes the file name unique. | |
217 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) | |
218 and O_TEXT, O_BINARY (defined in "binary-io.h"). | |
219 The file is then created, with the specified flags, ensuring it didn't exist | |
220 before. | |
221 The file is created read-write (mask at least 0600 & ~umask), but it may be | |
222 world-readable and world-writable (mask 0666 & ~umask), depending on the | |
223 implementation. | |
224 Returns the open file descriptor if successful, otherwise -1 and errno | |
225 set. */ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
226 extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1)); |
11882 | 227 # endif |
228 #elif defined GNULIB_POSIXCHECK | |
229 # undef mkostemp | |
230 # define mkostemp(t,f) \ | |
231 (GL_LINK_WARNING ("mkostemp is unportable - " \ | |
232 "use gnulib module mkostemp for portability"), \ | |
233 mkostemp (t, f)) | |
234 #endif | |
235 | |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
236 #if @GNULIB_MKOSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
237 # if !@HAVE_MKOSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
238 /* Create a unique temporary file from TEMPLATE. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
239 The last six characters of TEMPLATE before a suffix of length |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
240 SUFFIXLEN must be "XXXXXX"; |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
241 they are replaced with a string that makes the file name unique. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
242 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
243 and O_TEXT, O_BINARY (defined in "binary-io.h"). |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
244 The file is then created, with the specified flags, ensuring it didn't exist |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
245 before. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
246 The file is created read-write (mask at least 0600 & ~umask), but it may be |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
247 world-readable and world-writable (mask 0666 & ~umask), depending on the |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
248 implementation. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
249 Returns the open file descriptor if successful, otherwise -1 and errno |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
250 set. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
251 extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
252 _GL_ARG_NONNULL ((1)); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
253 # endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
254 #elif defined GNULIB_POSIXCHECK |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
255 # undef mkostemps |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
256 # define mkostemps(t,s,f) \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
257 (GL_LINK_WARNING ("mkostemps is unportable - " \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
258 "use gnulib module mkostemps for portability"), \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
259 mkostemps (t, s, f)) |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
260 #endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
261 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
262 #if @GNULIB_MKSTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
263 # if @REPLACE_MKSTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
264 /* Create a unique temporary file from TEMPLATE. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
265 The last six characters of TEMPLATE must be "XXXXXX"; |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
266 they are replaced with a string that makes the file name unique. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
267 The file is then created, ensuring it didn't exist before. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
268 The file is created read-write (mask at least 0600 & ~umask), but it may be |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
269 world-readable and world-writable (mask 0666 & ~umask), depending on the |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
270 implementation. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
271 Returns the open file descriptor if successful, otherwise -1 and errno |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
272 set. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
273 # define mkstemp rpl_mkstemp |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
274 extern int mkstemp (char * /*template*/) _GL_ARG_NONNULL ((1)); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
275 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
276 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
277 # undef mkstemp |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
278 # define mkstemp(t) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
279 (GL_LINK_WARNING ("mkstemp is unportable - " \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
280 "use gnulib module mkstemp for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
281 mkstemp (t)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
282 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
283 |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
284 #if @GNULIB_MKSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
285 # if !@HAVE_MKSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
286 /* Create a unique temporary file from TEMPLATE. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
287 The last six characters of TEMPLATE prior to a suffix of length |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
288 SUFFIXLEN must be "XXXXXX"; |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
289 they are replaced with a string that makes the file name unique. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
290 The file is then created, ensuring it didn't exist before. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
291 The file is created read-write (mask at least 0600 & ~umask), but it may be |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
292 world-readable and world-writable (mask 0666 & ~umask), depending on the |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
293 implementation. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
294 Returns the open file descriptor if successful, otherwise -1 and errno |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
295 set. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
296 extern int mkstemps (char * /*template*/, int /*suffixlen*/) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
297 _GL_ARG_NONNULL ((1)); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
298 # endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
299 #elif defined GNULIB_POSIXCHECK |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
300 # undef mkstemps |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
301 # define mkstemps(t,s) \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
302 (GL_LINK_WARNING ("mkstemps is unportable - " \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
303 "use gnulib module mkstemps for portability"), \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
304 mkstemps (t, s)) |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
305 #endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
306 |
9434
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
307 #if @GNULIB_PUTENV@ |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
308 # if @REPLACE_PUTENV@ |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
309 # undef putenv |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
310 # define putenv rpl_putenv |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
311 extern int putenv (char *string) _GL_ARG_NONNULL ((1)); |
9434
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
312 # endif |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
313 #endif |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
314 |
10704 | 315 #if @GNULIB_RANDOM_R@ |
316 # if !@HAVE_RANDOM_R@ | |
317 | |
318 # ifndef RAND_MAX | |
319 # define RAND_MAX 2147483647 | |
320 # endif | |
321 | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
322 int srandom_r (unsigned int seed, struct random_data *rand_state) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
323 _GL_ARG_NONNULL ((2)); |
10704 | 324 int initstate_r (unsigned int seed, char *buf, size_t buf_size, |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
325 struct random_data *rand_state) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
326 _GL_ARG_NONNULL ((2, 4)); |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
327 int setstate_r (char *arg_state, struct random_data *rand_state) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
328 _GL_ARG_NONNULL ((1, 2)); |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
329 int random_r (struct random_data *buf, int32_t *result) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
330 _GL_ARG_NONNULL ((1, 2)); |
10704 | 331 # endif |
332 #elif defined GNULIB_POSIXCHECK | |
333 # undef random_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
334 # define random_r(b,r) \ |
10704 | 335 (GL_LINK_WARNING ("random_r is unportable - " \ |
336 "use gnulib module random_r for portability"), \ | |
337 random_r (b,r)) | |
338 # undef initstate_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
339 # define initstate_r(s,b,sz,r) \ |
10704 | 340 (GL_LINK_WARNING ("initstate_r is unportable - " \ |
341 "use gnulib module random_r for portability"), \ | |
342 initstate_r (s,b,sz,r)) | |
343 # undef srandom_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
344 # define srandom_r(s,r) \ |
10704 | 345 (GL_LINK_WARNING ("srandom_r is unportable - " \ |
346 "use gnulib module random_r for portability"), \ | |
347 srandom_r (s,r)) | |
348 # undef setstate_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
349 # define setstate_r(a,r) \ |
10704 | 350 (GL_LINK_WARNING ("setstate_r is unportable - " \ |
351 "use gnulib module random_r for portability"), \ | |
352 setstate_r (a,r)) | |
353 #endif | |
354 | |
11997 | 355 #if @GNULIB_REALLOC_POSIX@ |
356 # if !@HAVE_REALLOC_POSIX@ | |
357 # undef realloc | |
358 # define realloc rpl_realloc | |
359 extern void * realloc (void *ptr, size_t size); | |
360 # endif | |
361 #elif defined GNULIB_POSIXCHECK | |
362 # undef realloc | |
363 # define realloc(p,s) \ | |
364 (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ | |
365 "use gnulib module realloc-posix for portability"), \ | |
366 realloc (p, s)) | |
367 #endif | |
10704 | 368 |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
369 #if @GNULIB_REALPATH@ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
370 # if @REPLACE_REALPATH@ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
371 # define realpath rpl_realpath |
12016
4fac822214af
canonicalize-lgpl: use native realpath if it works
Eric Blake <ebb9@byu.net>
parents:
12015
diff
changeset
|
372 # endif |
4fac822214af
canonicalize-lgpl: use native realpath if it works
Eric Blake <ebb9@byu.net>
parents:
12015
diff
changeset
|
373 # if !@HAVE_REALPATH@ || @REPLACE_REALPATH@ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
374 extern char *realpath (const char *name, char *resolved) _GL_ARG_NONNULL ((1)); |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
375 # endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
376 #elif defined GNULIB_POSIXCHECK |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
377 # undef realpath |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
378 # define realpath(n,r) \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
379 (GL_LINK_WARNING ("realpath is unportable - use gnulib module " \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
380 "canonicalize or canonicalize-lgpl for portability"), \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
381 realpath (n, r)) |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
382 #endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
383 |
10001 | 384 #if @GNULIB_RPMATCH@ |
385 # if !@HAVE_RPMATCH@ | |
386 /* Test a user response to a question. | |
387 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
388 extern int rpmatch (const char *response) _GL_ARG_NONNULL ((1)); |
10001 | 389 # endif |
390 #elif defined GNULIB_POSIXCHECK | |
391 # undef rpmatch | |
392 # define rpmatch(r) \ | |
393 (GL_LINK_WARNING ("rpmatch is unportable - " \ | |
394 "use gnulib module rpmatch for portability"), \ | |
395 rpmatch (r)) | |
396 #endif | |
397 | |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
398 #if @GNULIB_SETENV@ |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
399 # if @REPLACE_SETENV@ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
400 # undef setenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
401 # define setenv rpl_setenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
402 # endif |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
403 # if !@HAVE_SETENV@ || @REPLACE_SETENV@ |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
404 /* Set NAME to VALUE in the environment. |
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
405 If REPLACE is nonzero, overwrite an existing value. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
406 extern int setenv (const char *name, const char *value, int replace) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
407 _GL_ARG_NONNULL ((1)); |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
408 # endif |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
409 #elif defined GNULIB_POSIXCHECK |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
410 # undef setenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
411 # define setenv(n,v,o) \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
412 (GL_LINK_WARNING ("setenv is unportable - " \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
413 "use gnulib module setenv for portability"), \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
414 setenv (n, v, o)) |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
415 #endif |
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
416 |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
417 #if @GNULIB_STRTOD@ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
418 # if @REPLACE_STRTOD@ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
419 # define strtod rpl_strtod |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
420 # endif |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
421 # if !@HAVE_STRTOD@ || @REPLACE_STRTOD@ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
422 /* Parse a double from STRING, updating ENDP if appropriate. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
423 extern double strtod (const char *str, char **endp) _GL_ARG_NONNULL ((1)); |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
424 # endif |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
425 #elif defined GNULIB_POSIXCHECK |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
426 # undef strtod |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
427 # define strtod(s, e) \ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
428 (GL_LINK_WARNING ("strtod is unportable - " \ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
429 "use gnulib module strtod for portability"), \ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
430 strtod (s, e)) |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
431 #endif |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
432 |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
433 #if @GNULIB_STRTOLL@ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
434 # if !@HAVE_STRTOLL@ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
435 /* Parse a signed integer whose textual representation starts at STRING. |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
436 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
437 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
438 "0x"). |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
439 If ENDPTR is not NULL, the address of the first byte after the integer is |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
440 stored in *ENDPTR. |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
441 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
442 to ERANGE. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
443 extern long long strtoll (const char *string, char **endptr, int base) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
444 _GL_ARG_NONNULL ((1)); |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
445 # endif |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
446 #elif defined GNULIB_POSIXCHECK |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
447 # undef strtoll |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
448 # define strtoll(s,e,b) \ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
449 (GL_LINK_WARNING ("strtoll is unportable - " \ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
450 "use gnulib module strtoll for portability"), \ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
451 strtoll (s, e, b)) |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
452 #endif |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
453 |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
454 #if @GNULIB_STRTOULL@ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
455 # if !@HAVE_STRTOULL@ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
456 /* Parse an unsigned integer whose textual representation starts at STRING. |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
457 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
458 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
459 "0x"). |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
460 If ENDPTR is not NULL, the address of the first byte after the integer is |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
461 stored in *ENDPTR. |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
462 Upon overflow, the return value is ULLONG_MAX, and errno is set to |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
463 ERANGE. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
464 extern unsigned long long strtoull (const char *string, char **endptr, int base) |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
465 _GL_ARG_NONNULL ((1)); |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
466 # endif |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
467 #elif defined GNULIB_POSIXCHECK |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
468 # undef strtoull |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
469 # define strtoull(s,e,b) \ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
470 (GL_LINK_WARNING ("strtoull is unportable - " \ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
471 "use gnulib module strtoull for portability"), \ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
472 strtoull (s, e, b)) |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
473 #endif |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
474 |
11997 | 475 #if @GNULIB_UNSETENV@ |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
476 # if @REPLACE_UNSETENV@ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
477 # undef unsetenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
478 # define unsetenv rpl_unsetenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
479 # endif |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
480 # if !@HAVE_UNSETENV@ || @REPLACE_UNSETENV@ |
11997 | 481 /* Remove the variable NAME from the environment. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
482 extern int unsetenv (const char *name) _GL_ARG_NONNULL ((1)); |
11997 | 483 # endif |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
484 #elif defined GNULIB_POSIXCHECK |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
485 # undef unsetenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
486 # define unsetenv(n) \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
487 (GL_LINK_WARNING ("unsetenv is unportable - " \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
488 "use gnulib module unsetenv for portability"), \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
489 unsetenv (n)) |
11997 | 490 #endif |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
491 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
492 #ifdef __cplusplus |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
493 } |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
494 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
495 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
496 #endif /* _GL_STDLIB_H */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
497 #endif /* _GL_STDLIB_H */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
498 #endif |