Mercurial > hg > octave-shane > gnulib-hg
annotate lib/stdlib.in.h @ 12422:f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 11 Dec 2009 01:15:28 +0100 |
parents | e8d2c6fc33ad |
children | 4d9ecf602cb6 |
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 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
69 /* 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
|
70 |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
71 /* 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
|
72 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
73 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
74 /* 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
|
75 #ifndef EXIT_SUCCESS |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
76 # define EXIT_SUCCESS 0 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
77 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
78 /* 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
|
79 with proper operation of xargs. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
80 #ifndef EXIT_FAILURE |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
81 # define EXIT_FAILURE 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
82 #elif EXIT_FAILURE != 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
83 # undef EXIT_FAILURE |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
84 # define EXIT_FAILURE 1 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
85 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
86 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
87 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
88 #ifdef __cplusplus |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
89 extern "C" { |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
90 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
91 |
11997 | 92 #if @GNULIB_ATOLL@ |
93 # if !@HAVE_ATOLL@ | |
94 /* Parse a signed decimal integer. | |
95 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
|
96 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
|
97 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
98 #elif defined GNULIB_POSIXCHECK |
11997 | 99 # undef atoll |
100 # define atoll(s) \ | |
101 (GL_LINK_WARNING ("atoll is unportable - " \ | |
102 "use gnulib module atoll for portability"), \ | |
103 atoll (s)) | |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
104 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
105 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
106 #if @GNULIB_CALLOC_POSIX@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
107 # if !@HAVE_CALLOC_POSIX@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
108 # undef calloc |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
109 # define calloc rpl_calloc |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
110 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
|
111 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
112 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
113 # undef calloc |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
114 # define calloc(n,s) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
115 (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
|
116 "use gnulib module calloc-posix for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
117 calloc (n, s)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
118 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
119 |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
120 #if @GNULIB_CANONICALIZE_FILE_NAME@ |
12018
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
121 # if @REPLACE_CANONICALIZE_FILE_NAME@ |
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
122 # 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
|
123 # endif |
586fda772b8f
canonicalize-lgpl: fix glibc bug with trailing slash
Eric Blake <ebb9@byu.net>
parents:
12016
diff
changeset
|
124 # 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
|
125 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
|
126 # endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
127 #elif defined GNULIB_POSIXCHECK |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
128 # undef canonicalize_file_name |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
129 # define canonicalize_file_name(n) \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
130 (GL_LINK_WARNING ("canonicalize_file_name is unportable - " \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
131 "use gnulib module canonicalize-lgpl for portability"), \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
132 canonicalize_file_name (n)) |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
133 #endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
134 |
10665
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
135 #if @GNULIB_GETLOADAVG@ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
136 # if !@HAVE_DECL_GETLOADAVG@ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
137 /* 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
|
138 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
|
139 minutes, and the last 15 minutes, respectively. |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
140 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
|
141 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
|
142 # endif |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
143 #elif defined GNULIB_POSIXCHECK |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
144 # undef getloadavg |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
145 # define getloadavg(l,n) \ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
146 (GL_LINK_WARNING ("getloadavg is not portable - " \ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
147 "use gnulib module getloadavg for portability"), \ |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
148 getloadavg (l, n)) |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
149 #endif |
5394a3a10398
Add a getloadavg() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10655
diff
changeset
|
150 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 #if @GNULIB_GETSUBOPT@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
152 /* 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
|
153 "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
|
154 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
|
155 NULL-terminated array of tokens: |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
156 - 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
|
157 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
|
158 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
|
159 - 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
|
160 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
|
161 For more details see the POSIX:2001 specification. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
162 http://www.opengroup.org/susv3xsh/getsubopt.html */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
163 # 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
|
164 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
|
165 _GL_ARG_NONNULL ((1, 2, 3)); |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
166 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
167 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
168 # undef getsubopt |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
169 # define getsubopt(o,t,v) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
170 (GL_LINK_WARNING ("getsubopt is unportable - " \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
171 "use gnulib module getsubopt for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
172 getsubopt (o, t, v)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
174 |
11997 | 175 #if @GNULIB_MALLOC_POSIX@ |
176 # if !@HAVE_MALLOC_POSIX@ | |
177 # undef malloc | |
178 # define malloc rpl_malloc | |
179 extern void * malloc (size_t size); | |
180 # endif | |
181 #elif defined GNULIB_POSIXCHECK | |
182 # undef malloc | |
183 # define malloc(s) \ | |
184 (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ | |
185 "use gnulib module malloc-posix for portability"), \ | |
186 malloc (s)) | |
187 #endif | |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
188 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
189 #if @GNULIB_MKDTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
190 # if !@HAVE_MKDTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
191 /* Create a unique temporary directory from TEMPLATE. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
192 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
|
193 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
|
194 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
|
195 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
|
196 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
|
197 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
198 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
199 # undef mkdtemp |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
200 # define mkdtemp(t) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
201 (GL_LINK_WARNING ("mkdtemp is unportable - " \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
202 "use gnulib module mkdtemp for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
203 mkdtemp (t)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
204 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
205 |
11882 | 206 #if @GNULIB_MKOSTEMP@ |
207 # if !@HAVE_MKOSTEMP@ | |
208 /* Create a unique temporary file from TEMPLATE. | |
209 The last six characters of TEMPLATE must be "XXXXXX"; | |
210 they are replaced with a string that makes the file name unique. | |
211 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>) | |
212 and O_TEXT, O_BINARY (defined in "binary-io.h"). | |
213 The file is then created, with the specified flags, ensuring it didn't exist | |
214 before. | |
215 The file is created read-write (mask at least 0600 & ~umask), but it may be | |
216 world-readable and world-writable (mask 0666 & ~umask), depending on the | |
217 implementation. | |
218 Returns the open file descriptor if successful, otherwise -1 and errno | |
219 set. */ | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
220 extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1)); |
11882 | 221 # endif |
222 #elif defined GNULIB_POSIXCHECK | |
223 # undef mkostemp | |
224 # define mkostemp(t,f) \ | |
225 (GL_LINK_WARNING ("mkostemp is unportable - " \ | |
226 "use gnulib module mkostemp for portability"), \ | |
227 mkostemp (t, f)) | |
228 #endif | |
229 | |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
230 #if @GNULIB_MKOSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
231 # if !@HAVE_MKOSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
232 /* Create a unique temporary file from TEMPLATE. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
233 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
|
234 SUFFIXLEN must be "XXXXXX"; |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
235 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
|
236 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
|
237 and O_TEXT, O_BINARY (defined in "binary-io.h"). |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
238 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
|
239 before. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
240 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
|
241 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
|
242 implementation. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
243 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
|
244 set. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
245 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
|
246 _GL_ARG_NONNULL ((1)); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
247 # endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
248 #elif defined GNULIB_POSIXCHECK |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
249 # undef mkostemps |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
250 # define mkostemps(t,s,f) \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
251 (GL_LINK_WARNING ("mkostemps is unportable - " \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
252 "use gnulib module mkostemps for portability"), \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
253 mkostemps (t, s, f)) |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
254 #endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
255 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
256 #if @GNULIB_MKSTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
257 # if @REPLACE_MKSTEMP@ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
258 /* Create a unique temporary file from TEMPLATE. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
259 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
|
260 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
|
261 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
|
262 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
|
263 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
|
264 implementation. |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
265 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
|
266 set. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
267 # 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
|
268 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
|
269 # else |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
270 /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
271 # include <unistd.h> |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
272 # endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
273 #elif defined GNULIB_POSIXCHECK |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
274 # undef mkstemp |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
275 # define mkstemp(t) \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
276 (GL_LINK_WARNING ("mkstemp is unportable - " \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
277 "use gnulib module mkstemp for portability"), \ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
278 mkstemp (t)) |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
279 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
280 |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
281 #if @GNULIB_MKSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
282 # if !@HAVE_MKSTEMPS@ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
283 /* Create a unique temporary file from TEMPLATE. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
284 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
|
285 SUFFIXLEN must be "XXXXXX"; |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
286 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
|
287 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
|
288 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
|
289 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
|
290 implementation. |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
291 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
|
292 set. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
293 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
|
294 _GL_ARG_NONNULL ((1)); |
12234
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
295 # endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
296 #elif defined GNULIB_POSIXCHECK |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
297 # undef mkstemps |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
298 # define mkstemps(t,s) \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
299 (GL_LINK_WARNING ("mkstemps is unportable - " \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
300 "use gnulib module mkstemps for portability"), \ |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
301 mkstemps (t, s)) |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
302 #endif |
b45701f2ff71
mkstemps, mkostemps: new modules
Eric Blake <ebb9@byu.net>
parents:
12018
diff
changeset
|
303 |
9434
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
304 #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
|
305 # 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
|
306 # undef putenv |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
307 # 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
|
308 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
|
309 # endif |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
310 #endif |
b839560eec9f
Define the putenv substitute in <stdlib.h> rather than in <config.h>.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
311 |
10704 | 312 #if @GNULIB_RANDOM_R@ |
313 # if !@HAVE_RANDOM_R@ | |
314 | |
315 # ifndef RAND_MAX | |
316 # define RAND_MAX 2147483647 | |
317 # endif | |
318 | |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
319 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
|
320 _GL_ARG_NONNULL ((2)); |
10704 | 321 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
|
322 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, 4)); |
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
324 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
|
325 _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
|
326 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
|
327 _GL_ARG_NONNULL ((1, 2)); |
10704 | 328 # endif |
329 #elif defined GNULIB_POSIXCHECK | |
330 # undef random_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
331 # define random_r(b,r) \ |
10704 | 332 (GL_LINK_WARNING ("random_r is unportable - " \ |
333 "use gnulib module random_r for portability"), \ | |
334 random_r (b,r)) | |
335 # undef initstate_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
336 # define initstate_r(s,b,sz,r) \ |
10704 | 337 (GL_LINK_WARNING ("initstate_r is unportable - " \ |
338 "use gnulib module random_r for portability"), \ | |
339 initstate_r (s,b,sz,r)) | |
340 # undef srandom_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
341 # define srandom_r(s,r) \ |
10704 | 342 (GL_LINK_WARNING ("srandom_r is unportable - " \ |
343 "use gnulib module random_r for portability"), \ | |
344 srandom_r (s,r)) | |
345 # undef setstate_r | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12300
diff
changeset
|
346 # define setstate_r(a,r) \ |
10704 | 347 (GL_LINK_WARNING ("setstate_r is unportable - " \ |
348 "use gnulib module random_r for portability"), \ | |
349 setstate_r (a,r)) | |
350 #endif | |
351 | |
11997 | 352 #if @GNULIB_REALLOC_POSIX@ |
353 # if !@HAVE_REALLOC_POSIX@ | |
354 # undef realloc | |
355 # define realloc rpl_realloc | |
356 extern void * realloc (void *ptr, size_t size); | |
357 # endif | |
358 #elif defined GNULIB_POSIXCHECK | |
359 # undef realloc | |
360 # define realloc(p,s) \ | |
361 (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ | |
362 "use gnulib module realloc-posix for portability"), \ | |
363 realloc (p, s)) | |
364 #endif | |
10704 | 365 |
12015
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
366 #if @GNULIB_REALPATH@ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
367 # if @REPLACE_REALPATH@ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
368 # define realpath rpl_realpath |
12016
4fac822214af
canonicalize-lgpl: use native realpath if it works
Eric Blake <ebb9@byu.net>
parents:
12015
diff
changeset
|
369 # endif |
4fac822214af
canonicalize-lgpl: use native realpath if it works
Eric Blake <ebb9@byu.net>
parents:
12015
diff
changeset
|
370 # 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
|
371 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
|
372 # endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
373 #elif defined GNULIB_POSIXCHECK |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
374 # undef realpath |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
375 # define realpath(n,r) \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
376 (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
|
377 "canonicalize or canonicalize-lgpl for portability"), \ |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
378 realpath (n, r)) |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
379 #endif |
9317d4a9ac96
canonicalize, canonicalize-lgpl: use <stdlib.h>
Eric Blake <ebb9@byu.net>
parents:
11997
diff
changeset
|
380 |
10001 | 381 #if @GNULIB_RPMATCH@ |
382 # if !@HAVE_RPMATCH@ | |
383 /* Test a user response to a question. | |
384 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
|
385 extern int rpmatch (const char *response) _GL_ARG_NONNULL ((1)); |
10001 | 386 # endif |
387 #elif defined GNULIB_POSIXCHECK | |
388 # undef rpmatch | |
389 # define rpmatch(r) \ | |
390 (GL_LINK_WARNING ("rpmatch is unportable - " \ | |
391 "use gnulib module rpmatch for portability"), \ | |
392 rpmatch (r)) | |
393 #endif | |
394 | |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
395 #if @GNULIB_SETENV@ |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
396 # if @REPLACE_SETENV@ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
397 # undef setenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
398 # define setenv rpl_setenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
399 # endif |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
400 # 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
|
401 /* 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
|
402 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
|
403 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
|
404 _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
|
405 # endif |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
406 #elif defined GNULIB_POSIXCHECK |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
407 # undef setenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
408 # define setenv(n,v,o) \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
409 (GL_LINK_WARNING ("setenv is unportable - " \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
410 "use gnulib module setenv for portability"), \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
411 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
|
412 #endif |
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
9436
diff
changeset
|
413 |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
414 #if @GNULIB_STRTOD@ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
415 # if @REPLACE_STRTOD@ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
416 # define strtod rpl_strtod |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
417 # endif |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
418 # if !@HAVE_STRTOD@ || @REPLACE_STRTOD@ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
419 /* 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
|
420 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
|
421 # endif |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
422 #elif defined GNULIB_POSIXCHECK |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
423 # undef strtod |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
424 # define strtod(s, e) \ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
425 (GL_LINK_WARNING ("strtod is unportable - " \ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
426 "use gnulib module strtod for portability"), \ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
427 strtod (s, e)) |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
428 #endif |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
9545
diff
changeset
|
429 |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
430 #if @GNULIB_STRTOLL@ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
431 # if !@HAVE_STRTOLL@ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
432 /* 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
|
433 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
|
434 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
|
435 "0x"). |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
436 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
|
437 stored in *ENDPTR. |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
438 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
|
439 to ERANGE. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
440 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
|
441 _GL_ARG_NONNULL ((1)); |
10671
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
442 # endif |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
443 #elif defined GNULIB_POSIXCHECK |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
444 # undef strtoll |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
445 # define strtoll(s,e,b) \ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
446 (GL_LINK_WARNING ("strtoll is unportable - " \ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
447 "use gnulib module strtoll for portability"), \ |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
448 strtoll (s, e, b)) |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
449 #endif |
459974cd8b12
Add strtoll() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10665
diff
changeset
|
450 |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
451 #if @GNULIB_STRTOULL@ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
452 # if !@HAVE_STRTOULL@ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
453 /* 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
|
454 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
|
455 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
|
456 "0x"). |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
457 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
|
458 stored in *ENDPTR. |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
459 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
|
460 ERANGE. */ |
12422
f7842310a565
New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
461 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
|
462 _GL_ARG_NONNULL ((1)); |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
463 # endif |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
464 #elif defined GNULIB_POSIXCHECK |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
465 # undef strtoull |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
466 # define strtoull(s,e,b) \ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
467 (GL_LINK_WARNING ("strtoull is unportable - " \ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
468 "use gnulib module strtoull for portability"), \ |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
469 strtoull (s, e, b)) |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
470 #endif |
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
471 |
11997 | 472 #if @GNULIB_UNSETENV@ |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
473 # if @REPLACE_UNSETENV@ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
474 # undef unsetenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
475 # define unsetenv rpl_unsetenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
476 # endif |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
477 # if !@HAVE_UNSETENV@ || @REPLACE_UNSETENV@ |
11997 | 478 /* 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
|
479 extern int unsetenv (const char *name) _GL_ARG_NONNULL ((1)); |
11997 | 480 # endif |
12300
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
481 #elif defined GNULIB_POSIXCHECK |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
482 # undef unsetenv |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
483 # define unsetenv(n) \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
484 (GL_LINK_WARNING ("unsetenv is unportable - " \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
485 "use gnulib module unsetenv for portability"), \ |
c8288fd3f281
setenv, unsetenv: work around various bugs
Eric Blake <ebb9@byu.net>
parents:
12234
diff
changeset
|
486 unsetenv (n)) |
11997 | 487 #endif |
10672
66414a3e577c
Add strtoull() declaration to <stdlib.h>.
Bruno Haible <bruno@clisp.org>
parents:
10671
diff
changeset
|
488 |
9263
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
489 #ifdef __cplusplus |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
490 } |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
491 #endif |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
492 |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
493 #endif /* _GL_STDLIB_H */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
494 #endif /* _GL_STDLIB_H */ |
bb62a6456893
Rename stdlib_.h to stdlib.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
495 #endif |