compiler/ecc,ecp: Resolved issues from multipass preprocessing with MinGW-w64
[sdk] / compiler / bootstrap / ecs / bootstrap / ecs.c
1 #if defined(__GNUC__)
2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
5 #include <stdarg.h>
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
9 #ifdef _WIN32
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
13 #else
14 #define __declspec(x)
15 #endif
16 typedef long long int64;
17 typedef unsigned long long uint64;
18 #else
19 typedef __int64 int64;
20 typedef unsigned __int64 uint64;
21 #endif
22 #ifdef __BIG_ENDIAN__
23 #define __ENDIAN_PAD(x) (8 - (x))
24 #else
25 #define __ENDIAN_PAD(x) 0
26 #endif
27 #ifdef __MINGW32__
28 #ifdef _WIN64
29 typedef unsigned long long int uintptr_t;
30 typedef long long int intptr_t;
31 #else
32 typedef unsigned int uintptr_t;
33 typedef int intptr_t;
34 #endif
35 #else
36 #include <stdint.h>
37 #endif
38 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
39
40 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
41
42 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
43
44 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
45
46 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
47
48 struct __ecereNameSpace__ecere__sys__BTNode;
49
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
51
52 struct __ecereNameSpace__ecere__sys__BinaryTree
53 {
54 struct __ecereNameSpace__ecere__sys__BTNode * root;
55 int count;
56 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
57 void (*  FreeKey)(void *  key);
58 } __attribute__ ((gcc_struct));
59
60 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
61
62 struct __ecereNameSpace__ecere__sys__OldList
63 {
64 void *  first;
65 void *  last;
66 int count;
67 unsigned int offset;
68 unsigned int circ;
69 } __attribute__ ((gcc_struct));
70
71 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
72
73 struct __ecereNameSpace__ecere__com__Method
74 {
75 char *  name;
76 struct __ecereNameSpace__ecere__com__Method * parent;
77 struct __ecereNameSpace__ecere__com__Method * left;
78 struct __ecereNameSpace__ecere__com__Method * right;
79 int depth;
80 int (*  function)();
81 int vid;
82 int type;
83 struct __ecereNameSpace__ecere__com__Class * _class;
84 void *  symbol;
85 char *  dataTypeString;
86 struct Type * dataType;
87 int memberAccess;
88 } __attribute__ ((gcc_struct));
89
90 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
91
92 struct __ecereNameSpace__ecere__com__Property
93 {
94 struct __ecereNameSpace__ecere__com__Property * prev;
95 struct __ecereNameSpace__ecere__com__Property * next;
96 char *  name;
97 unsigned int isProperty;
98 int memberAccess;
99 int id;
100 struct __ecereNameSpace__ecere__com__Class * _class;
101 char *  dataTypeString;
102 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
103 struct Type * dataType;
104 void (*  Set)();
105 int (*  Get)();
106 unsigned int (*  IsSet)();
107 void *  data;
108 void *  symbol;
109 int vid;
110 unsigned int conversion;
111 unsigned int watcherOffset;
112 char *  category;
113 unsigned int compiled;
114 unsigned int selfWatchable;
115 unsigned int isWatchable;
116 } __attribute__ ((gcc_struct));
117
118 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
119
120 struct CodePosition
121 {
122 int line;
123 int charPos;
124 int pos;
125 unsigned int included;
126 } __attribute__ ((gcc_struct));
127
128 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
129
130 struct Location
131 {
132 struct CodePosition start;
133 struct CodePosition end;
134 } __attribute__ ((gcc_struct));
135
136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
137
138 struct Attrib;
139
140 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
141
142 struct ExtDecl;
143
144 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
145
146 struct ClassDefinition;
147
148 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
149
150 struct Context;
151
152 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
153
154 struct Instantiation;
155
156 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
157
158 struct Declaration;
159
160 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
161
162 struct Statement;
163
164 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
165
166 struct TypeName;
167
168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
169
170 struct Initializer;
171
172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
173
174 struct __ecereNameSpace__ecere__com__DataValue
175 {
176 union
177 {
178 char c;
179 unsigned char uc;
180 short s;
181 unsigned short us;
182 int i;
183 unsigned int ui;
184 void *  p;
185 float f;
186 double d;
187 long long i64;
188 uint64 ui64;
189 } __attribute__ ((gcc_struct));
190 } __attribute__ ((gcc_struct));
191
192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
193
194 struct Expression;
195
196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
197
198 struct TemplateDatatype;
199
200 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
201
202 struct TemplateArgument;
203
204 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
205
206 struct TemplateParameter;
207
208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
209
210 struct Specifier;
211
212 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
213
214 struct Identifier;
215
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
217
218 struct Declarator;
219
220 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
221
222 struct FunctionDefinition;
223
224 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
225
226 struct DBTableDef;
227
228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
229
230 struct External;
231
232 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
233
234 struct ModuleImport
235 {
236 struct ModuleImport * prev;
237 struct ModuleImport * next;
238 char *  name;
239 struct __ecereNameSpace__ecere__sys__OldList classes;
240 struct __ecereNameSpace__ecere__sys__OldList functions;
241 int importType;
242 int importAccess;
243 } __attribute__ ((gcc_struct));
244
245 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
246
247 struct ClassImport
248 {
249 struct ClassImport * prev;
250 struct ClassImport * next;
251 char *  name;
252 struct __ecereNameSpace__ecere__sys__OldList methods;
253 struct __ecereNameSpace__ecere__sys__OldList properties;
254 unsigned int itself;
255 unsigned int isRemote;
256 } __attribute__ ((gcc_struct));
257
258 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
259
260 struct Symbol
261 {
262 char *  string;
263 struct Symbol * parent;
264 struct Symbol * left;
265 struct Symbol * right;
266 int depth;
267 struct Type * type;
268 union
269 {
270 struct __ecereNameSpace__ecere__com__Method * method;
271 struct __ecereNameSpace__ecere__com__Property * _property;
272 struct __ecereNameSpace__ecere__com__Class * registered;
273 } __attribute__ ((gcc_struct));
274 int id;
275 int idCode;
276 union
277 {
278 struct
279 {
280 struct External * pointerExternal;
281 struct External * structExternal;
282 } __attribute__ ((gcc_struct));
283 struct
284 {
285 struct External * externalGet;
286 struct External * externalSet;
287 struct External * externalPtr;
288 struct External * externalIsSet;
289 } __attribute__ ((gcc_struct));
290 struct
291 {
292 struct External * methodExternal;
293 struct External * methodCodeExternal;
294 } __attribute__ ((gcc_struct));
295 } __attribute__ ((gcc_struct));
296 unsigned int imported;
297 unsigned int declaredStructSym;
298 struct __ecereNameSpace__ecere__com__Class * _class;
299 unsigned int declaredStruct;
300 unsigned int needConstructor;
301 unsigned int needDestructor;
302 char *  constructorName;
303 char *  structName;
304 char *  className;
305 char *  destructorName;
306 struct ModuleImport * module;
307 struct ClassImport * _import;
308 struct Location nameLoc;
309 unsigned int isParam;
310 unsigned int isRemote;
311 unsigned int isStruct;
312 unsigned int fireWatchersDone;
313 int declaring;
314 unsigned int classData;
315 unsigned int isStatic;
316 char *  shortName;
317 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
318 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
319 struct Context * ctx;
320 int isIterator;
321 struct Expression * propCategory;
322 } __attribute__ ((gcc_struct));
323
324 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
325
326 struct Type
327 {
328 struct Type * prev;
329 struct Type * next;
330 int refCount;
331 union
332 {
333 struct Symbol * _class;
334 struct
335 {
336 struct __ecereNameSpace__ecere__sys__OldList members;
337 char *  enumName;
338 } __attribute__ ((gcc_struct));
339 struct
340 {
341 struct Type * returnType;
342 struct __ecereNameSpace__ecere__sys__OldList params;
343 struct Symbol * thisClass;
344 unsigned int staticMethod;
345 struct TemplateParameter * thisClassTemplate;
346 } __attribute__ ((gcc_struct));
347 struct
348 {
349 struct __ecereNameSpace__ecere__com__Method * method;
350 struct __ecereNameSpace__ecere__com__Class * methodClass;
351 struct __ecereNameSpace__ecere__com__Class * usedClass;
352 } __attribute__ ((gcc_struct));
353 struct
354 {
355 struct Type * arrayType;
356 int arraySize;
357 struct Expression * arraySizeExp;
358 unsigned int freeExp;
359 struct Symbol * enumClass;
360 } __attribute__ ((gcc_struct));
361 struct Type * type;
362 struct TemplateParameter * templateParameter;
363 } __attribute__ ((gcc_struct));
364 unsigned int isSigned;
365 int kind;
366 unsigned int constant;
367 unsigned int size;
368 char *  name;
369 char *  typeName;
370 unsigned int count;
371 unsigned int truth;
372 int classObjectType;
373 unsigned int byReference;
374 unsigned int extraParam;
375 int alignment;
376 unsigned int directClassAccess;
377 unsigned int computing;
378 unsigned int dllExport;
379 unsigned int offset;
380 unsigned int keepCast;
381 unsigned int passAsTemplate;
382 int bitFieldCount;
383 } __attribute__ ((gcc_struct));
384
385 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
386
387 struct __ecereNameSpace__ecere__com__Class
388 {
389 struct __ecereNameSpace__ecere__com__Class * prev;
390 struct __ecereNameSpace__ecere__com__Class * next;
391 char *  name;
392 int offset;
393 int structSize;
394 int (* *  _vTbl)();
395 int vTblSize;
396 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
397 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
398 int offsetClass;
399 int sizeClass;
400 struct __ecereNameSpace__ecere__com__Class * base;
401 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
402 struct __ecereNameSpace__ecere__sys__BinaryTree members;
403 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
404 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
405 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
406 struct __ecereNameSpace__ecere__sys__OldList derivatives;
407 int memberID;
408 int startMemberID;
409 int type;
410 struct __ecereNameSpace__ecere__com__Instance * module;
411 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
412 char *  dataTypeString;
413 struct Type * dataType;
414 int typeSize;
415 int defaultAlignment;
416 void (*  Initialize)();
417 int memberOffset;
418 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
419 char *  designerClass;
420 unsigned int noExpansion;
421 char *  defaultProperty;
422 unsigned int comRedefinition;
423 int count;
424 unsigned int isRemote;
425 unsigned int internalDecl;
426 void *  data;
427 unsigned int computeSize;
428 int structAlignment;
429 int destructionWatchOffset;
430 unsigned int fixed;
431 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
432 int inheritanceAccess;
433 char *  fullName;
434 void *  symbol;
435 struct __ecereNameSpace__ecere__sys__OldList conversions;
436 struct __ecereNameSpace__ecere__sys__OldList templateParams;
437 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
438 struct __ecereNameSpace__ecere__com__Class * templateClass;
439 struct __ecereNameSpace__ecere__sys__OldList templatized;
440 int numParams;
441 } __attribute__ ((gcc_struct));
442
443 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
444
445 struct __ecereNameSpace__ecere__com__Instance
446 {
447 int (* *  _vTbl)();
448 struct __ecereNameSpace__ecere__com__Class * _class;
449 int _refCount;
450 } __attribute__ ((gcc_struct));
451
452 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
453
454 struct __ecereNameSpace__ecere__com__DataMember
455 {
456 struct __ecereNameSpace__ecere__com__DataMember * prev;
457 struct __ecereNameSpace__ecere__com__DataMember * next;
458 char *  name;
459 unsigned int isProperty;
460 int memberAccess;
461 int id;
462 struct __ecereNameSpace__ecere__com__Class * _class;
463 char *  dataTypeString;
464 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
465 struct Type * dataType;
466 int type;
467 int offset;
468 int memberID;
469 struct __ecereNameSpace__ecere__sys__OldList members;
470 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
471 int memberOffset;
472 int structAlignment;
473 } __attribute__ ((gcc_struct));
474
475 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
476
477 struct __ecereNameSpace__ecere__com__SerialBuffer
478 {
479 unsigned char *  _buffer;
480 unsigned int count;
481 unsigned int _size;
482 unsigned int pos;
483 } __attribute__ ((gcc_struct));
484
485 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
486
487 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
488 {
489 union
490 {
491 struct
492 {
493 char *  dataTypeString;
494 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
495 } __attribute__ ((gcc_struct));
496 struct __ecereNameSpace__ecere__com__DataValue expression;
497 struct
498 {
499 char *  memberString;
500 union
501 {
502 struct __ecereNameSpace__ecere__com__DataMember * member;
503 struct __ecereNameSpace__ecere__com__Property * prop;
504 struct __ecereNameSpace__ecere__com__Method * method;
505 } __attribute__ ((gcc_struct));
506 } __attribute__ ((gcc_struct));
507 } __attribute__ ((gcc_struct));
508 } __attribute__ ((gcc_struct));
509
510
511 static unsigned int i18n;
512
513 static int targetPlatform;
514
515 static int targetBits;
516
517 static unsigned int isConsole;
518
519 static unsigned int isDynamicLibrary;
520
521 static unsigned int isStaticLibrary;
522
523 static struct __ecereNameSpace__ecere__sys__OldList modules;
524
525 static struct __ecereNameSpace__ecere__com__Instance * dcomSymbols;
526
527 struct __ecereNameSpace__ecere__sys__OldList _defines = 
528 {
529 0, 0, 0, 0, 0
530 };
531
532 struct __ecereNameSpace__ecere__sys__OldList _imports = 
533 {
534 0, 0, 0, 0, 0
535 };
536
537 struct __ecereNameSpace__ecere__sys__OldList _excludedSymbols = 
538 {
539 0, 0, 0, (unsigned int)&((struct Symbol *)(void *)0)->left, 0
540 };
541
542 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
543
544 struct __ecereNameSpace__ecere__com__NameSpace
545 {
546 char *  name;
547 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
548 struct __ecereNameSpace__ecere__com__NameSpace *  left;
549 struct __ecereNameSpace__ecere__com__NameSpace *  right;
550 int depth;
551 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
552 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
553 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
554 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
555 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
556 } __attribute__ ((gcc_struct));
557
558 static struct __ecereNameSpace__ecere__com__NameSpace globalData;
559
560 static struct Context * theGlobalContext;
561
562 static struct ModuleImport * mainModule;
563
564 static struct __ecereNameSpace__ecere__com__Instance * privateModule;
565
566 static char mainModuleName[797];
567
568 static char projectName[797];
569
570 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__FileOpen(char *  fileName, int mode);
571
572 extern char *  __ecereNameSpace__ecere__sys__TrimLSpaces(char *  string, char *  output);
573
574 extern int strcmp(const char * , const char * );
575
576 extern struct ModuleImport * GetMainModule(void);
577
578 extern void SetMainModule(struct ModuleImport * moduleImport);
579
580 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
581
582 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
583
584 struct MethodImport
585 {
586 struct MethodImport * prev;
587 struct MethodImport * next;
588 char *  name;
589 unsigned int isVirtual;
590 } __attribute__ ((gcc_struct));
591
592 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
593
594 struct PropertyImport
595 {
596 struct PropertyImport * prev;
597 struct PropertyImport * next;
598 char *  name;
599 unsigned int isVirtual;
600 unsigned int hasSet;
601 unsigned int hasGet;
602 } __attribute__ ((gcc_struct));
603
604 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
605
606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
607
608 struct FunctionImport
609 {
610 struct FunctionImport * prev;
611 struct FunctionImport * next;
612 char *  name;
613 } __attribute__ ((gcc_struct));
614
615 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(struct __ecereNameSpace__ecere__com__Instance * this, char *  s, int max);
616
617 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
618
619 void *  __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(struct __ecereNameSpace__ecere__sys__OldList * this, char *  name, unsigned int warn);
620
621 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
622
623 static void LoadImports(char * fileName)
624 {
625 void * __ecereTemp1;
626 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__sys__FileOpen(fileName, 1);
627
628 if(f)
629 {
630 for(; ; )
631 {
632 char line[1024];
633
634 if(!__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof line))
635 break;
636 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
637 if(line[0] == '[')
638 {
639 if(!strcmp(line, "[Imported Modules]"))
640 {
641 struct ModuleImport * module = (((void *)0));
642
643 for(; ; )
644 {
645 if(!__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof line))
646 break;
647 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
648 if(!strcmp(line, "."))
649 break;
650 if(line[0] == '[')
651 {
652 struct ClassImport * _class = (((void *)0));
653 struct FunctionImport * function = (((void *)0));
654
655 if(!strcmp(line, "[This]"))
656 {
657 if((mainModule = GetMainModule()))
658 module = mainModule;
659 else
660 {
661 mainModule = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImport);
662 SetMainModule(mainModule);
663 module = mainModule;
664 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&_imports, module);
665 }
666 }
667 else if(!strcmp(line, "[Static]"))
668 {
669 module->importType = 1;
670 }
671 else if(!strcmp(line, "[Remote]"))
672 {
673 module->importType = 2;
674 }
675 else if(!strcmp(line, "[Private]"))
676 {
677 if(module->importAccess != 1)
678 module->importAccess = 2;
679 }
680 else if(!strcmp(line, "[Public]"))
681 {
682 module->importAccess = 1;
683 }
684 else if(!strcmp(line, "[Imported Classes]"))
685 {
686 for(; ; )
687 {
688 if(!__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof line))
689 break;
690 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
691 if(!strcmp(line, "."))
692 break;
693 if(line[0] == '[')
694 {
695 if(!strcmp(line, "[Instantiated]"))
696 {
697 _class->itself = 0x1;
698 }
699 else if(!strcmp(line, "[Remote]"))
700 {
701 _class->isRemote = (unsigned int)1;
702 }
703 else if(!strcmp(line, "[Imported Methods]"))
704 {
705 struct MethodImport * method = (((void *)0));
706
707 for(; ; )
708 {
709 if(!__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof line))
710 break;
711 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
712 if(!strcmp(line, "."))
713 break;
714 if(line[0] != '[')
715 {
716 if(!(method = __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(&_class->methods, line, 0x0)))
717 {
718 method = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(line), ((struct MethodImport *)__ecereTemp1));
719 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&_class->methods, method);
720 }
721 }
722 else if(!strcmp(line, "[Virtual]"))
723 method->isVirtual = 0x1;
724 }
725 }
726 else if(!strcmp(line, "[Imported Properties]"))
727 {
728 struct PropertyImport * prop = (((void *)0));
729
730 for(; ; )
731 {
732 if(!__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof line))
733 break;
734 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
735 if(!strcmp(line, "."))
736 break;
737 if(line[0] != '[')
738 {
739 if(!(prop = __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(&_class->properties, line, 0x0)))
740 {
741 prop = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(line), ((struct PropertyImport *)__ecereTemp1));
742 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&_class->properties, prop);
743 }
744 }
745 else if(!strcmp(line, "[Set]"))
746 prop->hasSet = 0x1;
747 else if(!strcmp(line, "[Get]"))
748 prop->hasGet = 0x1;
749 else if(!strcmp(line, "[Virtual]"))
750 prop->isVirtual = 0x1;
751 }
752 }
753 }
754 else
755 {
756 if(!(_class = __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(&module->classes, line, 0x0)))
757 {
758 _class = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(line), ((struct ClassImport *)__ecereTemp1));
759 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&module->classes, _class);
760 }
761 }
762 }
763 }
764 else if(!strcmp(line, "[Imported Functions]"))
765 {
766 for(; ; )
767 {
768 if(!__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof line))
769 break;
770 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
771 if(!strcmp(line, "."))
772 break;
773 if(line[0] == '[')
774 {
775 }
776 else
777 {
778 if(!(function = __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(&module->functions, line, 0x0)))
779 {
780 function = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(line), ((struct FunctionImport *)__ecereTemp1));
781 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&module->functions, function);
782 }
783 }
784 }
785 }
786 }
787 else
788 {
789 if(!(module = __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(&_imports, line, 0x0)))
790 {
791 if(!strcmp(line, "ecereCOM"))
792 {
793 module = __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(&_imports, "ecere", 0x0);
794 }
795 else if(!strcmp(line, "ecere"))
796 {
797 module = __ecereMethod___ecereNameSpace__ecere__sys__OldList_FindName(&_imports, "ecereCOM", 0x0);
798 if(module)
799 {
800 (__ecereNameSpace__ecere__com__eSystem_Delete(module->name), module->name = 0);
801 module->name = __ecereNameSpace__ecere__sys__CopyString("ecere");
802 }
803 }
804 if(!module)
805 {
806 module = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImport), ((struct ModuleImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(line), ((struct ModuleImport *)__ecereTemp1));
807 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&_imports, module);
808 }
809 }
810 }
811 }
812 }
813 }
814 }
815 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
816 }
817 }
818
819 static struct __ecereNameSpace__ecere__com__Class * thisAppClass;
820
821 struct ModuleInfo
822 {
823 struct ModuleInfo * prev, * next;
824 char * name;
825 unsigned int globalInstance;
826 } __attribute__ ((gcc_struct));
827
828 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleInfo;
829
830 extern char *  __ecereNameSpace__ecere__sys__GetLastDirectory(char *  string, char *  output);
831
832 extern unsigned int __ecereNameSpace__ecere__sys__StripExtension(char *  string);
833
834 extern char *  strcpy(char * , const char * );
835
836 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
837
838 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ImportedModule;
839
840 struct ImportedModule
841 {
842 struct ImportedModule * prev;
843 struct ImportedModule * next;
844 char *  name;
845 int type;
846 int importType;
847 unsigned int globalInstance;
848 unsigned int dllOnly;
849 int importAccess;
850 } __attribute__ ((gcc_struct));
851
852 static void BindDCOMServer();
853
854 static void BindDCOMClient();
855
856 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
857
858 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
859
860 extern void MangleClassName(char *  className);
861
862 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
863
864 extern struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
865
866 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
867
868 extern void FinishTemplatesContext(struct Context * context);
869
870 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
871
872 struct __ecereNameSpace__ecere__com__GlobalFunction
873 {
874 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
875 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
876 char *  name;
877 int (*  function)();
878 struct __ecereNameSpace__ecere__com__Instance * module;
879 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
880 char *  dataTypeString;
881 struct Type * dataType;
882 void *  symbol;
883 } __attribute__ ((gcc_struct));
884
885 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
886
887 extern int sprintf(char * , char * , ...);
888
889 extern void __ecereNameSpace__ecere__com__eInstance_Delete(struct __ecereNameSpace__ecere__com__Instance * instance);
890
891 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts;
892
893 int __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(struct __ecereNameSpace__ecere__com__Instance * this, char *  format, ...);
894
895 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
896
897 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof;
898
899 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
900
901 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
902
903 static void WriteMain(char * fileName)
904 {
905 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__sys__FileOpen(fileName, 2);
906
907 if(f)
908 {
909 struct ModuleImport * module;
910 struct ModuleInfo * defModule;
911 unsigned int nonInst = 0x0, anyMethod = 0x0, anyProp = 0x0, anyFunction = 0x0;
912 struct ImportedModule * importedModule;
913
914 __ecereNameSpace__ecere__sys__GetLastDirectory(fileName, mainModuleName);
915 __ecereNameSpace__ecere__sys__StripExtension(mainModuleName);
916 if(!projectName[0])
917 {
918 strcpy(projectName, mainModuleName);
919 __ecereNameSpace__ecere__sys__StripExtension(projectName);
920 }
921 __ecereNameSpace__ecere__sys__ChangeCh(mainModuleName, '.', '_');
922 __ecereNameSpace__ecere__sys__ChangeCh(mainModuleName, '-', '_');
923 __ecereNameSpace__ecere__sys__ChangeCh(mainModuleName, ' ', '_');
924 if(targetPlatform == 1 && !isConsole && !isStaticLibrary && !isDynamicLibrary)
925 {
926 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "typedef void * HINSTANCE;\n");
927 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "#define WINAPI __stdcall\n");
928 }
929 for(importedModule = _defines.first; importedModule; importedModule = importedModule->next)
930 {
931 if(importedModule->type == 0)
932 {
933 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "import ");
934 if(importedModule->importType == 1)
935 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "static ", importedModule->name);
936 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\"%s\"\n", importedModule->name);
937 }
938 }
939 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "default:\n");
940 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "static Module __currentModule;\n\n");
941 if(!isStaticLibrary)
942 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "Module __thisModule;\n\n");
943 BindDCOMServer();
944 BindDCOMClient();
945 if(dcomSymbols)
946 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void __ecereRegisterModule_%s(Module module);\n\n", mainModuleName);
947 for(module = _imports.first; module; module = module->next)
948 {
949 struct ClassImport * _class;
950 struct FunctionImport * function;
951
952 if(module->importType == 1)
953 {
954 {
955 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "bool __ecereDll_Load_%s(Module module);\n", module->name);
956 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "bool __ecereDll_Unload_%s(Module module);\n", module->name);
957 }
958 }
959 for(_class = module->classes.first; _class; _class = _class->next)
960 {
961 struct MethodImport * method;
962 struct PropertyImport * prop;
963 char className[1024] = "";
964 struct __ecereNameSpace__ecere__com__Class * regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, _class->name);
965
966 FullClassNameCat(className, _class->name, 0x1);
967 MangleClassName(className);
968 if(_class->itself)
969 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "Class __ecereClass_%s;\n", className);
970 else
971 nonInst = 0x1;
972 {
973 {
974 for(method = _class->methods.first; method; method = method->next)
975 {
976 struct __ecereNameSpace__ecere__com__Method * meth = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, method->name, privateModule);
977
978 if(meth && !meth->dataType)
979 {
980 struct Context * context = SetupTemplatesContext(regClass);
981
982 meth->dataType = ProcessTypeString(meth->dataTypeString, 0x0);
983 FinishTemplatesContext(context);
984 }
985 if(method->isVirtual)
986 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "int __ecereVMethodID_%s_%s;\n", className, method->name);
987 else if(module->name && module->importType != 1 && (!meth || !meth->dataType->dllExport))
988 {
989 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "int (*__ecereMethod_%s_%s)();\n", className, method->name);
990 }
991 anyMethod = 0x1;
992 }
993 }
994 for(prop = _class->properties.first; prop; prop = prop->next)
995 {
996 char propName[1024];
997
998 propName[0] = (char)0;
999 FullClassNameCat(propName, prop->name, 0x1);
1000 MangleClassName(propName);
1001 if(module->name && module->importType != 1)
1002 {
1003 if(prop->hasSet)
1004 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void * __ecereProp_%s_Set_%s;\n", className, propName);
1005 if(prop->hasGet)
1006 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void * __ecereProp_%s_Get_%s;\n", className, propName);
1007 }
1008 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "Property __ecereProp_%s_%s;\n", className, propName);
1009 anyProp = 0x1;
1010 }
1011 }
1012 }
1013 for(function = module->functions.first; function; function = function->next)
1014 {
1015 struct __ecereNameSpace__ecere__com__GlobalFunction * func = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, function->name);
1016
1017 if(func && !func->dataType)
1018 func->dataType = ProcessTypeString(func->dataTypeString, 0x0);
1019 if(module->name && module->importType != 1 && (!func || !func->dataType || !func->dataType->dllExport))
1020 {
1021 char functionName[1024];
1022
1023 functionName[0] = (char)0;
1024 FullClassNameCat(functionName, function->name, 0x0);
1025 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void * __ecereFunction_%s;\n", functionName);
1026 anyFunction = 0x1;
1027 }
1028 }
1029 }
1030 for(defModule = modules.first; defModule; defModule = defModule->next)
1031 {
1032 char moduleName[1024];
1033
1034 strcpy(moduleName, defModule->name);
1035 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, ' ', '_');
1036 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '-', '_');
1037 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '.', '_');
1038 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void __ecereRegisterModule_%s(Module module);\n", moduleName);
1039 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void __ecereUnregisterModule_%s(Module module);\n", moduleName);
1040 if(defModule->globalInstance)
1041 {
1042 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void __ecereCreateModuleInstances_%s();\n", moduleName);
1043 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "void __ecereDestroyModuleInstances_%s();\n", moduleName);
1044 }
1045 }
1046 if(dcomSymbols)
1047 {
1048 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1049 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))dcomSymbols->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(dcomSymbols, 0, 0);
1050 while(!((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))dcomSymbols->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof])(dcomSymbols))
1051 {
1052 char buffer[4096];
1053 int read = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))dcomSymbols->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(dcomSymbols, buffer, 1, sizeof buffer);
1054
1055 if(!read)
1056 break;
1057 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(f, buffer, 1, read);
1058 }
1059 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1060 }
1061 if(isStaticLibrary)
1062 {
1063 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\nbool __ecereDll_Load_%s(Module module)\n{\n", projectName);
1064 }
1065 else if(isDynamicLibrary)
1066 {
1067 if(targetPlatform == 1)
1068 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\ndllexport bool __stdcall __ecereDll_Load(Module module)\n{\n");
1069 else
1070 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\ndllexport bool __ecereDll_Load(Module module)\n{\n");
1071 }
1072 else if(targetPlatform == 1 && !isConsole)
1073 {
1074 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\nint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, char * cmdLine, int show)\n{\n");
1075 }
1076 else
1077 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\nint main(int _argc, char * _argv[])\n{\n");
1078 if(!isDynamicLibrary)
1079 {
1080 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   int exitCode;\n");
1081 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   Module module;\n");
1082 }
1083 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   Class _class;\n");
1084 if(anyMethod)
1085 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   Method method;\n");
1086 if(anyProp)
1087 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   Property _property;\n");
1088 if(anyFunction)
1089 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   GlobalFunction function;\n");
1090 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\n");
1091 if(isDynamicLibrary)
1092 {
1093 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   if(!__currentModule)\n");
1094 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   {\n");
1095 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "      __currentModule = module;\n");
1096 if(!isStaticLibrary)
1097 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "      __thisModule = module;\n");
1098 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   }\n\n");
1099 }
1100 else if(targetPlatform == 1 && !isConsole)
1101 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   __thisModule = __currentModule = module = __ecere_COM_Initialize(1, 0, null);\n\n");
1102 else
1103 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   __thisModule = __currentModule = module = __ecere_COM_Initialize(1, _argc, (void *)_argv);\n\n");
1104 if(_imports.count)
1105 {
1106 for(module = _imports.first; module; module = module->next)
1107 {
1108 if(module->name)
1109 {
1110 {
1111 if(module->importType == 1)
1112 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   eModule_LoadStatic(module, \"%s\", %s, __ecereDll_Load_%s, __ecereDll_Unload_%s);\n", module->name, (module->importAccess == 2) ? "privateAccess" : "publicAccess", module->name, module->name);
1113 else
1114 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   eModule_Load(module, \"%s\", %s);\n", module->name, (module->importAccess == 2) ? "privateAccess" : "publicAccess");
1115 }
1116 }
1117 }
1118 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1119 }
1120 if(modules.count)
1121 {
1122 for(defModule = modules.first; defModule; defModule = defModule->next)
1123 {
1124 char moduleName[1024];
1125
1126 strcpy(moduleName, defModule->name);
1127 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, ' ', '_');
1128 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '-', '_');
1129 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '.', '_');
1130 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereRegisterModule_%s(module);\n", moduleName);
1131 }
1132 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1133 }
1134 if(dcomSymbols)
1135 {
1136 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereRegisterModule_%s(module);\n\n", mainModuleName);
1137 (__ecereNameSpace__ecere__com__eInstance_DecRef(dcomSymbols), dcomSymbols = 0);
1138 }
1139 if(isDynamicLibrary)
1140 {
1141 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   if(__currentModule == module)\n");
1142 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   {\n");
1143 }
1144 for(module = _imports.first; module; module = module->next)
1145 {
1146 struct ClassImport * _class;
1147 struct FunctionImport * function;
1148
1149 if(module->classes.count)
1150 {
1151 for(_class = module->classes.first; _class; _class = _class->next)
1152 {
1153 struct __ecereNameSpace__ecere__com__Class * regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, _class->name);
1154
1155 {
1156 struct MethodImport * method;
1157 struct PropertyImport * prop;
1158 char classID[1024];
1159 char className[1024] = "";
1160
1161 FullClassNameCat(className, _class->name, 0x1);
1162 MangleClassName(className);
1163 if(_class->itself)
1164 sprintf(classID, "__ecereClass_%s", className);
1165 else
1166 strcpy(classID, "_class");
1167 if(isDynamicLibrary && !isStaticLibrary)
1168 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   %s = eSystem_FindClass(__currentModule, \"%s\");\n", classID, _class->name);
1169 else
1170 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   %s = eSystem_FindClass(module, \"%s\");\n", classID, _class->name);
1171 for(method = _class->methods.first; method; method = method->next)
1172 {
1173 struct __ecereNameSpace__ecere__com__Method * meth = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, method->name, privateModule);
1174
1175 if(!meth || !meth->dataType->dllExport)
1176 {
1177 if(method->isVirtual || (module->name && module->importType != 1))
1178 {
1179 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   method = eClass_FindMethod(%s, \"%s\", module);\n", classID, method->name);
1180 if(method->isVirtual)
1181 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   if(method) __ecereVMethodID_%s_%s = method.vid;\n", className, method->name);
1182 else
1183 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   if(method) __ecereMethod_%s_%s = method.function;\n", className, method->name);
1184 }
1185 }
1186 }
1187 for(prop = _class->properties.first; prop; prop = prop->next)
1188 {
1189 char propName[1024];
1190
1191 propName[0] = (char)0;
1192 FullClassNameCat(propName, prop->name, 0x1);
1193 MangleClassName(propName);
1194 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereProp_%s_%s = _property = eClass_FindProperty(%s, \"%s\", module);\n", className, propName, classID, prop->name);
1195 if(module->name && module->importType != 1)
1196 {
1197 if(prop->hasSet)
1198 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereProp_%s_Set_%s = _property.Set;\n", className, propName);
1199 if(prop->hasGet)
1200 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereProp_%s_Get_%s = _property.Get;\n", className, propName);
1201 }
1202 }
1203 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1204 }
1205 }
1206 }
1207 if(module->functions.count)
1208 {
1209 for(function = module->functions.first; function; function = function->next)
1210 {
1211 struct __ecereNameSpace__ecere__com__GlobalFunction * func = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, function->name);
1212
1213 if(module->name && module->importType != 1 && (!func || !func->dataType || !func->dataType->dllExport))
1214 {
1215 char functionName[1024];
1216
1217 functionName[0] = (char)0;
1218 FullClassNameCat(functionName, function->name, 0x0);
1219 if(isDynamicLibrary && !isStaticLibrary)
1220 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   function = eSystem_FindFunction(__currentModule, \"%s\");\n", function->name);
1221 else
1222 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   function = eSystem_FindFunction(module, \"%s\");\n", function->name);
1223 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   if(function) __ecereFunction_%s = function.function;\n", functionName);
1224 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1225 }
1226 }
1227 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1228 }
1229 }
1230 for(defModule = modules.first; defModule; defModule = defModule->next)
1231 if(defModule->globalInstance)
1232 {
1233 if(!strcmp(defModule->name, "i18n"))
1234 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereCreateModuleInstances_i18n();\n");
1235 }
1236 if(i18n)
1237 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      LoadTranslatedStrings(module, \"%s\");\n", projectName);
1238 if(isDynamicLibrary)
1239 {
1240 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   }\n");
1241 }
1242 if(!isDynamicLibrary && thisAppClass)
1243 {
1244 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   _class = eSystem_FindClass(__currentModule, \"%s\");\n", thisAppClass->name);
1245 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   eInstance_Evolve((Instance *)&__currentModule, _class);\n");
1246 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __thisModule = __currentModule;\n");
1247 }
1248 if(isDynamicLibrary)
1249 {
1250 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   if(__currentModule == module)\n");
1251 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   {\n");
1252 }
1253 if(modules.count)
1254 {
1255 for(defModule = modules.first; defModule; defModule = defModule->next)
1256 if(defModule->globalInstance)
1257 {
1258 char moduleName[1024];
1259
1260 if(!strcmp(defModule->name, "i18n"))
1261 continue;
1262 strcpy(moduleName, defModule->name);
1263 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, ' ', '_');
1264 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '-', '_');
1265 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '.', '_');
1266 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereCreateModuleInstances_%s();\n", moduleName);
1267 }
1268 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1269 }
1270 if(isDynamicLibrary)
1271 {
1272 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   }\n");
1273 }
1274 if(!isDynamicLibrary && thisAppClass)
1275 {
1276 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __currentModule._vTbl[12](__currentModule);\n");
1277 }
1278 if(isDynamicLibrary)
1279 {
1280 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   return true;\n");
1281 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "}\n");
1282 if(isStaticLibrary)
1283 {
1284 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\nbool __ecereDll_Unload_%s(Module module)\n{\n", projectName);
1285 }
1286 else
1287 {
1288 if(targetPlatform == 1)
1289 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\ndllexport bool __stdcall __ecereDll_Unload(Module module)\n{\n");
1290 else
1291 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\ndllexport bool __ecereDll_Unload(Module module)\n{\n");
1292 }
1293 }
1294 if(isDynamicLibrary)
1295 {
1296 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   if(__currentModule == module)\n");
1297 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   {\n");
1298 }
1299 {
1300 unsigned int destroyI18n = 0x0;
1301
1302 if(modules.count)
1303 {
1304 for(defModule = modules.first; defModule; defModule = defModule->next)
1305 if(defModule->globalInstance)
1306 {
1307 char moduleName[1024];
1308
1309 if(!strcmp(defModule->name, "i18n"))
1310 {
1311 destroyI18n = 0x1;
1312 continue;
1313 }
1314 strcpy(moduleName, defModule->name);
1315 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, ' ', '_');
1316 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '-', '_');
1317 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '.', '_');
1318 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereDestroyModuleInstances_%s();\n", moduleName);
1319 }
1320 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1321 }
1322 if(i18n)
1323 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   UnloadTranslatedStrings(__currentModule);\n");
1324 if(destroyI18n)
1325 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereDestroyModuleInstances_i18n();\n");
1326 }
1327 if(isDynamicLibrary)
1328 {
1329 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   }\n");
1330 if(isDynamicLibrary)
1331 {
1332 }
1333 if(modules.count)
1334 {
1335 for(defModule = modules.first; defModule; defModule = defModule->next)
1336 {
1337 char moduleName[1024];
1338
1339 strcpy(moduleName, defModule->name);
1340 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, ' ', '_');
1341 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '-', '_');
1342 __ecereNameSpace__ecere__sys__ChangeCh(moduleName, '.', '_');
1343 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   __ecereUnregisterModule_%s(module);\n", moduleName);
1344 }
1345 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1346 }
1347 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   if(__currentModule == module)\n");
1348 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "      __currentModule = (void *)0;\n");
1349 if(!isStaticLibrary)
1350 {
1351 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   if(__thisModule == module)\n");
1352 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "      __thisModule = (void *)0;\n");
1353 }
1354 }
1355 if(!isDynamicLibrary)
1356 {
1357 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "\n   _class = eSystem_FindClass(__currentModule, \"ecere::com::Application\");\n   exitCode = ((ecere::com::Application)__currentModule).exitCode;\n   delete __currentModule;\n   return exitCode;\n");
1358 }
1359 else
1360 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "   return true;\n");
1361 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, "}\n");
1362 __ecereNameSpace__ecere__com__eInstance_Delete(f);
1363 }
1364 }
1365
1366 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1367
1368 struct __ecereNameSpace__ecere__com__BTNamedLink
1369 {
1370 char *  name;
1371 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1372 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1373 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1374 int depth;
1375 void *  data;
1376 } __attribute__ ((gcc_struct));
1377
1378 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
1379
1380 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
1381
1382 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
1383
1384 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
1385
1386 static struct __ecereNameSpace__ecere__com__Class * FindAppClass(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, unsigned int thisModule)
1387 {
1388 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
1389 struct __ecereNameSpace__ecere__com__NameSpace * ns;
1390
1391 for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&(*nameSpace).classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
1392 {
1393 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
1394
1395 if(strcmp(_class->fullName, "ecere::com::Application") && (!thisModule || _class->module == privateModule))
1396 {
1397 struct __ecereNameSpace__ecere__com__Class * base;
1398
1399 for(base = _class->base; base && base->type != 1000; base = base->base)
1400 if(!strcmp(base->fullName, "ecere::com::Application"))
1401 return _class;
1402 }
1403 }
1404 for(ns = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&(*nameSpace).nameSpaces); ns; ns = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)ns)))
1405 {
1406 struct __ecereNameSpace__ecere__com__Class * _class = FindAppClass(ns, thisModule);
1407
1408 if(_class)
1409 return _class;
1410 }
1411 return (((void *)0));
1412 }
1413
1414 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1415
1416 struct __ecereNameSpace__ecere__com__Module
1417 {
1418 struct __ecereNameSpace__ecere__com__Instance * application;
1419 struct __ecereNameSpace__ecere__sys__OldList classes;
1420 struct __ecereNameSpace__ecere__sys__OldList defines;
1421 struct __ecereNameSpace__ecere__sys__OldList functions;
1422 struct __ecereNameSpace__ecere__sys__OldList modules;
1423 struct __ecereNameSpace__ecere__com__Instance * prev;
1424 struct __ecereNameSpace__ecere__com__Instance * next;
1425 char *  name;
1426 void *  library;
1427 void *  Unload;
1428 int importType;
1429 int origImportType;
1430 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1431 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1432 } __attribute__ ((gcc_struct));
1433
1434 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
1435
1436 struct __ecereNameSpace__ecere__com__SubModule
1437 {
1438 struct __ecereNameSpace__ecere__com__SubModule * prev;
1439 struct __ecereNameSpace__ecere__com__SubModule * next;
1440 struct __ecereNameSpace__ecere__com__Instance * module;
1441 int importMode;
1442 } __attribute__ ((gcc_struct));
1443
1444 static struct __ecereNameSpace__ecere__com__Class * SearchAppClass_Module(struct __ecereNameSpace__ecere__com__Instance * module)
1445 {
1446 struct __ecereNameSpace__ecere__com__Class * appClass;
1447 struct __ecereNameSpace__ecere__com__SubModule * subModule;
1448
1449 appClass = FindAppClass(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, 0x0);
1450 if(appClass)
1451 return appClass;
1452 appClass = FindAppClass(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->privateNameSpace, 0x0);
1453 if(appClass)
1454 return appClass;
1455 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
1456 {
1457 appClass = SearchAppClass_Module(subModule->module);
1458 if(appClass)
1459 return appClass;
1460 }
1461 return (((void *)0));
1462 }
1463
1464 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1465
1466 struct __ecereNameSpace__ecere__sys__TempFile
1467 {
1468 char __ecere_padding[24];
1469 } __attribute__ ((gcc_struct));
1470
1471 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
1472
1473 struct __ecereNameSpace__ecere__sys__OldLink
1474 {
1475 struct __ecereNameSpace__ecere__sys__OldLink * prev;
1476 struct __ecereNameSpace__ecere__sys__OldLink * next;
1477 void *  data;
1478 } __attribute__ ((gcc_struct));
1479
1480 extern void DeclareClass(struct Symbol * classSym, char *  className);
1481
1482 extern struct Symbol * FindClass(char *  name);
1483
1484 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1485
1486 extern void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
1487
1488 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1489
1490 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1491
1492 extern struct Identifier * MkIdentifier(char *  string);
1493
1494 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1495
1496 extern void OutputTypeName(struct TypeName * type, struct __ecereNameSpace__ecere__com__Instance * f);
1497
1498 extern char *  strcat(char * , const char * );
1499
1500 extern void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char *  name);
1501
1502 static void BindDCOMClient()
1503 {
1504 struct __ecereNameSpace__ecere__com__Class * dcomClientObjectClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::net::DCOMClientObject");
1505 struct __ecereNameSpace__ecere__sys__OldLink * deriv;
1506
1507 if(dcomClientObjectClass && dcomClientObjectClass->derivatives.first)
1508 {
1509 struct __ecereNameSpace__ecere__com__Instance * f;
1510
1511 if(!dcomSymbols)
1512 dcomSymbols = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1513 f = dcomSymbols;
1514 for(deriv = dcomClientObjectClass->derivatives.first; deriv; deriv = deriv->next)
1515 {
1516 struct __ecereNameSpace__ecere__com__Class * _class = deriv->data;
1517 struct __ecereNameSpace__ecere__com__Method * method, * next;
1518 int id = 0;
1519 int vid;
1520 unsigned int doVirtual;
1521
1522 DeclareClass(FindClass("ecere::net::DCOMClientObject"), "__ecereClass___ecereNameSpace__ecere__net__DCOMClientObject");
1523 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "class %s : ecere::net::DCOMClientObject\n", _class->fullName);
1524 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "{\n");
1525 if(_class->vTblSize > _class->base->vTblSize)
1526 {
1527 int vid;
1528
1529 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   virtual void CallVirtualMethod(uint __ecereMethodID, SerialBuffer __ecereBuffer)\n");
1530 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   {\n");
1531 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      switch(__ecereMethodID)\n");
1532 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      {\n");
1533 for(vid = _class->base->vTblSize; vid < _class->vTblSize; vid++)
1534 {
1535 struct __ecereNameSpace__ecere__com__Method * method;
1536
1537 for(method = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&_class->methods); method; method = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)method)))
1538 {
1539 if(method->type == 1 && method->_class == _class && method->vid == vid)
1540 break;
1541 }
1542 if(method)
1543 {
1544 struct Type * param;
1545
1546 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
1547 if(method->dataType && method->dataType->name)
1548 {
1549 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         case %d:\n", vid - _class->base->vTblSize);
1550 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         {\n");
1551 {
1552 if(method->dataType->returnType->kind != 0)
1553 {
1554 struct TypeName * resultType;
1555 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1556 struct Declarator * decl;
1557 char type[1024] = "";
1558 char className[1024];
1559 struct Symbol * classSym;
1560
1561 if(method->dataType->returnType->kind == 8)
1562 classSym = method->dataType->returnType->_class;
1563 else
1564 {
1565 PrintType(method->dataType->returnType, type, 0x0, 0x1);
1566 classSym = FindClass(type);
1567 type[0] = (char)0;
1568 }
1569 strcpy(className, "__ecereClass_");
1570 FullClassNameCat(className, classSym->string, 0x1);
1571 MangleClassName(className);
1572 DeclareClass(classSym, className);
1573 PrintType(method->dataType->returnType, type, 0x1, 0x1);
1574 decl = SpecDeclFromString(type, specs, MkDeclaratorIdentifier(MkIdentifier("__ecereResult")));
1575 resultType = MkTypeName(specs, decl);
1576 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            ");
1577 OutputTypeName(resultType, f);
1578 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ";\n");
1579 }
1580 for(param = method->dataType->params.first; param; param = param->next)
1581 {
1582 if(param->kind == 8 && !strcmp(param->_class->string, "String"))
1583 {
1584 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            char %s[1024];\n", param->name);
1585 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1586 DeclareClass(FindClass("String"), "__ecereClass_String");
1587 }
1588 else
1589 {
1590 struct TypeName * paramTypeName;
1591 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1592 struct Declarator * decl;
1593 char type[1024] = "";
1594 char className[1024];
1595 struct Symbol * classSym;
1596
1597 if(param->kind == 8)
1598 classSym = param->_class;
1599 else
1600 {
1601 PrintType(param, type, 0x0, 0x1);
1602 classSym = FindClass(type);
1603 type[0] = (char)0;
1604 }
1605 strcpy(className, "__ecereClass_");
1606 FullClassNameCat(className, classSym->string, 0x1);
1607 MangleClassName(className);
1608 DeclareClass(classSym, className);
1609 PrintType(param, type, 0x1, 0x1);
1610 decl = SpecDeclFromString(type, specs, MkDeclaratorIdentifier(MkIdentifier(param->name)));
1611 paramTypeName = MkTypeName(specs, decl);
1612 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            ");
1613 OutputTypeName(paramTypeName, f);
1614 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ";\n");
1615 }
1616 }
1617 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1618 for(param = method->dataType->params.first; param; param = param->next)
1619 {
1620 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Unserialize(");
1621 if(param->kind == 8 && !strcmp(param->_class->string, "String"))
1622 {
1623 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1624 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "(StaticString)");
1625 }
1626 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, param->name);
1627 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ");\n");
1628 }
1629 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            ");
1630 if(method->dataType->returnType->kind != 0)
1631 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "__ecereResult = ");
1632 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "%s(", method->name);
1633 for(param = method->dataType->params.first; param; param = param->next)
1634 {
1635 if(param->prev)
1636 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ", ");
1637 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "%s", param->name);
1638 }
1639 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ");\n");
1640 for(param = method->dataType->params.first; param; param = param->next)
1641 {
1642 if(param->kind == 8 && ((param->_class && param->_class->registered && param->_class->registered->type == 1) || !strcmp(param->_class->string, "String")) && !param->constant)
1643 {
1644 if(!strcmp(param->_class->string, "String"))
1645 {
1646 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1647 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Serialize((StaticString)%s);\n", param->name);
1648 }
1649 else
1650 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Serialize(%s);\n", param->name);
1651 }
1652 }
1653 if(method->dataType->returnType->kind != 0)
1654 {
1655 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Serialize(__ecereResult);\n");
1656 }
1657 for(param = method->dataType->params.first; param; param = param->next)
1658 {
1659 if(param->kind == 8 && strcmp(param->_class->string, "String") && param->_class->registered && (param->_class->registered->type == 0 || param->_class->registered->type == 5))
1660 {
1661 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            delete %s;\n", param->name);
1662 }
1663 }
1664 if(method->dataType->returnType->kind == 8 && strcmp(method->dataType->returnType->_class->string, "String") && method->dataType->returnType->_class->registered && (method->dataType->returnType->_class->registered->type == 0 || method->dataType->returnType->_class->registered->type == 5))
1665 {
1666 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            delete __ecereResult;\n");
1667 }
1668 }
1669 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            break;\n");
1670 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         }\n");
1671 }
1672 }
1673 }
1674 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      }\n");
1675 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   }\n");
1676 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1677 }
1678 doVirtual = 0x1;
1679 id = 0;
1680 vid = _class->base->vTblSize;
1681 next = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&_class->methods);
1682 while(next && ((next->type == 1) != doVirtual || (doVirtual && next->vid != vid)))
1683 {
1684 id++;
1685 next = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)next));
1686 if(!next && doVirtual)
1687 {
1688 if(vid == _class->vTblSize)
1689 doVirtual = 0x0;
1690 else
1691 vid++;
1692 id = 0;
1693 next = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&_class->methods);
1694 }
1695 }
1696 for(method = next; method; method = next)
1697 {
1698 struct Type * param;
1699
1700 if(!method->dataType)
1701 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
1702 if(method->dataType->name)
1703 {
1704 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   ");
1705 if(doVirtual)
1706 {
1707 char name[1024];
1708
1709 strcpy(name, "__ecereVMethodID_");
1710 FullClassNameCat(name, method->_class->fullName, 0x1);
1711 strcat(name, "_");
1712 strcat(name, method->name);
1713 DeclareMethod(method, name);
1714 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "virtual ");
1715 }
1716 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "%s\n", method->dataTypeString);
1717 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   {\n");
1718 if(method->dataType)
1719 {
1720 if(method->dataType->returnType->kind != 0)
1721 {
1722 struct TypeName * resultType;
1723 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1724 struct Declarator * decl;
1725 char type[1024] = "";
1726 char className[1024];
1727 struct Symbol * classSym;
1728
1729 if(method->dataType->returnType->kind == 8)
1730 classSym = method->dataType->returnType->_class;
1731 else
1732 {
1733 PrintType(method->dataType->returnType, type, 0x0, 0x1);
1734 classSym = FindClass(type);
1735 type[0] = (char)0;
1736 }
1737 strcpy(className, "__ecereClass_");
1738 FullClassNameCat(className, classSym->string, 0x1);
1739 MangleClassName(className);
1740 DeclareClass(classSym, className);
1741 PrintType(method->dataType->returnType, type, 0x1, 0x1);
1742 decl = SpecDeclFromString(type, specs, MkDeclaratorIdentifier(MkIdentifier("__ecereResult")));
1743 resultType = MkTypeName(specs, decl);
1744 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      ");
1745 OutputTypeName(resultType, f);
1746 if(method->dataType->returnType->kind == 9)
1747 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " = { 0 }");
1748 else if(method->dataType->returnType->kind == 8 && method->dataType->returnType->_class->registered && method->dataType->returnType->_class->registered->type == 1)
1749 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " { }");
1750 else
1751 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " = 0");
1752 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ";\n\n");
1753 }
1754 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      incref this;\n");
1755 for(param = method->dataType->params.first; param; param = param->next)
1756 {
1757 char type[1024] = "";
1758 char className[1024];
1759 struct Symbol * classSym;
1760
1761 if(param->kind == 8)
1762 classSym = param->_class;
1763 else
1764 {
1765 PrintType(param, type, 0x0, 0x1);
1766 classSym = FindClass(type);
1767 type[0] = (char)0;
1768 }
1769 strcpy(className, "__ecereClass_");
1770 FullClassNameCat(className, classSym->string, 0x1);
1771 MangleClassName(className);
1772 DeclareClass(classSym, className);
1773 if(param->kind == 8 && !strcmp(param->_class->string, "String"))
1774 {
1775 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1776 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereBuffer.Serialize((StaticString)%s);\n", param->name);
1777 }
1778 else
1779 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereBuffer.Serialize(%s);\n", param->name);
1780 }
1781 DeclareMethod(__ecereNameSpace__ecere__com__eClass_FindMethod(__ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::net::DCOMClientObject"), "CallMethod", privateModule), "__ecereMethod___ecereNameSpace__ecere__net__DCOMClientObject_CallMethod");
1782 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      if(DCOMClientObject::CallMethod(%d))\n", id++);
1783 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      {\n");
1784 for(param = method->dataType->params.first; param; param = param->next)
1785 {
1786 if(param->kind == 8 && ((param->_class && param->_class->registered && param->_class->registered->type == 1) || !strcmp(param->_class->string, "String")) && !param->constant)
1787 {
1788 if(!strcmp(param->_class->string, "String"))
1789 {
1790 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1791 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereBuffer.Unserialize((StaticString)%s);\n", param->name);
1792 }
1793 else
1794 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereBuffer.Unserialize(%s);\n", param->name);
1795 }
1796 }
1797 if(method->dataType->returnType->kind != 0)
1798 {
1799 if(method->dataType->returnType->kind == 8 && !strcmp(method->dataType->returnType->_class->string, "String"))
1800 {
1801 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1802 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereBuffer.Unserialize((StaticString)__ecereResult);\n");
1803 }
1804 else
1805 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereBuffer.Unserialize(__ecereResult);\n");
1806 }
1807 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      }\n");
1808 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereBuffer.Free();\n");
1809 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      delete this;\n");
1810 if(method->dataType->returnType->kind != 0)
1811 {
1812 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      return __ecereResult;\n");
1813 }
1814 }
1815 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   }\n");
1816 }
1817 next = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)method));
1818 while(next && ((next->type == 1) != doVirtual || (doVirtual && next->vid != vid)))
1819 {
1820 id++;
1821 next = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)next));
1822 if(!next && doVirtual)
1823 {
1824 if(vid == _class->vTblSize)
1825 doVirtual = 0x0;
1826 else
1827 vid++;
1828 id = 0;
1829 next = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&_class->methods);
1830 }
1831 }
1832 if(next)
1833 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1834 }
1835 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "}\n");
1836 if(deriv->next)
1837 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1838 }
1839 }
1840 }
1841
1842 static void BindDCOMServer()
1843 {
1844 unsigned int mutexDeclared = 0x0;
1845 struct __ecereNameSpace__ecere__com__Class * _class;
1846
1847 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)privateModule + 12)))->classes.first; _class; _class = _class->next)
1848 {
1849 if(_class->isRemote == (unsigned int)3)
1850 break;
1851 }
1852 if(_class)
1853 {
1854 struct __ecereNameSpace__ecere__com__Instance * f;
1855
1856 if(!dcomSymbols)
1857 dcomSymbols = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1858 f = dcomSymbols;
1859 DeclareClass(FindClass("ecere::net::DCOMServerObject"), "__ecereClass___ecereNameSpace__ecere__net__DCOMServerObject");
1860 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)privateModule + 12)))->classes.first; _class; _class = _class->next)
1861 {
1862 if(_class->isRemote == (unsigned int)3)
1863 {
1864 struct __ecereNameSpace__ecere__com__Method * method;
1865 int id = 0;
1866 int vid;
1867
1868 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "class DCOM%s : ecere::net::DCOMServerObject\n", _class->fullName);
1869 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "{\n");
1870 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   virtual void CallMethod(uint __ecereMethodID, SerialBuffer __ecereBuffer)\n");
1871 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   {\n");
1872 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      %s inst = (%s)instance;\n", _class->fullName, _class->fullName);
1873 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      incref inst;\n");
1874 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      switch(__ecereMethodID)\n");
1875 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      {\n");
1876 for(method = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&_class->methods); method; method = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)method)))
1877 {
1878 struct Type * param;
1879
1880 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
1881 if(method->dataType && method->dataType->name)
1882 {
1883 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         case %d:\n", id++);
1884 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         {\n");
1885 {
1886 if(method->dataType->returnType->kind != 0)
1887 {
1888 struct TypeName * resultType;
1889 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1890 struct Declarator * decl;
1891 char type[1024] = "";
1892 char className[1024];
1893 struct Symbol * classSym;
1894
1895 if(method->dataType->returnType->kind == 8)
1896 classSym = method->dataType->returnType->_class;
1897 else
1898 {
1899 PrintType(method->dataType->returnType, type, 0x0, 0x1);
1900 classSym = FindClass(type);
1901 type[0] = (char)0;
1902 }
1903 strcpy(className, "__ecereClass_");
1904 FullClassNameCat(className, classSym->string, 0x1);
1905 MangleClassName(className);
1906 DeclareClass(classSym, className);
1907 PrintType(method->dataType->returnType, type, 0x1, 0x1);
1908 decl = SpecDeclFromString(type, specs, MkDeclaratorIdentifier(MkIdentifier("__ecereResult")));
1909 resultType = MkTypeName(specs, decl);
1910 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            ");
1911 OutputTypeName(resultType, f);
1912 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ";\n");
1913 }
1914 for(param = method->dataType->params.first; param; param = param->next)
1915 {
1916 if(param->kind == 8 && !strcmp(param->_class->string, "String"))
1917 {
1918 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            char %s[1024];\n", param->name);
1919 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1920 DeclareClass(FindClass("String"), "__ecereClass_String");
1921 }
1922 else
1923 {
1924 struct TypeName * paramTypeName;
1925 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1926 struct Declarator * decl;
1927 char type[1024] = "";
1928 char className[1024];
1929 struct Symbol * classSym;
1930
1931 if(param->kind == 8)
1932 classSym = param->_class;
1933 else
1934 {
1935 PrintType(param, type, 0x0, 0x1);
1936 classSym = FindClass(type);
1937 type[0] = (char)0;
1938 }
1939 strcpy(className, "__ecereClass_");
1940 FullClassNameCat(className, classSym->string, 0x1);
1941 MangleClassName(className);
1942 DeclareClass(classSym, className);
1943 PrintType(param, type, 0x1, 0x1);
1944 decl = SpecDeclFromString(type, specs, MkDeclaratorIdentifier(MkIdentifier(param->name)));
1945 paramTypeName = MkTypeName(specs, decl);
1946 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            ");
1947 OutputTypeName(paramTypeName, f);
1948 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ";\n");
1949 }
1950 }
1951 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
1952 for(param = method->dataType->params.first; param; param = param->next)
1953 {
1954 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Unserialize(");
1955 if(param->kind == 8 && !strcmp(param->_class->string, "String"))
1956 {
1957 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1958 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "(StaticString)");
1959 }
1960 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(f, param->name);
1961 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ");\n");
1962 }
1963 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            ");
1964 if(method->dataType->returnType->kind != 0)
1965 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "__ecereResult = ");
1966 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "((%s)instance).%s(", _class->fullName, method->name);
1967 for(param = method->dataType->params.first; param; param = param->next)
1968 {
1969 if(param->prev)
1970 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ", ");
1971 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "%s", param->name);
1972 }
1973 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ");\n");
1974 for(param = method->dataType->params.first; param; param = param->next)
1975 {
1976 if(param->kind == 8 && ((param->_class && param->_class->registered && param->_class->registered->type == 1) || !strcmp(param->_class->string, "String")) && !param->constant)
1977 {
1978 if(!strcmp(param->_class->string, "String"))
1979 {
1980 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
1981 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Serialize((StaticString)%s);\n", param->name);
1982 }
1983 else
1984 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Serialize(%s);\n", param->name);
1985 }
1986 }
1987 if(method->dataType->returnType->kind != 0)
1988 {
1989 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            __ecereBuffer.Serialize(__ecereResult);\n");
1990 }
1991 for(param = method->dataType->params.first; param; param = param->next)
1992 {
1993 if(param->kind == 8 && strcmp(param->_class->string, "String") && param->_class->registered && (param->_class->registered->type == 0 || param->_class->registered->type == 5))
1994 {
1995 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            delete %s;\n", param->name);
1996 }
1997 }
1998 if(method->dataType->returnType->kind == 8 && strcmp(method->dataType->returnType->_class->string, "String") && method->dataType->returnType->_class->registered && (method->dataType->returnType->_class->registered->type == 0 || method->dataType->returnType->_class->registered->type == 5))
1999 {
2000 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            delete __ecereResult;\n");
2001 }
2002 }
2003 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "            break;\n");
2004 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         }\n");
2005 }
2006 }
2007 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      }\n");
2008 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      delete inst;\n");
2009 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   }\n");
2010 for(vid = _class->base->vTblSize; vid < _class->vTblSize; vid++)
2011 {
2012 struct __ecereNameSpace__ecere__com__Method * method;
2013 struct Type * param;
2014
2015 for(method = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&_class->methods); method; method = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)method)))
2016 if(method->type == 1 && method->_class == _class && method->vid == vid)
2017 break;
2018 if(method)
2019 {
2020 if(!mutexDeclared)
2021 {
2022 DeclareClass(FindClass("ecere::sys::Mutex"), "__ecereClass___ecereNameSpace__ecere__sys__Mutex");
2023 DeclareMethod(__ecereNameSpace__ecere__com__eClass_FindMethod(__ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::sys::Mutex"), "Wait", privateModule), "__ecereMethod___ecereNameSpace__ecere__sys__Mutex_Wait");
2024 DeclareMethod(__ecereNameSpace__ecere__com__eClass_FindMethod(__ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::sys::Mutex"), "Release", privateModule), "__ecereMethod___ecereNameSpace__ecere__sys__Mutex_Release");
2025 mutexDeclared = 0x1;
2026 }
2027 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "\n");
2028 if(!method->dataType)
2029 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
2030 if(method->dataType->name)
2031 {
2032 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   virtual %s\n", method->dataTypeString);
2033 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   {\n");
2034 if(method->dataType)
2035 {
2036 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      DCOM%s __ecereObject = (void *)_vTbl[-1];\n", _class->fullName);
2037 if(method->dataType->returnType->kind != 0)
2038 {
2039 struct TypeName * resultType;
2040 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2041 struct Declarator * decl;
2042 char type[1024] = "";
2043 char className[1024];
2044 struct Symbol * classSym;
2045
2046 if(method->dataType->returnType->kind == 8)
2047 classSym = method->dataType->returnType->_class;
2048 else
2049 {
2050 PrintType(method->dataType->returnType, type, 0x0, 0x1);
2051 classSym = FindClass(type);
2052 type[0] = (char)0;
2053 }
2054 strcpy(className, "__ecereClass_");
2055 FullClassNameCat(className, classSym->string, 0x1);
2056 MangleClassName(className);
2057 DeclareClass(classSym, className);
2058 PrintType(method->dataType->returnType, type, 0x1, 0x1);
2059 decl = SpecDeclFromString(type, specs, MkDeclaratorIdentifier(MkIdentifier("__ecereResult")));
2060 resultType = MkTypeName(specs, decl);
2061 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      ");
2062 OutputTypeName(resultType, f);
2063 if(method->dataType->returnType->kind == 9)
2064 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " = { 0 }");
2065 else if(method->dataType->returnType->kind == 8 && method->dataType->returnType->_class->registered && method->dataType->returnType->_class->registered->type == 1)
2066 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " { }");
2067 else
2068 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, " = 0");
2069 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ";\n\n");
2070 }
2071 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      incref __ecereObject;\n");
2072 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereMethod___ecereNameSpace__ecere__sys__Mutex_Wait(__ecereObject.mutex);\n");
2073 for(param = method->dataType->params.first; param; param = param->next)
2074 {
2075 char type[1024] = "";
2076 char className[1024];
2077 struct Symbol * classSym;
2078
2079 if(param->kind == 8)
2080 classSym = param->_class;
2081 else
2082 {
2083 PrintType(param, type, 0x0, 0x1);
2084 classSym = FindClass(type);
2085 type[0] = (char)0;
2086 }
2087 strcpy(className, "__ecereClass_");
2088 FullClassNameCat(className, classSym->string, 0x1);
2089 MangleClassName(className);
2090 DeclareClass(classSym, className);
2091 if(param->kind == 8 && !strcmp(param->_class->string, "String"))
2092 {
2093 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
2094 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereObject.argsBuffer.Serialize((StaticString)%s);\n", param->name);
2095 }
2096 else
2097 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereObject.argsBuffer.Serialize(%s);\n", param->name);
2098 }
2099 DeclareMethod(__ecereNameSpace__ecere__com__eClass_FindMethod(__ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::net::DCOMServerObject"), "CallVirtualMethod", privateModule), "__ecereMethod___ecereNameSpace__ecere__net__DCOMServerObject_CallVirtualMethod");
2100 {
2101 unsigned int hasReturnValue = method->dataType->returnType->kind != 0;
2102
2103 if(!hasReturnValue)
2104 {
2105 for(param = method->dataType->params.first; param; param = param->next)
2106 {
2107 if(param->kind == 8 && ((param->_class && param->_class->registered && param->_class->registered->type == 1) || !strcmp(param->_class->string, "String")) && !param->constant)
2108 {
2109 hasReturnValue = 0x1;
2110 break;
2111 }
2112 }
2113 }
2114 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      if(__ecereObject.CallVirtualMethod(%d, %s))\n", vid - _class->base->vTblSize, hasReturnValue ? "true" : "false");
2115 }
2116 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      {\n");
2117 for(param = method->dataType->params.first; param; param = param->next)
2118 {
2119 if(param->kind == 8 && ((param->_class && param->_class->registered && param->_class->registered->type == 1) || !strcmp(param->_class->string, "String")) && !param->constant)
2120 {
2121 if(!strcmp(param->_class->string, "String"))
2122 {
2123 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
2124 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereObject.returnBuffer.Unserialize((StaticString)%s);\n", param->name);
2125 }
2126 else
2127 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereObject.returnBuffer.Unserialize(%s);\n", param->name);
2128 }
2129 }
2130 if(method->dataType->returnType->kind != 0)
2131 {
2132 if(method->dataType->returnType->kind == 8 && !strcmp(method->dataType->returnType->_class->string, "String"))
2133 {
2134 DeclareClass(FindClass("StaticString"), "__ecereClass_StaticString");
2135 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereObject.returnBuffer.Unserialize((StaticString)__ecereResult);\n");
2136 }
2137 else
2138 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         __ecereObject.returnBuffer.Unserialize(__ecereResult);\n");
2139 }
2140 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      }\n");
2141 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      else\n");
2142 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "         ((%s)this).%s::%s(", _class->fullName, _class->fullName, method->name);
2143 for(param = method->dataType->params.first; param; param = param->next)
2144 {
2145 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "%s", param->name);
2146 if(param->next)
2147 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ", ");
2148 }
2149 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, ");\n");
2150 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereObject.returnBuffer.Free();\n");
2151 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      __ecereMethod___ecereNameSpace__ecere__sys__Mutex_Release(__ecereObject.mutex);\n");
2152 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      delete __ecereObject;\n");
2153 if(method->dataType->returnType->kind != 0)
2154 {
2155 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "      return __ecereResult;\n");
2156 }
2157 }
2158 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   }\n");
2159 }
2160 }
2161 }
2162 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "}\n");
2163 }
2164 }
2165 }
2166 }
2167
2168 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_SymbolgenApp;
2169
2170 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
2171
2172 extern int GetHostBits(void);
2173
2174 extern void SetSymbolsDir(char *  s);
2175
2176 extern int printf(char * , ...);
2177
2178 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2179
2180 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2181
2182 extern char *  __ecereNameSpace__ecere__sys__GetExtension(char *  string, char *  output);
2183
2184 extern void SetDefines(struct __ecereNameSpace__ecere__sys__OldList *  list);
2185
2186 extern void SetImports(struct __ecereNameSpace__ecere__sys__OldList *  list);
2187
2188 extern void SetGlobalData(struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace);
2189
2190 extern void SetExcludedSymbols(struct __ecereNameSpace__ecere__sys__OldList *  list);
2191
2192 extern void SetGlobalContext(struct Context * context);
2193
2194 extern void SetTopContext(struct Context * context);
2195
2196 extern void SetCurrentContext(struct Context * context);
2197
2198 extern void SetTargetPlatform(int platform);
2199
2200 extern void SetTargetBits(int bits);
2201
2202 extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com____ecere_COM_Initialize(unsigned int guiApp, int argc, char *  argv[]);
2203
2204 extern void SetPrivateModule(struct __ecereNameSpace__ecere__com__Instance * module);
2205
2206 extern char *  GetSymbolsDir(void);
2207
2208 extern char *  __ecereNameSpace__ecere__sys__SearchString(char *  buffer, int start, char *  subStr, unsigned int matchCase, unsigned int matchWord);
2209
2210 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__IteratorPointer;
2211
2212 struct __ecereNameSpace__ecere__com__IteratorPointer;
2213
2214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__MapIterator;
2215
2216 struct __ecereNameSpace__ecere__com__MapIterator
2217 {
2218 struct __ecereNameSpace__ecere__com__Instance * container;
2219 struct __ecereNameSpace__ecere__com__IteratorPointer * pointer;
2220 } __attribute__ ((gcc_struct));
2221
2222 extern int strcasecmp(const char * , const char * );
2223
2224 extern unsigned int LoadSymbols(char *  fileName, int importType, unsigned int loadDllOnly);
2225
2226 extern void CheckDataRedefinitions(void);
2227
2228 extern char *  __ecereNameSpace__ecere__sys__ChangeExtension(char *  string, char *  ext, char *  output);
2229
2230 extern char *  strstr(char * , const char * );
2231
2232 extern int strlen(const char * );
2233
2234 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ContextStringPair;
2235
2236 struct ContextStringPair
2237 {
2238 char * string;
2239 char * context;
2240 } __attribute__ ((gcc_struct));
2241
2242 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Iterator;
2243
2244 struct __ecereNameSpace__ecere__com__Iterator
2245 {
2246 struct __ecereNameSpace__ecere__com__Instance * container;
2247 struct __ecereNameSpace__ecere__com__IteratorPointer * pointer;
2248 } __attribute__ ((gcc_struct));
2249
2250 extern void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module);
2251
2252 extern unsigned int __ecereNameSpace__ecere__sys__MakeDir(char *  path);
2253
2254 extern char *  __ecereNameSpace__ecere__sys__PathCat(char *  string, char *  addedPath);
2255
2256 extern void FreeContext(struct Context * context);
2257
2258 extern void FreeExcludedSymbols(struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols);
2259
2260 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Definition;
2261
2262 struct Definition;
2263
2264 extern void FreeModuleDefine(struct Definition * def);
2265
2266 extern void FreeModuleImport(struct ModuleImport * imp);
2267
2268 extern void FreeTypeData(struct __ecereNameSpace__ecere__com__Instance * privateModule);
2269
2270 extern void FreeIncludeFiles(void);
2271
2272 extern void FreeGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * globalDataList);
2273
2274 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Map_TPL_ContextStringPair__ecere__com__List_TPL_String___;
2275
2276 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__List_TPL_String_;
2277
2278 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
2279
2280 struct __ecereNameSpace__ecere__com__Application
2281 {
2282 int argc;
2283 char * *  argv;
2284 int exitCode;
2285 unsigned int isGUIApp;
2286 struct __ecereNameSpace__ecere__sys__OldList allModules;
2287 char *  parsedCommand;
2288 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
2289 } __attribute__ ((gcc_struct));
2290
2291 char *  __ecereProp___ecereNameSpace__ecere__com__Platform_Get_char__PTR_(int this);
2292
2293 int __ecereProp___ecereNameSpace__ecere__com__Platform_Set_char__PTR_(char *  value);
2294
2295 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__com__Platform_char__PTR_;
2296
2297 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
2298
2299 struct __ecereNameSpace__ecere__com__Instance * __ecereProp___ecereNameSpace__ecere__com__MapIterator_Get_map(struct __ecereNameSpace__ecere__com__MapIterator * this);
2300
2301 void __ecereProp___ecereNameSpace__ecere__com__MapIterator_Set_map(struct __ecereNameSpace__ecere__com__MapIterator * this, struct __ecereNameSpace__ecere__com__Instance * value);
2302
2303 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__com__MapIterator_map;
2304
2305 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_Add;
2306
2307 unsigned int __ecereMethod___ecereNameSpace__ecere__com__Iterator_Index(struct __ecereNameSpace__ecere__com__Iterator * this, uint64 index, unsigned int create);
2308
2309 uint64 __ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(struct __ecereNameSpace__ecere__com__Iterator * this);
2310
2311 void __ecereProp___ecereNameSpace__ecere__com__Iterator_Set_data(struct __ecereNameSpace__ecere__com__Iterator * this, uint64 value);
2312
2313 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__com__Iterator_data;
2314
2315 unsigned int __ecereMethod___ecereNameSpace__ecere__com__Iterator_Next();
2316
2317 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_RemoveAll;
2318
2319 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_Free;
2320
2321 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__CustomAVLTree;
2322
2323 struct __ecereNameSpace__ecere__com__CustomAVLTree
2324 {
2325 struct __ecereNameSpace__ecere__com__AVLNode * root;
2326 int count;
2327 } __attribute__ ((gcc_struct));
2328
2329 uint64 __ecereProp___ecereNameSpace__ecere__com__MapIterator_Get_key(struct __ecereNameSpace__ecere__com__MapIterator * this);
2330
2331 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__com__MapIterator_key;
2332
2333 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
2334
2335 void __ecereMethod_SymbolgenApp_Main(struct __ecereNameSpace__ecere__com__Instance * this)
2336 {
2337 void * __ecereTemp1;
2338 int c;
2339 unsigned int valid = 0x1;
2340 char * output = (((void *)0));
2341
2342 targetPlatform = __ecereNameSpace__ecere__com__GetRuntimePlatform();
2343 targetBits = GetHostBits();
2344 for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc; c++)
2345 {
2346 char * arg = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c];
2347
2348 if(arg[0] == '-')
2349 {
2350 if(!strcmp(arg + 1, "m32") || !strcmp(arg + 1, "m64"))
2351 {
2352 targetBits = !strcmp(arg + 1, "m32") ? 32 : 64;
2353 }
2354 else if(!strcmp(arg + 1, "o"))
2355 {
2356 if(!output && c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc)
2357 {
2358 output = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c + 1];
2359 c++;
2360 }
2361 else
2362 valid = 0x0;
2363 }
2364 else if(!strcmp(arg, "-name"))
2365 {
2366 if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc)
2367 {
2368 strcpy(projectName, ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c + 1]);
2369 c++;
2370 }
2371 else
2372 valid = 0x0;
2373 }
2374 else if(!strcmp(arg, "-t"))
2375 {
2376 if(++c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc)
2377 targetPlatform = __ecereProp___ecereNameSpace__ecere__com__Platform_Set_char__PTR_(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c]);
2378 else
2379 valid = 0x0;
2380 }
2381 else if(!strcmp(arg, "-console"))
2382 isConsole = 0x1;
2383 else if(!strcmp(arg, "-dynamiclib"))
2384 isDynamicLibrary = 0x1;
2385 else if(!strcmp(arg, "-staticlib"))
2386 {
2387 isDynamicLibrary = 0x1;
2388 isStaticLibrary = 0x1;
2389 }
2390 else if(!strcmp(arg, "-symbols"))
2391 {
2392 if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc)
2393 {
2394 SetSymbolsDir(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c + 1]);
2395 c++;
2396 }
2397 else
2398 valid = 0x0;
2399 }
2400 }
2401 }
2402 if(!output)
2403 valid = 0x0;
2404 if(!valid)
2405 printf(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Syntax:\n   ecs [-t <target platform>] <input>[, <input>]* -o <output>\n", (((void *)0))));
2406 else
2407 {
2408 int c;
2409 char ext[17];
2410 char symbolModule[274];
2411
2412 __ecereNameSpace__ecere__sys__GetExtension(output, ext);
2413 __ecereNameSpace__ecere__sys__GetLastDirectory(output, symbolModule);
2414 SetDefines(&_defines);
2415 SetImports(&_imports);
2416 SetGlobalData(&globalData);
2417 SetExcludedSymbols(&_excludedSymbols);
2418 SetGlobalContext(theGlobalContext);
2419 SetTopContext(theGlobalContext);
2420 SetCurrentContext(theGlobalContext);
2421 SetTargetPlatform(targetPlatform);
2422 SetTargetBits(targetBits);
2423 privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize(0x1 | ((targetBits == 64) ? (unsigned int)2 : (unsigned int)0), 1, (((void *)0)));
2424 SetPrivateModule(privateModule);
2425 mainModule = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImport);
2426 SetMainModule(mainModule);
2427 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&_imports, mainModule);
2428 {
2429 char * symbolsDir = GetSymbolsDir();
2430 unsigned int outputPot = symbolsDir && __ecereNameSpace__ecere__sys__SearchString(symbolsDir, 0, "release.", 0x0, 0x0);
2431 struct __ecereNameSpace__ecere__com__Instance * intlStrings = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__com__Map_TPL_ContextStringPair__ecere__com__List_TPL_String___);
2432 struct __ecereNameSpace__ecere__com__MapIterator it = (it.container = (void *)0, it.pointer = (void *)0, __ecereProp___ecereNameSpace__ecere__com__MapIterator_Set_map(&it, intlStrings), it);
2433
2434 for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc; c++)
2435 {
2436 char * file = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c];
2437
2438 if(file[0] == '-')
2439 {
2440 if(!strcmp(file, "-c"))
2441 c++;
2442 }
2443 else
2444 {
2445 char ext[17];
2446
2447 __ecereNameSpace__ecere__sys__GetExtension(file, ext);
2448 if(!strcmp(ext, "imp"))
2449 LoadImports(file);
2450 }
2451 }
2452 for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc; c++)
2453 {
2454 char * file = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c];
2455
2456 if(file[0] == '-')
2457 {
2458 if(!strcmp(file, "-c"))
2459 c++;
2460 }
2461 }
2462 for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc; c++)
2463 {
2464 char * file = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c];
2465
2466 if(file[0] == '-')
2467 {
2468 if(!strcmp(file, "-c"))
2469 c++;
2470 }
2471 else
2472 {
2473 char ext[17];
2474 char moduleName[797];
2475
2476 __ecereNameSpace__ecere__sys__GetExtension(file, ext);
2477 __ecereNameSpace__ecere__sys__GetLastDirectory(file, moduleName);
2478 __ecereNameSpace__ecere__sys__StripExtension(moduleName);
2479 strcat(moduleName, ".ec");
2480 if(((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? (strcasecmp) : strcmp)(moduleName, symbolModule) && (!strcmp(ext, "sym") || !strcmp(ext, "ec")))
2481 {
2482 struct ImportedModule * importedModule;
2483 struct ModuleInfo * module = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleInfo);
2484 char fileName[274];
2485
2486 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&modules, module);
2487 __ecereNameSpace__ecere__sys__GetLastDirectory(file, fileName);
2488 module->name = __ecereNameSpace__ecere__sys__CopyString(fileName);
2489 __ecereNameSpace__ecere__sys__StripExtension(module->name);
2490 for(importedModule = _defines.first; importedModule; importedModule = importedModule->next)
2491 {
2492 if(importedModule->type == 0 && !(strcasecmp)(importedModule->name, module->name) && !(importedModule->importType == 2))
2493 break;
2494 }
2495 if(importedModule)
2496 module->globalInstance = importedModule->globalInstance;
2497 else
2498 {
2499 importedModule = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ImportedModule), ((struct ImportedModule *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(module->name), ((struct ImportedModule *)__ecereTemp1)->type = 0, ((struct ImportedModule *)__ecereTemp1)->importType = 0, ((struct ImportedModule *)__ecereTemp1));
2500 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&_defines, importedModule);
2501 module->globalInstance = LoadSymbols(file, 0, 0x0);
2502 CheckDataRedefinitions();
2503 }
2504 {
2505 struct __ecereNameSpace__ecere__com__Instance * f;
2506
2507 __ecereNameSpace__ecere__sys__ChangeExtension(file, "bowl", fileName);
2508 f = __ecereNameSpace__ecere__sys__FileOpen(fileName, 1);
2509 if(f)
2510 {
2511 static char line[65536];
2512 struct __ecereNameSpace__ecere__com__Instance * comments = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__com__List_TPL_String_);
2513 char * msgid = (((void *)0)), * msgstr = (((void *)0)), * msgctxt = (((void *)0));
2514
2515 while(!((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof])(f))
2516 {
2517 if(__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, line, sizeof line))
2518 {
2519 int len;
2520
2521 __ecereNameSpace__ecere__sys__TrimLSpaces(line, line);
2522 if(line[0] == '#')
2523 {
2524 ((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, uint64 value))comments->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Container_Add])(comments, (uint64)(__ecereNameSpace__ecere__sys__CopyString(line)));
2525 }
2526 else if(strstr(line, "msgid \"") == line)
2527 {
2528 (__ecereNameSpace__ecere__com__eSystem_Delete(msgid), msgid = 0);
2529 msgid = __ecereNameSpace__ecere__sys__CopyString(line + 7);
2530 len = strlen(msgid);
2531 if(len)
2532 msgid[len - 1] = (unsigned char)0;
2533 }
2534 else if(strstr(line, "msgctxt \"") == line)
2535 {
2536 (__ecereNameSpace__ecere__com__eSystem_Delete(msgctxt), msgctxt = 0);
2537 msgctxt = __ecereNameSpace__ecere__sys__CopyString(line + 9);
2538 len = strlen(msgctxt);
2539 if(len)
2540 msgctxt[len - 1] = (unsigned char)0;
2541 }
2542 else if(strstr(line, "msgstr \"") == line)
2543 {
2544 (__ecereNameSpace__ecere__com__eSystem_Delete(msgstr), msgstr = 0);
2545 msgstr = __ecereNameSpace__ecere__sys__CopyString(line + 8);
2546 len = strlen(msgstr);
2547 if(len)
2548 msgstr[len - 1] = (unsigned char)0;
2549 }
2550 if(msgid && msgstr)
2551 {
2552 struct ContextStringPair pair = 
2553 {
2554 msgid, msgctxt
2555 };
2556
2557 i18n = 0x1;
2558 if(!__ecereMethod___ecereNameSpace__ecere__com__Iterator_Index(&it, (&pair), 0x0))
2559 {
2560 msgid = (((void *)0));
2561 msgctxt = (((void *)0));
2562 __extension__ ({
2563 struct __ecereNameSpace__ecere__com__Iterator __internalIterator = 
2564 {
2565 intlStrings, 0
2566 };
2567
2568 __ecereMethod___ecereNameSpace__ecere__com__Iterator_Index(&__internalIterator, (((&pair))), 0x1);
2569 __ecereProp___ecereNameSpace__ecere__com__Iterator_Set_data(&__internalIterator, comments);
2570 });
2571 comments = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__com__List_TPL_String_);
2572 }
2573 else
2574 {
2575 {
2576 struct __ecereNameSpace__ecere__com__Iterator s = 
2577 {
2578 (comments), 0
2579 };
2580
2581 while(__ecereMethod___ecereNameSpace__ecere__com__Iterator_Next(&s))
2582 ((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, uint64 value))((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&it))->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Container_Add])(((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&it)), __ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&s));
2583 }
2584 ((void (*)(struct __ecereNameSpace__ecere__com__Instance *))comments->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Container_RemoveAll])(comments);
2585 }
2586 (__ecereNameSpace__ecere__com__eSystem_Delete(msgid), msgid = 0);
2587 (__ecereNameSpace__ecere__com__eSystem_Delete(msgctxt), msgctxt = 0);
2588 (__ecereNameSpace__ecere__com__eSystem_Delete(msgstr), msgstr = 0);
2589 }
2590 }
2591 }
2592 ((void (*)(struct __ecereNameSpace__ecere__com__Instance *))comments->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Container_Free])(comments);
2593 (__ecereNameSpace__ecere__com__eInstance_DecRef(comments), comments = 0);
2594 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
2595 }
2596 }
2597 }
2598 }
2599 }
2600 ComputeModuleClasses(privateModule);
2601 if(!isDynamicLibrary)
2602 {
2603 thisAppClass = SearchAppClass_Module(privateModule);
2604 }
2605 WriteMain(output);
2606 if(outputPot && ((struct __ecereNameSpace__ecere__com__CustomAVLTree *)(((char *)intlStrings + 12)))->count)
2607 {
2608 struct __ecereNameSpace__ecere__com__Instance * potFile;
2609 char potFileName[797];
2610
2611 strcpy(potFileName, "locale");
2612 __ecereNameSpace__ecere__sys__MakeDir(potFileName);
2613 __ecereNameSpace__ecere__sys__PathCat(potFileName, projectName);
2614 __ecereNameSpace__ecere__sys__ChangeExtension(potFileName, "pot", potFileName);
2615 potFile = __ecereNameSpace__ecere__sys__FileOpen(potFileName, 2);
2616 if(potFile)
2617 {
2618 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgid \"\"\n");
2619 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgstr \"\"\n");
2620 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Project-Id-Version: \\n\"\n");
2621 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"POT-Creation-Date: \\n\"\n");
2622 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"PO-Revision-Date: \\n\"\n");
2623 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Last-Translator: \\n\"\n");
2624 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Language-Team: \\n\"\n");
2625 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"MIME-Version: 1.0\\n\"\n");
2626 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Content-Type: text/plain; charset=iso-8859-1\\n\"\n");
2627 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"Content-Transfer-Encoding: 8bit\\n\"\n");
2628 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"X-Poedit-Basepath: ../\\n\"\n");
2629 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\n");
2630 {
2631 struct __ecereNameSpace__ecere__com__MapIterator i = (i.container = (void *)0, i.pointer = (void *)0, __ecereProp___ecereNameSpace__ecere__com__MapIterator_Set_map(&i, (intlStrings)), i);
2632
2633 while(__ecereMethod___ecereNameSpace__ecere__com__Iterator_Next(&i))
2634 {
2635 struct ContextStringPair pair = (*(struct ContextStringPair *)__ecereProp___ecereNameSpace__ecere__com__MapIterator_Get_key(&i));
2636 struct __ecereNameSpace__ecere__com__Instance * comments = ((struct __ecereNameSpace__ecere__com__Instance *)__ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&i));
2637
2638 {
2639 struct __ecereNameSpace__ecere__com__Iterator s = 
2640 {
2641 (comments), 0
2642 };
2643
2644 while(__ecereMethod___ecereNameSpace__ecere__com__Iterator_Next(&s))
2645 {
2646 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(potFile, __ecereProp___ecereNameSpace__ecere__com__Iterator_Get_data(&s));
2647 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\n");
2648 }
2649 }
2650 if(pair.context)
2651 {
2652 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgctxt \"");
2653 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, pair.context);
2654 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"\n");
2655 }
2656 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgid \"");
2657 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, pair.string);
2658 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"\n");
2659 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "msgstr \"");
2660 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, pair.string);
2661 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\"\n");
2662 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))potFile->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(potFile, "\n");
2663 }
2664 }
2665 ((void (*)(struct __ecereNameSpace__ecere__com__Instance *))intlStrings->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Container_Free])(intlStrings);
2666 (__ecereNameSpace__ecere__com__eInstance_DecRef(intlStrings), intlStrings = 0);
2667 (__ecereNameSpace__ecere__com__eInstance_DecRef(potFile), potFile = 0);
2668 }
2669 }
2670 }
2671 FreeContext(theGlobalContext);
2672 FreeExcludedSymbols(&_excludedSymbols);
2673 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&_defines, FreeModuleDefine);
2674 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&_imports, FreeModuleImport);
2675 FreeTypeData(privateModule);
2676 FreeIncludeFiles();
2677 FreeGlobalData(&globalData);
2678 (__ecereNameSpace__ecere__com__eInstance_DecRef(privateModule), privateModule = 0);
2679 }
2680 SetSymbolsDir((((void *)0)));
2681 }
2682
2683 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
2684
2685 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, void *  function, int declMode);
2686
2687 void __ecereRegisterModule_ecs(struct __ecereNameSpace__ecere__com__Instance * module)
2688 {
2689 struct __ecereNameSpace__ecere__com__Class * class;
2690
2691 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ModuleInfo", 0, sizeof(struct ModuleInfo), 0, 0, 0, module, 2, 1);
2692 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
2693 __ecereClass_ModuleInfo = class;
2694 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "SymbolgenApp", "ecere::com::Application", 0, 0, 0, 0, module, 2, 1);
2695 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
2696 __ecereClass_SymbolgenApp = class;
2697 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Main", 0, __ecereMethod_SymbolgenApp_Main, 1);
2698 }
2699
2700 void __ecereUnregisterModule_ecs(struct __ecereNameSpace__ecere__com__Instance * module)
2701 {
2702
2703 }
2704
2705 int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  a, char *  b);
2706
2707 void __ecereCreateModuleInstances_ecs()
2708 {
2709 (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);
2710 theGlobalContext = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
2711 }
2712
2713 void __ecereDestroyModuleInstances_ecs()
2714 {
2715 ((theGlobalContext ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(theGlobalContext) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(theGlobalContext)) : 0), theGlobalContext = 0);
2716 }
2717