compiler/libec: Fixed warnings for related struct (and class:struct) classes
[sdk] / compiler / bootstrap / ecc / bootstrap / ecc.c
1 /* Code generated from eC source file: ecc.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
35 #define _64BIT 1
36 #else
37 #define _64BIT 0
38 #endif
39
40 #define arch_PointerSize                  sizeof(void *)
41 #define structSize_Instance               (_64BIT ? 24 : 12)
42 #define structSize_Module                 (_64BIT ? 560 : 300)
43
44 struct __ecereNameSpace__ecere__com__Instance;
45
46 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
47
48 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
49
50 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
51
52 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
53
54 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
55
56 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
57
58 struct __ecereNameSpace__ecere__sys__BTNode;
59
60 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
61
62 struct __ecereNameSpace__ecere__sys__BinaryTree
63 {
64 struct __ecereNameSpace__ecere__sys__BTNode * root;
65 int count;
66 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
67 void (*  FreeKey)(void *  key);
68 } __attribute__ ((gcc_struct));
69
70 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
71
72 struct __ecereNameSpace__ecere__sys__OldList
73 {
74 void *  first;
75 void *  last;
76 int count;
77 unsigned int offset;
78 unsigned int circ;
79 } __attribute__ ((gcc_struct));
80
81 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
82
83 struct __ecereNameSpace__ecere__com__Method
84 {
85 const char *  name;
86 struct __ecereNameSpace__ecere__com__Method * parent;
87 struct __ecereNameSpace__ecere__com__Method * left;
88 struct __ecereNameSpace__ecere__com__Method * right;
89 int depth;
90 int (*  function)();
91 int vid;
92 int type;
93 struct __ecereNameSpace__ecere__com__Class * _class;
94 void *  symbol;
95 const char *  dataTypeString;
96 struct Type * dataType;
97 int memberAccess;
98 } __attribute__ ((gcc_struct));
99
100 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
101
102 struct __ecereNameSpace__ecere__com__Property
103 {
104 struct __ecereNameSpace__ecere__com__Property * prev;
105 struct __ecereNameSpace__ecere__com__Property * next;
106 const char *  name;
107 unsigned int isProperty;
108 int memberAccess;
109 int id;
110 struct __ecereNameSpace__ecere__com__Class * _class;
111 const char *  dataTypeString;
112 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
113 struct Type * dataType;
114 void (*  Set)(void * , int);
115 int (*  Get)(void * );
116 unsigned int (*  IsSet)(void * );
117 void *  data;
118 void *  symbol;
119 int vid;
120 unsigned int conversion;
121 unsigned int watcherOffset;
122 const char *  category;
123 unsigned int compiled;
124 unsigned int selfWatchable;
125 unsigned int isWatchable;
126 } __attribute__ ((gcc_struct));
127
128 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
129
130 struct CodePosition
131 {
132 int line;
133 int charPos;
134 int pos;
135 int included;
136 } __attribute__ ((gcc_struct));
137
138 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
139
140 struct Location
141 {
142 struct CodePosition start;
143 struct CodePosition end;
144 } __attribute__ ((gcc_struct));
145
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
147
148 struct Attrib;
149
150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
151
152 struct ExtDecl;
153
154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
155
156 struct ClassDefinition;
157
158 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
159
160 struct Context
161 {
162 struct Context * parent;
163 struct __ecereNameSpace__ecere__sys__BinaryTree types;
164 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
165 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
166 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
167 int nextID;
168 int simpleID;
169 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
170 struct ClassDefinition * classDef;
171 unsigned int templateTypesOnly;
172 unsigned int hasNameSpace;
173 } __attribute__ ((gcc_struct));
174
175 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
176
177 struct Instantiation;
178
179 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
180
181 struct Declaration;
182
183 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
184
185 struct Statement;
186
187 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
188
189 struct TypeName;
190
191 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
192
193 struct Initializer;
194
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
196
197 struct __ecereNameSpace__ecere__com__DataValue
198 {
199 union
200 {
201 char c;
202 unsigned char uc;
203 short s;
204 unsigned short us;
205 int i;
206 unsigned int ui;
207 void *  p;
208 float f;
209 double d;
210 long long i64;
211 uint64 ui64;
212 } __attribute__ ((gcc_struct)) __anon1;
213 } __attribute__ ((gcc_struct));
214
215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
216
217 struct Expression;
218
219 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
220
221 struct TemplateDatatype;
222
223 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
224
225 struct TemplateArgument;
226
227 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
228
229 struct TemplateParameter;
230
231 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
232
233 struct Specifier;
234
235 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
236
237 struct Identifier;
238
239 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
240
241 struct Declarator;
242
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
244
245 struct FunctionDefinition;
246
247 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
248
249 struct DBTableDef;
250
251 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
252
253 struct External;
254
255 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
256
257 struct ModuleImport
258 {
259 struct ModuleImport * prev;
260 struct ModuleImport * next;
261 char *  name;
262 struct __ecereNameSpace__ecere__sys__OldList classes;
263 struct __ecereNameSpace__ecere__sys__OldList functions;
264 int importType;
265 int importAccess;
266 } __attribute__ ((gcc_struct));
267
268 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
269
270 struct ClassImport
271 {
272 struct ClassImport * prev;
273 struct ClassImport * next;
274 char *  name;
275 struct __ecereNameSpace__ecere__sys__OldList methods;
276 struct __ecereNameSpace__ecere__sys__OldList properties;
277 unsigned int itself;
278 int isRemote;
279 } __attribute__ ((gcc_struct));
280
281 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
282
283 struct Symbol
284 {
285 char *  string;
286 struct Symbol * parent;
287 struct Symbol * left;
288 struct Symbol * right;
289 int depth;
290 struct Type * type;
291 union
292 {
293 struct __ecereNameSpace__ecere__com__Method * method;
294 struct __ecereNameSpace__ecere__com__Property * _property;
295 struct __ecereNameSpace__ecere__com__Class * registered;
296 } __attribute__ ((gcc_struct)) __anon1;
297 int id;
298 int idCode;
299 union
300 {
301 struct
302 {
303 struct External * pointerExternal;
304 struct External * structExternal;
305 } __attribute__ ((gcc_struct)) __anon1;
306 struct
307 {
308 struct External * externalGet;
309 struct External * externalSet;
310 struct External * externalPtr;
311 struct External * externalIsSet;
312 } __attribute__ ((gcc_struct)) __anon2;
313 struct
314 {
315 struct External * methodExternal;
316 struct External * methodCodeExternal;
317 } __attribute__ ((gcc_struct)) __anon3;
318 } __attribute__ ((gcc_struct)) __anon2;
319 unsigned int imported;
320 unsigned int declaredStructSym;
321 struct __ecereNameSpace__ecere__com__Class * _class;
322 unsigned int declaredStruct;
323 unsigned int needConstructor;
324 unsigned int needDestructor;
325 char *  constructorName;
326 char *  structName;
327 char *  className;
328 char *  destructorName;
329 struct ModuleImport * module;
330 struct ClassImport * _import;
331 struct Location nameLoc;
332 unsigned int isParam;
333 unsigned int isRemote;
334 unsigned int isStruct;
335 unsigned int fireWatchersDone;
336 int declaring;
337 unsigned int classData;
338 unsigned int isStatic;
339 char *  shortName;
340 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
341 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
342 struct Context * ctx;
343 int isIterator;
344 struct Expression * propCategory;
345 } __attribute__ ((gcc_struct));
346
347 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
348
349 struct Type;
350
351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
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 int (* *  _vTbl)();
361 int vTblSize;
362 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
363 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
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 int structAlignment;
395 int destructionWatchOffset;
396 unsigned int fixed;
397 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
398 int inheritanceAccess;
399 const char *  fullName;
400 void *  symbol;
401 struct __ecereNameSpace__ecere__sys__OldList conversions;
402 struct __ecereNameSpace__ecere__sys__OldList templateParams;
403 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
404 struct __ecereNameSpace__ecere__com__Class * templateClass;
405 struct __ecereNameSpace__ecere__sys__OldList templatized;
406 int numParams;
407 unsigned int isInstanceClass;
408 unsigned int byValueSystemClass;
409 } __attribute__ ((gcc_struct));
410
411 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
412
413 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
414
415 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
416
417 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
418
419 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
420
421 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);
422
423 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
424
425 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
426
427 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
428
429 struct __ecereNameSpace__ecere__com__Instance
430 {
431 int (* *  _vTbl)();
432 struct __ecereNameSpace__ecere__com__Class * _class;
433 int _refCount;
434 } __attribute__ ((gcc_struct));
435
436 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
437
438 struct __ecereNameSpace__ecere__com__DataMember
439 {
440 struct __ecereNameSpace__ecere__com__DataMember * prev;
441 struct __ecereNameSpace__ecere__com__DataMember * next;
442 const char *  name;
443 unsigned int isProperty;
444 int memberAccess;
445 int id;
446 struct __ecereNameSpace__ecere__com__Class * _class;
447 const char *  dataTypeString;
448 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
449 struct Type * dataType;
450 int type;
451 int offset;
452 int memberID;
453 struct __ecereNameSpace__ecere__sys__OldList members;
454 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
455 int memberOffset;
456 int structAlignment;
457 } __attribute__ ((gcc_struct));
458
459 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
460
461 struct __ecereNameSpace__ecere__com__SerialBuffer
462 {
463 unsigned char *  _buffer;
464 unsigned int count;
465 unsigned int _size;
466 unsigned int pos;
467 } __attribute__ ((gcc_struct));
468
469 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
470
471 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
472 {
473 union
474 {
475 struct
476 {
477 const char *  dataTypeString;
478 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
479 } __attribute__ ((gcc_struct)) __anon1;
480 struct __ecereNameSpace__ecere__com__DataValue expression;
481 struct
482 {
483 const char *  memberString;
484 union
485 {
486 struct __ecereNameSpace__ecere__com__DataMember * member;
487 struct __ecereNameSpace__ecere__com__Property * prop;
488 struct __ecereNameSpace__ecere__com__Method * method;
489 } __attribute__ ((gcc_struct)) __anon1;
490 } __attribute__ ((gcc_struct)) __anon2;
491 } __attribute__ ((gcc_struct)) __anon1;
492 } __attribute__ ((gcc_struct));
493
494 static struct Context * globalContext;
495
496 static struct __ecereNameSpace__ecere__com__Instance * privateModule;
497
498 static struct ModuleImport * mainModule;
499
500 struct __ecereNameSpace__ecere__sys__OldList _excludedSymbols =
501 {
502 0, 0, 0, (unsigned int)(uintptr_t)&((struct Symbol *)(void * )0)->left, 0
503 };
504
505 static struct __ecereNameSpace__ecere__sys__OldList defines, imports;
506
507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
508
509 struct __ecereNameSpace__ecere__com__NameSpace
510 {
511 const char *  name;
512 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
513 struct __ecereNameSpace__ecere__com__NameSpace *  left;
514 struct __ecereNameSpace__ecere__com__NameSpace *  right;
515 int depth;
516 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
517 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
518 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
519 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
520 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
521 } __attribute__ ((gcc_struct));
522
523 static struct __ecereNameSpace__ecere__com__NameSpace globalData;
524
525 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__FileOpen(const char *  fileName, int mode);
526
527 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
528
529 struct MethodImport
530 {
531 struct MethodImport * prev;
532 struct MethodImport * next;
533 char *  name;
534 unsigned int isVirtual;
535 } __attribute__ ((gcc_struct));
536
537 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
538
539 struct PropertyImport
540 {
541 struct PropertyImport * prev;
542 struct PropertyImport * next;
543 char *  name;
544 unsigned int isVirtual;
545 unsigned int hasSet;
546 unsigned int hasGet;
547 } __attribute__ ((gcc_struct));
548
549 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
550
551 struct FunctionImport
552 {
553 struct FunctionImport * prev;
554 struct FunctionImport * next;
555 char *  name;
556 } __attribute__ ((gcc_struct));
557
558 int __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(struct __ecereNameSpace__ecere__com__Instance * this, const char *  format, ...);
559
560 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
561
562 static void OutputImports(char * fileName)
563 {
564 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__sys__FileOpen(fileName, 2);
565
566 if(f)
567 {
568 if(imports.first)
569 {
570 struct ModuleImport * module;
571
572 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "[Imported Modules]\n");
573 for(module = imports.first; module; module = module->next)
574 {
575 struct ClassImport * _class;
576 struct FunctionImport * function;
577
578 if(module->name)
579 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   %s\n", module->name);
580 else
581 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   [This]\n");
582 if(module->importType == 1)
583 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      [Static]\n");
584 else if(module->importType == 2)
585 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      [Remote]\n");
586 if(module->importAccess == 2)
587 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      [Private]\n");
588 else
589 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      [Public]\n");
590 if(module->classes.first)
591 {
592 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      [Imported Classes]\n");
593 for(_class = module->classes.first; _class; _class = _class->next)
594 {
595 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         %s\n", _class->name);
596 if(_class->itself)
597 {
598 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            [Instantiated]\n");
599 }
600 if(_class->isRemote)
601 {
602 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            [Remote]\n");
603 }
604 if(_class->methods.first)
605 {
606 struct MethodImport * method;
607
608 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            [Imported Methods]\n");
609 for(method = _class->methods.first; method; method = method->next)
610 {
611 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "               %s\n", method->name);
612 if(method->isVirtual)
613 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "                  [Virtual]\n");
614 }
615 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "               .\n");
616 }
617 if(_class->properties.first)
618 {
619 struct PropertyImport * prop;
620
621 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            [Imported Properties]\n");
622 for(prop = _class->properties.first; prop; prop = prop->next)
623 {
624 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "               %s\n", prop->name);
625 if(prop->isVirtual)
626 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "                  [Virtual]\n");
627 if(prop->hasSet)
628 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "                  [Set]\n");
629 if(prop->hasGet)
630 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "                  [Get]\n");
631 }
632 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "               .\n");
633 }
634 }
635 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "        .\n");
636 }
637 if(module->functions.first)
638 {
639 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      [Imported Functions]\n");
640 for(function = module->functions.first; function; function = function->next)
641 {
642 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         %s\n", function->name);
643 }
644 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "        .\n");
645 }
646 }
647 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   .\n");
648 }
649 }
650 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
651 }
652
653 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_CompilerApp;
654
655 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
656
657 extern int GetHostBits(void);
658
659 extern void SetSymbolsDir(const char *  s);
660
661 extern int strcmp(const char * , const char * );
662
663 extern size_t strlen(const char * );
664
665 extern char *  strcpy(char * , const char * );
666
667 extern char *  PassArg(char *  output, const char *  input);
668
669 extern void SetBuildingEcereCom(unsigned int b);
670
671 extern void SetBuildingEcereComModule(unsigned int b);
672
673 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
674
675 extern const char *  GetOutputFile(void);
676
677 extern void SetOutputFile(const char *  s);
678
679 extern const char *  GetSourceFile(void);
680
681 extern void SetSourceFile(const char *  s);
682
683 extern void SetI18nModuleName(const char *  s);
684
685 extern void SetMemoryGuard(unsigned int b);
686
687 extern void SetDefaultNameSpace(const char *  s);
688
689 extern void SetStrictNameSpaces(unsigned int b);
690
691 extern void SetOutputLineNumbers(unsigned int value);
692
693 extern char *  __ecereNameSpace__ecere__sys__PathCat(char *  string, const char *  addedPath);
694
695 extern char *  __ecereNameSpace__ecere__sys__ChangeExtension(const char *  string, const char *  ext, char *  output);
696
697 extern int printf(const char * , ...);
698
699 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
700
701 extern void SetGlobalData(struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace);
702
703 extern void SetExcludedSymbols(struct __ecereNameSpace__ecere__sys__OldList *  list);
704
705 extern void SetGlobalContext(struct Context * context);
706
707 extern void SetCurrentContext(struct Context * context);
708
709 extern void SetTopContext(struct Context * context);
710
711 extern void SetDefines(struct __ecereNameSpace__ecere__sys__OldList *  list);
712
713 extern void SetImports(struct __ecereNameSpace__ecere__sys__OldList *  list);
714
715 extern void SetInCompiler(unsigned int b);
716
717 extern void SetTargetPlatform(int platform);
718
719 extern void SetTargetBits(int bits);
720
721 extern void SetEchoOn(unsigned int b);
722
723 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com____ecere_COM_Initialize(unsigned int guiApp, int argc, char *  argv[]);
724
725 extern void SetPrivateModule(struct __ecereNameSpace__ecere__com__Instance * module);
726
727 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
728
729 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
730
731 struct GlobalData
732 {
733 uintptr_t key;
734 struct __ecereNameSpace__ecere__sys__BTNode * parent;
735 struct __ecereNameSpace__ecere__sys__BTNode * left;
736 struct __ecereNameSpace__ecere__sys__BTNode * right;
737 int depth;
738 struct __ecereNameSpace__ecere__com__Instance * module;
739 char *  dataTypeString;
740 struct Type * dataType;
741 void *  symbol;
742 char *  fullName;
743 } __attribute__ ((gcc_struct));
744
745 extern int snprintf(char * , size_t, const char * , ...);
746
747 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, const char *  commandLine);
748
749 extern void SetFileInput(struct __ecereNameSpace__ecere__com__Instance * file);
750
751 extern void SetMainModule(struct ModuleImport * moduleImport);
752
753 extern char *  __ecereNameSpace__ecere__sys__GetLastDirectory(const char *  string, char *  output);
754
755 extern unsigned int __ecereNameSpace__ecere__sys__StripExtension(char *  string);
756
757 extern void resetScanner(void);
758
759 extern const char *  GetSymbolsDir(void);
760
761 extern unsigned int LoadSymbols(const char *  fileName, int importType, unsigned int loadDllOnly);
762
763 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ImportedModule;
764
765 struct ImportedModule
766 {
767 struct ImportedModule * prev;
768 struct ImportedModule * next;
769 char *  name;
770 int type;
771 int importType;
772 unsigned int globalInstance;
773 unsigned int dllOnly;
774 int importAccess;
775 } __attribute__ ((gcc_struct));
776
777 extern int strcasecmp(const char * , const char * );
778
779 extern unsigned int GetEcereImported(void);
780
781 extern unsigned int GetBuildingEcereCom(void);
782
783 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com__eModule_LoadStrict(struct __ecereNameSpace__ecere__com__Instance * fromModule, const char *  name, int importAccess);
784
785 extern void ParseEc(void);
786
787 extern void CheckDataRedefinitions(void);
788
789 extern void SetYydebug(unsigned int b);
790
791 extern void SetCurrentNameSpace(const char *  s);
792
793 extern void SetDeclMode(int accessMode);
794
795 extern struct __ecereNameSpace__ecere__sys__OldList *  GetAST(void);
796
797 extern void ProcessDBTableDefinitions(void);
798
799 extern void PrePreProcessClassDefinitions(void);
800
801 extern void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module);
802
803 extern void PreProcessClassDefinitions(void);
804
805 extern void ProcessClassDefinitions(void);
806
807 extern void ComputeDataTypes(void);
808
809 extern void ProcessInstantiations(void);
810
811 extern void ProcessMemberAccess(void);
812
813 extern void ProcessInstanceDeclarations(void);
814
815 extern void OutputTree(struct __ecereNameSpace__ecere__sys__OldList * ast, struct __ecereNameSpace__ecere__com__Instance * f);
816
817 extern void FreeASTTree(struct __ecereNameSpace__ecere__sys__OldList * ast);
818
819 extern void FreeContext(struct Context * context);
820
821 extern void FreeExcludedSymbols(struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols);
822
823 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Definition;
824
825 struct Definition;
826
827 extern void FreeModuleDefine(struct Definition * def);
828
829 extern void FreeModuleImport(struct ModuleImport * imp);
830
831 extern void FreeTypeData(struct __ecereNameSpace__ecere__com__Instance * privateModule);
832
833 extern void FreeIncludeFiles(void);
834
835 extern void FreeGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * globalDataList);
836
837 extern void OutputIntlStrings(void);
838
839 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
840
841 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
842
843 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
844
845 struct __ecereNameSpace__ecere__com__Application
846 {
847 int argc;
848 const char * *  argv;
849 int exitCode;
850 unsigned int isGUIApp;
851 struct __ecereNameSpace__ecere__sys__OldList allModules;
852 char *  parsedCommand;
853 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
854 } __attribute__ ((gcc_struct));
855
856 const char *  __ecereProp___ecereNameSpace__ecere__com__Platform_Get_char__PTR_(int this);
857
858 int __ecereProp___ecereNameSpace__ecere__com__Platform_Set_char__PTR_(const char *  value);
859
860 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__com__Platform_char__PTR_;
861
862 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
863
864 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
865
866 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
867
868 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof;
869
870 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__DualPipe;
871
872 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
873
874 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
875
876 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode();
877
878 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
879
880 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Delete(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
881
882 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
883
884 void __ecereMethod_CompilerApp_Main(struct __ecereNameSpace__ecere__com__Instance * this)
885 {
886 char * cppCommand = (((void *)0));
887 char * cppOptions = (((void *)0));
888 int cppOptionsLen = 0;
889 int c;
890 unsigned int valid = 0x1;
891 char defaultOutputFile[797];
892 unsigned int buildingBootStrap = 0x0;
893 int targetPlatform = __ecereNameSpace__ecere__com__GetRuntimePlatform();
894 int targetBits = GetHostBits();
895
896 SetSymbolsDir("");
897 for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc; c++)
898 {
899 const char * arg = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c];
900
901 if(arg[0] == '-')
902 {
903 if(!strcmp(arg + 1, "m32") || !strcmp(arg + 1, "m64"))
904 {
905 int newLen = cppOptionsLen + 1 + strlen(arg);
906
907 cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (newLen + 1));
908 cppOptions[cppOptionsLen] = ' ';
909 strcpy(cppOptions + cppOptionsLen + 1, arg);
910 cppOptionsLen = newLen;
911 targetBits = !strcmp(arg + 1, "m32") ? 32 : 64;
912 }
913 else if(!strcmp(arg + 1, "t32") || !strcmp(arg + 1, "t64"))
914 {
915 targetBits = !strcmp(arg + 1, "t32") ? 32 : 64;
916 }
917 else if(arg[1] == 'D' || arg[1] == 'I')
918 {
919 char * buf;
920 int size = cppOptionsLen + 1 + strlen(arg) * 2 + 1;
921
922 cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (size));
923 buf = cppOptions + cppOptionsLen;
924 *buf++ = ' ';
925 PassArg(buf, arg);
926 cppOptionsLen = cppOptionsLen + 1 + strlen(buf);
927 if(arg[1] == 'D')
928 {
929 if(!strcmp(arg, "-DBUILDING_ECERE_COM"))
930 SetBuildingEcereCom(0x1);
931 else if(!strcmp(arg, "-DECERE_COM_MODULE"))
932 SetBuildingEcereComModule(0x1);
933 else if(!strcmp(arg, "-DECERE_BOOTSTRAP"))
934 buildingBootStrap = 0x1;
935 }
936 }
937 else if(!strcmp(arg + 1, "t"))
938 {
939 if(++c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
940 targetPlatform = __ecereProp___ecereNameSpace__ecere__com__Platform_Set_char__PTR_(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c]);
941 else
942 valid = 0x0;
943 }
944 else if(!strcmp(arg + 1, "cpp"))
945 {
946 if(++c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
947 cppCommand = __ecereNameSpace__ecere__sys__CopyString(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c]);
948 else
949 valid = 0x0;
950 }
951 else if(!strcmp(arg + 1, "o"))
952 {
953 if(!GetOutputFile() && c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
954 {
955 SetOutputFile(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c + 1]);
956 c++;
957 }
958 else
959 valid = 0x0;
960 }
961 else if(!strcmp(arg + 1, "c"))
962 {
963 if(!GetSourceFile() && c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
964 {
965 SetSourceFile(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c + 1]);
966 c++;
967 }
968 else
969 valid = 0x0;
970 }
971 else if(!strcmp(arg + 1, "isystem") || !strcmp(arg + 1, "isysroot"))
972 {
973 if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
974 {
975 char * buf;
976 const char * arg1 = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[++c];
977 int size = cppOptionsLen + 1 + strlen(arg) * 2 + strlen(arg1) * 2 + 1;
978
979 cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (size));
980 buf = cppOptions + cppOptionsLen;
981 *buf++ = ' ';
982 buf = PassArg(buf, arg);
983 *buf++ = ' ';
984 buf = PassArg(buf, arg1);
985 cppOptionsLen = buf - cppOptions;
986 }
987 else
988 valid = 0x0;
989 }
990 else if(!strcmp(arg + 1, "fno-diagnostics-show-caret"))
991 {
992 char * buf;
993 int size = cppOptionsLen + 1 + strlen(arg) * 2 + 1;
994
995 cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (size));
996 buf = cppOptions + cppOptionsLen;
997 *buf++ = ' ';
998 PassArg(buf, arg);
999 cppOptionsLen = cppOptionsLen + 1 + strlen(buf);
1000 }
1001 else if(!strcmp(arg + 1, "symbols"))
1002 {
1003 if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
1004 {
1005 SetSymbolsDir(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c + 1]);
1006 c++;
1007 }
1008 else
1009 valid = 0x0;
1010 }
1011 else if(!strcmp(arg + 1, "module"))
1012 {
1013 if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
1014 {
1015 SetI18nModuleName(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c + 1]);
1016 c++;
1017 }
1018 else
1019 valid = 0x0;
1020 }
1021 else if(!strcmp(arg + 1, "memguard"))
1022 {
1023 SetMemoryGuard(0x1);
1024 }
1025 else if(!strcmp(arg + 1, "defaultns"))
1026 {
1027 if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
1028 {
1029 SetDefaultNameSpace(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c + 1]);
1030 c++;
1031 }
1032 else
1033 valid = 0x0;
1034 }
1035 else if(!strcmp(arg + 1, "strictns"))
1036 {
1037 SetStrictNameSpaces(0x1);
1038 }
1039 else if(!strcmp(arg + 1, "nolinenumbers"))
1040 {
1041 SetOutputLineNumbers(0x0);
1042 }
1043 }
1044 else
1045 valid = 0x0;
1046 }
1047 if(valid)
1048 {
1049 if(!cppCommand)
1050 cppCommand = __ecereNameSpace__ecere__sys__CopyString("gcc");
1051 if(!GetSourceFile())
1052 valid = 0x0;
1053 else if(!GetOutputFile())
1054 {
1055 strcpy(defaultOutputFile, "");
1056 __ecereNameSpace__ecere__sys__PathCat(defaultOutputFile, GetSourceFile());
1057 __ecereNameSpace__ecere__sys__ChangeExtension(defaultOutputFile, "c", defaultOutputFile);
1058 SetOutputFile(defaultOutputFile);
1059 }
1060 }
1061 if(!valid)
1062 {
1063 printf(__ecereNameSpace__ecere__GetTranslatedString("ecc", "Syntax:\n   ecc [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-module <module>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n", (((void *)0))));
1064 }
1065 else
1066 {
1067 struct __ecereNameSpace__ecere__com__Instance * cppOutput;
1068 char command[3075];
1069
1070 SetGlobalData(&globalData);
1071 SetExcludedSymbols(&_excludedSymbols);
1072 SetGlobalContext(globalContext);
1073 SetCurrentContext(globalContext);
1074 SetTopContext(globalContext);
1075 SetDefines(&defines);
1076 SetImports(&imports);
1077 SetInCompiler(0x1);
1078 SetTargetPlatform(targetPlatform);
1079 SetTargetBits(targetBits);
1080 SetEchoOn(0x0);
1081 privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize((unsigned int)(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? 2 : targetBits == 32 ? 4 : (unsigned int)0) | 8), 1, (((void *)0)));
1082 SetPrivateModule(privateModule);
1083 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1084 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1085
1086 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint"), __ecereInstance1->type = ProcessTypeString("unsigned int", 0x0), __ecereInstance1;
1087 }));
1088 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1089 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1090
1091 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint64"), __ecereInstance1->type = ProcessTypeString("unsigned int64", 0x0), __ecereInstance1;
1092 }));
1093 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1094 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1095
1096 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint32"), __ecereInstance1->type = ProcessTypeString("unsigned int", 0x0), __ecereInstance1;
1097 }));
1098 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1099 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1100
1101 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint16"), __ecereInstance1->type = ProcessTypeString("unsigned short", 0x0), __ecereInstance1;
1102 }));
1103 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1104 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1105
1106 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("byte"), __ecereInstance1->type = ProcessTypeString("unsigned char", 0x0), __ecereInstance1;
1107 }));
1108 if(buildingBootStrap)
1109 {
1110 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1111 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1112
1113 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("intptr_t"), __ecereInstance1->type = ProcessTypeString("intptr", 0x0), __ecereInstance1;
1114 }));
1115 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1116 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1117
1118 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uintptr_t"), __ecereInstance1->type = ProcessTypeString("uintptr", 0x0), __ecereInstance1;
1119 }));
1120 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1121 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1122
1123 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("ssize_t"), __ecereInstance1->type = ProcessTypeString("intsize", 0x0), __ecereInstance1;
1124 }));
1125 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
1126 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1127
1128 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("size_t"), __ecereInstance1->type = ProcessTypeString("uintsize", 0x0), __ecereInstance1;
1129 }));
1130 }
1131 {
1132 struct GlobalData * data = (data = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_GlobalData), data->fullName = __ecereNameSpace__ecere__sys__CopyString("__thisModule"), data->dataTypeString = __ecereNameSpace__ecere__sys__CopyString("Module"), data->module = privateModule, data);
1133
1134 data->key = (uintptr_t)data->fullName;
1135 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalData.functions, (struct __ecereNameSpace__ecere__sys__BTNode *)data);
1136 }
1137 snprintf(command, sizeof (command), "%s%s -x c -E %s\"%s\"", cppCommand, cppOptions ? cppOptions : "", buildingBootStrap ? "" : "-include stdint.h -include sys/types.h ", GetSourceFile());
1138 command[sizeof (command) - 1] = (char)0;
1139 if((cppOutput = __ecereNameSpace__ecere__sys__DualPipeOpen((((unsigned int)(0x1))), command)))
1140 {
1141 char impFile[797];
1142 struct ImportedModule * module;
1143 char sourceFileName[274];
1144 char mainModuleName[274];
1145 int exitCode;
1146 struct __ecereNameSpace__ecere__sys__OldList * ast;
1147 struct __ecereNameSpace__ecere__com__Instance * fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1148
1149 SetFileInput(fileInput);
1150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&imports, (mainModule = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImport)));
1151 SetMainModule(mainModule);
1152 __ecereNameSpace__ecere__sys__GetLastDirectory(GetSourceFile(), sourceFileName);
1153 strcpy(mainModuleName, sourceFileName);
1154 __ecereNameSpace__ecere__sys__StripExtension(mainModuleName);
1155 module = __extension__ ({
1156 struct ImportedModule * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ImportedModule);
1157
1158 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(mainModuleName), __ecereInstance1->type = 0, __ecereInstance1;
1159 });
1160 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&defines, module);
1161 resetScanner();
1162 while(!((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))__extension__ ({
1163 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = cppOutput;
1164
1165 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__DualPipe->_vTbl;
1166 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof])(cppOutput))
1167 {
1168 char junk[4096];
1169 int count = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1170 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = cppOutput;
1171
1172 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__DualPipe->_vTbl;
1173 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(cppOutput, junk, 1, 4096);
1174
1175 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1176 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
1177
1178 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1179 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, junk, 1, count);
1180 }
1181 exitCode = __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode(cppOutput);
1182 (__ecereNameSpace__ecere__com__eInstance_DecRef(cppOutput), cppOutput = 0);
1183 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1184 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
1185
1186 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1187 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
1188 {
1189 char symFile[274];
1190 char symLocation[797];
1191 struct ImportedModule * module, * next;
1192
1193 strcpy(symFile, sourceFileName);
1194 __ecereNameSpace__ecere__sys__ChangeExtension(symFile, "sym", symFile);
1195 strcpy(symLocation, GetSymbolsDir());
1196 __ecereNameSpace__ecere__sys__PathCat(symLocation, symFile);
1197 LoadSymbols(symLocation, 3, 0x0);
1198 for(module = defines.first; module; module = next)
1199 {
1200 next = module->next;
1201 if(module->type == 0 && (strcasecmp)(module->name, mainModuleName))
1202 {
1203 (__ecereNameSpace__ecere__com__eSystem_Delete(module->name), module->name = 0);
1204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Delete(&defines, module);
1205 }
1206 }
1207 if(!GetEcereImported() && !GetBuildingEcereCom())
1208 __ecereNameSpace__ecere__com__eModule_LoadStrict(privateModule, "ecereCOM", 1);
1209 }
1210 ParseEc();
1211 CheckDataRedefinitions();
1212 SetYydebug(0x0);
1213 SetCurrentNameSpace((((void *)0)));
1214 SetDefaultNameSpace((((void *)0)));
1215 SetDeclMode(2);
1216 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
1217 SetFileInput((((void *)0)));
1218 ast = GetAST();
1219 if(!exitCode)
1220 {
1221 ProcessDBTableDefinitions();
1222 PrePreProcessClassDefinitions();
1223 ComputeModuleClasses(privateModule);
1224 PreProcessClassDefinitions();
1225 ComputeModuleClasses(privateModule);
1226 ProcessClassDefinitions();
1227 ComputeDataTypes();
1228 ProcessInstantiations();
1229 ProcessMemberAccess();
1230 ProcessInstanceDeclarations();
1231 strcpy(impFile, GetSymbolsDir());
1232 __ecereNameSpace__ecere__sys__PathCat(impFile, sourceFileName);
1233 __ecereNameSpace__ecere__sys__ChangeExtension(impFile, "imp", impFile);
1234 if(imports.first)
1235 OutputImports(impFile);
1236 if(!((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->exitCode)
1237 {
1238 struct __ecereNameSpace__ecere__com__Instance * output = __ecereNameSpace__ecere__sys__FileOpen(GetOutputFile(), 2);
1239
1240 if(output)
1241 {
1242 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "/* Code generated from eC source file: %s */\n", sourceFileName);
1243 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#if defined(__GNUC__)\n");
1244 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef long long int64;\n");
1245 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef unsigned long long uint64;\n");
1246 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#ifndef _WIN32\n");
1247 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __declspec(x)\n");
1248 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
1249 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#elif defined(__TINYC__)\n");
1250 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#include <stdarg.h>\n");
1251 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __builtin_va_list va_list\n");
1252 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __builtin_va_start va_start\n");
1253 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __builtin_va_end va_end\n");
1254 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#ifdef _WIN32\n");
1255 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define strcasecmp stricmp\n");
1256 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define strncasecmp strnicmp\n");
1257 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __declspec(x) __attribute__((x))\n");
1258 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#else\n");
1259 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __declspec(x)\n");
1260 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
1261 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef long long int64;\n");
1262 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef unsigned long long uint64;\n");
1263 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#else\n");
1264 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef __int64 int64;\n");
1265 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef unsigned __int64 uint64;\n");
1266 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
1267 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#ifdef __BIG_ENDIAN__\n");
1268 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __ENDIAN_PAD(x) (8 - (x))\n");
1269 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#else\n");
1270 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __ENDIAN_PAD(x) 0\n");
1271 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
1272 if(buildingBootStrap)
1273 {
1274 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#include <stdint.h>\n");
1275 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#include <sys/types.h>\n");
1276 }
1277 if(ast)
1278 OutputTree(ast, output);
1279 (__ecereNameSpace__ecere__com__eInstance_DecRef(output), output = 0);
1280 }
1281 }
1282 }
1283 else
1284 ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->exitCode = exitCode;
1285 if(ast)
1286 {
1287 FreeASTTree(ast);
1288 }
1289 }
1290 FreeContext(globalContext);
1291 FreeExcludedSymbols(&_excludedSymbols);
1292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&defines, FreeModuleDefine);
1293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&imports, FreeModuleImport);
1294 FreeTypeData(privateModule);
1295 FreeIncludeFiles();
1296 FreeGlobalData(&globalData);
1297 (__ecereNameSpace__ecere__com__eInstance_DecRef(privateModule), privateModule = 0);
1298 }
1299 (__ecereNameSpace__ecere__com__eSystem_Delete(cppCommand), cppCommand = 0);
1300 (__ecereNameSpace__ecere__com__eSystem_Delete(cppOptions), cppOptions = 0);
1301 SetSymbolsDir((((void *)0)));
1302 OutputIntlStrings();
1303 }
1304
1305 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char *  name, const char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
1306
1307 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1308
1309 struct __ecereNameSpace__ecere__com__Module
1310 {
1311 struct __ecereNameSpace__ecere__com__Instance * application;
1312 struct __ecereNameSpace__ecere__sys__OldList classes;
1313 struct __ecereNameSpace__ecere__sys__OldList defines;
1314 struct __ecereNameSpace__ecere__sys__OldList functions;
1315 struct __ecereNameSpace__ecere__sys__OldList modules;
1316 struct __ecereNameSpace__ecere__com__Instance * prev;
1317 struct __ecereNameSpace__ecere__com__Instance * next;
1318 const char *  name;
1319 void *  library;
1320 void *  Unload;
1321 int importType;
1322 int origImportType;
1323 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1324 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1325 } __attribute__ ((gcc_struct));
1326
1327 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
1328
1329 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, void *  function, int declMode);
1330
1331 void __ecereRegisterModule_ecc(struct __ecereNameSpace__ecere__com__Instance * module)
1332 {
1333 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
1334
1335 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "CompilerApp", "ecere::com::Application", 0, 0, 0, 0, module, 2, 1);
1336 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
1337 __ecereClass_CompilerApp = class;
1338 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Main", 0, __ecereMethod_CompilerApp_Main, 1);
1339 }
1340
1341 void __ecereUnregisterModule_ecc(struct __ecereNameSpace__ecere__com__Instance * module)
1342 {
1343
1344 }
1345
1346 int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  a, const char *  b);
1347
1348 void __ecereCreateModuleInstances_ecc()
1349 {
1350 globalContext = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1351 (globalData.classes.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString, globalData.defines.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString, globalData.functions.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString, globalData.nameSpaces.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString);
1352 }
1353
1354 void __ecereDestroyModuleInstances_ecc()
1355 {
1356 ((globalContext ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)globalContext) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(globalContext)) : 0), globalContext = 0);
1357 }
1358