annotate lib/stdlib.in.h @ 286:701132971855 2.3

Fixed regression related to force linking a library file
author lost
date Sat, 25 Apr 2009 02:18:06 +0000
parents 2cb097e760a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
1 /* A GNU-like <stdlib.h>.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
2
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
3 Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
4
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
5 This program is free software: you can redistribute it and/or modify
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
8 (at your option) any later version.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
9
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
13 GNU General Public License for more details.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
14
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
17
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
18 #if __GNUC__ >= 3
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
19 @PRAGMA_SYSTEM_HEADER@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
20 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
21
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
22 #if defined __need_malloc_and_calloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
23 /* Special invocation convention inside glibc header files. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
24
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
25 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
26
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
27 #else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
28 /* Normal invocation convention. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
29
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
30 #ifndef _GL_STDLIB_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
31
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
32 /* The include_next requires a split double-inclusion guard. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
33 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
34
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
35 #ifndef _GL_STDLIB_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
36 #define _GL_STDLIB_H
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
37
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
38
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
39 /* Solaris declares getloadavg() in <sys/loadavg.h>. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
40 #if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
41 # include <sys/loadavg.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
42 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
43
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
44 #if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
45 # include <stdint.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
46 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
47
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
48 #if !@HAVE_STRUCT_RANDOM_DATA@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
49 struct random_data
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
50 {
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
51 int32_t *fptr; /* Front pointer. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
52 int32_t *rptr; /* Rear pointer. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
53 int32_t *state; /* Array of state values. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
54 int rand_type; /* Type of random number generator. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
55 int rand_deg; /* Degree of random number generator. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
56 int rand_sep; /* Distance between front and rear. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
57 int32_t *end_ptr; /* Pointer behind state table. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
58 };
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
59 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
60
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
61 /* The definition of GL_LINK_WARNING is copied here. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
62
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
63
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
64 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
65 #ifndef EXIT_SUCCESS
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
66 # define EXIT_SUCCESS 0
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
67 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
68 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
69 with proper operation of xargs. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
70 #ifndef EXIT_FAILURE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
71 # define EXIT_FAILURE 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
72 #elif EXIT_FAILURE != 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
73 # undef EXIT_FAILURE
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
74 # define EXIT_FAILURE 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
75 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
76
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
77
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
78 #ifdef __cplusplus
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
79 extern "C" {
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
80 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
81
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
82
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
83 #if @GNULIB_MALLOC_POSIX@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
84 # if !@HAVE_MALLOC_POSIX@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
85 # undef malloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
86 # define malloc rpl_malloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
87 extern void * malloc (size_t size);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
88 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
89 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
90 # undef malloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
91 # define malloc(s) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
92 (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
93 "use gnulib module malloc-posix for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
94 malloc (s))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
95 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
96
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
97
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
98 #if @GNULIB_REALLOC_POSIX@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
99 # if !@HAVE_REALLOC_POSIX@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
100 # undef realloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
101 # define realloc rpl_realloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
102 extern void * realloc (void *ptr, size_t size);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
103 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
104 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
105 # undef realloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
106 # define realloc(p,s) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
107 (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
108 "use gnulib module realloc-posix for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
109 realloc (p, s))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
110 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
111
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
112
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
113 #if @GNULIB_CALLOC_POSIX@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
114 # if !@HAVE_CALLOC_POSIX@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
115 # undef calloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
116 # define calloc rpl_calloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
117 extern void * calloc (size_t nmemb, size_t size);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
118 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
119 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
120 # undef calloc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
121 # define calloc(n,s) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
122 (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
123 "use gnulib module calloc-posix for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
124 calloc (n, s))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
125 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
126
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
127
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
128 #if @GNULIB_ATOLL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
129 # if !@HAVE_ATOLL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
130 /* Parse a signed decimal integer.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
131 Returns the value of the integer. Errors are not detected. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
132 extern long long atoll (const char *string);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
133 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
134 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
135 # undef atoll
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
136 # define atoll(s) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
137 (GL_LINK_WARNING ("atoll is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
138 "use gnulib module atoll for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
139 atoll (s))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
140 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
141
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
142
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
143 #if @GNULIB_GETLOADAVG@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
144 # if !@HAVE_DECL_GETLOADAVG@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
145 /* Store max(NELEM,3) load average numbers in LOADAVG[].
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
146 The three numbers are the load average of the last 1 minute, the last 5
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
147 minutes, and the last 15 minutes, respectively.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
148 LOADAVG is an array of NELEM numbers. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
149 extern int getloadavg (double loadavg[], int nelem);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
150 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
151 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
152 # undef getloadavg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
153 # define getloadavg(l,n) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
154 (GL_LINK_WARNING ("getloadavg is not portable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
155 "use gnulib module getloadavg for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
156 getloadavg (l, n))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
157 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
158
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
159
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
160 #if @GNULIB_GETSUBOPT@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
161 /* Assuming *OPTIONP is a comma separated list of elements of the form
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
162 "token" or "token=value", getsubopt parses the first of these elements.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
163 If the first element refers to a "token" that is member of the given
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
164 NULL-terminated array of tokens:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
165 - It replaces the comma with a NUL byte, updates *OPTIONP to point past
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
166 the first option and the comma, sets *VALUEP to the value of the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
167 element (or NULL if it doesn't contain an "=" sign),
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
168 - It returns the index of the "token" in the given array of tokens.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
169 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
170 For more details see the POSIX:2001 specification.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
171 http://www.opengroup.org/susv3xsh/getsubopt.html */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
172 # if !@HAVE_GETSUBOPT@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
173 extern int getsubopt (char **optionp, char *const *tokens, char **valuep);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
174 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
175 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
176 # undef getsubopt
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
177 # define getsubopt(o,t,v) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
178 (GL_LINK_WARNING ("getsubopt is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
179 "use gnulib module getsubopt for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
180 getsubopt (o, t, v))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
181 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
182
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
183
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
184 #if @GNULIB_MKDTEMP@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
185 # if !@HAVE_MKDTEMP@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
186 /* Create a unique temporary directory from TEMPLATE.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
187 The last six characters of TEMPLATE must be "XXXXXX";
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
188 they are replaced with a string that makes the directory name unique.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
189 Returns TEMPLATE, or a null pointer if it cannot get a unique name.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
190 The directory is created mode 700. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
191 extern char * mkdtemp (char * /*template*/);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
192 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
193 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
194 # undef mkdtemp
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
195 # define mkdtemp(t) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
196 (GL_LINK_WARNING ("mkdtemp is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
197 "use gnulib module mkdtemp for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
198 mkdtemp (t))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
199 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
200
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
201
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
202 #if @GNULIB_MKSTEMP@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
203 # if @REPLACE_MKSTEMP@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
204 /* Create a unique temporary file from TEMPLATE.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
205 The last six characters of TEMPLATE must be "XXXXXX";
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
206 they are replaced with a string that makes the file name unique.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
207 The file is then created, ensuring it didn't exist before.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
208 The file is created read-write (mask at least 0600 & ~umask), but it may be
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
209 world-readable and world-writable (mask 0666 & ~umask), depending on the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
210 implementation.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
211 Returns the open file descriptor if successful, otherwise -1 and errno
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
212 set. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
213 # define mkstemp rpl_mkstemp
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
214 extern int mkstemp (char * /*template*/);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
215 # else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
216 /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
217 # include <unistd.h>
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
218 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
219 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
220 # undef mkstemp
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
221 # define mkstemp(t) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
222 (GL_LINK_WARNING ("mkstemp is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
223 "use gnulib module mkstemp for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
224 mkstemp (t))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
225 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
226
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
227
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
228 #if @GNULIB_PUTENV@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
229 # if @REPLACE_PUTENV@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
230 # undef putenv
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
231 # define putenv rpl_putenv
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
232 extern int putenv (char *string);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
233 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
234 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
235
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
236
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
237 #if @GNULIB_RANDOM_R@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
238 # if !@HAVE_RANDOM_R@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
239
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
240 # ifndef RAND_MAX
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
241 # define RAND_MAX 2147483647
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
242 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
243
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
244 int srandom_r (unsigned int seed, struct random_data *rand_state);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
245 int initstate_r (unsigned int seed, char *buf, size_t buf_size,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
246 struct random_data *rand_state);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
247 int setstate_r (char *arg_state, struct random_data *rand_state);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
248 int random_r (struct random_data *buf, int32_t *result);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
249 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
250 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
251 # undef random_r
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
252 # define random_r(b,r) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
253 (GL_LINK_WARNING ("random_r is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
254 "use gnulib module random_r for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
255 random_r (b,r))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
256 # undef initstate_r
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
257 # define initstate_r(s,b,sz,r) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
258 (GL_LINK_WARNING ("initstate_r is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
259 "use gnulib module random_r for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
260 initstate_r (s,b,sz,r))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
261 # undef srandom_r
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
262 # define srandom_r(s,r) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
263 (GL_LINK_WARNING ("srandom_r is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
264 "use gnulib module random_r for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
265 srandom_r (s,r))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
266 # undef setstate_r
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
267 # define setstate_r(a,r) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
268 (GL_LINK_WARNING ("setstate_r is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
269 "use gnulib module random_r for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
270 setstate_r (a,r))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
271 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
272
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
273
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
274 #if @GNULIB_RPMATCH@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
275 # if !@HAVE_RPMATCH@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
276 /* Test a user response to a question.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
277 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
278 extern int rpmatch (const char *response);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
279 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
280 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
281 # undef rpmatch
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
282 # define rpmatch(r) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
283 (GL_LINK_WARNING ("rpmatch is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
284 "use gnulib module rpmatch for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
285 rpmatch (r))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
286 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
287
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
288
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
289 #if @GNULIB_SETENV@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
290 # if !@HAVE_SETENV@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
291 /* Set NAME to VALUE in the environment.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
292 If REPLACE is nonzero, overwrite an existing value. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
293 extern int setenv (const char *name, const char *value, int replace);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
294 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
295 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
296
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
297
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
298 #if @GNULIB_UNSETENV@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
299 # if @HAVE_UNSETENV@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
300 # if @VOID_UNSETENV@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
301 /* On some systems, unsetenv() returns void.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
302 This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
303 # define unsetenv(name) ((unsetenv)(name), 0)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
304 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
305 # else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
306 /* Remove the variable NAME from the environment. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
307 extern int unsetenv (const char *name);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
308 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
309 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
310
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
311
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
312 #if @GNULIB_STRTOD@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
313 # if @REPLACE_STRTOD@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
314 # define strtod rpl_strtod
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
315 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
316 # if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
317 /* Parse a double from STRING, updating ENDP if appropriate. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
318 extern double strtod (const char *str, char **endp);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
319 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
320 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
321 # undef strtod
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
322 # define strtod(s, e) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
323 (GL_LINK_WARNING ("strtod is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
324 "use gnulib module strtod for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
325 strtod (s, e))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
326 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
327
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
328
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
329 #if @GNULIB_STRTOLL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
330 # if !@HAVE_STRTOLL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
331 /* Parse a signed integer whose textual representation starts at STRING.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
332 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
333 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
334 "0x").
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
335 If ENDPTR is not NULL, the address of the first byte after the integer is
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
336 stored in *ENDPTR.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
337 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
338 to ERANGE. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
339 extern long long strtoll (const char *string, char **endptr, int base);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
340 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
341 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
342 # undef strtoll
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
343 # define strtoll(s,e,b) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
344 (GL_LINK_WARNING ("strtoll is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
345 "use gnulib module strtoll for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
346 strtoll (s, e, b))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
347 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
348
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
349
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
350 #if @GNULIB_STRTOULL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
351 # if !@HAVE_STRTOULL@
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
352 /* Parse an unsigned integer whose textual representation starts at STRING.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
353 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
354 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
355 "0x").
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
356 If ENDPTR is not NULL, the address of the first byte after the integer is
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
357 stored in *ENDPTR.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
358 Upon overflow, the return value is ULLONG_MAX, and errno is set to
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
359 ERANGE. */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
360 extern unsigned long long strtoull (const char *string, char **endptr, int base);
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
361 # endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
362 #elif defined GNULIB_POSIXCHECK
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
363 # undef strtoull
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
364 # define strtoull(s,e,b) \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
365 (GL_LINK_WARNING ("strtoull is unportable - " \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
366 "use gnulib module strtoull for portability"), \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
367 strtoull (s, e, b))
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
368 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
369
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
370
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
371 #ifdef __cplusplus
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
372 }
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
373 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
374
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
375 #endif /* _GL_STDLIB_H */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
376 #endif /* _GL_STDLIB_H */
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
377 #endif