2 * D header file for POSIX.
4 * Copyright: Public Domain
5 * License: Public Domain
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
9 module stdc.posix.stdlib;
11 private import stdc.posix.config;
12 public import stdc.stdlib;
13 public import stdc.posix.sys.wait;
18 // Required (defined in stdc.stdlib)
35 int atexit(void function());
36 double atof(in char*);
38 c_long atol(in char*);
40 void* bsearch(in void*, in void*, size_t, size_t, int function(in void*, in void*));
41 void* calloc(size_t, size_t);
45 char* getenv(in char*);
47 ldiv_t ldiv(c_long, c_long);
49 lldiv_t lldiv(long, long);
51 int mblen(in char*, size_t);
52 size_t mbstowcs(wchar_t*, in char*, size_t);
53 int mbtowc(wchar_t*, in char*, size_t);
54 void qsort(void*, size_t, size_t, int function(in void*, in void*));
56 void* realloc(void*, size_t);
58 double strtod(in char*, char**);
59 float strtof(in char*, char**);
60 c_long strtol(in char*, char**, int);
61 real strtold(in char*, char**);
62 long strtoll(in char*, char**, int);
63 c_ulong strtoul(in char*, char**, int);
64 ulong strtoull(in char*, char**, int);
66 size_t wcstombs(char*, in wchar_t*, size_t);
67 int wctomb(char*, wchar_t);
71 // Advisory Information (ADV)
74 int posix_memalign(void**, size_t, size_t);
79 int posix_memalign(void**, size_t, size_t);
86 int setenv(in char*, in char*, int);
87 int unsetenv(in char*);
92 int setenv(in char*, in char*, int);
93 int unsetenv(in char*);
95 void* valloc(size_t); // LEGACY non-standard
97 else version( darwin )
99 int setenv(in char*, in char*, int);
100 int unsetenv(in char*);
102 void* valloc(size_t); // LEGACY non-standard
104 else version( freebsd )
106 int setenv(in char*, in char*, int);
107 int unsetenv(in char*);
109 void* valloc(size_t); // LEGACY non-standard
113 // Thread-Safe Functions (TSF)
123 else version( darwin )
127 else version( freebsd )
136 WNOHANG (defined in stdc.posix.sys.wait)
137 WUNTRACED (defined in stdc.posix.sys.wait)
138 WEXITSTATUS (defined in stdc.posix.sys.wait)
139 WIFEXITED (defined in stdc.posix.sys.wait)
140 WIFSIGNALED (defined in stdc.posix.sys.wait)
141 WIFSTOPPED (defined in stdc.posix.sys.wait)
142 WSTOPSIG (defined in stdc.posix.sys.wait)
143 WTERMSIG (defined in stdc.posix.sys.wait)
145 c_long a64l(in char*);
147 char* ecvt(double, int, int *, int *); // LEGACY
148 double erand48(ushort[3]);
149 char* fcvt(double, int, int *, int *); // LEGACY
150 char* gcvt(double, int, char*); // LEGACY
151 // per spec: int getsubopt(char** char* const*, char**);
152 int getsubopt(char**, in char**, char**);
154 char* initstate(uint, char*, size_t);
155 c_long jrand48(ushort[3]);
157 void lcong48(ushort[7]);
159 char* mktemp(char*); // LEGACY
162 c_long nrand48(ushort[3]);
163 int posix_openpt(int);
167 char* realpath(in char*, char*);
168 ushort seed48(ushort[3]);
169 void setkey(in char*);
170 char* setstate(in char*);
171 void srand48(c_long);
178 //WNOHANG (defined in stdc.posix.sys.wait)
179 //WUNTRACED (defined in stdc.posix.sys.wait)
180 //WEXITSTATUS (defined in stdc.posix.sys.wait)
181 //WIFEXITED (defined in stdc.posix.sys.wait)
182 //WIFSIGNALED (defined in stdc.posix.sys.wait)
183 //WIFSTOPPED (defined in stdc.posix.sys.wait)
184 //WSTOPSIG (defined in stdc.posix.sys.wait)
185 //WTERMSIG (defined in stdc.posix.sys.wait)
187 c_long a64l(in char*);
189 char* ecvt(double, int, int *, int *); // LEGACY
190 double erand48(ushort[3]);
191 char* fcvt(double, int, int *, int *); // LEGACY
192 char* gcvt(double, int, char*); // LEGACY
193 int getsubopt(char**, in char**, char**);
195 char* initstate(uint, char*, size_t);
196 c_long jrand48(ushort[3]);
198 void lcong48(ushort[7]);
200 char* mktemp(char*); // LEGACY
201 //int mkstemp(char*);
203 c_long nrand48(ushort[3]);
204 int posix_openpt(int);
208 char* realpath(in char*, char*);
209 ushort seed48(ushort[3]);
210 void setkey(in char*);
211 char* setstate(in char*);
212 void srand48(c_long);
216 static if( __USE_LARGEFILE64 )
218 int mkstemp64(char*);
219 alias mkstemp64 mkstemp;
226 else version( darwin )
228 //WNOHANG (defined in stdc.posix.sys.wait)
229 //WUNTRACED (defined in stdc.posix.sys.wait)
230 //WEXITSTATUS (defined in stdc.posix.sys.wait)
231 //WIFEXITED (defined in stdc.posix.sys.wait)
232 //WIFSIGNALED (defined in stdc.posix.sys.wait)
233 //WIFSTOPPED (defined in stdc.posix.sys.wait)
234 //WSTOPSIG (defined in stdc.posix.sys.wait)
235 //WTERMSIG (defined in stdc.posix.sys.wait)
237 c_long a64l(in char*);
239 char* ecvt(double, int, int *, int *); // LEGACY
240 double erand48(ushort[3]);
241 char* fcvt(double, int, int *, int *); // LEGACY
242 char* gcvt(double, int, char*); // LEGACY
243 int getsubopt(char**, in char**, char**);
245 char* initstate(uint, char*, size_t);
246 c_long jrand48(ushort[3]);
248 void lcong48(ushort[7]);
250 char* mktemp(char*); // LEGACY
253 c_long nrand48(ushort[3]);
254 int posix_openpt(int);
258 char* realpath(in char*, char*);
259 ushort seed48(ushort[3]);
260 void setkey(in char*);
261 char* setstate(in char*);
262 void srand48(c_long);
266 else version( freebsd )
268 //WNOHANG (defined in stdc.posix.sys.wait)
269 //WUNTRACED (defined in stdc.posix.sys.wait)
270 //WEXITSTATUS (defined in stdc.posix.sys.wait)
271 //WIFEXITED (defined in stdc.posix.sys.wait)
272 //WIFSIGNALED (defined in stdc.posix.sys.wait)
273 //WIFSTOPPED (defined in stdc.posix.sys.wait)
274 //WSTOPSIG (defined in stdc.posix.sys.wait)
275 //WTERMSIG (defined in stdc.posix.sys.wait)
277 c_long a64l(in char*);
279 //char* ecvt(double, int, int *, int *); // LEGACY
280 double erand48(ushort[3]);
281 //char* fcvt(double, int, int *, int *); // LEGACY
282 //char* gcvt(double, int, char*); // LEGACY
283 int getsubopt(char**, in char**, char**);
285 char* initstate(uint, char*, size_t);
286 c_long jrand48(ushort[3]);
288 void lcong48(ushort[7]);
290 char* mktemp(char*); // LEGACY
293 c_long nrand48(ushort[3]);
294 int posix_openpt(int);
298 char* realpath(in char*, char*);
299 ushort seed48(ushort[3]);
300 void setkey(in char*);
301 char* setstate(in char*);
302 void srand48(c_long);