8bf2b58f2accddb07cbe1541d2dcbfa22912144b
[sdk] / compiler / bootstrap / libec / bootstrap / copy.c
1 /* Code generated from eC source file: copy.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #include <stdint.h>
39 #include <sys/types.h>
40 struct __ecereNameSpace__ecere__sys__OldList
41 {
42 void *  first;
43 void *  last;
44 int count;
45 unsigned int offset;
46 unsigned int circ;
47 } __attribute__ ((gcc_struct));
48
49 struct __ecereNameSpace__ecere__sys__BTNode;
50
51 struct __ecereNameSpace__ecere__com__DataValue
52 {
53 union
54 {
55 char c;
56 unsigned char uc;
57 short s;
58 unsigned short us;
59 int i;
60 unsigned int ui;
61 void *  p;
62 float f;
63 double d;
64 long long i64;
65 uint64 ui64;
66 } __attribute__ ((gcc_struct)) __anon1;
67 } __attribute__ ((gcc_struct));
68
69 struct __ecereNameSpace__ecere__com__SerialBuffer
70 {
71 unsigned char *  _buffer;
72 unsigned int count;
73 unsigned int _size;
74 unsigned int pos;
75 } __attribute__ ((gcc_struct));
76
77 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
78
79 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
80
81 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
82
83 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
84
85 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
86
87 struct CodePosition
88 {
89 int line;
90 int charPos;
91 int pos;
92 int included;
93 } __attribute__ ((gcc_struct));
94
95 struct Context;
96
97 struct TemplateParameter;
98
99 struct ClassFunction;
100
101 struct External;
102
103 struct ModuleImport;
104
105 struct ClassImport;
106
107 struct PropertyDef;
108
109 struct PropertyWatch;
110
111 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
112
113 struct __ecereNameSpace__ecere__com__GlobalFunction;
114
115 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
116
117 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
118
119 struct Location
120 {
121 struct CodePosition start;
122 struct CodePosition end;
123 } __attribute__ ((gcc_struct));
124
125 struct Attrib
126 {
127 struct Location loc;
128 int type;
129 struct __ecereNameSpace__ecere__sys__OldList *  attribs;
130 } __attribute__ ((gcc_struct));
131
132 struct ExtDecl
133 {
134 struct Location loc;
135 int type;
136 union
137 {
138 char * s;
139 struct Attrib * attr;
140 } __attribute__ ((gcc_struct)) __anon1;
141 } __attribute__ ((gcc_struct));
142
143 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
144
145 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
146
147 extern struct ExtDecl * MkExtDeclString(char * s);
148
149 struct __ecereNameSpace__ecere__com__Class;
150
151 struct __ecereNameSpace__ecere__com__Instance
152 {
153 void * *  _vTbl;
154 struct __ecereNameSpace__ecere__com__Class * _class;
155 int _refCount;
156 } __attribute__ ((gcc_struct));
157
158 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
159
160 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
161
162 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
163
164 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
165
166 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
167
168 struct __ecereNameSpace__ecere__com__Property;
169
170 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
171
172 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
173
174 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
175
176 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
177
178 struct Identifier;
179
180 extern struct Identifier * MkIdentifier(const char *  string);
181
182 struct Expression;
183
184 extern struct Expression * MkExpDummy(void);
185
186 extern struct Expression * MkExpIdentifier(struct Identifier * id);
187
188 extern struct Expression * MkExpConstant(const char *  string);
189
190 extern struct Expression * MkExpString(const char *  string);
191
192 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
193
194 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
195
196 extern struct Expression * MkExpIndex(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * index);
197
198 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
199
200 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
201
202 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
203
204 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
205
206 struct Symbol;
207
208 extern struct Symbol * FindClass(const char *  name);
209
210 struct Declaration;
211
212 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
213
214 struct Specifier;
215
216 struct Identifier
217 {
218 struct Identifier * prev;
219 struct Identifier * next;
220 struct Location loc;
221 struct Symbol * classSym;
222 struct Specifier * _class;
223 char *  string;
224 struct Identifier * badID;
225 } __attribute__ ((gcc_struct));
226
227 struct Specifier
228 {
229 struct Specifier * prev;
230 struct Specifier * next;
231 struct Location loc;
232 int type;
233 union
234 {
235 int specifier;
236 struct
237 {
238 struct ExtDecl * extDecl;
239 char *  name;
240 struct Symbol * symbol;
241 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
242 } __attribute__ ((gcc_struct)) __anon1;
243 struct
244 {
245 struct Identifier * id;
246 struct __ecereNameSpace__ecere__sys__OldList *  list;
247 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
248 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
249 unsigned int addNameSpace;
250 struct Context * ctx;
251 struct ExtDecl * extDeclStruct;
252 } __attribute__ ((gcc_struct)) __anon2;
253 struct Expression * expression;
254 struct Specifier * _class;
255 struct TemplateParameter * templateParameter;
256 } __attribute__ ((gcc_struct)) __anon1;
257 } __attribute__ ((gcc_struct));
258
259 extern struct Specifier * MkSpecifier(int specifier);
260
261 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
262
263 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
264
265 extern struct Specifier * MkSpecifierSubClass(struct Specifier * _class);
266
267 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
268
269 struct Declarator;
270
271 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
272
273 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
274
275 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
276
277 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
278
279 extern struct Declarator * MkDeclaratorEnumArray(struct Declarator * declarator, struct Specifier * _class);
280
281 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
282
283 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
284
285 extern struct Declarator * MkDeclaratorExtended(struct ExtDecl * extended, struct Declarator * declarator);
286
287 extern struct Declarator * MkDeclaratorExtendedEnd(struct ExtDecl * extended, struct Declarator * declarator);
288
289 struct __ecereNameSpace__ecere__sys__Item;
290
291 struct __ecereNameSpace__ecere__sys__Item
292 {
293 struct __ecereNameSpace__ecere__sys__Item * prev;
294 struct __ecereNameSpace__ecere__sys__Item * next;
295 } __attribute__ ((gcc_struct));
296
297 struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void *))
298 {
299 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
300
301 if(source)
302 {
303 struct __ecereNameSpace__ecere__sys__Item * item;
304
305 list = MkList();
306 for(item = (*source).first; item; item = item->next)
307 ListAdd(list, CopyFunction(item));
308 }
309 return list;
310 }
311
312 struct Pointer;
313
314 struct Pointer
315 {
316 struct Pointer * prev;
317 struct Pointer * next;
318 struct Location loc;
319 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
320 struct Pointer * pointer;
321 } __attribute__ ((gcc_struct));
322
323 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
324
325 struct Declarator
326 {
327 struct Declarator * prev;
328 struct Declarator * next;
329 struct Location loc;
330 int type;
331 struct Symbol * symbol;
332 struct Declarator * declarator;
333 union
334 {
335 struct Identifier * identifier;
336 struct
337 {
338 struct Expression * exp;
339 struct Expression * posExp;
340 struct Attrib * attrib;
341 } __attribute__ ((gcc_struct)) structDecl;
342 struct
343 {
344 struct Expression * exp;
345 struct Specifier * enumClass;
346 } __attribute__ ((gcc_struct)) array;
347 struct
348 {
349 struct __ecereNameSpace__ecere__sys__OldList * parameters;
350 } __attribute__ ((gcc_struct)) function;
351 struct
352 {
353 struct Pointer * pointer;
354 } __attribute__ ((gcc_struct)) pointer;
355 struct
356 {
357 struct ExtDecl * extended;
358 } __attribute__ ((gcc_struct)) extended;
359 } __attribute__ ((gcc_struct)) __anon1;
360 } __attribute__ ((gcc_struct));
361
362 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
363
364 struct Initializer;
365
366 struct Initializer
367 {
368 struct Initializer * prev;
369 struct Initializer * next;
370 struct Location loc;
371 int type;
372 union
373 {
374 struct Expression * exp;
375 struct __ecereNameSpace__ecere__sys__OldList *  list;
376 } __attribute__ ((gcc_struct)) __anon1;
377 unsigned int isConstant;
378 struct Identifier * id;
379 } __attribute__ ((gcc_struct));
380
381 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
382
383 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
384
385 struct MembersInit;
386
387 struct MembersInit
388 {
389 struct MembersInit * prev;
390 struct MembersInit * next;
391 struct Location loc;
392 int type;
393 union
394 {
395 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
396 struct ClassFunction * function;
397 } __attribute__ ((gcc_struct)) __anon1;
398 } __attribute__ ((gcc_struct));
399
400 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
401
402 struct Statement;
403
404 extern struct Expression * MkExpExtensionCompound(struct Statement * compound);
405
406 struct Statement
407 {
408 struct Statement * prev;
409 struct Statement * next;
410 struct Location loc;
411 int type;
412 union
413 {
414 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
415 struct
416 {
417 struct Identifier * id;
418 struct Statement * stmt;
419 } __attribute__ ((gcc_struct)) labeled;
420 struct
421 {
422 struct Expression * exp;
423 struct Statement * stmt;
424 } __attribute__ ((gcc_struct)) caseStmt;
425 struct
426 {
427 struct __ecereNameSpace__ecere__sys__OldList * declarations;
428 struct __ecereNameSpace__ecere__sys__OldList * statements;
429 struct Context * context;
430 unsigned int isSwitch;
431 } __attribute__ ((gcc_struct)) compound;
432 struct
433 {
434 struct __ecereNameSpace__ecere__sys__OldList * exp;
435 struct Statement * stmt;
436 struct Statement * elseStmt;
437 } __attribute__ ((gcc_struct)) ifStmt;
438 struct
439 {
440 struct __ecereNameSpace__ecere__sys__OldList * exp;
441 struct Statement * stmt;
442 } __attribute__ ((gcc_struct)) switchStmt;
443 struct
444 {
445 struct __ecereNameSpace__ecere__sys__OldList * exp;
446 struct Statement * stmt;
447 } __attribute__ ((gcc_struct)) whileStmt;
448 struct
449 {
450 struct __ecereNameSpace__ecere__sys__OldList * exp;
451 struct Statement * stmt;
452 } __attribute__ ((gcc_struct)) doWhile;
453 struct
454 {
455 struct Statement * init;
456 struct Statement * check;
457 struct __ecereNameSpace__ecere__sys__OldList * increment;
458 struct Statement * stmt;
459 } __attribute__ ((gcc_struct)) forStmt;
460 struct
461 {
462 struct Identifier * id;
463 } __attribute__ ((gcc_struct)) gotoStmt;
464 struct
465 {
466 struct Specifier * spec;
467 char * statements;
468 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
469 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
470 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
471 } __attribute__ ((gcc_struct)) asmStmt;
472 struct
473 {
474 struct Expression * watcher;
475 struct Expression * object;
476 struct __ecereNameSpace__ecere__sys__OldList * watches;
477 } __attribute__ ((gcc_struct)) _watch;
478 struct
479 {
480 struct Identifier * id;
481 struct __ecereNameSpace__ecere__sys__OldList * exp;
482 struct __ecereNameSpace__ecere__sys__OldList * filter;
483 struct Statement * stmt;
484 } __attribute__ ((gcc_struct)) forEachStmt;
485 struct Declaration * decl;
486 } __attribute__ ((gcc_struct)) __anon1;
487 } __attribute__ ((gcc_struct));
488
489 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
490
491 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
492
493 extern struct Statement * MkBadDeclStmt(struct Declaration * decl);
494
495 struct __ecereNameSpace__ecere__sys__BinaryTree;
496
497 struct __ecereNameSpace__ecere__sys__BinaryTree
498 {
499 struct __ecereNameSpace__ecere__sys__BTNode * root;
500 int count;
501 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
502 void (*  FreeKey)(void *  key);
503 } __attribute__ ((gcc_struct));
504
505 struct Attrib *  CopyAttrib(struct Attrib *  attrib);
506
507 struct ExtDecl * CopyExtDecl(struct ExtDecl * extDecl)
508 {
509 if(extDecl)
510 {
511 if(extDecl->type == 1)
512 return MkExtDeclAttrib(CopyAttrib(extDecl->__anon1.attr));
513 else if(extDecl->type == 0)
514 return MkExtDeclString(__ecereNameSpace__ecere__sys__CopyString(extDecl->__anon1.s));
515 }
516 return (((void *)0));
517 }
518
519 struct __ecereNameSpace__ecere__com__Method;
520
521 struct __ecereNameSpace__ecere__com__Module;
522
523 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
524
525 struct Type;
526
527 struct __ecereNameSpace__ecere__com__Property
528 {
529 struct __ecereNameSpace__ecere__com__Property * prev;
530 struct __ecereNameSpace__ecere__com__Property * next;
531 const char *  name;
532 unsigned int isProperty;
533 int memberAccess;
534 int id;
535 struct __ecereNameSpace__ecere__com__Class * _class;
536 const char *  dataTypeString;
537 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
538 struct Type * dataType;
539 void (*  Set)(void * , int);
540 int (*  Get)(void * );
541 unsigned int (*  IsSet)(void * );
542 void *  data;
543 void *  symbol;
544 int vid;
545 unsigned int conversion;
546 unsigned int watcherOffset;
547 const char *  category;
548 unsigned int compiled;
549 unsigned int selfWatchable;
550 unsigned int isWatchable;
551 } __attribute__ ((gcc_struct));
552
553 struct __ecereNameSpace__ecere__com__Method
554 {
555 const char *  name;
556 struct __ecereNameSpace__ecere__com__Method * parent;
557 struct __ecereNameSpace__ecere__com__Method * left;
558 struct __ecereNameSpace__ecere__com__Method * right;
559 int depth;
560 int (*  function)();
561 int vid;
562 int type;
563 struct __ecereNameSpace__ecere__com__Class * _class;
564 void *  symbol;
565 const char *  dataTypeString;
566 struct Type * dataType;
567 int memberAccess;
568 } __attribute__ ((gcc_struct));
569
570 struct Symbol
571 {
572 char *  string;
573 struct Symbol * parent;
574 struct Symbol * left;
575 struct Symbol * right;
576 int depth;
577 struct Type * type;
578 union
579 {
580 struct __ecereNameSpace__ecere__com__Method * method;
581 struct __ecereNameSpace__ecere__com__Property * _property;
582 struct __ecereNameSpace__ecere__com__Class * registered;
583 } __attribute__ ((gcc_struct)) __anon1;
584 unsigned int notYetDeclared;
585 union
586 {
587 struct
588 {
589 struct External * pointerExternal;
590 struct External * structExternal;
591 } __attribute__ ((gcc_struct)) __anon1;
592 struct
593 {
594 struct External * externalGet;
595 struct External * externalSet;
596 struct External * externalPtr;
597 struct External * externalIsSet;
598 } __attribute__ ((gcc_struct)) __anon2;
599 struct
600 {
601 struct External * methodExternal;
602 struct External * methodCodeExternal;
603 } __attribute__ ((gcc_struct)) __anon3;
604 } __attribute__ ((gcc_struct)) __anon2;
605 unsigned int imported;
606 unsigned int declaredStructSym;
607 struct __ecereNameSpace__ecere__com__Class * _class;
608 unsigned int declaredStruct;
609 unsigned int needConstructor;
610 unsigned int needDestructor;
611 char *  constructorName;
612 char *  structName;
613 char *  className;
614 char *  destructorName;
615 struct ModuleImport * module;
616 struct ClassImport * _import;
617 struct Location nameLoc;
618 unsigned int isParam;
619 unsigned int isRemote;
620 unsigned int isStruct;
621 unsigned int fireWatchersDone;
622 int declaring;
623 unsigned int classData;
624 unsigned int isStatic;
625 char *  shortName;
626 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
627 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
628 struct Context * ctx;
629 int isIterator;
630 struct Expression * propCategory;
631 } __attribute__ ((gcc_struct));
632
633 struct Type
634 {
635 struct Type * prev;
636 struct Type * next;
637 int refCount;
638 union
639 {
640 struct Symbol * _class;
641 struct
642 {
643 struct __ecereNameSpace__ecere__sys__OldList members;
644 char *  enumName;
645 } __attribute__ ((gcc_struct)) __anon1;
646 struct
647 {
648 struct Type * returnType;
649 struct __ecereNameSpace__ecere__sys__OldList params;
650 struct Symbol * thisClass;
651 unsigned int staticMethod;
652 struct TemplateParameter * thisClassTemplate;
653 } __attribute__ ((gcc_struct)) __anon2;
654 struct
655 {
656 struct __ecereNameSpace__ecere__com__Method * method;
657 struct __ecereNameSpace__ecere__com__Class * methodClass;
658 struct __ecereNameSpace__ecere__com__Class * usedClass;
659 } __attribute__ ((gcc_struct)) __anon3;
660 struct
661 {
662 struct Type * arrayType;
663 int arraySize;
664 struct Expression * arraySizeExp;
665 unsigned int freeExp;
666 struct Symbol * enumClass;
667 } __attribute__ ((gcc_struct)) __anon4;
668 struct Type * type;
669 struct TemplateParameter * templateParameter;
670 } __attribute__ ((gcc_struct)) __anon1;
671 int kind;
672 unsigned int size;
673 char *  name;
674 char *  typeName;
675 int classObjectType;
676 int alignment;
677 unsigned int offset;
678 int bitFieldCount;
679 int count;
680 unsigned int isSigned : 1;
681 unsigned int constant : 1;
682 unsigned int truth : 1;
683 unsigned int byReference : 1;
684 unsigned int extraParam : 1;
685 unsigned int directClassAccess : 1;
686 unsigned int computing : 1;
687 unsigned int keepCast : 1;
688 unsigned int passAsTemplate : 1;
689 unsigned int dllExport : 1;
690 unsigned int attrStdcall : 1;
691 unsigned int declaredWithStruct : 1;
692 unsigned int typedByReference : 1;
693 unsigned int casted : 1;
694 unsigned int pointerAlignment : 1;
695 } __attribute__ ((gcc_struct));
696
697 struct Instantiation;
698
699 struct Instantiation
700 {
701 struct Instantiation * prev;
702 struct Instantiation * next;
703 struct Location loc;
704 struct Specifier * _class;
705 struct Expression * exp;
706 struct __ecereNameSpace__ecere__sys__OldList *  members;
707 struct Symbol * symbol;
708 unsigned int fullSet;
709 unsigned int isConstant;
710 unsigned char *  data;
711 struct Location nameLoc;
712 struct Location insideLoc;
713 unsigned int built;
714 } __attribute__ ((gcc_struct));
715
716 extern struct Instantiation * MkInstantiation(struct Specifier * _class, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
717
718 extern struct Expression * MkExpInstance(struct Instantiation * inst);
719
720 struct Declaration
721 {
722 struct Declaration * prev;
723 struct Declaration * next;
724 struct Location loc;
725 int type;
726 union
727 {
728 struct
729 {
730 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
731 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
732 } __attribute__ ((gcc_struct)) __anon1;
733 struct Instantiation * inst;
734 struct
735 {
736 struct Identifier * id;
737 struct Expression * exp;
738 } __attribute__ ((gcc_struct)) __anon2;
739 } __attribute__ ((gcc_struct)) __anon1;
740 struct Specifier * extStorage;
741 struct Symbol * symbol;
742 int declMode;
743 } __attribute__ ((gcc_struct));
744
745 struct TypeName;
746
747 struct Expression
748 {
749 struct Expression * prev;
750 struct Expression * next;
751 struct Location loc;
752 int type;
753 union
754 {
755 struct
756 {
757 char *  constant;
758 struct Identifier * identifier;
759 } __attribute__ ((gcc_struct)) __anon1;
760 struct Statement * compound;
761 struct Instantiation * instance;
762 struct
763 {
764 char *  string;
765 unsigned int intlString;
766 unsigned int wideString;
767 } __attribute__ ((gcc_struct)) __anon2;
768 struct __ecereNameSpace__ecere__sys__OldList *  list;
769 struct
770 {
771 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
772 struct Declarator * decl;
773 } __attribute__ ((gcc_struct)) _classExp;
774 struct
775 {
776 struct Identifier * id;
777 } __attribute__ ((gcc_struct)) classData;
778 struct
779 {
780 struct Expression * exp;
781 struct __ecereNameSpace__ecere__sys__OldList * arguments;
782 struct Location argLoc;
783 } __attribute__ ((gcc_struct)) call;
784 struct
785 {
786 struct Expression * exp;
787 struct __ecereNameSpace__ecere__sys__OldList * index;
788 } __attribute__ ((gcc_struct)) index;
789 struct
790 {
791 struct Expression * exp;
792 struct Identifier * member;
793 int memberType;
794 unsigned int thisPtr;
795 } __attribute__ ((gcc_struct)) member;
796 struct
797 {
798 int op;
799 struct Expression * exp1;
800 struct Expression * exp2;
801 } __attribute__ ((gcc_struct)) op;
802 struct TypeName * typeName;
803 struct Specifier * _class;
804 struct
805 {
806 struct TypeName * typeName;
807 struct Expression * exp;
808 } __attribute__ ((gcc_struct)) cast;
809 struct
810 {
811 struct Expression * cond;
812 struct __ecereNameSpace__ecere__sys__OldList * exp;
813 struct Expression * elseExp;
814 } __attribute__ ((gcc_struct)) cond;
815 struct
816 {
817 struct TypeName * typeName;
818 struct Expression * size;
819 } __attribute__ ((gcc_struct)) _new;
820 struct
821 {
822 struct TypeName * typeName;
823 struct Expression * size;
824 struct Expression * exp;
825 } __attribute__ ((gcc_struct)) _renew;
826 struct
827 {
828 char * table;
829 struct Identifier * id;
830 } __attribute__ ((gcc_struct)) db;
831 struct
832 {
833 struct Expression * ds;
834 struct Expression * name;
835 } __attribute__ ((gcc_struct)) dbopen;
836 struct
837 {
838 struct TypeName * typeName;
839 struct Initializer * initializer;
840 } __attribute__ ((gcc_struct)) initializer;
841 struct
842 {
843 struct Expression * exp;
844 struct TypeName * typeName;
845 } __attribute__ ((gcc_struct)) vaArg;
846 } __attribute__ ((gcc_struct)) __anon1;
847 unsigned int debugValue;
848 struct __ecereNameSpace__ecere__com__DataValue val;
849 uint64 address;
850 unsigned int hasAddress;
851 struct Type * expType;
852 struct Type * destType;
853 unsigned int usage;
854 int tempCount;
855 unsigned int byReference;
856 unsigned int isConstant;
857 unsigned int addedThis;
858 unsigned int needCast;
859 unsigned int thisPtr;
860 unsigned int opDestType;
861 unsigned int needTemplateCast;
862 } __attribute__ ((gcc_struct));
863
864 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
865
866 extern struct Expression * MkExpTypeAlign(struct TypeName * typeName);
867
868 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
869
870 extern struct Expression * MkExpVaArg(struct Expression * exp, struct TypeName * type);
871
872 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
873
874 struct TypeName
875 {
876 struct TypeName * prev;
877 struct TypeName * next;
878 struct Location loc;
879 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
880 struct Declarator * declarator;
881 int classObjectType;
882 struct Expression * bitCount;
883 } __attribute__ ((gcc_struct));
884
885 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
886
887 struct Enumerator;
888
889 extern struct Enumerator * MkEnumerator(struct Identifier * id, struct Expression * exp);
890
891 struct Enumerator
892 {
893 struct Enumerator * prev;
894 struct Enumerator * next;
895 struct Location loc;
896 struct Identifier * id;
897 struct Expression * exp;
898 } __attribute__ ((gcc_struct));
899
900 struct Attribute;
901
902 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
903
904 struct Attribute
905 {
906 struct Attribute * prev;
907 struct Attribute * next;
908 struct Location loc;
909 char * attr;
910 struct Expression * exp;
911 } __attribute__ ((gcc_struct));
912
913 struct ClassDef;
914
915 struct ClassDef
916 {
917 struct ClassDef * prev;
918 struct ClassDef * next;
919 struct Location loc;
920 int type;
921 union
922 {
923 struct Declaration * decl;
924 struct ClassFunction * function;
925 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
926 struct PropertyDef * propertyDef;
927 struct PropertyWatch * propertyWatch;
928 char *  designer;
929 struct Identifier * defaultProperty;
930 struct
931 {
932 struct Identifier * id;
933 struct Initializer * initializer;
934 } __attribute__ ((gcc_struct)) __anon1;
935 } __attribute__ ((gcc_struct)) __anon1;
936 int memberAccess;
937 void *  object;
938 } __attribute__ ((gcc_struct));
939
940 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
941
942 struct Specifier *  CopySpecifier(struct Specifier *  spec);
943
944 struct Identifier * CopyIdentifier(struct Identifier * id)
945 {
946 if(id)
947 {
948 struct Identifier * copy = MkIdentifier(id->string);
949
950 copy->_class = id->_class ? CopySpecifier(id->_class) : (((void *)0));
951 copy->classSym = id->classSym;
952 return copy;
953 }
954 return (((void *)0));
955 }
956
957 static struct Pointer * CopyPointer(struct Pointer * ptr)
958 {
959 if(ptr)
960 {
961 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
962 struct Specifier * spec;
963
964 if(ptr->qualifiers)
965 {
966 for(spec = (*ptr->qualifiers).first; spec; spec = spec->next)
967 ListAdd(list, CopySpecifier(spec));
968 }
969 return MkPointer(list, CopyPointer(ptr->pointer));
970 }
971 return (((void *)0));
972 }
973
974 struct Attribute *  CopyAttribute(struct Attribute *  attrib);
975
976 struct Attrib * CopyAttrib(struct Attrib * attrib)
977 {
978 if(attrib)
979 return MkAttrib(attrib->type, CopyList(attrib->attribs, (void *)(CopyAttribute)));
980 return (((void *)0));
981 }
982
983 struct MemberInit;
984
985 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
986
987 struct MemberInit
988 {
989 struct MemberInit * prev;
990 struct MemberInit * next;
991 struct Location loc;
992 struct Location realLoc;
993 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
994 struct Initializer * initializer;
995 unsigned int used;
996 unsigned int variable;
997 unsigned int takeOutExp;
998 } __attribute__ ((gcc_struct));
999
1000 struct InitDeclarator;
1001
1002 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1003
1004 struct InitDeclarator
1005 {
1006 struct InitDeclarator * prev;
1007 struct InitDeclarator * next;
1008 struct Location loc;
1009 struct Declarator * declarator;
1010 struct Initializer * initializer;
1011 } __attribute__ ((gcc_struct));
1012
1013 struct __ecereNameSpace__ecere__com__NameSpace;
1014
1015 struct __ecereNameSpace__ecere__com__NameSpace
1016 {
1017 const char *  name;
1018 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
1019 struct __ecereNameSpace__ecere__com__NameSpace *  left;
1020 struct __ecereNameSpace__ecere__com__NameSpace *  right;
1021 int depth;
1022 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
1023 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1024 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1025 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1026 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1027 } __attribute__ ((gcc_struct));
1028
1029 struct __ecereNameSpace__ecere__com__Application
1030 {
1031 int argc;
1032 const char * *  argv;
1033 int exitCode;
1034 unsigned int isGUIApp;
1035 struct __ecereNameSpace__ecere__sys__OldList allModules;
1036 char *  parsedCommand;
1037 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1038 } __attribute__ ((gcc_struct));
1039
1040 struct __ecereNameSpace__ecere__com__Module
1041 {
1042 struct __ecereNameSpace__ecere__com__Instance * application;
1043 struct __ecereNameSpace__ecere__sys__OldList classes;
1044 struct __ecereNameSpace__ecere__sys__OldList defines;
1045 struct __ecereNameSpace__ecere__sys__OldList functions;
1046 struct __ecereNameSpace__ecere__sys__OldList modules;
1047 struct __ecereNameSpace__ecere__com__Instance * prev;
1048 struct __ecereNameSpace__ecere__com__Instance * next;
1049 const char *  name;
1050 void *  library;
1051 void *  Unload;
1052 int importType;
1053 int origImportType;
1054 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1055 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1056 } __attribute__ ((gcc_struct));
1057
1058 void __ecereUnregisterModule_copy(struct __ecereNameSpace__ecere__com__Instance * module)
1059 {
1060
1061 }
1062
1063 struct __ecereNameSpace__ecere__com__DataMember;
1064
1065 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1066 {
1067 union
1068 {
1069 struct
1070 {
1071 const char *  dataTypeString;
1072 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1073 } __attribute__ ((gcc_struct)) __anon1;
1074 struct __ecereNameSpace__ecere__com__DataValue expression;
1075 struct
1076 {
1077 const char *  memberString;
1078 union
1079 {
1080 struct __ecereNameSpace__ecere__com__DataMember * member;
1081 struct __ecereNameSpace__ecere__com__Property * prop;
1082 struct __ecereNameSpace__ecere__com__Method * method;
1083 } __attribute__ ((gcc_struct)) __anon1;
1084 } __attribute__ ((gcc_struct)) __anon2;
1085 } __attribute__ ((gcc_struct)) __anon1;
1086 } __attribute__ ((gcc_struct));
1087
1088 struct __ecereNameSpace__ecere__com__DataMember
1089 {
1090 struct __ecereNameSpace__ecere__com__DataMember * prev;
1091 struct __ecereNameSpace__ecere__com__DataMember * next;
1092 const char *  name;
1093 unsigned int isProperty;
1094 int memberAccess;
1095 int id;
1096 struct __ecereNameSpace__ecere__com__Class * _class;
1097 const char *  dataTypeString;
1098 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1099 struct Type * dataType;
1100 int type;
1101 int offset;
1102 int memberID;
1103 struct __ecereNameSpace__ecere__sys__OldList members;
1104 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
1105 int memberOffset;
1106 short structAlignment;
1107 short pointerAlignment;
1108 } __attribute__ ((gcc_struct));
1109
1110 struct __ecereNameSpace__ecere__com__Class
1111 {
1112 struct __ecereNameSpace__ecere__com__Class * prev;
1113 struct __ecereNameSpace__ecere__com__Class * next;
1114 const char *  name;
1115 int offset;
1116 int structSize;
1117 void * *  _vTbl;
1118 int vTblSize;
1119 unsigned int (*  Constructor)(void * );
1120 void (*  Destructor)(void * );
1121 int offsetClass;
1122 int sizeClass;
1123 struct __ecereNameSpace__ecere__com__Class * base;
1124 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1125 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1126 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1127 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1128 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1129 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1130 int memberID;
1131 int startMemberID;
1132 int type;
1133 struct __ecereNameSpace__ecere__com__Instance * module;
1134 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
1135 const char *  dataTypeString;
1136 struct Type * dataType;
1137 int typeSize;
1138 int defaultAlignment;
1139 void (*  Initialize)();
1140 int memberOffset;
1141 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1142 const char *  designerClass;
1143 unsigned int noExpansion;
1144 const char *  defaultProperty;
1145 unsigned int comRedefinition;
1146 int count;
1147 int isRemote;
1148 unsigned int internalDecl;
1149 void *  data;
1150 unsigned int computeSize;
1151 short structAlignment;
1152 short pointerAlignment;
1153 int destructionWatchOffset;
1154 unsigned int fixed;
1155 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1156 int inheritanceAccess;
1157 const char *  fullName;
1158 void *  symbol;
1159 struct __ecereNameSpace__ecere__sys__OldList conversions;
1160 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1161 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
1162 struct __ecereNameSpace__ecere__com__Class * templateClass;
1163 struct __ecereNameSpace__ecere__sys__OldList templatized;
1164 int numParams;
1165 unsigned int isInstanceClass;
1166 unsigned int byValueSystemClass;
1167 } __attribute__ ((gcc_struct));
1168
1169 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
1170
1171 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
1172
1173 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
1174
1175 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
1176
1177 struct Expression * MoveExpContents(struct Expression * exp)
1178 {
1179 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
1180
1181 *newExp = *exp;
1182 newExp->prev = (((void *)0));
1183 newExp->next = (((void *)0));
1184 newExp->destType = (((void *)0));
1185 if(exp->expType)
1186 exp->expType->refCount++;
1187 return newExp;
1188 }
1189
1190 struct Expression *  CopyExpression(struct Expression *  exp);
1191
1192 static struct Initializer * CopyInitializer(struct Initializer * initializer)
1193 {
1194 struct Initializer * copy = (((void *)0));
1195
1196 ;
1197 if(initializer->type == 0)
1198 copy = MkInitializerAssignment(CopyExpression(initializer->__anon1.exp));
1199 else if(initializer->type == 1)
1200 copy = MkInitializerList(CopyList(initializer->__anon1.list, (void *)(CopyInitializer)));
1201 if(copy)
1202 {
1203 copy->loc = initializer->loc;
1204 if(initializer->id)
1205 copy->id = CopyIdentifier(initializer->id);
1206 copy->isConstant = initializer->isConstant;
1207 }
1208 return copy;
1209 }
1210
1211 static struct Enumerator * CopyEnumerator(struct Enumerator * enumerator)
1212 {
1213 return MkEnumerator(CopyIdentifier(enumerator->id), CopyExpression(enumerator->exp));
1214 }
1215
1216 struct Attribute * CopyAttribute(struct Attribute * attrib)
1217 {
1218 if(attrib)
1219 return MkAttribute(__ecereNameSpace__ecere__sys__CopyString(attrib->attr), CopyExpression(attrib->exp));
1220 return (((void *)0));
1221 }
1222
1223 static struct MemberInit * CopyMemberInit(struct MemberInit * member)
1224 {
1225 return MkMemberInit(CopyList(member->identifiers, (void *)(CopyIdentifier)), CopyInitializer(member->initializer));
1226 }
1227
1228 static struct MembersInit * CopyMembersInit(struct MembersInit * members)
1229 {
1230 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1231
1232 switch(members->type)
1233 {
1234 case 0:
1235 {
1236 if(members)
1237 {
1238 struct MemberInit * member;
1239
1240 list = MkList();
1241 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1242 ListAdd(list, CopyMemberInit(member));
1243 }
1244 }
1245 }
1246 return MkMembersInitList(list);
1247 }
1248
1249 static struct Instantiation * CopyInstantiation(struct Instantiation * inst)
1250 {
1251 struct Instantiation * copy;
1252 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1253 struct MembersInit * member;
1254
1255 if(inst->members)
1256 {
1257 for(member = (*inst->members).first; member; member = member->next)
1258 ListAdd(list, CopyMembersInit(member));
1259 }
1260 copy = MkInstantiation(CopySpecifier(inst->_class), CopyExpression(inst->exp), list);
1261 copy->data = inst->data;
1262 if(inst->data)
1263 {
1264 struct Symbol * classSym = FindClass(inst->_class->__anon1.__anon1.name);
1265 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
1266
1267 if(_class)
1268 {
1269 if(_class->type == 0)
1270 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)copy->data))->_refCount++;
1271 }
1272 }
1273 copy->loc = inst->loc;
1274 copy->isConstant = inst->isConstant;
1275 return copy;
1276 }
1277
1278 struct Declaration *  CopyDeclaration(struct Declaration *  decl);
1279
1280 static struct Statement * CopyStatement(struct Statement * stmt)
1281 {
1282 struct Statement * result = (((void *)0));
1283
1284 if(stmt)
1285 {
1286 switch(stmt->type)
1287 {
1288 case 2:
1289 result = MkCompoundStmt(CopyList(stmt->__anon1.compound.declarations, (void *)(CopyDeclaration)), CopyList(stmt->__anon1.compound.statements, (void *)(CopyStatement)));
1290 result->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
1291 break;
1292 case 3:
1293 result = MkExpressionStmt(CopyList(stmt->__anon1.expressions, (void *)(CopyExpression)));
1294 break;
1295 case 14:
1296 result = MkBadDeclStmt(CopyDeclaration(stmt->__anon1.decl));
1297 break;
1298 }
1299 }
1300 if(result)
1301 {
1302 result->loc = stmt->loc;
1303 }
1304 return result;
1305 }
1306
1307 struct ClassDef * CopyClassDef(struct ClassDef * def)
1308 {
1309 switch(def->type)
1310 {
1311 case 0:
1312 return (((void *)0));
1313 case 1:
1314 return (((void *)0));
1315 case 2:
1316 return MkClassDefDeclaration(CopyDeclaration(def->__anon1.decl));
1317 case 3:
1318 return (((void *)0));
1319 }
1320 return (((void *)0));
1321 }
1322
1323 struct Specifier * CopySpecifier(struct Specifier * spec)
1324 {
1325 if(spec)
1326 switch(spec->type)
1327 {
1328 case 0:
1329 return MkSpecifier(spec->__anon1.specifier);
1330 case 2:
1331 {
1332 struct Identifier * id = CopyIdentifier(spec->__anon1.__anon2.id);
1333 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1334 struct Enumerator * enumerator;
1335
1336 if(spec->__anon1.__anon2.list)
1337 {
1338 for(enumerator = (*spec->__anon1.__anon2.list).first; enumerator; enumerator = enumerator->next)
1339 ListAdd(list, CopyEnumerator(enumerator));
1340 }
1341 return MkEnum(id, list);
1342 }
1343 case 3:
1344 case 4:
1345 {
1346 struct Identifier * id = CopyIdentifier(spec->__anon1.__anon2.id);
1347 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1348 struct ClassDef * def;
1349 struct Specifier * s;
1350
1351 if(spec->__anon1.__anon2.definitions)
1352 {
1353 list = MkList();
1354 if(spec->__anon1.__anon2.list)
1355 {
1356 for(def = (*spec->__anon1.__anon2.list).first; def; def = def->next)
1357 ListAdd(list, CopyClassDef(def));
1358 }
1359 }
1360 s = MkStructOrUnion(spec->type, id, list);
1361 s->__anon1.__anon2.extDeclStruct = CopyExtDecl(spec->__anon1.__anon2.extDeclStruct);
1362 return s;
1363 }
1364 case 1:
1365 {
1366 struct Specifier * copy = (copy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier), copy->type = 1, copy->__anon1.__anon1.name = __ecereNameSpace__ecere__sys__CopyString(spec->__anon1.__anon1.name), copy->__anon1.__anon1.symbol = spec->__anon1.__anon1.symbol, copy->__anon1.__anon1.templateArgs = (((void *)0)), copy);
1367
1368 return copy;
1369 }
1370 case 7:
1371 return MkSpecifierSubClass(CopySpecifier(spec->__anon1._class));
1372 case 8:
1373 return __extension__ ({
1374 struct Specifier * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier);
1375
1376 __ecereInstance1->loc = spec->loc, __ecereInstance1->type = 8, __ecereInstance1->__anon1.templateParameter = spec->__anon1.templateParameter, __ecereInstance1;
1377 });
1378 case 5:
1379 return MkSpecifierExtended(CopyExtDecl(spec->__anon1.__anon1.extDecl));
1380 }
1381 return (((void *)0));
1382 }
1383
1384 struct Declarator *  CopyDeclarator(struct Declarator *  declarator);
1385
1386 struct TypeName * CopyTypeName(struct TypeName * typeName)
1387 {
1388 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1389 struct TypeName * copy;
1390
1391 if(typeName->qualifiers)
1392 {
1393 struct Specifier * spec;
1394
1395 list = MkList();
1396 for(spec = (*typeName->qualifiers).first; spec; spec = spec->next)
1397 ListAdd(list, CopySpecifier(spec));
1398 }
1399 copy = MkTypeName(list, CopyDeclarator(typeName->declarator));
1400 copy->classObjectType = typeName->classObjectType;
1401 return copy;
1402 }
1403
1404 struct InitDeclarator * CopyInitDeclarator(struct InitDeclarator * initDecl)
1405 {
1406 return MkInitDeclarator(CopyDeclarator(initDecl->declarator), CopyInitializer(initDecl->initializer));
1407 }
1408
1409 struct Expression * CopyExpression(struct Expression * exp)
1410 {
1411 struct Expression * result = (((void *)0));
1412
1413 if(exp)
1414 switch(exp->type)
1415 {
1416 case 16:
1417 result = MkExpDummy();
1418 break;
1419 case 0:
1420 result = MkExpIdentifier(CopyIdentifier(exp->__anon1.__anon1.identifier));
1421 break;
1422 case 1:
1423 result = MkExpInstance(CopyInstantiation(exp->__anon1.instance));
1424 break;
1425 case 2:
1426 result = MkExpConstant(exp->__anon1.__anon2.string);
1427 break;
1428 case 3:
1429 result = MkExpString(exp->__anon1.__anon2.string);
1430 break;
1431 case 4:
1432 result = MkExpOp(CopyExpression(exp->__anon1.op.exp1), exp->__anon1.op.op, CopyExpression(exp->__anon1.op.exp2));
1433 break;
1434 case 5:
1435 {
1436 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1437 struct Expression * e;
1438
1439 for(e = (*exp->__anon1.list).first; e; e = e->next)
1440 ListAdd(list, CopyExpression(e));
1441 result = MkExpBrackets(list);
1442 break;
1443 }
1444 case 6:
1445 {
1446 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1447 struct Expression * e;
1448
1449 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1450 ListAdd(list, CopyExpression(e));
1451 result = MkExpIndex(CopyExpression(exp->__anon1.index.exp), list);
1452 break;
1453 }
1454 case 7:
1455 {
1456 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1457 struct Expression * arg;
1458
1459 if(exp->__anon1.call.arguments)
1460 {
1461 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1462 ListAdd(list, CopyExpression(arg));
1463 }
1464 result = MkExpCall(CopyExpression(exp->__anon1.call.exp), list);
1465 break;
1466 }
1467 case 8:
1468 result = MkExpMember(CopyExpression(exp->__anon1.member.exp), CopyIdentifier(exp->__anon1.member.member));
1469 result->__anon1.member.memberType = exp->__anon1.member.memberType;
1470 result->__anon1.member.thisPtr = exp->__anon1.member.thisPtr;
1471 break;
1472 case 9:
1473 result = MkExpPointer(CopyExpression(exp->__anon1.member.exp), CopyIdentifier(exp->__anon1.member.member));
1474 break;
1475 case 10:
1476 result = MkExpTypeSize(CopyTypeName(exp->__anon1.typeName));
1477 break;
1478 case 36:
1479 result = MkExpTypeAlign(CopyTypeName(exp->__anon1.typeName));
1480 break;
1481 case 11:
1482 result = MkExpCast(CopyTypeName(exp->__anon1.cast.typeName), CopyExpression(exp->__anon1.cast.exp));
1483 break;
1484 case 12:
1485 {
1486 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
1487 struct Expression * e;
1488
1489 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1490 ListAdd(list, CopyExpression(e));
1491 result = MkExpCondition(CopyExpression(exp->__anon1.cond.cond), list, CopyExpression(exp->__anon1.cond.elseExp));
1492 break;
1493 }
1494 case 34:
1495 result = MkExpVaArg(CopyExpression(exp->__anon1.vaArg.exp), CopyTypeName(exp->__anon1.vaArg.typeName));
1496 break;
1497 case 23:
1498 result = MkExpExtensionCompound(CopyStatement(exp->__anon1.compound));
1499 break;
1500 case 33:
1501 result = MkExpExtensionInitializer(CopyTypeName(exp->__anon1.initializer.typeName), CopyInitializer(exp->__anon1.initializer.initializer));
1502 break;
1503 case 24:
1504 result = MkExpClass(CopyList(exp->__anon1._classExp.specifiers, (void *)(CopySpecifier)), CopyDeclarator(exp->__anon1._classExp.decl));
1505 break;
1506 }
1507 if(result)
1508 {
1509 result->expType = exp->expType;
1510 if(exp->expType)
1511 exp->expType->refCount++;
1512 result->destType = exp->destType;
1513 if(exp->destType)
1514 exp->destType->refCount++;
1515 result->loc = exp->loc;
1516 result->isConstant = exp->isConstant;
1517 result->byReference = exp->byReference;
1518 result->opDestType = exp->opDestType;
1519 result->needTemplateCast = exp->needTemplateCast;
1520 }
1521 return result;
1522 }
1523
1524 struct Declarator * CopyDeclarator(struct Declarator * declarator)
1525 {
1526 if(declarator)
1527 {
1528 switch(declarator->type)
1529 {
1530 case 0:
1531 {
1532 struct Declarator * decl = MkStructDeclarator(CopyDeclarator(declarator->declarator), CopyExpression(declarator->__anon1.structDecl.exp));
1533
1534 if(declarator->__anon1.structDecl.attrib)
1535 decl->__anon1.structDecl.attrib = CopyAttrib(declarator->__anon1.structDecl.attrib);
1536 return decl;
1537 }
1538 case 1:
1539 return MkDeclaratorIdentifier(CopyIdentifier(declarator->__anon1.identifier));
1540 case 2:
1541 return MkDeclaratorBrackets(CopyDeclarator(declarator->declarator));
1542 case 3:
1543 if(declarator->__anon1.array.enumClass)
1544 return MkDeclaratorEnumArray(CopyDeclarator(declarator->declarator), CopySpecifier(declarator->__anon1.array.enumClass));
1545 else
1546 return MkDeclaratorArray(CopyDeclarator(declarator->declarator), CopyExpression(declarator->__anon1.array.exp));
1547 case 4:
1548 {
1549 struct __ecereNameSpace__ecere__sys__OldList * parameters = MkList();
1550 struct TypeName * param;
1551
1552 if(declarator->__anon1.function.parameters)
1553 {
1554 for(param = (*declarator->__anon1.function.parameters).first; param; param = param->next)
1555 ListAdd(parameters, CopyTypeName(param));
1556 }
1557 return MkDeclaratorFunction(CopyDeclarator(declarator->declarator), parameters);
1558 }
1559 case 5:
1560 return MkDeclaratorPointer(CopyPointer(declarator->__anon1.pointer.pointer), CopyDeclarator(declarator->declarator));
1561 case 6:
1562 return MkDeclaratorExtended(CopyExtDecl(declarator->__anon1.extended.extended), CopyDeclarator(declarator->declarator));
1563 case 7:
1564 return MkDeclaratorExtendedEnd(CopyExtDecl(declarator->__anon1.extended.extended), CopyDeclarator(declarator->declarator));
1565 }
1566 }
1567 return (((void *)0));
1568 }
1569
1570 struct Declaration * CopyDeclaration(struct Declaration * decl)
1571 {
1572 if(decl->type == 1)
1573 {
1574 return MkDeclaration(CopyList(decl->__anon1.__anon1.specifiers, (void *)(CopySpecifier)), CopyList(decl->__anon1.__anon1.declarators, (void *)(CopyInitDeclarator)));
1575 }
1576 else
1577 {
1578 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList(), * declarators = MkList();
1579 struct Specifier * spec;
1580 struct Declarator * declarator;
1581
1582 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1583 ListAdd(specifiers, CopySpecifier(spec));
1584 if(decl->__anon1.__anon1.declarators)
1585 {
1586 for(declarator = (*decl->__anon1.__anon1.declarators).first; declarator; declarator = declarator->next)
1587 ListAdd(declarators, CopyDeclarator(declarator));
1588 }
1589 return MkDeclaration(specifiers, declarators);
1590 }
1591 }
1592
1593 void __ecereRegisterModule_copy(struct __ecereNameSpace__ecere__com__Instance * module)
1594 {
1595 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
1596
1597 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyIdentifier", "Identifier CopyIdentifier(Identifier id)", CopyIdentifier, module, 2);
1598 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MoveExpContents", "Expression MoveExpContents(Expression exp)", MoveExpContents, module, 2);
1599 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyExpression", "Expression CopyExpression(Expression exp)", CopyExpression, module, 1);
1600 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyClassDef", "ClassDef CopyClassDef(ClassDef def)", CopyClassDef, module, 2);
1601 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopySpecifier", "Specifier CopySpecifier(Specifier spec)", CopySpecifier, module, 2);
1602 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyTypeName", "TypeName CopyTypeName(TypeName typeName)", CopyTypeName, module, 2);
1603 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyExtDecl", "ExtDecl CopyExtDecl(ExtDecl extDecl)", CopyExtDecl, module, 2);
1604 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyAttribute", "Attribute CopyAttribute(Attribute attrib)", CopyAttribute, module, 2);
1605 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyAttrib", "Attrib CopyAttrib(Attrib attrib)", CopyAttrib, module, 2);
1606 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyDeclarator", "Declarator CopyDeclarator(Declarator declarator)", CopyDeclarator, module, 2);
1607 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyInitDeclarator", "InitDeclarator CopyInitDeclarator(InitDeclarator initDecl)", CopyInitDeclarator, module, 2);
1608 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyDeclaration", "Declaration CopyDeclaration(Declaration decl)", CopyDeclaration, module, 2);
1609 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyList", "ecere::sys::OldList * CopyList(ecere::sys::OldList * source, void * (* CopyFunction)(void *))", CopyList, module, 2);
1610 }
1611