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