Mercurial > projects > ldc
comparison druntime/import/stdc/posix/stdlib.d @ 760:6f33b427bfd1
Seems like hg ignores .di files, so I missed a bunch of stuff. complete druntime should be there now :)
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 12 Nov 2008 00:19:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
759:d3eb054172f9 | 760:6f33b427bfd1 |
---|---|
1 /** | |
2 * D header file for POSIX. | |
3 * | |
4 * Copyright: Public Domain | |
5 * License: Public Domain | |
6 * Authors: Sean Kelly | |
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition | |
8 */ | |
9 module stdc.posix.stdlib; | |
10 | |
11 private import stdc.posix.config; | |
12 public import stdc.stdlib; | |
13 public import stdc.posix.sys.wait; | |
14 | |
15 extern (C): | |
16 | |
17 // | |
18 // Required (defined in stdc.stdlib) | |
19 // | |
20 /* | |
21 EXIT_FAILURE | |
22 EXIT_SUCCESS | |
23 NULL | |
24 RAND_MAX | |
25 MB_CUR_MAX | |
26 div_t | |
27 ldiv_t | |
28 lldiv_t | |
29 size_t | |
30 wchar_t | |
31 | |
32 void _Exit(int); | |
33 void abort(); | |
34 int abs(int); | |
35 int atexit(void function()); | |
36 double atof(in char*); | |
37 int atoi(in char*); | |
38 c_long atol(in char*); | |
39 long atoll(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); | |
42 div_t div(int, int); | |
43 void exit(int); | |
44 void free(void*); | |
45 char* getenv(in char*); | |
46 c_long labs(c_long); | |
47 ldiv_t ldiv(c_long, c_long); | |
48 long llabs(long); | |
49 lldiv_t lldiv(long, long); | |
50 void* malloc(size_t); | |
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*)); | |
55 int rand(); | |
56 void* realloc(void*, size_t); | |
57 void srand(uint); | |
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); | |
65 int system(in char*); | |
66 size_t wcstombs(char*, in wchar_t*, size_t); | |
67 int wctomb(char*, wchar_t); | |
68 */ | |
69 | |
70 // | |
71 // Advisory Information (ADV) | |
72 // | |
73 /* | |
74 int posix_memalign(void**, size_t, size_t); | |
75 */ | |
76 | |
77 version( linux ) | |
78 { | |
79 int posix_memalign(void**, size_t, size_t); | |
80 } | |
81 | |
82 // | |
83 // C Extension (CX) | |
84 // | |
85 /* | |
86 int setenv(in char*, in char*, int); | |
87 int unsetenv(in char*); | |
88 */ | |
89 | |
90 version( linux ) | |
91 { | |
92 int setenv(in char*, in char*, int); | |
93 int unsetenv(in char*); | |
94 | |
95 void* valloc(size_t); // LEGACY non-standard | |
96 } | |
97 else version( darwin ) | |
98 { | |
99 int setenv(in char*, in char*, int); | |
100 int unsetenv(in char*); | |
101 | |
102 void* valloc(size_t); // LEGACY non-standard | |
103 } | |
104 else version( freebsd ) | |
105 { | |
106 int setenv(in char*, in char*, int); | |
107 int unsetenv(in char*); | |
108 | |
109 void* valloc(size_t); // LEGACY non-standard | |
110 } | |
111 | |
112 // | |
113 // Thread-Safe Functions (TSF) | |
114 // | |
115 /* | |
116 int rand_r(uint*); | |
117 */ | |
118 | |
119 version( linux ) | |
120 { | |
121 int rand_r(uint*); | |
122 } | |
123 else version( darwin ) | |
124 { | |
125 int rand_r(uint*); | |
126 } | |
127 else version( freebsd ) | |
128 { | |
129 int rand_r(uint*); | |
130 } | |
131 | |
132 // | |
133 // XOpen (XSI) | |
134 // | |
135 /* | |
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) | |
144 | |
145 c_long a64l(in char*); | |
146 double drand48(); | |
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**); | |
153 int grantpt(int); | |
154 char* initstate(uint, char*, size_t); | |
155 c_long jrand48(ushort[3]); | |
156 char* l64a(c_long); | |
157 void lcong48(ushort[7]); | |
158 c_long lrand48(); | |
159 char* mktemp(char*); // LEGACY | |
160 int mkstemp(char*); | |
161 c_long mrand48(); | |
162 c_long nrand48(ushort[3]); | |
163 int posix_openpt(int); | |
164 char* ptsname(int); | |
165 int putenv(char*); | |
166 c_long random(); | |
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); | |
172 void srandom(uint); | |
173 int unlockpt(int); | |
174 */ | |
175 | |
176 version( linux ) | |
177 { | |
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) | |
186 | |
187 c_long a64l(in char*); | |
188 double drand48(); | |
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**); | |
194 int grantpt(int); | |
195 char* initstate(uint, char*, size_t); | |
196 c_long jrand48(ushort[3]); | |
197 char* l64a(c_long); | |
198 void lcong48(ushort[7]); | |
199 c_long lrand48(); | |
200 char* mktemp(char*); // LEGACY | |
201 //int mkstemp(char*); | |
202 c_long mrand48(); | |
203 c_long nrand48(ushort[3]); | |
204 int posix_openpt(int); | |
205 char* ptsname(int); | |
206 int putenv(char*); | |
207 c_long random(); | |
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); | |
213 void srandom(uint); | |
214 int unlockpt(int); | |
215 | |
216 static if( __USE_LARGEFILE64 ) | |
217 { | |
218 int mkstemp64(char*); | |
219 alias mkstemp64 mkstemp; | |
220 } | |
221 else | |
222 { | |
223 int mkstemp(char*); | |
224 } | |
225 } | |
226 else version( darwin ) | |
227 { | |
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) | |
236 | |
237 c_long a64l(in char*); | |
238 double drand48(); | |
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**); | |
244 int grantpt(int); | |
245 char* initstate(uint, char*, size_t); | |
246 c_long jrand48(ushort[3]); | |
247 char* l64a(c_long); | |
248 void lcong48(ushort[7]); | |
249 c_long lrand48(); | |
250 char* mktemp(char*); // LEGACY | |
251 int mkstemp(char*); | |
252 c_long mrand48(); | |
253 c_long nrand48(ushort[3]); | |
254 int posix_openpt(int); | |
255 char* ptsname(int); | |
256 int putenv(char*); | |
257 c_long random(); | |
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); | |
263 void srandom(uint); | |
264 int unlockpt(int); | |
265 } | |
266 else version( freebsd ) | |
267 { | |
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) | |
276 | |
277 c_long a64l(in char*); | |
278 double drand48(); | |
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**); | |
284 int grantpt(int); | |
285 char* initstate(uint, char*, size_t); | |
286 c_long jrand48(ushort[3]); | |
287 char* l64a(c_long); | |
288 void lcong48(ushort[7]); | |
289 c_long lrand48(); | |
290 char* mktemp(char*); // LEGACY | |
291 int mkstemp(char*); | |
292 c_long mrand48(); | |
293 c_long nrand48(ushort[3]); | |
294 int posix_openpt(int); | |
295 char* ptsname(int); | |
296 int putenv(char*); | |
297 c_long random(); | |
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); | |
303 void srandom(uint); | |
304 int unlockpt(int); | |
305 } |