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