1 /* Code generated from eC source file: BTNode.ec */
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
7 #define __runtimePlatform 2
10 typedef long long int64;
11 typedef unsigned long long uint64;
15 #elif defined(__TINYC__)
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
27 typedef long long int64;
28 typedef unsigned long long uint64;
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
34 #define __ENDIAN_PAD(x) (8 - (x))
36 #define __ENDIAN_PAD(x) 0
39 # if defined(__GNUC__) || defined(__TINYC__)
40 # define stdcall __attribute__((__stdcall__))
42 # define stdcall __stdcall
48 #include <sys/types.h>
49 typedef __builtin_va_list va_list;
51 struct __ecereNameSpace__ecere__sys__OldList
58 } __attribute__ ((gcc_struct));
60 struct __ecereNameSpace__ecere__com__DataValue
75 } __attribute__ ((gcc_struct)) __anon1;
76 } __attribute__ ((gcc_struct));
78 struct __ecereNameSpace__ecere__com__SerialBuffer
80 unsigned char * _buffer;
84 } __attribute__ ((gcc_struct));
86 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
88 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
90 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
92 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
94 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
96 extern int vsprintf(char * , const char * , __builtin_va_list);
98 extern size_t strlen(const char * );
100 extern int strcmp(const char * , const char * );
102 extern int strncmp(const char * , const char * , size_t n);
104 extern char * strcat(char * , const char * );
106 extern int sprintf(char * , const char * , ...);
108 extern int printf(const char * , ...);
110 struct __ecereNameSpace__ecere__com__GlobalFunction;
112 void __ecereNameSpace__ecere__sys__strcatf(char * string, const char * format, ...)
116 __builtin_va_start(args, format);
117 vsprintf(string + strlen(string), format, args);
118 __builtin_va_end(args);
121 struct __ecereNameSpace__ecere__com__Property;
123 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
125 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_prev, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev;
127 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next;
129 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_minimum, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum;
131 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_maximum, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum;
133 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_count, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count;
135 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_depthProp, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp;
137 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_balanceFactor, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor;
139 struct __ecereNameSpace__ecere__sys__BTNode;
141 struct __ecereNameSpace__ecere__sys__BTNode
144 struct __ecereNameSpace__ecere__sys__BTNode * parent, * left, * right;
146 } __attribute__ ((gcc_struct));
148 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(struct __ecereNameSpace__ecere__sys__BTNode * this)
155 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(struct __ecereNameSpace__ecere__sys__BTNode * this)
162 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindString(struct __ecereNameSpace__ecere__sys__BTNode * this, const char * key)
169 result = strcmp(key, (const char *)this->key);
170 else if(key && !this->key)
172 else if(!key && this->key)
186 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindPrefix(struct __ecereNameSpace__ecere__sys__BTNode * this, const char * key)
188 struct __ecereNameSpace__ecere__sys__BTNode * subString = (((void *)0));
189 int len = key ? strlen(key) : 0;
196 result = strcmp(key, (const char *)this->key);
197 else if(key && !this->key)
199 else if(!key && this->key)
205 if(!strncmp(key, (const char *)this->key, len))
220 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * swap)
224 swap->left->parent = swap->parent;
225 if(swap == swap->parent->left)
226 swap->parent->left = swap->left;
227 else if(swap == swap->parent->right)
228 swap->parent->right = swap->left;
229 swap->left = (((void *)0));
233 swap->right->parent = swap->parent;
234 if(swap == swap->parent->left)
235 swap->parent->left = swap->right;
236 else if(swap == swap->parent->right)
237 swap->parent->right = swap->right;
238 swap->right = (((void *)0));
240 if(swap == swap->parent->left)
241 swap->parent->left = (((void *)0));
242 else if(swap == swap->parent->right)
243 swap->parent->right = (((void *)0));
245 struct __ecereNameSpace__ecere__sys__BTNode * n;
247 for(n = swap->parent; n; n = n->parent)
249 int __simpleStruct0, __simpleStruct1;
250 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
252 if(newDepth == n->depth)
260 swap->left = this->left;
262 this->left->parent = swap;
265 swap->right = this->right;
267 this->right->parent = swap;
269 swap->parent = this->parent;
270 this->left = (((void *)0));
271 this->right = (((void *)0));
274 if(this == this->parent->left)
275 this->parent->left = swap;
276 else if(this == this->parent->right)
277 this->parent->right = swap;
281 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(struct __ecereNameSpace__ecere__sys__BTNode * this)
283 int leftDepth = this->left ? (this->left->depth + 1) : 0;
284 int rightDepth = this->right ? (this->right->depth + 1) : 0;
286 return rightDepth - leftDepth;
289 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
291 int __simpleStruct2, __simpleStruct3;
292 int __simpleStruct0, __simpleStruct1;
296 if(this == this->parent->left)
297 this->parent->left = this->left;
298 else if(this == this->parent->right)
299 this->parent->right = this->left;
301 this->left->parent = this->parent;
302 this->parent = this->left;
303 this->left = this->parent->right;
305 this->left->parent = this;
306 this->parent->right = this;
307 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
308 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);
310 struct __ecereNameSpace__ecere__sys__BTNode * n;
312 for(n = this->parent->parent; n; n = n->parent)
314 int __simpleStruct0, __simpleStruct1;
315 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
317 if(newDepth == n->depth)
324 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
326 int __simpleStruct2, __simpleStruct3;
327 int __simpleStruct0, __simpleStruct1;
331 if(this == this->parent->right)
332 this->parent->right = this->right;
333 else if(this == this->parent->left)
334 this->parent->left = this->right;
336 this->right->parent = this->parent;
337 this->parent = this->right;
338 this->right = this->parent->left;
340 this->right->parent = this;
341 this->parent->left = this;
342 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
343 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);
345 struct __ecereNameSpace__ecere__sys__BTNode * n;
347 for(n = this->parent->parent; n; n = n->parent)
349 int __simpleStruct0, __simpleStruct1;
350 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
352 if(newDepth == n->depth)
359 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(struct __ecereNameSpace__ecere__sys__BTNode * this);
361 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(struct __ecereNameSpace__ecere__sys__BTNode * this);
363 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(struct __ecereNameSpace__ecere__sys__BTNode * this);
365 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count(struct __ecereNameSpace__ecere__sys__BTNode * this);
367 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(struct __ecereNameSpace__ecere__sys__BTNode * this);
369 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
371 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this->left);
372 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
375 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
377 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this->right);
378 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
381 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(struct __ecereNameSpace__ecere__sys__BTNode * this)
383 int leftDepth = this->left ? (__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->left) + 1) : 0;
384 int rightDepth = this->right ? (__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->right) + 1) : 0;
386 return ((leftDepth > rightDepth) ? leftDepth : rightDepth);
389 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_prev(struct __ecereNameSpace__ecere__sys__BTNode * this)
392 return __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(this->left);
395 if(this->parent && this == this->parent->right)
403 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this)
405 struct __ecereNameSpace__ecere__sys__BTNode * right = this->right;
408 return __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(right);
411 struct __ecereNameSpace__ecere__sys__BTNode * parent = this->parent;
413 if(parent && this == parent->left)
418 return (((void *)0));
421 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count(struct __ecereNameSpace__ecere__sys__BTNode * this)
423 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);
426 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(struct __ecereNameSpace__ecere__sys__BTNode * this)
430 int factor = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this);
434 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->left) == 1)
435 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(this);
437 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
441 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->right) == -1)
442 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(this);
444 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
453 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
455 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(this->left) : this->right;
456 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
460 swapParent = swap->parent;
461 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
465 if(this == this->parent->left)
466 this->parent->left = (((void *)0));
467 else if(this == this->parent->right)
468 this->parent->right = (((void *)0));
471 struct __ecereNameSpace__ecere__sys__BTNode * n;
473 for(n = swap ? swap : this->parent; n; n = n->parent)
475 int __simpleStruct0, __simpleStruct1;
476 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
478 if(newDepth == n->depth && n != swap)
483 if(swapParent && swapParent != this)
484 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
486 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
487 else if(this->parent)
488 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
490 return (((void *)0));
493 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
495 struct __ecereNameSpace__ecere__sys__BTNode * result;
496 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(this->right) : this->left;
497 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
501 swapParent = swap->parent;
502 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
506 if(this == this->parent->left)
507 this->parent->left = (((void *)0));
508 else if(this == this->parent->right)
509 this->parent->right = (((void *)0));
512 struct __ecereNameSpace__ecere__sys__BTNode * n;
514 for(n = swap ? swap : this->parent; n; n = n->parent)
516 int __simpleStruct0, __simpleStruct1;
517 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
519 if(newDepth == n->depth && n != swap)
524 if(swapParent && swapParent != this)
525 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
527 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
528 else if(this->parent)
529 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
531 result = (((void *)0));
535 struct __ecereNameSpace__ecere__com__Class;
537 struct __ecereNameSpace__ecere__com__Instance
540 struct __ecereNameSpace__ecere__com__Class * _class;
542 } __attribute__ ((gcc_struct));
544 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
546 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
548 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
550 extern void __ecereNameSpace__ecere__com__eEnum_AddFixedValue(struct __ecereNameSpace__ecere__com__Class * _class, const char * string, long long value);
552 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * dataType, void * setStmt, void * getStmt, int declMode);
554 struct __ecereNameSpace__ecere__com__Property
556 struct __ecereNameSpace__ecere__com__Property * prev;
557 struct __ecereNameSpace__ecere__com__Property * next;
559 unsigned int isProperty;
562 struct __ecereNameSpace__ecere__com__Class * _class;
563 const char * dataTypeString;
564 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
565 struct __ecereNameSpace__ecere__com__Instance * dataType;
566 void (* Set)(void * , int);
567 int (* Get)(void * );
568 unsigned int (* IsSet)(void * );
572 unsigned int conversion;
573 unsigned int watcherOffset;
574 const char * category;
575 unsigned int compiled;
576 unsigned int selfWatchable;
577 unsigned int isWatchable;
578 } __attribute__ ((gcc_struct));
580 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
582 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
584 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
586 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);
588 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
590 void __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * class, const void * data);
592 void __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * class, void * * data);
594 struct __ecereNameSpace__ecere__sys__StringBTNode;
596 struct __ecereNameSpace__ecere__sys__StringBTNode
599 struct __ecereNameSpace__ecere__sys__StringBTNode * parent, * left, * right;
601 } __attribute__ ((gcc_struct));
603 struct __ecereNameSpace__ecere__sys__BinaryTree;
605 struct __ecereNameSpace__ecere__sys__BinaryTree
607 struct __ecereNameSpace__ecere__sys__BTNode * root;
609 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
610 void (* FreeKey)(void * key);
611 } __attribute__ ((gcc_struct));
613 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)
615 uintptr_t newKey = node->key;
619 int result = tree->CompareKey(tree, newKey, this->key);
635 struct __ecereNameSpace__ecere__sys__BTNode * n;
637 for(n = this; n; n = n->parent)
639 int __simpleStruct0, __simpleStruct1;
640 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
642 if(newDepth == n->depth)
660 struct __ecereNameSpace__ecere__sys__BTNode * n;
662 for(n = this; n; n = n->parent)
664 int __simpleStruct0, __simpleStruct1;
665 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
667 if(newDepth == n->depth)
678 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Find(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t key)
682 int result = tree->CompareKey(tree, key, this->key);
694 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
696 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * node)
700 else if(this->left && __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(this->left, node))
702 else if(this->right && __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(this->right, node))
707 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(struct __ecereNameSpace__ecere__sys__BTNode * this, uintptr_t key);
709 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(struct __ecereNameSpace__ecere__sys__BTNode * this, uintptr_t key)
711 struct __ecereNameSpace__ecere__sys__BTNode * result = (((void *)0));
715 if(!result && this->left)
716 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->left, key);
717 if(!result && this->right)
718 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->right, key);
722 char * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int tps);
724 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int wantedDepth, int curDepth, int maxDepth, unsigned int last);
726 char * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int tps)
735 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
737 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->left, output, tps);
739 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
741 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->right, output, tps);
743 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
748 int maxDepth = this->depth;
751 for(curDepth = 0; curDepth <= maxDepth; curDepth++)
755 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4 / 2; c++)
757 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(this, output, curDepth, 0, maxDepth, 1);
758 strcat(output, "\n");
763 return (((void *)0));
766 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int wantedDepth, int curDepth, int maxDepth, unsigned int last)
770 if(wantedDepth == curDepth)
772 char nodeString[10] = "";
776 sprintf(nodeString, "%d", (int)this->key);
777 len = strlen(nodeString);
778 for(c = 0; c < (4 - len) / 2; c++)
781 strcat(output, nodeString);
782 for(c = len; c < 4; c++)
784 if(curDepth && !last)
786 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4; c++)
790 else if(curDepth <= maxDepth)
792 __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);
793 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth((this ? this->right : (struct __ecereNameSpace__ecere__sys__BTNode *)(((void *)0))), output, wantedDepth, curDepth + 1, maxDepth, last);
797 struct __ecereNameSpace__ecere__com__DataMember;
799 struct __ecereNameSpace__ecere__com__DataMember
801 struct __ecereNameSpace__ecere__com__DataMember * prev;
802 struct __ecereNameSpace__ecere__com__DataMember * next;
804 unsigned int isProperty;
807 struct __ecereNameSpace__ecere__com__Class * _class;
808 const char * dataTypeString;
809 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
810 struct __ecereNameSpace__ecere__com__Instance * dataType;
814 struct __ecereNameSpace__ecere__sys__OldList members;
815 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
817 short structAlignment;
818 short pointerAlignment;
819 } __attribute__ ((gcc_struct));
821 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
823 struct __ecereNameSpace__ecere__com__Method;
825 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
831 const char * dataTypeString;
832 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
833 } __attribute__ ((gcc_struct)) __anon1;
834 struct __ecereNameSpace__ecere__com__DataValue expression;
837 const char * memberString;
840 struct __ecereNameSpace__ecere__com__DataMember * member;
841 struct __ecereNameSpace__ecere__com__Property * prop;
842 struct __ecereNameSpace__ecere__com__Method * method;
843 } __attribute__ ((gcc_struct)) __anon1;
844 } __attribute__ ((gcc_struct)) __anon2;
845 } __attribute__ ((gcc_struct)) __anon1;
846 } __attribute__ ((gcc_struct));
848 struct __ecereNameSpace__ecere__com__Method
851 struct __ecereNameSpace__ecere__com__Method * parent;
852 struct __ecereNameSpace__ecere__com__Method * left;
853 struct __ecereNameSpace__ecere__com__Method * right;
858 struct __ecereNameSpace__ecere__com__Class * _class;
860 const char * dataTypeString;
861 struct __ecereNameSpace__ecere__com__Instance * dataType;
863 } __attribute__ ((gcc_struct));
865 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, void * function, int declMode);
867 struct __ecereNameSpace__ecere__com__Module;
869 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char * name, const char * baseName, int size, int sizeClass, unsigned int (* Constructor)(void * ), void (* Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
871 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
873 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);
875 struct __ecereNameSpace__ecere__com__NameSpace;
877 struct __ecereNameSpace__ecere__com__NameSpace
880 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
881 struct __ecereNameSpace__ecere__com__NameSpace * left;
882 struct __ecereNameSpace__ecere__com__NameSpace * right;
884 struct __ecereNameSpace__ecere__com__NameSpace * parent;
885 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
886 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
887 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
888 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
889 } __attribute__ ((gcc_struct));
891 struct __ecereNameSpace__ecere__com__Class
893 struct __ecereNameSpace__ecere__com__Class * prev;
894 struct __ecereNameSpace__ecere__com__Class * next;
900 unsigned int (* Constructor)(void * );
901 void (* Destructor)(void * );
904 struct __ecereNameSpace__ecere__com__Class * base;
905 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
906 struct __ecereNameSpace__ecere__sys__BinaryTree members;
907 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
908 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
909 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
910 struct __ecereNameSpace__ecere__sys__OldList derivatives;
914 struct __ecereNameSpace__ecere__com__Instance * module;
915 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
916 const char * dataTypeString;
917 struct __ecereNameSpace__ecere__com__Instance * dataType;
919 int defaultAlignment;
920 void (* Initialize)();
922 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
923 const char * designerClass;
924 unsigned int noExpansion;
925 const char * defaultProperty;
926 unsigned int comRedefinition;
929 unsigned int internalDecl;
931 unsigned int computeSize;
932 short structAlignment;
933 short pointerAlignment;
934 int destructionWatchOffset;
936 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
937 int inheritanceAccess;
938 const char * fullName;
940 struct __ecereNameSpace__ecere__sys__OldList conversions;
941 struct __ecereNameSpace__ecere__sys__OldList templateParams;
942 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
943 struct __ecereNameSpace__ecere__com__Class * templateClass;
944 struct __ecereNameSpace__ecere__sys__OldList templatized;
946 unsigned int isInstanceClass;
947 unsigned int byValueSystemClass;
948 } __attribute__ ((gcc_struct));
950 struct __ecereNameSpace__ecere__com__Application
955 unsigned int isGUIApp;
956 struct __ecereNameSpace__ecere__sys__OldList allModules;
957 char * parsedCommand;
958 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
959 } __attribute__ ((gcc_struct));
961 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TreePrintStyle;
963 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
965 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__StringBTNode;
967 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_bool;
969 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_uint;
971 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_String;
973 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
975 struct __ecereNameSpace__ecere__com__Module
977 struct __ecereNameSpace__ecere__com__Instance * application;
978 struct __ecereNameSpace__ecere__sys__OldList classes;
979 struct __ecereNameSpace__ecere__sys__OldList defines;
980 struct __ecereNameSpace__ecere__sys__OldList functions;
981 struct __ecereNameSpace__ecere__sys__OldList modules;
982 struct __ecereNameSpace__ecere__com__Instance * prev;
983 struct __ecereNameSpace__ecere__com__Instance * next;
989 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
990 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
991 } __attribute__ ((gcc_struct));
993 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)
995 if((struct __ecereNameSpace__ecere__sys__BTNode *)this)
997 unsigned int __internalValue000;
998 unsigned int truth = 1;
1000 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_bool, (void *)&truth);
1001 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, __extension__ ({
1002 __internalValue000 = (unsigned int)this->key;
1003 (void *)&__internalValue000;
1005 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, this->left);
1006 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, this->right);
1010 unsigned int nothing = 0;
1012 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, (void *)¬hing);
1016 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)
1020 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_bool, (void *)&truth);
1023 (*this) = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__BTNode);
1027 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_uint, (void *)&k);
1030 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, (void *)&(*this)->left);
1033 (*this)->left->parent = *(struct __ecereNameSpace__ecere__sys__BTNode **)this;
1035 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, (void *)&(*this)->right);
1038 (*this)->right->parent = *(struct __ecereNameSpace__ecere__sys__BTNode **)this;
1040 (*this)->depth = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp((*(struct __ecereNameSpace__ecere__sys__BTNode **)this));
1043 (*this) = (((void *)0));
1046 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)
1048 if((struct __ecereNameSpace__ecere__sys__StringBTNode *)this)
1050 unsigned int truth = 1;
1052 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_bool, (void *)&truth);
1053 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_String, this->key);
1054 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->left);
1055 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->right);
1059 unsigned int nothing = 0;
1061 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, (void *)¬hing);
1065 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)
1069 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_bool, (void *)&truth);
1072 (*this) = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__StringBTNode);
1073 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_String, (void *)&(*this)->key);
1074 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, (void *)&(*this)->left);
1077 (*this)->left->parent = *(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
1079 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, (void *)&(*this)->right);
1082 (*this)->right->parent = *(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
1084 (*this)->depth = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(((struct __ecereNameSpace__ecere__sys__BTNode *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this));
1087 (*this) = (((void *)0));
1090 void __ecereUnregisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1093 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1094 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1095 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1096 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1097 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1098 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1099 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1102 void __ecereRegisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1104 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
1106 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(4, "ecere::sys::TreePrintStyle", 0, 0, 0, (void *)0, (void *)0, module, 4, 1);
1107 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application && class)
1108 __ecereClass___ecereNameSpace__ecere__sys__TreePrintStyle = class;
1109 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "inOrder", 0);
1110 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "postOrder", 1);
1111 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "preOrder", 2);
1112 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "depthOrder", 3);
1113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::strcatf", "void ecere::sys::strcatf(char * string, const char * format, ...)", __ecereNameSpace__ecere__sys__strcatf, module, 4);
1114 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::sys::BTNode", 0, sizeof(struct __ecereNameSpace__ecere__sys__BTNode), 0, (void *)0, (void *)0, module, 4, 1);
1115 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application && class)
1116 __ecereClass___ecereNameSpace__ecere__sys__BTNode = class;
1117 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnSerialize, 1);
1118 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnUnserialize, 1);
1119 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "FindPrefix", "ecere::sys::BTNode FindPrefix(const char * key)", __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindPrefix, 1);
1120 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "FindString", "ecere::sys::BTNode FindString(const char * key)", __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindString, 1);
1121 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "uintptr", sizeof(void *), 0xF000F000, 1);
1122 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::BTNode", sizeof(void *), 0xF000F000, 1);
1123 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::BTNode", sizeof(void *), 0xF000F000, 1);
1124 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::BTNode", sizeof(void *), 0xF000F000, 1);
1125 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1126 __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);
1127 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
1128 __ecereProp___ecereNameSpace__ecere__sys__BTNode_prev = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1129 __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);
1130 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
1131 __ecereProp___ecereNameSpace__ecere__sys__BTNode_next = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1132 __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);
1133 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
1134 __ecereProp___ecereNameSpace__ecere__sys__BTNode_minimum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1135 __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);
1136 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
1137 __ecereProp___ecereNameSpace__ecere__sys__BTNode_maximum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1138 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "count", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count, 1);
1139 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
1140 __ecereProp___ecereNameSpace__ecere__sys__BTNode_count = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1141 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "depthProp", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp, 1);
1142 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
1143 __ecereProp___ecereNameSpace__ecere__sys__BTNode_depthProp = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1144 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "balanceFactor", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor, 2);
1145 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
1146 __ecereProp___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1148 class->fixed = (unsigned int)1;
1149 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::sys::StringBTNode", 0, sizeof(struct __ecereNameSpace__ecere__sys__StringBTNode), 0, (void *)0, (void *)0, module, 4, 1);
1150 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application && class)
1151 __ecereClass___ecereNameSpace__ecere__sys__StringBTNode = class;
1152 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnSerialize, 1);
1153 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnUnserialize, 1);
1154 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "String", sizeof(void *), 0xF000F000, 1);
1155 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::StringBTNode", sizeof(void *), 0xF000F000, 1);
1156 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::StringBTNode", sizeof(void *), 0xF000F000, 1);
1157 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::StringBTNode", sizeof(void *), 0xF000F000, 1);
1158 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1160 class->fixed = (unsigned int)1;
1163 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree);
1165 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree)
1167 unsigned int valid = 1;
1168 int leftHeight = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->left) + 1 : 0;
1169 int rightHeight = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->right) + 1 : 0;
1170 int diffHeight = rightHeight - leftHeight;
1174 if(this->left->parent != this)
1176 printf("Parent not set properly at node %d\n", (int)this->left->key);
1179 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->left, tree);
1183 if(this->right->parent != this)
1185 printf("Parent not set properly at node %d\n", (int)this->right->key);
1188 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->right, tree);
1190 if(this->depth != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this))
1192 printf("Depth value at node %d (%d) doesn't match depth property (%d)\n", (int)this->key, this->depth, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this));
1193 valid = (unsigned int)0;
1195 if(diffHeight < -1 || diffHeight > 1)
1197 valid = (unsigned int)0;
1198 printf("Height difference is %d at node %d\n", diffHeight, (int)this->key);
1200 if(diffHeight != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this))
1202 valid = (unsigned int)0;
1203 printf("Height difference %d doesnt match balance-factor of %d at node %d\n", diffHeight, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this), (int)this->key);
1205 if(this->left && tree->CompareKey(tree, this->left->key, this->key) > 0)
1208 printf("Node %d is *smaller* than left subtree %d\n", (int)this->key, (int)this->left->key);
1210 if(this->right && tree->CompareKey(tree, this->right->key, this->key) < 0)
1213 printf("Node %d is *greater* than right subtree %d\n", (int)this->key, (int)this->right->key);
1218 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(struct __ecereNameSpace__ecere__sys__BTNode * this, void (* FreeKey)(void * key));
1220 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(struct __ecereNameSpace__ecere__sys__BTNode * this, void (* FreeKey)(void * key))
1223 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(this->left, FreeKey);
1225 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(this->right, FreeKey);
1227 FreeKey((void *)this->key);
1228 ((this ? (__ecereClass___ecereNameSpace__ecere__sys__BTNode->Destructor ? __ecereClass___ecereNameSpace__ecere__sys__BTNode->Destructor((void *)this) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(this)) : 0), this = 0);