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