Mercurial > projects > ldc
annotate lphobos/std/c/stdlib.d @ 94:61615fa85940 trunk
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
Added support for array .sort and .reverse properties.
Fixed some bugs with pointer arithmetic.
Disabled some DMD AST optimizations that was messing things up, destroying valuable information.
Added a KDevelop project file, this is what I use for coding LLVMDC now :)
Other minor stuff.
author | lindquist |
---|---|
date | Mon, 12 Nov 2007 06:32:46 +0100 |
parents | c53b6e3fe49a |
children | 373489eeaf90 |
rev | line source |
---|---|
1 | 1 /** |
2 * C's <stdlib.h> | |
3 * Authors: Walter Bright, Digital Mars, www.digitalmars.com | |
4 * License: Public Domain | |
5 * Macros: | |
6 * WIKI=Phobos/StdCStdlib | |
7 */ | |
8 | |
9 | |
10 module std.c.stdlib; | |
11 | |
12 private import std.c.stddef; | |
13 | |
14 extern (C): | |
15 | |
16 enum | |
17 { | |
18 _MAX_PATH = 260, | |
19 _MAX_DRIVE = 3, | |
20 _MAX_DIR = 256, | |
21 _MAX_FNAME = 256, | |
22 _MAX_EXT = 256, | |
23 } | |
24 | |
25 /// | |
26 struct div_t { int quot,rem; } | |
27 /// | |
28 struct ldiv_t { int quot,rem; } | |
29 /// | |
30 struct lldiv_t { long quot,rem; } | |
31 | |
32 div_t div(int,int); /// | |
33 ldiv_t ldiv(int,int); /// ditto | |
34 lldiv_t lldiv(long, long); /// ditto | |
35 | |
36 const int EXIT_SUCCESS = 0; /// | |
37 const int EXIT_FAILURE = 1; /// ditto | |
38 | |
39 int atexit(void (*)()); /// | |
40 void exit(int); /// ditto | |
41 void _exit(int); /// ditto | |
42 | |
43 int system(char *); | |
44 | |
94
61615fa85940
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents:
1
diff
changeset
|
45 pragma(LLVM_internal, "alloca") |
1 | 46 void *alloca(uint); /// |
47 | |
48 void *calloc(size_t, size_t); /// | |
49 void *malloc(size_t); /// ditto | |
50 void *realloc(void *, size_t); /// ditto | |
51 void free(void *); /// ditto | |
52 | |
53 void *bsearch(void *,void *,size_t,size_t, | |
54 int function(void *,void *)); /// | |
55 void qsort(void *base, size_t nelems, size_t elemsize, | |
56 int (*compare)(void *elem1, void *elem2)); /// ditto | |
57 | |
58 char* getenv(char*); /// | |
59 int setenv(char*, char*, int); /// extension to ISO C standard, not available on all platforms | |
60 void unsetenv(char*); /// extension to ISO C standard, not available on all platforms | |
61 | |
62 int rand(); /// | |
63 void srand(uint); /// ditto | |
64 int random(int num); /// ditto | |
65 void randomize(); /// ditto | |
66 | |
67 int getErrno(); /// ditto | |
68 int setErrno(int); /// ditto | |
69 | |
70 const int ERANGE = 34; // on both Windows and linux | |
71 | |
72 double atof(char *); /// | |
73 int atoi(char *); /// ditto | |
74 int atol(char *); /// ditto | |
75 float strtof(char *,char **); /// ditto | |
76 double strtod(char *,char **); /// ditto | |
77 real strtold(char *,char **); /// ditto | |
78 long strtol(char *,char **,int); /// ditto | |
79 uint strtoul(char *,char **,int); /// ditto | |
80 long atoll(char *); /// ditto | |
81 long strtoll(char *,char **,int); /// ditto | |
82 ulong strtoull(char *,char **,int); /// ditto | |
83 | |
84 char* itoa(int, char*, int); /// | |
85 char* ultoa(uint, char*, int); /// ditto | |
86 | |
87 int mblen(char *s, size_t n); /// | |
88 int mbtowc(wchar_t *pwc, char *s, size_t n); /// ditto | |
89 int wctomb(char *s, wchar_t wc); /// ditto | |
90 size_t mbstowcs(wchar_t *pwcs, char *s, size_t n); /// ditto | |
91 size_t wcstombs(char *s, wchar_t *pwcs, size_t n); /// ditto |