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 ecere_stdcall __attribute__((__stdcall__))
41 # define ecere_gcc_struct __attribute__((gcc_struct))
43 # define ecere_stdcall __stdcall
44 # define ecere_gcc_struct
47 # define ecere_stdcall
48 # define ecere_gcc_struct
51 #include <sys/types.h>
52 typedef __builtin_va_list va_list;
54 struct __ecereNameSpace__ecere__sys__OldList
63 struct __ecereNameSpace__ecere__com__DataValue
78 } ecere_gcc_struct __anon1;
81 struct __ecereNameSpace__ecere__com__SerialBuffer
83 unsigned char * _buffer;
89 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
91 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
93 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
95 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
97 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
99 extern int vsprintf(char * , const char * , __builtin_va_list);
101 extern size_t strlen(const char * );
103 extern int strcmp(const char * , const char * );
105 extern int strncmp(const char * , const char * , size_t n);
107 extern char * strcat(char * , const char * );
109 extern int sprintf(char * , const char * , ...);
111 extern int printf(const char * , ...);
113 struct __ecereNameSpace__ecere__com__GlobalFunction;
115 void __ecereNameSpace__ecere__sys__strcatf(char * string, const char * format, ...)
119 __builtin_va_start(args, format);
120 vsprintf(string + strlen(string), format, args);
121 __builtin_va_end(args);
124 struct __ecereNameSpace__ecere__com__Property;
126 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
128 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_prev, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev;
130 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next;
132 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_minimum, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum;
134 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_maximum, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum;
136 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_count, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count;
138 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_depthProp, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp;
140 static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_balanceFactor, * __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor;
142 struct __ecereNameSpace__ecere__sys__BTNode;
144 struct __ecereNameSpace__ecere__sys__BTNode
147 struct __ecereNameSpace__ecere__sys__BTNode * parent, * left, * right;
151 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(struct __ecereNameSpace__ecere__sys__BTNode * this)
158 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(struct __ecereNameSpace__ecere__sys__BTNode * this)
165 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindString(struct __ecereNameSpace__ecere__sys__BTNode * this, const char * key)
172 result = strcmp(key, (const char *)this->key);
173 else if(key && !this->key)
175 else if(!key && this->key)
189 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindPrefix(struct __ecereNameSpace__ecere__sys__BTNode * this, const char * key)
191 struct __ecereNameSpace__ecere__sys__BTNode * subString = (((void *)0));
192 int len = key ? strlen(key) : 0;
199 result = strcmp(key, (const char *)this->key);
200 else if(key && !this->key)
202 else if(!key && this->key)
208 if(!strncmp(key, (const char *)this->key, len))
223 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * swap)
227 swap->left->parent = swap->parent;
228 if(swap == swap->parent->left)
229 swap->parent->left = swap->left;
230 else if(swap == swap->parent->right)
231 swap->parent->right = swap->left;
232 swap->left = (((void *)0));
236 swap->right->parent = swap->parent;
237 if(swap == swap->parent->left)
238 swap->parent->left = swap->right;
239 else if(swap == swap->parent->right)
240 swap->parent->right = swap->right;
241 swap->right = (((void *)0));
243 if(swap == swap->parent->left)
244 swap->parent->left = (((void *)0));
245 else if(swap == swap->parent->right)
246 swap->parent->right = (((void *)0));
248 struct __ecereNameSpace__ecere__sys__BTNode * n;
250 for(n = swap->parent; n; n = n->parent)
252 int __simpleStruct0, __simpleStruct1;
253 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
255 if(newDepth == n->depth)
263 swap->left = this->left;
265 this->left->parent = swap;
268 swap->right = this->right;
270 this->right->parent = swap;
272 swap->parent = this->parent;
273 this->left = (((void *)0));
274 this->right = (((void *)0));
277 if(this == this->parent->left)
278 this->parent->left = swap;
279 else if(this == this->parent->right)
280 this->parent->right = swap;
284 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(struct __ecereNameSpace__ecere__sys__BTNode * this)
286 int leftDepth = this->left ? (this->left->depth + 1) : 0;
287 int rightDepth = this->right ? (this->right->depth + 1) : 0;
289 return rightDepth - leftDepth;
292 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
294 int __simpleStruct2, __simpleStruct3;
295 int __simpleStruct0, __simpleStruct1;
299 if(this == this->parent->left)
300 this->parent->left = this->left;
301 else if(this == this->parent->right)
302 this->parent->right = this->left;
304 this->left->parent = this->parent;
305 this->parent = this->left;
306 this->left = this->parent->right;
308 this->left->parent = this;
309 this->parent->right = this;
310 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
311 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);
313 struct __ecereNameSpace__ecere__sys__BTNode * n;
315 for(n = this->parent->parent; n; n = n->parent)
317 int __simpleStruct0, __simpleStruct1;
318 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
320 if(newDepth == n->depth)
327 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
329 int __simpleStruct2, __simpleStruct3;
330 int __simpleStruct0, __simpleStruct1;
334 if(this == this->parent->right)
335 this->parent->right = this->right;
336 else if(this == this->parent->left)
337 this->parent->left = this->right;
339 this->right->parent = this->parent;
340 this->parent = this->right;
341 this->right = this->parent->left;
343 this->right->parent = this;
344 this->parent->left = this;
345 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
346 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);
348 struct __ecereNameSpace__ecere__sys__BTNode * n;
350 for(n = this->parent->parent; n; n = n->parent)
352 int __simpleStruct0, __simpleStruct1;
353 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
355 if(newDepth == n->depth)
362 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(struct __ecereNameSpace__ecere__sys__BTNode * this);
364 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(struct __ecereNameSpace__ecere__sys__BTNode * this);
366 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(struct __ecereNameSpace__ecere__sys__BTNode * this);
368 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count(struct __ecereNameSpace__ecere__sys__BTNode * this);
370 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(struct __ecereNameSpace__ecere__sys__BTNode * this);
372 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
374 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this->left);
375 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
378 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
380 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this->right);
381 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
384 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(struct __ecereNameSpace__ecere__sys__BTNode * this)
386 int leftDepth = this->left ? (__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->left) + 1) : 0;
387 int rightDepth = this->right ? (__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->right) + 1) : 0;
389 return ((leftDepth > rightDepth) ? leftDepth : rightDepth);
392 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_prev(struct __ecereNameSpace__ecere__sys__BTNode * this)
395 return __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(this->left);
398 if(this->parent && this == this->parent->right)
406 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this)
408 struct __ecereNameSpace__ecere__sys__BTNode * right = this->right;
411 return __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(right);
414 struct __ecereNameSpace__ecere__sys__BTNode * parent = this->parent;
416 if(parent && this == parent->left)
421 return (((void *)0));
424 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count(struct __ecereNameSpace__ecere__sys__BTNode * this)
426 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);
429 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(struct __ecereNameSpace__ecere__sys__BTNode * this)
433 int factor = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this);
437 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->left) == 1)
438 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(this);
440 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
444 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->right) == -1)
445 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(this);
447 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
456 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
458 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(this->left) : this->right;
459 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
463 swapParent = swap->parent;
464 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
468 if(this == this->parent->left)
469 this->parent->left = (((void *)0));
470 else if(this == this->parent->right)
471 this->parent->right = (((void *)0));
474 struct __ecereNameSpace__ecere__sys__BTNode * n;
476 for(n = swap ? swap : this->parent; n; n = n->parent)
478 int __simpleStruct0, __simpleStruct1;
479 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
481 if(newDepth == n->depth && n != swap)
486 if(swapParent && swapParent != this)
487 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
489 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
490 else if(this->parent)
491 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
493 return (((void *)0));
496 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
498 struct __ecereNameSpace__ecere__sys__BTNode * result;
499 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(this->right) : this->left;
500 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
504 swapParent = swap->parent;
505 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
509 if(this == this->parent->left)
510 this->parent->left = (((void *)0));
511 else if(this == this->parent->right)
512 this->parent->right = (((void *)0));
515 struct __ecereNameSpace__ecere__sys__BTNode * n;
517 for(n = swap ? swap : this->parent; n; n = n->parent)
519 int __simpleStruct0, __simpleStruct1;
520 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
522 if(newDepth == n->depth && n != swap)
527 if(swapParent && swapParent != this)
528 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
530 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
531 else if(this->parent)
532 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
534 result = (((void *)0));
538 struct __ecereNameSpace__ecere__com__Class;
540 struct __ecereNameSpace__ecere__com__Instance
543 struct __ecereNameSpace__ecere__com__Class * _class;
547 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
549 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
551 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
553 extern void __ecereNameSpace__ecere__com__eEnum_AddFixedValue(struct __ecereNameSpace__ecere__com__Class * _class, const char * string, long long value);
555 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);
557 struct __ecereNameSpace__ecere__com__Property
559 struct __ecereNameSpace__ecere__com__Property * prev;
560 struct __ecereNameSpace__ecere__com__Property * next;
562 unsigned int isProperty;
565 struct __ecereNameSpace__ecere__com__Class * _class;
566 const char * dataTypeString;
567 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
568 struct __ecereNameSpace__ecere__com__Instance * dataType;
569 void (* Set)(void * , int);
570 int (* Get)(void * );
571 unsigned int (* IsSet)(void * );
575 unsigned int conversion;
576 unsigned int watcherOffset;
577 const char * category;
578 unsigned int compiled;
579 unsigned int selfWatchable;
580 unsigned int isWatchable;
583 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
585 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
587 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
589 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);
591 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
593 void __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * class, const void * data);
595 void __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Class * class, void * * data);
597 struct __ecereNameSpace__ecere__sys__StringBTNode;
599 struct __ecereNameSpace__ecere__sys__StringBTNode
602 struct __ecereNameSpace__ecere__sys__StringBTNode * parent, * left, * right;
606 struct __ecereNameSpace__ecere__sys__BinaryTree;
608 struct __ecereNameSpace__ecere__sys__BinaryTree
610 struct __ecereNameSpace__ecere__sys__BTNode * root;
612 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
613 void (* FreeKey)(void * key);
616 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)
618 uintptr_t newKey = node->key;
622 int result = tree->CompareKey(tree, newKey, this->key);
638 struct __ecereNameSpace__ecere__sys__BTNode * n;
640 for(n = this; n; n = n->parent)
642 int __simpleStruct0, __simpleStruct1;
643 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
645 if(newDepth == n->depth)
663 struct __ecereNameSpace__ecere__sys__BTNode * n;
665 for(n = this; n; n = n->parent)
667 int __simpleStruct0, __simpleStruct1;
668 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
670 if(newDepth == n->depth)
681 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)
685 int result = tree->CompareKey(tree, key, this->key);
697 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
699 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * node)
703 else if(this->left && __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(this->left, node))
705 else if(this->right && __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindNode(this->right, node))
710 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(struct __ecereNameSpace__ecere__sys__BTNode * this, uintptr_t key);
712 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(struct __ecereNameSpace__ecere__sys__BTNode * this, uintptr_t key)
714 struct __ecereNameSpace__ecere__sys__BTNode * result = (((void *)0));
718 if(!result && this->left)
719 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->left, key);
720 if(!result && this->right)
721 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->right, key);
725 char * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int tps);
727 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int wantedDepth, int curDepth, int maxDepth, unsigned int last);
729 char * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int tps)
738 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
740 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->left, output, tps);
742 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
744 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->right, output, tps);
746 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
751 int maxDepth = this->depth;
754 for(curDepth = 0; curDepth <= maxDepth; curDepth++)
758 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4 / 2; c++)
760 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(this, output, curDepth, 0, maxDepth, 1);
761 strcat(output, "\n");
766 return (((void *)0));
769 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int wantedDepth, int curDepth, int maxDepth, unsigned int last)
773 if(wantedDepth == curDepth)
775 char nodeString[10] = "";
779 sprintf(nodeString, "%d", (int)this->key);
780 len = strlen(nodeString);
781 for(c = 0; c < (4 - len) / 2; c++)
784 strcat(output, nodeString);
785 for(c = len; c < 4; c++)
787 if(curDepth && !last)
789 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4; c++)
793 else if(curDepth <= maxDepth)
795 __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);
796 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth((this ? this->right : (struct __ecereNameSpace__ecere__sys__BTNode *)(((void *)0))), output, wantedDepth, curDepth + 1, maxDepth, last);
800 struct __ecereNameSpace__ecere__com__DataMember;
802 struct __ecereNameSpace__ecere__com__DataMember
804 struct __ecereNameSpace__ecere__com__DataMember * prev;
805 struct __ecereNameSpace__ecere__com__DataMember * next;
807 unsigned int isProperty;
810 struct __ecereNameSpace__ecere__com__Class * _class;
811 const char * dataTypeString;
812 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
813 struct __ecereNameSpace__ecere__com__Instance * dataType;
817 struct __ecereNameSpace__ecere__sys__OldList members;
818 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
820 short structAlignment;
821 short pointerAlignment;
824 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);
826 struct __ecereNameSpace__ecere__com__Method;
828 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
834 const char * dataTypeString;
835 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
836 } ecere_gcc_struct __anon1;
837 struct __ecereNameSpace__ecere__com__DataValue expression;
840 const char * memberString;
843 struct __ecereNameSpace__ecere__com__DataMember * member;
844 struct __ecereNameSpace__ecere__com__Property * prop;
845 struct __ecereNameSpace__ecere__com__Method * method;
846 } ecere_gcc_struct __anon1;
847 } ecere_gcc_struct __anon2;
848 } ecere_gcc_struct __anon1;
851 struct __ecereNameSpace__ecere__com__Method
854 struct __ecereNameSpace__ecere__com__Method * parent;
855 struct __ecereNameSpace__ecere__com__Method * left;
856 struct __ecereNameSpace__ecere__com__Method * right;
861 struct __ecereNameSpace__ecere__com__Class * _class;
863 const char * dataTypeString;
864 struct __ecereNameSpace__ecere__com__Instance * dataType;
868 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);
870 struct __ecereNameSpace__ecere__com__Module;
872 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);
874 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
876 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);
878 struct __ecereNameSpace__ecere__com__NameSpace;
880 struct __ecereNameSpace__ecere__com__NameSpace
883 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
884 struct __ecereNameSpace__ecere__com__NameSpace * left;
885 struct __ecereNameSpace__ecere__com__NameSpace * right;
887 struct __ecereNameSpace__ecere__com__NameSpace * parent;
888 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
889 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
890 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
891 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
894 struct __ecereNameSpace__ecere__com__Class
896 struct __ecereNameSpace__ecere__com__Class * prev;
897 struct __ecereNameSpace__ecere__com__Class * next;
903 unsigned int (* Constructor)(void * );
904 void (* Destructor)(void * );
907 struct __ecereNameSpace__ecere__com__Class * base;
908 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
909 struct __ecereNameSpace__ecere__sys__BinaryTree members;
910 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
911 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
912 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
913 struct __ecereNameSpace__ecere__sys__OldList derivatives;
917 struct __ecereNameSpace__ecere__com__Instance * module;
918 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
919 const char * dataTypeString;
920 struct __ecereNameSpace__ecere__com__Instance * dataType;
922 int defaultAlignment;
923 void (* Initialize)();
925 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
926 const char * designerClass;
927 unsigned int noExpansion;
928 const char * defaultProperty;
929 unsigned int comRedefinition;
932 unsigned int internalDecl;
934 unsigned int computeSize;
935 short structAlignment;
936 short pointerAlignment;
937 int destructionWatchOffset;
939 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
940 int inheritanceAccess;
941 const char * fullName;
943 struct __ecereNameSpace__ecere__sys__OldList conversions;
944 struct __ecereNameSpace__ecere__sys__OldList templateParams;
945 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
946 struct __ecereNameSpace__ecere__com__Class * templateClass;
947 struct __ecereNameSpace__ecere__sys__OldList templatized;
949 unsigned int isInstanceClass;
950 unsigned int byValueSystemClass;
953 struct __ecereNameSpace__ecere__com__Application
958 unsigned int isGUIApp;
959 struct __ecereNameSpace__ecere__sys__OldList allModules;
960 char * parsedCommand;
961 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
964 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TreePrintStyle;
966 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
968 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__StringBTNode;
970 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_bool;
972 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_uint;
974 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_String;
976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
978 struct __ecereNameSpace__ecere__com__Module
980 struct __ecereNameSpace__ecere__com__Instance * application;
981 struct __ecereNameSpace__ecere__sys__OldList classes;
982 struct __ecereNameSpace__ecere__sys__OldList defines;
983 struct __ecereNameSpace__ecere__sys__OldList functions;
984 struct __ecereNameSpace__ecere__sys__OldList modules;
985 struct __ecereNameSpace__ecere__com__Instance * prev;
986 struct __ecereNameSpace__ecere__com__Instance * next;
992 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
993 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
996 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)
998 if((struct __ecereNameSpace__ecere__sys__BTNode *)this)
1000 unsigned int __internalValue000;
1001 unsigned int truth = 1;
1003 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_bool, (void *)&truth);
1004 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, __extension__ ({
1005 __internalValue000 = (unsigned int)this->key;
1006 (void *)&__internalValue000;
1008 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, this->left);
1009 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, this->right);
1013 unsigned int nothing = 0;
1015 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, (void *)¬hing);
1019 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)
1023 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_bool, (void *)&truth);
1026 (*this) = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__BTNode);
1030 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_uint, (void *)&k);
1033 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, (void *)&(*this)->left);
1036 (*this)->left->parent = *(struct __ecereNameSpace__ecere__sys__BTNode **)this;
1038 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__BTNode, (void *)&(*this)->right);
1041 (*this)->right->parent = *(struct __ecereNameSpace__ecere__sys__BTNode **)this;
1043 (*this)->depth = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp((*(struct __ecereNameSpace__ecere__sys__BTNode **)this));
1046 (*this) = (((void *)0));
1049 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)
1051 if((struct __ecereNameSpace__ecere__sys__StringBTNode *)this)
1053 unsigned int truth = 1;
1055 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_bool, (void *)&truth);
1056 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_String, this->key);
1057 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->left);
1058 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->right);
1062 unsigned int nothing = 0;
1064 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, (void *)¬hing);
1068 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)
1072 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_bool, (void *)&truth);
1075 (*this) = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(struct __ecereNameSpace__ecere__sys__StringBTNode));
1076 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_String, (void *)&(*this)->key);
1077 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, (void *)&(*this)->left);
1080 (*this)->left->parent = *(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
1082 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, (void *)&(*this)->right);
1085 (*this)->right->parent = *(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
1087 (*this)->depth = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(((struct __ecereNameSpace__ecere__sys__BTNode *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this));
1090 (*this) = (((void *)0));
1093 void __ecereUnregisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1096 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1097 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1098 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1099 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1100 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1101 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1102 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1105 void __ecereRegisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1107 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
1109 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(4, "ecere::sys::TreePrintStyle", 0, 0, 0, (void *)0, (void *)0, module, 4, 1);
1110 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)
1111 __ecereClass___ecereNameSpace__ecere__sys__TreePrintStyle = class;
1112 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "inOrder", 0);
1113 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "postOrder", 1);
1114 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "preOrder", 2);
1115 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "depthOrder", 3);
1116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::strcatf", "void ecere::sys::strcatf(char * string, const char * format, ...)", __ecereNameSpace__ecere__sys__strcatf, module, 4);
1117 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);
1118 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)
1119 __ecereClass___ecereNameSpace__ecere__sys__BTNode = class;
1120 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnSerialize, 1);
1121 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnUnserialize, 1);
1122 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "FindPrefix", "ecere::sys::BTNode FindPrefix(const char * key)", __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindPrefix, 1);
1123 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "FindString", "ecere::sys::BTNode FindString(const char * key)", __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindString, 1);
1124 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "uintptr", sizeof(void *), 0xF000F000, 1);
1125 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::BTNode", sizeof(void *), 0xF000F000, 1);
1126 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::BTNode", sizeof(void *), 0xF000F000, 1);
1127 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::BTNode", sizeof(void *), 0xF000F000, 1);
1128 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1129 __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);
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_prev = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1132 __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);
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_next = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1135 __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);
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_minimum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1138 __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);
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_maximum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1141 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "count", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count, 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_count = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1144 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "depthProp", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp, 1);
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_depthProp = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1147 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "balanceFactor", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor, 2);
1148 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)
1149 __ecereProp___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1151 class->fixed = (unsigned int)1;
1152 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);
1153 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)
1154 __ecereClass___ecereNameSpace__ecere__sys__StringBTNode = class;
1155 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnSerialize, 1);
1156 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnUnserialize, 1);
1157 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "String", sizeof(void *), 0xF000F000, 1);
1158 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::StringBTNode", sizeof(void *), 0xF000F000, 1);
1159 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::StringBTNode", sizeof(void *), 0xF000F000, 1);
1160 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::StringBTNode", sizeof(void *), 0xF000F000, 1);
1161 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1163 class->fixed = (unsigned int)1;
1166 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree);
1168 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree)
1170 unsigned int valid = 1;
1171 int leftHeight = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->left) + 1 : 0;
1172 int rightHeight = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->right) + 1 : 0;
1173 int diffHeight = rightHeight - leftHeight;
1177 if(this->left->parent != this)
1179 printf("Parent not set properly at node %d\n", (int)this->left->key);
1182 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->left, tree);
1186 if(this->right->parent != this)
1188 printf("Parent not set properly at node %d\n", (int)this->right->key);
1191 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->right, tree);
1193 if(this->depth != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this))
1195 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));
1196 valid = (unsigned int)0;
1198 if(diffHeight < -1 || diffHeight > 1)
1200 valid = (unsigned int)0;
1201 printf("Height difference is %d at node %d\n", diffHeight, (int)this->key);
1203 if(diffHeight != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this))
1205 valid = (unsigned int)0;
1206 printf("Height difference %d doesn't match balance-factor of %d at node %d\n", diffHeight, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this), (int)this->key);
1208 if(this->left && tree->CompareKey(tree, this->left->key, this->key) > 0)
1211 printf("Node %d is *smaller* than left subtree %d\n", (int)this->key, (int)this->left->key);
1213 if(this->right && tree->CompareKey(tree, this->right->key, this->key) < 0)
1216 printf("Node %d is *greater* than right subtree %d\n", (int)this->key, (int)this->right->key);
1221 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(struct __ecereNameSpace__ecere__sys__BTNode * this, void (* FreeKey)(void * key));
1223 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(struct __ecereNameSpace__ecere__sys__BTNode * this, void (* FreeKey)(void * key))
1226 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(this->left, FreeKey);
1228 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Free(this->right, FreeKey);
1230 FreeKey((void *)this->key);
1231 ((this ? __extension__ ({
1232 void * __ecerePtrToDelete = (this);
1234 __ecereClass___ecereNameSpace__ecere__sys__BTNode->Destructor ? __ecereClass___ecereNameSpace__ecere__sys__BTNode->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);