d72fd7e4002e64efcbbe9cc5ea8adf943e38c658
[sdk] / compiler / bootstrap / ecere / bootstrap / memory.c
1 /* Code generated from eC source file: memory.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #include <stdint.h>
39 #include <sys/types.h>
40 void __ecereNameSpace__ecere__sys__FillBytesBy2(void * area, unsigned short value, unsigned int count)
41 {
42 unsigned short * dest = area;
43 int c;
44
45 for(c = 0; c < count; c++)
46 dest[c] = value;
47 }
48
49 void __ecereNameSpace__ecere__sys__FillBytesBy4(void * area, unsigned int value, unsigned int count)
50 {
51 unsigned int * dest = area;
52 int c;
53
54 for(c = 0; c < count; c++)
55 dest[c] = value;
56 }
57
58 struct __ecereNameSpace__ecere__sys__OldList
59 {
60 void *  first;
61 void *  last;
62 int count;
63 unsigned int offset;
64 unsigned int circ;
65 } __attribute__ ((gcc_struct));
66
67 struct __ecereNameSpace__ecere__sys__BTNode;
68
69 struct __ecereNameSpace__ecere__com__DataValue
70 {
71 union
72 {
73 char c;
74 unsigned char uc;
75 short s;
76 unsigned short us;
77 int i;
78 unsigned int ui;
79 void *  p;
80 float f;
81 double d;
82 long long i64;
83 uint64 ui64;
84 } __attribute__ ((gcc_struct)) __anon1;
85 } __attribute__ ((gcc_struct));
86
87 struct __ecereNameSpace__ecere__com__SerialBuffer
88 {
89 unsigned char *  _buffer;
90 unsigned int count;
91 unsigned int _size;
92 unsigned int pos;
93 } __attribute__ ((gcc_struct));
94
95 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
96
97 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
98
99 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
100
101 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
102
103 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
104
105 extern void *  memmove(void * , const void * , size_t size);
106
107 extern void *  memcpy(void * , const void * , size_t size);
108
109 extern void *  memset(void *  area, int value, size_t count);
110
111 struct __ecereNameSpace__ecere__com__GlobalFunction;
112
113 void __ecereNameSpace__ecere__sys__MoveBytes(void * dest, const void * source, unsigned int count)
114 {
115 memmove(dest, source, count);
116 }
117
118 void __ecereNameSpace__ecere__sys__CopyBytes(void * dest, const void * source, unsigned int count)
119 {
120 memcpy(dest, source, count);
121 }
122
123 void __ecereNameSpace__ecere__sys__CopyBytesBy2(void * dest, const void * source, unsigned int count)
124 {
125 memcpy(dest, source, count << 1);
126 }
127
128 void __ecereNameSpace__ecere__sys__CopyBytesBy4(void * dest, const void * source, unsigned int count)
129 {
130 memcpy(dest, source, count << 2);
131 }
132
133 void __ecereNameSpace__ecere__sys__FillBytes(void * area, unsigned char value, unsigned int count)
134 {
135 memset(area, value, count);
136 }
137
138 struct __ecereNameSpace__ecere__com__Class;
139
140 struct __ecereNameSpace__ecere__com__Instance
141 {
142 void * *  _vTbl;
143 struct __ecereNameSpace__ecere__com__Class * _class;
144 int _refCount;
145 } __attribute__ ((gcc_struct));
146
147 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
148
149 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
150
151 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
152
153 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
154
155 struct __ecereNameSpace__ecere__com__Property;
156
157 struct __ecereNameSpace__ecere__com__Property
158 {
159 struct __ecereNameSpace__ecere__com__Property * prev;
160 struct __ecereNameSpace__ecere__com__Property * next;
161 const char *  name;
162 unsigned int isProperty;
163 int memberAccess;
164 int id;
165 struct __ecereNameSpace__ecere__com__Class * _class;
166 const char *  dataTypeString;
167 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
168 struct __ecereNameSpace__ecere__com__Instance * dataType;
169 void (*  Set)(void * , int);
170 int (*  Get)(void * );
171 unsigned int (*  IsSet)(void * );
172 void *  data;
173 void *  symbol;
174 int vid;
175 unsigned int conversion;
176 unsigned int watcherOffset;
177 const char *  category;
178 unsigned int compiled;
179 unsigned int selfWatchable;
180 unsigned int isWatchable;
181 } __attribute__ ((gcc_struct));
182
183 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
184
185 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
186
187 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
188
189 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
190
191 struct __ecereNameSpace__ecere__sys__BinaryTree;
192
193 struct __ecereNameSpace__ecere__sys__BinaryTree
194 {
195 struct __ecereNameSpace__ecere__sys__BTNode * root;
196 int count;
197 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
198 void (*  FreeKey)(void *  key);
199 } __attribute__ ((gcc_struct));
200
201 struct __ecereNameSpace__ecere__com__Method;
202
203 struct __ecereNameSpace__ecere__com__Method
204 {
205 const char *  name;
206 struct __ecereNameSpace__ecere__com__Method * parent;
207 struct __ecereNameSpace__ecere__com__Method * left;
208 struct __ecereNameSpace__ecere__com__Method * right;
209 int depth;
210 int (*  function)();
211 int vid;
212 int type;
213 struct __ecereNameSpace__ecere__com__Class * _class;
214 void *  symbol;
215 const char *  dataTypeString;
216 struct __ecereNameSpace__ecere__com__Instance * dataType;
217 int memberAccess;
218 } __attribute__ ((gcc_struct));
219
220 struct __ecereNameSpace__ecere__com__Module;
221
222 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
223
224 struct __ecereNameSpace__ecere__com__NameSpace;
225
226 struct __ecereNameSpace__ecere__com__NameSpace
227 {
228 const char *  name;
229 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
230 struct __ecereNameSpace__ecere__com__NameSpace *  left;
231 struct __ecereNameSpace__ecere__com__NameSpace *  right;
232 int depth;
233 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
234 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
235 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
236 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
237 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
238 } __attribute__ ((gcc_struct));
239
240 struct __ecereNameSpace__ecere__com__Application
241 {
242 int argc;
243 const char * *  argv;
244 int exitCode;
245 unsigned int isGUIApp;
246 struct __ecereNameSpace__ecere__sys__OldList allModules;
247 char *  parsedCommand;
248 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
249 } __attribute__ ((gcc_struct));
250
251 struct __ecereNameSpace__ecere__com__Module
252 {
253 struct __ecereNameSpace__ecere__com__Instance * application;
254 struct __ecereNameSpace__ecere__sys__OldList classes;
255 struct __ecereNameSpace__ecere__sys__OldList defines;
256 struct __ecereNameSpace__ecere__sys__OldList functions;
257 struct __ecereNameSpace__ecere__sys__OldList modules;
258 struct __ecereNameSpace__ecere__com__Instance * prev;
259 struct __ecereNameSpace__ecere__com__Instance * next;
260 const char *  name;
261 void *  library;
262 void *  Unload;
263 int importType;
264 int origImportType;
265 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
266 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
267 } __attribute__ ((gcc_struct));
268
269 void __ecereRegisterModule_memory(struct __ecereNameSpace__ecere__com__Instance * module)
270 {
271 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
272
273 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::MoveBytes", "void ecere::sys::MoveBytes(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__MoveBytes, module, 1);
274 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytes", "void ecere::sys::CopyBytes(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytes, module, 1);
275 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytesBy2", "void ecere::sys::CopyBytesBy2(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytesBy2, module, 1);
276 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::CopyBytesBy4", "void ecere::sys::CopyBytesBy4(void * dest, const void * source, uint count)", __ecereNameSpace__ecere__sys__CopyBytesBy4, module, 1);
277 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytes", "void ecere::sys::FillBytes(void * area, byte value, uint count)", __ecereNameSpace__ecere__sys__FillBytes, module, 1);
278 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytesBy2", "void ecere::sys::FillBytesBy2(void * area, uint16 value, uint count)", __ecereNameSpace__ecere__sys__FillBytesBy2, module, 1);
279 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::FillBytesBy4", "void ecere::sys::FillBytesBy4(void * area, uint value, uint count)", __ecereNameSpace__ecere__sys__FillBytesBy4, module, 1);
280 }
281
282 void __ecereUnregisterModule_memory(struct __ecereNameSpace__ecere__com__Instance * module)
283 {
284
285 }
286
287 struct __ecereNameSpace__ecere__com__DataMember;
288
289 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
290 {
291 union
292 {
293 struct
294 {
295 const char *  dataTypeString;
296 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
297 } __attribute__ ((gcc_struct)) __anon1;
298 struct __ecereNameSpace__ecere__com__DataValue expression;
299 struct
300 {
301 const char *  memberString;
302 union
303 {
304 struct __ecereNameSpace__ecere__com__DataMember * member;
305 struct __ecereNameSpace__ecere__com__Property * prop;
306 struct __ecereNameSpace__ecere__com__Method * method;
307 } __attribute__ ((gcc_struct)) __anon1;
308 } __attribute__ ((gcc_struct)) __anon2;
309 } __attribute__ ((gcc_struct)) __anon1;
310 } __attribute__ ((gcc_struct));
311
312 struct __ecereNameSpace__ecere__com__DataMember
313 {
314 struct __ecereNameSpace__ecere__com__DataMember * prev;
315 struct __ecereNameSpace__ecere__com__DataMember * next;
316 const char *  name;
317 unsigned int isProperty;
318 int memberAccess;
319 int id;
320 struct __ecereNameSpace__ecere__com__Class * _class;
321 const char *  dataTypeString;
322 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
323 struct __ecereNameSpace__ecere__com__Instance * dataType;
324 int type;
325 int offset;
326 int memberID;
327 struct __ecereNameSpace__ecere__sys__OldList members;
328 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
329 int memberOffset;
330 short structAlignment;
331 short pointerAlignment;
332 } __attribute__ ((gcc_struct));
333
334 struct __ecereNameSpace__ecere__com__Class
335 {
336 struct __ecereNameSpace__ecere__com__Class * prev;
337 struct __ecereNameSpace__ecere__com__Class * next;
338 const char *  name;
339 int offset;
340 int structSize;
341 void * *  _vTbl;
342 int vTblSize;
343 unsigned int (*  Constructor)(void * );
344 void (*  Destructor)(void * );
345 int offsetClass;
346 int sizeClass;
347 struct __ecereNameSpace__ecere__com__Class * base;
348 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
349 struct __ecereNameSpace__ecere__sys__BinaryTree members;
350 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
351 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
352 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
353 struct __ecereNameSpace__ecere__sys__OldList derivatives;
354 int memberID;
355 int startMemberID;
356 int type;
357 struct __ecereNameSpace__ecere__com__Instance * module;
358 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
359 const char *  dataTypeString;
360 struct __ecereNameSpace__ecere__com__Instance * dataType;
361 int typeSize;
362 int defaultAlignment;
363 void (*  Initialize)();
364 int memberOffset;
365 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
366 const char *  designerClass;
367 unsigned int noExpansion;
368 const char *  defaultProperty;
369 unsigned int comRedefinition;
370 int count;
371 int isRemote;
372 unsigned int internalDecl;
373 void *  data;
374 unsigned int computeSize;
375 short structAlignment;
376 short pointerAlignment;
377 int destructionWatchOffset;
378 unsigned int fixed;
379 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
380 int inheritanceAccess;
381 const char *  fullName;
382 void *  symbol;
383 struct __ecereNameSpace__ecere__sys__OldList conversions;
384 struct __ecereNameSpace__ecere__sys__OldList templateParams;
385 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
386 struct __ecereNameSpace__ecere__com__Class * templateClass;
387 struct __ecereNameSpace__ecere__sys__OldList templatized;
388 int numParams;
389 unsigned int isInstanceClass;
390 unsigned int byValueSystemClass;
391 } __attribute__ ((gcc_struct));
392