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