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