Mercurial > projects > ldc
comparison tango/tango/stdc/stdlib.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 /** | |
2 * D header file for C99. | |
3 * | |
4 * Copyright: Public Domain | |
5 * License: Public Domain | |
6 * Authors: Sean Kelly | |
7 * Standards: ISO/IEC 9899:1999 (E) | |
8 */ | |
9 module tango.stdc.stdlib; | |
10 | |
11 private import tango.stdc.stddef; | |
12 private import tango.stdc.config; | |
13 | |
14 extern (C): | |
15 | |
16 struct div_t | |
17 { | |
18 int quot, | |
19 rem; | |
20 } | |
21 | |
22 struct ldiv_t | |
23 { | |
24 int quot, | |
25 rem; | |
26 } | |
27 | |
28 struct lldiv_t | |
29 { | |
30 long quot, | |
31 rem; | |
32 } | |
33 | |
34 const EXIT_SUCCESS = 0; | |
35 const EXIT_FAILURE = 1; | |
36 const RAND_MAX = 32767; | |
37 const MB_CUR_MAX = 1; | |
38 | |
39 double atof(char* nptr); | |
40 int atoi(char* nptr); | |
41 c_long atol(char* nptr); | |
42 long atoll(char* nptr); | |
43 | |
44 double strtod(char* nptr, char** endptr); | |
45 float strtof(char* nptr, char** endptr); | |
46 real strtold(char* nptr, char** endptr); | |
47 c_long strtol(char* nptr, char** endptr, int base); | |
48 long strtoll(char* nptr, char** endptr, int base); | |
49 c_ulong strtoul(char* nptr, char** endptr, int base); | |
50 ulong strtoull(char* nptr, char** endptr, int base); | |
51 | |
52 double wcstod(wchar_t* nptr, wchar_t** endptr); | |
53 float wcstof(wchar_t* nptr, wchar_t** endptr); | |
54 real wcstold(wchar_t* nptr, wchar_t** endptr); | |
55 c_long wcstol(wchar_t* nptr, wchar_t** endptr, int base); | |
56 long wcstoll(wchar_t* nptr, wchar_t** endptr, int base); | |
57 c_ulong wcstoul(wchar_t* nptr, wchar_t** endptr, int base); | |
58 ulong wcstoull(wchar_t* nptr, wchar_t** endptr, int base); | |
59 | |
60 int rand(); | |
61 void srand(uint seed); | |
62 | |
63 void* malloc(size_t size); | |
64 void* calloc(size_t nmemb, size_t size); | |
65 void* realloc(void* ptr, size_t size); | |
66 void free(void* ptr); | |
67 | |
68 void abort(); | |
69 void exit(int status); | |
70 int atexit(void function() func); | |
71 void _Exit(int status); | |
72 | |
73 char* getenv(char* name); | |
74 int system(char* string); | |
75 | |
76 void* bsearch(void* key, void* base, size_t nmemb, size_t size, int function(void*, void*) compar); | |
77 void qsort(void* base, size_t nmemb, size_t size, int function(void*, void*) compar); | |
78 | |
79 int abs(int j); | |
80 c_long labs(c_long j); | |
81 long llabs(long j); | |
82 | |
83 div_t div(int numer, int denom); | |
84 ldiv_t ldiv(c_long numer, c_long denom); | |
85 lldiv_t lldiv(long numer, long denom); | |
86 | |
87 int mblen(char* s, size_t n); | |
88 int mbtowc(wchar_t* pwc, char* s, size_t n); | |
89 int wctomb(char*s, wchar_t wc); | |
90 size_t mbstowcs(wchar_t* pwcs, char* s, size_t n); | |
91 size_t wcstombs(char* s, wchar_t* pwcs, size_t n); | |
92 | |
93 version( DigitalMars ) | |
94 { | |
95 void* alloca(size_t size); | |
96 } | |
97 else version( GNU ) | |
98 { | |
99 private import gcc.builtins; | |
100 alias gcc.builtins.__builtin_alloca alloca; | |
101 } | |
102 else version( LLVMDC ) | |
103 { | |
104 pragma(LLVM_internal, "alloca") | |
105 void* alloca(size_t size); | |
106 } |