compiler/libec: (#18, #26, #439, #685) Fixed serious performance issues and warnings...
[sdk] / compiler / bootstrap / ecp / bootstrap / ecp.main.c
1 /* Code generated from eC source file: ecp.main.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 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof;
41
42 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts;
43
44 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
45
46 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
47
48 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
49
50 void __ecereCreateModuleInstances_ecp();
51
52 void __ecereDestroyModuleInstances_ecp();
53
54 struct __ecereNameSpace__ecere__sys__OldList
55 {
56 void *  first;
57 void *  last;
58 int count;
59 unsigned int offset;
60 unsigned int circ;
61 } __attribute__ ((gcc_struct));
62
63 struct __ecereNameSpace__ecere__sys__BTNode;
64
65 struct Type;
66
67 struct __ecereNameSpace__ecere__com__DataValue
68 {
69 union
70 {
71 char c;
72 unsigned char uc;
73 short s;
74 unsigned short us;
75 int i;
76 unsigned int ui;
77 void *  p;
78 float f;
79 double d;
80 long long i64;
81 uint64 ui64;
82 } __attribute__ ((gcc_struct)) __anon1;
83 } __attribute__ ((gcc_struct));
84
85 struct __ecereNameSpace__ecere__com__SerialBuffer
86 {
87 unsigned char *  _buffer;
88 unsigned int count;
89 unsigned int _size;
90 unsigned int pos;
91 } __attribute__ ((gcc_struct));
92
93 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
94
95 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
96
97 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
98
99 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
100
101 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
102
103 extern void __ecereNameSpace__ecere__LoadTranslatedStrings(const char * moduleName, const char *  name);
104
105 extern void __ecereNameSpace__ecere__UnloadTranslatedStrings(const char * name);
106
107 struct __ecereNameSpace__ecere__com__Class;
108
109 struct __ecereNameSpace__ecere__com__Instance
110 {
111 void * *  _vTbl;
112 struct __ecereNameSpace__ecere__com__Class * _class;
113 int _refCount;
114 } __attribute__ ((gcc_struct));
115
116 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
117
118 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
119
120 struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
121
122 struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
123
124 struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
125
126 struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
127
128 struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
129
130 struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
131
132 struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__DualPipe;
133
134 struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
135
136 struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
137
138 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
139
140 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
141
142 extern void __ecereNameSpace__ecere__com__eInstance_Evolve(struct __ecereNameSpace__ecere__com__Instance **  instancePtr, struct __ecereNameSpace__ecere__com__Class * _class);
143
144 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
145
146 struct __ecereNameSpace__ecere__com__Property;
147
148 struct __ecereNameSpace__ecere__com__Property
149 {
150 struct __ecereNameSpace__ecere__com__Property * prev;
151 struct __ecereNameSpace__ecere__com__Property * next;
152 const char *  name;
153 unsigned int isProperty;
154 int memberAccess;
155 int id;
156 struct __ecereNameSpace__ecere__com__Class * _class;
157 const char *  dataTypeString;
158 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
159 struct Type * dataType;
160 void (*  Set)(void * , int);
161 int (*  Get)(void * );
162 unsigned int (*  IsSet)(void * );
163 void *  data;
164 void *  symbol;
165 int vid;
166 unsigned int conversion;
167 unsigned int watcherOffset;
168 const char *  category;
169 unsigned int compiled;
170 unsigned int selfWatchable;
171 unsigned int isWatchable;
172 } __attribute__ ((gcc_struct));
173
174 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
175
176 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);
177
178 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
179
180 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
181
182 struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__Platform_char__PTR_;
183
184 struct __ecereNameSpace__ecere__sys__BinaryTree;
185
186 struct __ecereNameSpace__ecere__sys__BinaryTree
187 {
188 struct __ecereNameSpace__ecere__sys__BTNode * root;
189 int count;
190 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
191 void (*  FreeKey)(void *  key);
192 } __attribute__ ((gcc_struct));
193
194 struct __ecereNameSpace__ecere__com__Method;
195
196 struct __ecereNameSpace__ecere__com__Method
197 {
198 const char *  name;
199 struct __ecereNameSpace__ecere__com__Method * parent;
200 struct __ecereNameSpace__ecere__com__Method * left;
201 struct __ecereNameSpace__ecere__com__Method * right;
202 int depth;
203 int (*  function)();
204 int vid;
205 int type;
206 struct __ecereNameSpace__ecere__com__Class * _class;
207 void *  symbol;
208 const char *  dataTypeString;
209 struct Type * dataType;
210 int memberAccess;
211 } __attribute__ ((gcc_struct));
212
213 struct __ecereNameSpace__ecere__com__Module;
214
215 static struct __ecereNameSpace__ecere__com__Instance * __currentModule;
216
217 struct __ecereNameSpace__ecere__com__Instance * __thisModule;
218
219 unsigned int __ecereDll_Load_ec(struct __ecereNameSpace__ecere__com__Instance * module);
220
221 unsigned int __ecereDll_Unload_ec(struct __ecereNameSpace__ecere__com__Instance * module);
222
223 unsigned int __ecereDll_Load_ecere(struct __ecereNameSpace__ecere__com__Instance * module);
224
225 unsigned int __ecereDll_Unload_ecere(struct __ecereNameSpace__ecere__com__Instance * module);
226
227 void __ecereRegisterModule_ecp(struct __ecereNameSpace__ecere__com__Instance * module);
228
229 void __ecereUnregisterModule_ecp(struct __ecereNameSpace__ecere__com__Instance * module);
230
231 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com__eModule_LoadStatic(struct __ecereNameSpace__ecere__com__Instance * fromModule, const char *  name, int importAccess, unsigned int (*  Load)(struct __ecereNameSpace__ecere__com__Instance * module), unsigned int (*  Unload)(struct __ecereNameSpace__ecere__com__Instance * module));
232
233 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
234
235 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
236
237 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
238
239 struct __ecereNameSpace__ecere__com__Application;
240
241 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com____ecere_COM_Initialize(unsigned int guiApp, int argc, char *  argv[]);
242
243 struct __ecereNameSpace__ecere__com__NameSpace;
244
245 struct __ecereNameSpace__ecere__com__NameSpace
246 {
247 const char *  name;
248 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
249 struct __ecereNameSpace__ecere__com__NameSpace *  left;
250 struct __ecereNameSpace__ecere__com__NameSpace *  right;
251 int depth;
252 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
253 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
254 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
255 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
256 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
257 } __attribute__ ((gcc_struct));
258
259 struct __ecereNameSpace__ecere__com__Application
260 {
261 int argc;
262 const char * *  argv;
263 int exitCode;
264 unsigned int isGUIApp;
265 struct __ecereNameSpace__ecere__sys__OldList allModules;
266 char *  parsedCommand;
267 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
268 } __attribute__ ((gcc_struct));
269
270 struct __ecereNameSpace__ecere__com__Module
271 {
272 struct __ecereNameSpace__ecere__com__Instance * application;
273 struct __ecereNameSpace__ecere__sys__OldList classes;
274 struct __ecereNameSpace__ecere__sys__OldList defines;
275 struct __ecereNameSpace__ecere__sys__OldList functions;
276 struct __ecereNameSpace__ecere__sys__OldList modules;
277 struct __ecereNameSpace__ecere__com__Instance * prev;
278 struct __ecereNameSpace__ecere__com__Instance * next;
279 const char *  name;
280 void *  library;
281 void *  Unload;
282 int importType;
283 int origImportType;
284 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
285 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
286 } __attribute__ ((gcc_struct));
287
288 void __ecereRegisterModule_ecp_main(struct __ecereNameSpace__ecere__com__Instance * module)
289 {
290 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
291
292 }
293
294 void __ecereUnregisterModule_ecp_main(struct __ecereNameSpace__ecere__com__Instance * module)
295 {
296
297 }
298
299 struct __ecereNameSpace__ecere__com__DataMember;
300
301 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
302 {
303 union
304 {
305 struct
306 {
307 const char *  dataTypeString;
308 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
309 } __attribute__ ((gcc_struct)) __anon1;
310 struct __ecereNameSpace__ecere__com__DataValue expression;
311 struct
312 {
313 const char *  memberString;
314 union
315 {
316 struct __ecereNameSpace__ecere__com__DataMember * member;
317 struct __ecereNameSpace__ecere__com__Property * prop;
318 struct __ecereNameSpace__ecere__com__Method * method;
319 } __attribute__ ((gcc_struct)) __anon1;
320 } __attribute__ ((gcc_struct)) __anon2;
321 } __attribute__ ((gcc_struct)) __anon1;
322 } __attribute__ ((gcc_struct));
323
324 struct __ecereNameSpace__ecere__com__DataMember
325 {
326 struct __ecereNameSpace__ecere__com__DataMember * prev;
327 struct __ecereNameSpace__ecere__com__DataMember * next;
328 const char *  name;
329 unsigned int isProperty;
330 int memberAccess;
331 int id;
332 struct __ecereNameSpace__ecere__com__Class * _class;
333 const char *  dataTypeString;
334 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
335 struct Type * dataType;
336 int type;
337 int offset;
338 int memberID;
339 struct __ecereNameSpace__ecere__sys__OldList members;
340 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
341 int memberOffset;
342 short structAlignment;
343 short pointerAlignment;
344 } __attribute__ ((gcc_struct));
345
346 struct __ecereNameSpace__ecere__com__Class
347 {
348 struct __ecereNameSpace__ecere__com__Class * prev;
349 struct __ecereNameSpace__ecere__com__Class * next;
350 const char *  name;
351 int offset;
352 int structSize;
353 void * *  _vTbl;
354 int vTblSize;
355 unsigned int (*  Constructor)(void * );
356 void (*  Destructor)(void * );
357 int offsetClass;
358 int sizeClass;
359 struct __ecereNameSpace__ecere__com__Class * base;
360 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
361 struct __ecereNameSpace__ecere__sys__BinaryTree members;
362 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
363 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
364 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
365 struct __ecereNameSpace__ecere__sys__OldList derivatives;
366 int memberID;
367 int startMemberID;
368 int type;
369 struct __ecereNameSpace__ecere__com__Instance * module;
370 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
371 const char *  dataTypeString;
372 struct Type * dataType;
373 int typeSize;
374 int defaultAlignment;
375 void (*  Initialize)();
376 int memberOffset;
377 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
378 const char *  designerClass;
379 unsigned int noExpansion;
380 const char *  defaultProperty;
381 unsigned int comRedefinition;
382 int count;
383 int isRemote;
384 unsigned int internalDecl;
385 void *  data;
386 unsigned int computeSize;
387 short structAlignment;
388 short pointerAlignment;
389 int destructionWatchOffset;
390 unsigned int fixed;
391 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
392 int inheritanceAccess;
393 const char *  fullName;
394 void *  symbol;
395 struct __ecereNameSpace__ecere__sys__OldList conversions;
396 struct __ecereNameSpace__ecere__sys__OldList templateParams;
397 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
398 struct __ecereNameSpace__ecere__com__Class * templateClass;
399 struct __ecereNameSpace__ecere__sys__OldList templatized;
400 int numParams;
401 unsigned int isInstanceClass;
402 unsigned int byValueSystemClass;
403 } __attribute__ ((gcc_struct));
404
405 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
406
407 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
408
409 int main(int _argc, char * _argv[])
410 {
411 int exitCode;
412 struct __ecereNameSpace__ecere__com__Instance * module;
413 __attribute__((unused)) struct __ecereNameSpace__ecere__com__Class * _class;
414 __attribute__((unused)) struct __ecereNameSpace__ecere__com__Method * method;
415 __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * _property;
416
417 __thisModule = __currentModule = module = __ecereNameSpace__ecere__com____ecere_COM_Initialize((unsigned int)1, _argc, (void *)_argv);
418 __ecereNameSpace__ecere__com__eModule_LoadStatic(module, "ec", 2, (void *)(__ecereDll_Load_ec), (void *)(__ecereDll_Unload_ec));
419 __ecereNameSpace__ecere__com__eModule_LoadStatic(module, "ecere", 2, (void *)(__ecereDll_Load_ecere), (void *)(__ecereDll_Unload_ecere));
420 __ecereRegisterModule_ecp(module);
421 __ecereClass___ecereNameSpace__ecere__com__Application = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::com::Application");
422 __ecereClass___ecereNameSpace__ecere__com__Module = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::com::Module");
423 __ecereClass_Context = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "Context");
424 __ecereClass_ModuleImport = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ModuleImport");
425 __ecereClass_Symbol = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "Symbol");
426 __ecereClass_Type = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "Type");
427 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::com::Platform");
428 __ecereProp___ecereNameSpace__ecere__com__Platform_char__PTR_ = _property = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, "char *", module);
429 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::sys::BinaryTree");
430 __ecereClass___ecereNameSpace__ecere__sys__DualPipe = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::sys::DualPipe");
431 __ecereClass___ecereNameSpace__ecere__sys__File = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::sys::File");
432 method = __ecereNameSpace__ecere__com__eClass_FindMethod(__ecereClass___ecereNameSpace__ecere__sys__File, "Eof", module);
433 if(method)
434 __ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof = method->vid;
435 method = __ecereNameSpace__ecere__com__eClass_FindMethod(__ecereClass___ecereNameSpace__ecere__sys__File, "Puts", module);
436 if(method)
437 __ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts = method->vid;
438 method = __ecereNameSpace__ecere__com__eClass_FindMethod(__ecereClass___ecereNameSpace__ecere__sys__File, "Read", module);
439 if(method)
440 __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read = method->vid;
441 method = __ecereNameSpace__ecere__com__eClass_FindMethod(__ecereClass___ecereNameSpace__ecere__sys__File, "Seek", module);
442 if(method)
443 __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek = method->vid;
444 method = __ecereNameSpace__ecere__com__eClass_FindMethod(__ecereClass___ecereNameSpace__ecere__sys__File, "Write", module);
445 if(method)
446 __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write = method->vid;
447 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::sys::OldList");
448 __ecereClass___ecereNameSpace__ecere__sys__TempFile = __ecereNameSpace__ecere__com__eSystem_FindClass(module, "ecere::sys::TempFile");
449 __ecereNameSpace__ecere__LoadTranslatedStrings((((void *)0)), "ecp");
450 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(__currentModule, "PrecompApp");
451 __ecereNameSpace__ecere__com__eInstance_Evolve((struct __ecereNameSpace__ecere__com__Instance **)&__currentModule, _class);
452 __thisModule = __currentModule;
453 __ecereCreateModuleInstances_ecp();
454 ((void (*)(void *))(void *)((struct __ecereNameSpace__ecere__com__Instance *)(char *)__currentModule)->_vTbl[12])(__currentModule);
455 __ecereDestroyModuleInstances_ecp();
456 __ecereNameSpace__ecere__UnloadTranslatedStrings("ecp");
457 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(__currentModule, "ecere::com::Application");
458 exitCode = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Instance *)__currentModule) + sizeof(struct __ecereNameSpace__ecere__com__Module) + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->exitCode;
459 (__ecereNameSpace__ecere__com__eInstance_DecRef(__currentModule), __currentModule = 0);
460 return exitCode;
461 }
462