comparison tango/lib/compiler/llvmdc/mars.h @ 133:44a95ac7368a trunk

[svn r137] Many fixes towards tango.io.Console working, but not quite there yet... In particular, assertions has been fixed to include file/line info, and much more!
author lindquist
date Mon, 14 Jan 2008 05:11:54 +0100
parents
children
comparison
equal deleted inserted replaced
132:1700239cab2e 133:44a95ac7368a
1
2 /*
3 * Placed into the Public Domain
4 * written by Walter Bright, Digital Mars
5 * www.digitalmars.com
6 */
7
8 /*
9 * Modified by Sean Kelly <sean@f4.ca> for use with Tango.
10 */
11
12 #include <stddef.h>
13
14 #if __cplusplus
15 extern "C" {
16 #endif
17
18 struct ClassInfo;
19 struct Vtbl;
20
21 typedef struct Vtbl
22 {
23 size_t len;
24 void **vptr;
25 } Vtbl;
26
27 typedef struct Interface
28 {
29 struct ClassInfo *classinfo;
30 struct Vtbl vtbl;
31 int offset;
32 } Interface;
33
34 typedef struct Object
35 {
36 void **vptr;
37 void *monitor;
38 } Object;
39
40 typedef struct ClassInfo
41 {
42 Object object;
43
44 size_t initlen;
45 void *init;
46
47 size_t namelen;
48 char *name;
49
50 Vtbl vtbl;
51
52 size_t interfacelen;
53 Interface *interfaces;
54
55 struct ClassInfo *baseClass;
56
57 void *destructor;
58 void *invariant;
59
60 int flags;
61 } ClassInfo;
62
63 typedef struct Exception
64 {
65 Object object;
66
67 size_t msglen;
68 char* msg;
69
70 size_t filelen;
71 char* file;
72
73 size_t line;
74
75 struct Exception *next;
76 } Exception;
77
78 typedef struct Array
79 {
80 size_t length;
81 void *ptr;
82 } Array;
83
84 typedef struct Delegate
85 {
86 void *thisptr;
87 void (*funcptr)();
88 } Delegate;
89
90 void _d_monitorenter(Object *h);
91 void _d_monitorexit(Object *h);
92
93 int _d_isbaseof(ClassInfo *b, ClassInfo *c);
94 Object *_d_dynamic_cast(Object *o, ClassInfo *ci);
95
96 Object * _d_newclass(ClassInfo *ci);
97 void _d_delclass(Object **p);
98
99 void _d_OutOfMemory();
100
101 #if __cplusplus
102 }
103 #endif
104