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