compiler/libec: Marking all structs with gcc_struct to get same packed padding as...
[sdk] / compiler / bootstrap / ecere / bootstrap / BTNode.c
1 #if defined(__GNUC__)
2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
5 #include <stdarg.h>
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
9 #ifdef _WIN32
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
13 #endif
14 typedef long long int64;
15 typedef unsigned long long uint64;
16 #else
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
19 #endif
20 #ifdef __BIG_ENDIAN__
21 #define __ENDIAN_PAD(x) (8 - (x))
22 #else
23 #define __ENDIAN_PAD(x) 0
24 #endif
25 struct __ecereNameSpace__ecere__sys__BTNode
26 {
27 unsigned int key;
28 struct __ecereNameSpace__ecere__sys__BTNode * parent, * left, * right;
29 int depth;
30 } __attribute__ ((gcc_struct));
31
32 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
33
34 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
35
36 struct __ecereNameSpace__ecere__sys__BinaryTree
37 {
38 struct __ecereNameSpace__ecere__sys__BTNode * root;
39 int count;
40 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, unsigned int a, unsigned int b);
41 void (*  FreeKey)(void *  key);
42 } __attribute__ ((gcc_struct));
43
44 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
45
46 struct __ecereNameSpace__ecere__sys__OldList
47 {
48 void *  first;
49 void *  last;
50 int count;
51 unsigned int offset;
52 unsigned int circ;
53 } __attribute__ ((gcc_struct));
54
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
56
57 struct __ecereNameSpace__ecere__com__Class
58 {
59 struct __ecereNameSpace__ecere__com__Class * prev;
60 struct __ecereNameSpace__ecere__com__Class * next;
61 char *  name;
62 int offset;
63 int structSize;
64 int (* *  _vTbl)();
65 int vTblSize;
66 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
67 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
68 int offsetClass;
69 int sizeClass;
70 struct __ecereNameSpace__ecere__com__Class * base;
71 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
72 struct __ecereNameSpace__ecere__sys__BinaryTree members;
73 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
74 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
75 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
76 struct __ecereNameSpace__ecere__sys__OldList derivatives;
77 int memberID;
78 int startMemberID;
79 int type;
80 struct __ecereNameSpace__ecere__com__Instance * module;
81 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
82 char *  dataTypeString;
83 struct __ecereNameSpace__ecere__com__Instance * dataType;
84 int typeSize;
85 int defaultAlignment;
86 void (*  Initialize)();
87 int memberOffset;
88 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
89 char *  designerClass;
90 unsigned int noExpansion;
91 char *  defaultProperty;
92 unsigned int comRedefinition;
93 int count;
94 unsigned int isRemote;
95 unsigned int internalDecl;
96 void *  data;
97 unsigned int computeSize;
98 int structAlignment;
99 int destructionWatchOffset;
100 unsigned int fixed;
101 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
102 int inheritanceAccess;
103 char *  fullName;
104 void *  symbol;
105 struct __ecereNameSpace__ecere__sys__OldList conversions;
106 struct __ecereNameSpace__ecere__sys__OldList templateParams;
107 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
108 struct __ecereNameSpace__ecere__com__Class * templateClass;
109 struct __ecereNameSpace__ecere__sys__OldList templatized;
110 int numParams;
111 } __attribute__ ((gcc_struct));
112
113 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
114
115 struct __ecereNameSpace__ecere__com__Instance
116 {
117 int (* *  _vTbl)();
118 struct __ecereNameSpace__ecere__com__Class * _class;
119 int _refCount;
120 } __attribute__ ((gcc_struct));
121
122 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
123
124 struct __ecereNameSpace__ecere__com__Property
125 {
126 struct __ecereNameSpace__ecere__com__Property * prev;
127 struct __ecereNameSpace__ecere__com__Property * next;
128 char *  name;
129 unsigned int isProperty;
130 int memberAccess;
131 int id;
132 struct __ecereNameSpace__ecere__com__Class * _class;
133 char *  dataTypeString;
134 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
135 struct __ecereNameSpace__ecere__com__Instance * dataType;
136 void (*  Set)();
137 int (*  Get)();
138 unsigned int (*  IsSet)();
139 void *  data;
140 void *  symbol;
141 int vid;
142 unsigned int conversion;
143 unsigned int watcherOffset;
144 char *  category;
145 unsigned int compiled;
146 unsigned int selfWatchable;
147 unsigned int isWatchable;
148 } __attribute__ ((gcc_struct));
149
150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
151
152 struct __ecereNameSpace__ecere__com__DataMember
153 {
154 struct __ecereNameSpace__ecere__com__DataMember * prev;
155 struct __ecereNameSpace__ecere__com__DataMember * next;
156 char *  name;
157 unsigned int isProperty;
158 int memberAccess;
159 int id;
160 struct __ecereNameSpace__ecere__com__Class * _class;
161 char *  dataTypeString;
162 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
163 struct __ecereNameSpace__ecere__com__Instance * dataType;
164 int type;
165 int offset;
166 int memberID;
167 struct __ecereNameSpace__ecere__sys__OldList members;
168 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
169 int memberOffset;
170 int structAlignment;
171 } __attribute__ ((gcc_struct));
172
173 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
174
175 struct __ecereNameSpace__ecere__com__Method
176 {
177 char *  name;
178 struct __ecereNameSpace__ecere__com__Method * parent;
179 struct __ecereNameSpace__ecere__com__Method * left;
180 struct __ecereNameSpace__ecere__com__Method * right;
181 int depth;
182 int (*  function)();
183 int vid;
184 int type;
185 struct __ecereNameSpace__ecere__com__Class * _class;
186 void *  symbol;
187 char *  dataTypeString;
188 struct __ecereNameSpace__ecere__com__Instance * dataType;
189 int memberAccess;
190 } __attribute__ ((gcc_struct));
191
192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
193
194 struct __ecereNameSpace__ecere__com__SerialBuffer
195 {
196 unsigned char *  _buffer;
197 unsigned int count;
198 unsigned int _size;
199 unsigned int pos;
200 } __attribute__ ((gcc_struct));
201
202 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
203
204 struct __ecereNameSpace__ecere__com__DataValue
205 {
206 union
207 {
208 char c;
209 unsigned char uc;
210 short s;
211 unsigned short us;
212 int i;
213 unsigned int ui;
214 void *  p;
215 float f;
216 double d;
217 long long i64;
218 uint64 ui64;
219 } __attribute__ ((gcc_struct));
220 } __attribute__ ((gcc_struct));
221
222 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
223
224 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
225 {
226 union
227 {
228 struct
229 {
230 char *  dataTypeString;
231 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
232 } __attribute__ ((gcc_struct));
233 struct __ecereNameSpace__ecere__com__DataValue expression;
234 struct
235 {
236 char *  memberString;
237 union
238 {
239 struct __ecereNameSpace__ecere__com__DataMember * member;
240 struct __ecereNameSpace__ecere__com__Property * prop;
241 struct __ecereNameSpace__ecere__com__Method * method;
242 } __attribute__ ((gcc_struct));
243 } __attribute__ ((gcc_struct));
244 } __attribute__ ((gcc_struct));
245 } __attribute__ ((gcc_struct));
246
247 typedef __builtin_va_list __gnuc_va_list;
248
249 typedef __gnuc_va_list va_list;
250
251 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TreePrintStyle;
252
253 extern int vsprintf(char * , const char * , __builtin_va_list);
254
255 extern int strlen(const char * );
256
257 void __ecereNameSpace__ecere__sys__strcatf(char * string, char * format, ...)
258 {
259 va_list args;
260
261 __builtin_va_start(args, format);
262 vsprintf(string + strlen(string), format, args);
263 __builtin_va_end(args);
264 }
265
266 static struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_prev, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev;
267
268 static struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next;
269
270 static struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_count, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count;
271
272 static struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_balanceFactor, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor;
273
274 void __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * class, void * data);
275
276 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_bool;
277
278 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_uint;
279
280 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnSerialize(struct __ecereNameSpace__ecere__com__Class * class, struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__com__Instance * channel)
281 {
282 if((struct __ecereNameSpace__ecere__sys__BTNode *)this)
283 {
284 unsigned int truth = 0x1;
285
286 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_bool, &truth);
287 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, &this->key);
288 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, this->left);
289 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, this->right);
290 }
291 else
292 {
293 unsigned int nothing = 0;
294
295 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, &nothing);
296 }
297 }
298
299 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
300
301 void __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * class, void * *  data);
302
303 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(struct __ecereNameSpace__ecere__sys__BTNode * this);
304
305 static struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_depthProp, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp;
306
307 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnUnserialize(struct __ecereNameSpace__ecere__com__Class * class, struct __ecereNameSpace__ecere__sys__BTNode ** this, struct __ecereNameSpace__ecere__com__Instance * channel)
308 {
309 unsigned int truth;
310
311 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_bool, &truth);
312 if(truth)
313 {
314 (*(this)) = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__BTNode);
315 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_uint, &(*(this))->key);
316 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, &(*(this))->left);
317 if((*(this))->left)
318 {
319 (*(this))->left->parent = (void *)*(struct __ecereNameSpace__ecere__sys__BTNode **)this;
320 }
321 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, &(*(this))->right);
322 if((*(this))->right)
323 {
324 (*(this))->right->parent = (void *)*(struct __ecereNameSpace__ecere__sys__BTNode **)this;
325 }
326 (*(this))->depth = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(((struct __ecereNameSpace__ecere__sys__BTNode *)(void *)*(struct __ecereNameSpace__ecere__sys__BTNode **)this));
327 }
328 else
329 (*(this)) = (((void *)0));
330 }
331
332 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(struct __ecereNameSpace__ecere__sys__BTNode * this);
333
334 static struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_maximum, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum;
335
336 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_prev(struct __ecereNameSpace__ecere__sys__BTNode * this)
337 {
338 if(this->left)
339 return __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(this->left);
340 while(this)
341 {
342 if(this->parent && this == this->parent->right)
343 return this->parent;
344 else
345 this = this->parent;
346 }
347 return this;
348 }
349
350 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(struct __ecereNameSpace__ecere__sys__BTNode * this);
351
352 static struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_minimum, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum;
353
354 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this)
355 {
356 struct __ecereNameSpace__ecere__sys__BTNode * right = this->right;
357
358 if(right)
359 return __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(right);
360 while(this)
361 {
362 struct __ecereNameSpace__ecere__sys__BTNode * parent = this->parent;
363
364 if(parent && this == parent->left)
365 return parent;
366 else
367 this = parent;
368 }
369 return (((void *)0));
370 }
371
372 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(struct __ecereNameSpace__ecere__sys__BTNode * this)
373 {
374 while(this->left)
375 this = this->left;
376 return this;
377 }
378
379 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(struct __ecereNameSpace__ecere__sys__BTNode * this)
380 {
381 while(this->right)
382 this = this->right;
383 return this;
384 }
385
386 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count(struct __ecereNameSpace__ecere__sys__BTNode * this)
387 {
388 return 1 + (this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count(this->left) : 0) + (this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count(this->right) : 0);
389 }
390
391 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(struct __ecereNameSpace__ecere__sys__BTNode * this)
392 {
393 int leftDepth = this->left ? (__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->left) + 1) : 0;
394 int rightDepth = this->right ? (__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->right) + 1) : 0;
395
396 return ((leftDepth > rightDepth) ? leftDepth : rightDepth);
397 }
398
399 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(struct __ecereNameSpace__ecere__sys__BTNode * this, void (* FreeKey)(void * key))
400 {
401 if(this->left)
402 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(this->left, FreeKey);
403 if(this->right)
404 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(this->right, FreeKey);
405 if(FreeKey)
406 FreeKey((void *)this->key);
407 ((this ? (__ecereClass___ecereNameSpace__ecere__sys__BTNode->Destructor ? __ecereClass___ecereNameSpace__ecere__sys__BTNode->Destructor(this) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(this)) : 0), this = 0);
408 }
409
410 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Add(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree, struct __ecereNameSpace__ecere__sys__BTNode * node)
411 {
412 unsigned int newKey = node->key;
413
414 while(0x1)
415 {
416 int result = tree->CompareKey(tree, newKey, this->key);
417
418 if(!result)
419 {
420 return 0x0;
421 }
422 else if(result > 0)
423 {
424 if(this->right)
425 this = this->right;
426 else
427 {
428 node->parent = this;
429 this->right = node;
430 node->depth = 0;
431 {
432 struct __ecereNameSpace__ecere__sys__BTNode * n;
433
434 for(n = this; n; n = n->parent)
435 {
436 int __simpleStruct0, __simpleStruct1;
437 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
438
439 if(newDepth == n->depth)
440 break;
441 n->depth = newDepth;
442 }
443 }
444 return 0x1;
445 }
446 }
447 else
448 {
449 if(this->left)
450 this = this->left;
451 else
452 {
453 node->parent = this;
454 this->left = node;
455 node->depth = 0;
456 {
457 struct __ecereNameSpace__ecere__sys__BTNode * n;
458
459 for(n = this; n; n = n->parent)
460 {
461 int __simpleStruct0, __simpleStruct1;
462 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
463
464 if(newDepth == n->depth)
465 break;
466 n->depth = newDepth;
467 }
468 }
469 return 0x1;
470 }
471 }
472 }
473 }
474
475 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * node)
476 {
477 if(this == node)
478 return 0x1;
479 else if(this->left && __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(this->left, node))
480 return 0x1;
481 else if(this->right && __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(this->right, node))
482 return 0x1;
483 return 0x0;
484 }
485
486 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Find(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree, unsigned int key)
487 {
488 while(this)
489 {
490 int result = tree->CompareKey(tree, key, this->key);
491
492 if(result < 0)
493 this = this->left;
494 else if(result > 0)
495 this = this->right;
496 else
497 break;
498 }
499 return this;
500 }
501
502 extern int strcmp(const char * , const char * );
503
504 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindString(struct __ecereNameSpace__ecere__sys__BTNode * this, char * key)
505 {
506 while(this)
507 {
508 int result;
509
510 if(key && this->key)
511 result = strcmp(key, (char *)this->key);
512 else if(key && !this->key)
513 result = 1;
514 else if(!key && this->key)
515 result = -1;
516 else
517 result = 0;
518 if(result < 0)
519 this = this->left;
520 else if(result > 0)
521 this = this->right;
522 else
523 break;
524 }
525 return this;
526 }
527
528 extern int strncmp(const char * , const char * , int n);
529
530 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindPrefix(struct __ecereNameSpace__ecere__sys__BTNode * this, char * key)
531 {
532 struct __ecereNameSpace__ecere__sys__BTNode * subString = (((void *)0));
533 int len = key ? strlen(key) : 0;
534
535 while(this)
536 {
537 int result;
538
539 if(key && this->key)
540 result = strcmp(key, (char *)this->key);
541 else if(key && !this->key)
542 result = 1;
543 else if(!key && this->key)
544 result = -1;
545 else
546 result = 0;
547 if(result < 0)
548 {
549 if(!strncmp(key, (char *)this->key, len))
550 subString = this;
551 this = this->left;
552 }
553 else if(result > 0)
554 this = this->right;
555 else
556 {
557 subString = this;
558 break;
559 }
560 }
561 return subString;
562 }
563
564 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(struct __ecereNameSpace__ecere__sys__BTNode * this, unsigned int key)
565 {
566 struct __ecereNameSpace__ecere__sys__BTNode * result = (((void *)0));
567
568 if(this->key == key)
569 result = this;
570 if(!result && this->left)
571 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->left, key);
572 if(!result && this->right)
573 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->right, key);
574 return result;
575 }
576
577 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * swap)
578 {
579 if(swap->left)
580 {
581 swap->left->parent = swap->parent;
582 if(swap == swap->parent->left)
583 swap->parent->left = swap->left;
584 else if(swap == swap->parent->right)
585 swap->parent->right = swap->left;
586 swap->left = (((void *)0));
587 }
588 if(swap->right)
589 {
590 swap->right->parent = swap->parent;
591 if(swap == swap->parent->left)
592 swap->parent->left = swap->right;
593 else if(swap == swap->parent->right)
594 swap->parent->right = swap->right;
595 swap->right = (((void *)0));
596 }
597 if(swap == swap->parent->left)
598 swap->parent->left = (((void *)0));
599 else if(swap == swap->parent->right)
600 swap->parent->right = (((void *)0));
601 {
602 struct __ecereNameSpace__ecere__sys__BTNode * n;
603
604 for(n = swap->parent; n; n = n->parent)
605 {
606 int __simpleStruct0, __simpleStruct1;
607 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
608
609 if(newDepth == n->depth)
610 break;
611 n->depth = newDepth;
612 if(n == this)
613 break;
614 }
615 }
616 {
617 swap->left = this->left;
618 if(this->left)
619 this->left->parent = swap;
620 }
621 {
622 swap->right = this->right;
623 if(this->right)
624 this->right->parent = swap;
625 }
626 swap->parent = this->parent;
627 this->left = (((void *)0));
628 this->right = (((void *)0));
629 if(this->parent)
630 {
631 if(this == this->parent->left)
632 this->parent->left = swap;
633 else if(this == this->parent->right)
634 this->parent->right = swap;
635 }
636 }
637
638 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance();
639
640 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
641 {
642 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(this->left) : this->right;
643 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
644
645 if(swap)
646 {
647 swapParent = swap->parent;
648 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
649 }
650 if(this->parent)
651 {
652 if(this == this->parent->left)
653 this->parent->left = (((void *)0));
654 else if(this == this->parent->right)
655 this->parent->right = (((void *)0));
656 }
657 {
658 struct __ecereNameSpace__ecere__sys__BTNode * n;
659
660 for(n = swap ? swap : this->parent; n; n = n->parent)
661 {
662 int __simpleStruct0, __simpleStruct1;
663 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
664
665 if(newDepth == n->depth && n != swap)
666 break;
667 n->depth = newDepth;
668 }
669 }
670 if(swapParent && swapParent != this)
671 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
672 else if(swap)
673 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
674 else if(this->parent)
675 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
676 else
677 return (((void *)0));
678 }
679
680 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
681 {
682 struct __ecereNameSpace__ecere__sys__BTNode * result;
683 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(this->right) : this->left;
684 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
685
686 if(swap)
687 {
688 swapParent = swap->parent;
689 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
690 }
691 if(this->parent)
692 {
693 if(this == this->parent->left)
694 this->parent->left = (((void *)0));
695 else if(this == this->parent->right)
696 this->parent->right = (((void *)0));
697 }
698 {
699 struct __ecereNameSpace__ecere__sys__BTNode * n;
700
701 for(n = swap ? swap : this->parent; n; n = n->parent)
702 {
703 int __simpleStruct0, __simpleStruct1;
704 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
705
706 if(newDepth == n->depth && n != swap)
707 break;
708 n->depth = newDepth;
709 }
710 }
711 if(swapParent && swapParent != this)
712 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
713 else if(swap)
714 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
715 else if(this->parent)
716 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
717 else
718 result = (((void *)0));
719 return result;
720 }
721
722 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(struct __ecereNameSpace__ecere__sys__BTNode * this)
723 {
724 int leftDepth = this->left ? (this->left->depth + 1) : 0;
725 int rightDepth = this->right ? (this->right->depth + 1) : 0;
726
727 return rightDepth - leftDepth;
728 }
729
730 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight();
731
732 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight();
733
734 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft();
735
736 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft();
737
738 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(struct __ecereNameSpace__ecere__sys__BTNode * this)
739 {
740 while(0x1)
741 {
742 int factor = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this);
743
744 if(factor < -1)
745 {
746 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->left) == 1)
747 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(this);
748 else
749 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
750 }
751 else if(factor > 1)
752 {
753 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->right) == -1)
754 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(this);
755 else
756 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
757 }
758 if(this->parent)
759 this = this->parent;
760 else
761 return this;
762 }
763 }
764
765 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
766 {
767 int __simpleStruct2, __simpleStruct3;
768 int __simpleStruct0, __simpleStruct1;
769
770 if(this->parent)
771 {
772 if(this == this->parent->left)
773 this->parent->left = this->left;
774 else if(this == this->parent->right)
775 this->parent->right = this->left;
776 }
777 this->left->parent = this->parent;
778 this->parent = this->left;
779 this->left = this->parent->right;
780 if(this->left)
781 this->left->parent = this;
782 this->parent->right = this;
783 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
784 this->parent->depth = (__simpleStruct2 = this->parent->left ? (this->parent->left->depth + 1) : 0, __simpleStruct3 = this->parent->right ? (this->parent->right->depth + 1) : 0, (__simpleStruct2 > __simpleStruct3) ? __simpleStruct2 : __simpleStruct3);
785 {
786 struct __ecereNameSpace__ecere__sys__BTNode * n;
787
788 for(n = this->parent->parent; n; n = n->parent)
789 {
790 int __simpleStruct0, __simpleStruct1;
791 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
792
793 if(newDepth == n->depth)
794 break;
795 n->depth = newDepth;
796 }
797 }
798 }
799
800 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
801 {
802 int __simpleStruct2, __simpleStruct3;
803 int __simpleStruct0, __simpleStruct1;
804
805 if(this->parent)
806 {
807 if(this == this->parent->right)
808 this->parent->right = this->right;
809 else if(this == this->parent->left)
810 this->parent->left = this->right;
811 }
812 this->right->parent = this->parent;
813 this->parent = this->right;
814 this->right = this->parent->left;
815 if(this->right)
816 this->right->parent = this;
817 this->parent->left = this;
818 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
819 this->parent->depth = (__simpleStruct2 = this->parent->left ? (this->parent->left->depth + 1) : 0, __simpleStruct3 = this->parent->right ? (this->parent->right->depth + 1) : 0, (__simpleStruct2 > __simpleStruct3) ? __simpleStruct2 : __simpleStruct3);
820 {
821 struct __ecereNameSpace__ecere__sys__BTNode * n;
822
823 for(n = this->parent->parent; n; n = n->parent)
824 {
825 int __simpleStruct0, __simpleStruct1;
826 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
827
828 if(newDepth == n->depth)
829 break;
830 n->depth = newDepth;
831 }
832 }
833 }
834
835 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
836 {
837 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this->left);
838 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
839 }
840
841 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
842 {
843 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this->right);
844 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
845 }
846
847 extern char *  strcat(char * , const char * );
848
849 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char *  output, int wantedDepth, int curDepth, int maxDepth, unsigned int last);
850
851 char * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int tps)
852 {
853 switch(tps)
854 {
855 case 0:
856 case 2:
857 case 1:
858 {
859 if(tps == 2)
860 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
861 if(this->left)
862 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->left, output, tps);
863 if(tps == 0)
864 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
865 if(this->right)
866 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->right, output, tps);
867 if(tps == 1)
868 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
869 return output;
870 }
871 case 3:
872 {
873 int maxDepth = this->depth;
874 int curDepth;
875
876 for(curDepth = 0; curDepth <= maxDepth; curDepth++)
877 {
878 int c;
879
880 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4 / 2; c++)
881 strcat(output, " ");
882 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(this, output, curDepth, 0, maxDepth, 0x1);
883 strcat(output, "\n");
884 }
885 return output;
886 }
887 }
888 return (((void *)0));
889 }
890
891 extern int sprintf(char * , char * , ...);
892
893 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int wantedDepth, int curDepth, int maxDepth, unsigned int last)
894 {
895 int c;
896
897 if(wantedDepth == curDepth)
898 {
899 char nodeString[10] = "";
900 int len;
901
902 if(this)
903 sprintf(nodeString, "%d", this->key);
904 len = strlen(nodeString);
905 for(c = 0; c < (4 - len) / 2; c++)
906 strcat(output, " ");
907 len += c;
908 strcat(output, nodeString);
909 for(c = len; c < 4; c++)
910 strcat(output, " ");
911 if(curDepth && !last)
912 {
913 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4; c++)
914 strcat(output, " ");
915 }
916 }
917 else if(curDepth <= maxDepth)
918 {
919 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth((this ? this->left : (struct __ecereNameSpace__ecere__sys__BTNode *)(((void *)0))), output, wantedDepth, curDepth + 1, maxDepth, last && this && !this->right);
920 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth((this ? this->right : (struct __ecereNameSpace__ecere__sys__BTNode *)(((void *)0))), output, wantedDepth, curDepth + 1, maxDepth, last);
921 }
922 }
923
924 extern int printf(char * , ...);
925
926 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree)
927 {
928 unsigned int valid = 0x1;
929 int leftHeight = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->left) + 1 : 0;
930 int rightHeight = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->right) + 1 : 0;
931 int diffHeight = rightHeight - leftHeight;
932
933 if(this->left)
934 {
935 if(this->left->parent != this)
936 {
937 printf("Parent not set properly at node %d\n", this->left->key);
938 valid = 0x0;
939 }
940 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->left, tree);
941 }
942 if(this->right)
943 {
944 if(this->right->parent != this)
945 {
946 printf("Parent not set properly at node %d\n", this->right->key);
947 valid = 0x0;
948 }
949 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->right, tree);
950 }
951 if(this->depth != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this))
952 {
953 printf("Depth value at node %d (%d) doesn't match depth property (%d)\n", this->key, this->depth, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this));
954 valid = (unsigned int)0;
955 }
956 if(diffHeight < -1 || diffHeight > 1)
957 {
958 valid = (unsigned int)0;
959 printf("Height difference is %d at node %d\n", diffHeight, this->key);
960 }
961 if(diffHeight != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this))
962 {
963 valid = (unsigned int)0;
964 printf("Height difference %d doesnt match balance-factor of %d at node \n", diffHeight, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this), this->key);
965 }
966 if(this->left && tree->CompareKey(tree, this->left->key, this->key) > 0)
967 {
968 valid = 0x0;
969 printf("Node %d is *smaller* than left subtree %d\n", this->key, this->left->key);
970 }
971 if(this->right && tree->CompareKey(tree, this->right->key, this->key) < 0)
972 {
973 valid = 0x0;
974 printf("Node %d is *greater* than right subtree %d\n", this->key, this->right->key);
975 }
976 return valid;
977 }
978
979 struct __ecereNameSpace__ecere__sys__StringBTNode
980 {
981 char * key;
982 struct __ecereNameSpace__ecere__sys__StringBTNode * parent, * left, * right;
983 int depth;
984 } __attribute__ ((gcc_struct));
985
986 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__StringBTNode;
987
988 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_String;
989
990 void __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnSerialize(struct __ecereNameSpace__ecere__com__Class * class, struct __ecereNameSpace__ecere__sys__StringBTNode * this, struct __ecereNameSpace__ecere__com__Instance * channel)
991 {
992 if((struct __ecereNameSpace__ecere__sys__StringBTNode *)this)
993 {
994 unsigned int truth = 0x1;
995
996 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_bool, &truth);
997 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_String, this->key);
998 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->left);
999 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->right);
1000 }
1001 else
1002 {
1003 unsigned int nothing = 0;
1004
1005 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, &nothing);
1006 }
1007 }
1008
1009 void __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnUnserialize(struct __ecereNameSpace__ecere__com__Class * class, struct __ecereNameSpace__ecere__sys__StringBTNode ** this, struct __ecereNameSpace__ecere__com__Instance * channel)
1010 {
1011 unsigned int truth;
1012
1013 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_bool, &truth);
1014 if(truth)
1015 {
1016 (*(this)) = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__StringBTNode);
1017 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_String, &(*(this))->key);
1018 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, &(*(this))->left);
1019 if((*(this))->left)
1020 {
1021 (*(this))->left->parent = (void *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
1022 }
1023 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, &(*(this))->right);
1024 if((*(this))->right)
1025 {
1026 (*(this))->right->parent = (void *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
1027 }
1028 (*(this))->depth = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(((struct __ecereNameSpace__ecere__sys__BTNode *)((void *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this)));
1029 }
1030 else
1031 (*(this)) = (((void *)0));
1032 }
1033
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
1035
1036 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1037
1038 struct __ecereNameSpace__ecere__com__NameSpace
1039 {
1040 char *  name;
1041 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
1042 struct __ecereNameSpace__ecere__com__NameSpace *  left;
1043 struct __ecereNameSpace__ecere__com__NameSpace *  right;
1044 int depth;
1045 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
1046 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1047 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1048 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1049 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1050 } __attribute__ ((gcc_struct));
1051
1052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1053
1054 struct __ecereNameSpace__ecere__com__Module
1055 {
1056 struct __ecereNameSpace__ecere__com__Instance * application;
1057 struct __ecereNameSpace__ecere__sys__OldList classes;
1058 struct __ecereNameSpace__ecere__sys__OldList defines;
1059 struct __ecereNameSpace__ecere__sys__OldList functions;
1060 struct __ecereNameSpace__ecere__sys__OldList modules;
1061 struct __ecereNameSpace__ecere__com__Instance * prev;
1062 struct __ecereNameSpace__ecere__com__Instance * next;
1063 char *  name;
1064 void *  library;
1065 void *  Unload;
1066 int importType;
1067 int origImportType;
1068 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1069 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1070 } __attribute__ ((gcc_struct));
1071
1072 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
1073
1074 extern void __ecereNameSpace__ecere__com__eEnum_AddFixedValue(struct __ecereNameSpace__ecere__com__Class * _class, char *  string, int value);
1075
1076 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
1077
1078 struct __ecereNameSpace__ecere__com__GlobalFunction;
1079
1080 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char *  name, char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
1081
1082 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, void *  function, int declMode);
1083
1084 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, unsigned int size, unsigned int alignment, int declMode);
1085
1086 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  dataType, void *  setStmt, void *  getStmt, int declMode);
1087
1088 void __ecereRegisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1089 {
1090 struct __ecereNameSpace__ecere__com__Class * class;
1091
1092 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(4, "ecere::sys::TreePrintStyle", 0, 0, 0, 0, 0, module, 4, 1);
1093 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
1094 __ecereClass___ecereNameSpace__ecere__sys__TreePrintStyle = class;
1095 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "inOrder", 0);
1096 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "postOrder", 1);
1097 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "preOrder", 2);
1098 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "depthOrder", 3);
1099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::strcatf", "void ecere::sys::strcatf(char * string, char * format, ...)", __ecereNameSpace__ecere__sys__strcatf, module, 4);
1100 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::sys::BTNode", 0, sizeof(struct __ecereNameSpace__ecere__sys__BTNode), 0, 0, 0, module, 4, 1);
1101 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
1102 __ecereClass___ecereNameSpace__ecere__sys__BTNode = class;
1103 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnSerialize, 1);
1104 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnUnserialize, 1);
1105 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "FindPrefix", "ecere::sys::BTNode FindPrefix(char * key)", __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindPrefix, 1);
1106 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "FindString", "ecere::sys::BTNode FindString(char * key)", __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindString, 1);
1107 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "uint", 4, 4, 1);
1108 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::BTNode", 4, 4, 1);
1109 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::BTNode", 4, 4, 1);
1110 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::BTNode", 4, 4, 1);
1111 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1112 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "prev", "ecere::sys::BTNode", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_prev, 1);
1113 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1114 __ecereProp___ecereNameSpace__ecere__sys__BTNode_prev = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1115 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "next", "ecere::sys::BTNode", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next, 1);
1116 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1117 __ecereProp___ecereNameSpace__ecere__sys__BTNode_next = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1118 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "minimum", "ecere::sys::BTNode", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum, 1);
1119 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1120 __ecereProp___ecereNameSpace__ecere__sys__BTNode_minimum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1121 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "maximum", "ecere::sys::BTNode", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum, 1);
1122 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1123 __ecereProp___ecereNameSpace__ecere__sys__BTNode_maximum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1124 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "count", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count, 1);
1125 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1126 __ecereProp___ecereNameSpace__ecere__sys__BTNode_count = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1127 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "depthProp", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp, 1);
1128 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1129 __ecereProp___ecereNameSpace__ecere__sys__BTNode_depthProp = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1130 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "balanceFactor", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor, 2);
1131 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1132 __ecereProp___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1133 if(class)
1134 class->fixed = (unsigned int)1;
1135 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::sys::StringBTNode", 0, sizeof(struct __ecereNameSpace__ecere__sys__StringBTNode), 0, 0, 0, module, 4, 1);
1136 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
1137 __ecereClass___ecereNameSpace__ecere__sys__StringBTNode = class;
1138 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnSerialize, 1);
1139 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnUnserialize, 1);
1140 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "String", 4, 4, 1);
1141 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::StringBTNode", 4, 4, 1);
1142 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::StringBTNode", 4, 4, 1);
1143 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::StringBTNode", 4, 4, 1);
1144 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1145 if(class)
1146 class->fixed = (unsigned int)1;
1147 }
1148
1149 void __ecereUnregisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1150 {
1151
1152 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1153 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1154 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1155 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1156 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1157 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1158 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1159 }
1160