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