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