Fixes for Archlinux: #ifdef out stdcall (weird segfault on gcc 4.6 with -O2 on ecere...
[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;
509
510 if(key && this->key)
511 result = strcmp(key, (char *)this->key);
512 else if(key && !this->key)
513 result = 1;
514 else if(!key && this->key)
515 result = -1;
516 else
517 result = 0;
518 if(result < 0)
519 this = this->left;
520 else if(result > 0)
521 this = this->right;
522 else
523 break;
524 }
525 return this;
526 }
527
528 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(struct __ecereNameSpace__ecere__sys__BTNode * this, unsigned int key)
529 {
530 struct __ecereNameSpace__ecere__sys__BTNode * result = (((void *)0));
531
532 if(this->key == key)
533 result = this;
534 if(!result && this->left)
535 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->left, key);
536 if(!result && this->right)
537 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindAll(this->right, key);
538 return result;
539 }
540
541 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BTNode * swap)
542 {
543 if(swap->left)
544 {
545 swap->left->parent = swap->parent;
546 if(swap == swap->parent->left)
547 swap->parent->left = swap->left;
548 else if(swap == swap->parent->right)
549 swap->parent->right = swap->left;
550 swap->left = (((void *)0));
551 }
552 if(swap->right)
553 {
554 swap->right->parent = swap->parent;
555 if(swap == swap->parent->left)
556 swap->parent->left = swap->right;
557 else if(swap == swap->parent->right)
558 swap->parent->right = swap->right;
559 swap->right = (((void *)0));
560 }
561 if(swap == swap->parent->left)
562 swap->parent->left = (((void *)0));
563 else if(swap == swap->parent->right)
564 swap->parent->right = (((void *)0));
565 {
566 struct __ecereNameSpace__ecere__sys__BTNode * n;
567
568 for(n = swap->parent; n; n = n->parent)
569 {
570 int __simpleStruct0, __simpleStruct1;
571 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
572
573 if(newDepth == n->depth)
574 break;
575 n->depth = newDepth;
576 if(n == this)
577 break;
578 }
579 }
580 {
581 swap->left = this->left;
582 if(this->left)
583 this->left->parent = swap;
584 }
585 {
586 swap->right = this->right;
587 if(this->right)
588 this->right->parent = swap;
589 }
590 swap->parent = this->parent;
591 this->left = (((void *)0));
592 this->right = (((void *)0));
593 if(this->parent)
594 {
595 if(this == this->parent->left)
596 this->parent->left = swap;
597 else if(this == this->parent->right)
598 this->parent->right = swap;
599 }
600 }
601
602 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance();
603
604 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
605 {
606 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_maximum(this->left) : this->right;
607 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
608
609 if(swap)
610 {
611 swapParent = swap->parent;
612 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
613 }
614 if(this->parent)
615 {
616 if(this == this->parent->left)
617 this->parent->left = (((void *)0));
618 else if(this == this->parent->right)
619 this->parent->right = (((void *)0));
620 }
621 {
622 struct __ecereNameSpace__ecere__sys__BTNode * n;
623
624 for(n = swap ? swap : this->parent; n; n = n->parent)
625 {
626 int __simpleStruct0, __simpleStruct1;
627 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
628
629 if(newDepth == n->depth && n != swap)
630 break;
631 n->depth = newDepth;
632 }
633 }
634 if(swapParent && swapParent != this)
635 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
636 else if(swap)
637 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
638 else if(this->parent)
639 return __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
640 else
641 return (((void *)0));
642 }
643
644 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwapRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
645 {
646 struct __ecereNameSpace__ecere__sys__BTNode * result;
647 struct __ecereNameSpace__ecere__sys__BTNode * swap = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_minimum(this->right) : this->left;
648 struct __ecereNameSpace__ecere__sys__BTNode * swapParent = (((void *)0));
649
650 if(swap)
651 {
652 swapParent = swap->parent;
653 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_RemoveSwap(this, swap);
654 }
655 if(this->parent)
656 {
657 if(this == this->parent->left)
658 this->parent->left = (((void *)0));
659 else if(this == this->parent->right)
660 this->parent->right = (((void *)0));
661 }
662 {
663 struct __ecereNameSpace__ecere__sys__BTNode * n;
664
665 for(n = swap ? swap : this->parent; n; n = n->parent)
666 {
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);
669
670 if(newDepth == n->depth && n != swap)
671 break;
672 n->depth = newDepth;
673 }
674 }
675 if(swapParent && swapParent != this)
676 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swapParent);
677 else if(swap)
678 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(swap);
679 else if(this->parent)
680 result = __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(this->parent);
681 else
682 result = (((void *)0));
683 return result;
684 }
685
686 int __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(struct __ecereNameSpace__ecere__sys__BTNode * this)
687 {
688 int leftDepth = this->left ? (this->left->depth + 1) : 0;
689 int rightDepth = this->right ? (this->right->depth + 1) : 0;
690
691 return rightDepth - leftDepth;
692 }
693
694 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight();
695
696 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight();
697
698 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft();
699
700 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft();
701
702 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Rebalance(struct __ecereNameSpace__ecere__sys__BTNode * this)
703 {
704 while(0x1)
705 {
706 int factor = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this);
707
708 if(factor < -1)
709 {
710 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->left) == 1)
711 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(this);
712 else
713 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
714 }
715 else if(factor > 1)
716 {
717 if(__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this->right) == -1)
718 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(this);
719 else
720 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
721 }
722 if(this->parent)
723 this = this->parent;
724 else
725 return this;
726 }
727 }
728
729 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
730 {
731 int __simpleStruct2, __simpleStruct3;
732 int __simpleStruct0, __simpleStruct1;
733
734 if(this->parent)
735 {
736 if(this == this->parent->left)
737 this->parent->left = this->left;
738 else if(this == this->parent->right)
739 this->parent->right = this->left;
740 }
741 this->left->parent = this->parent;
742 this->parent = this->left;
743 this->left = this->parent->right;
744 if(this->left)
745 this->left->parent = this;
746 this->parent->right = this;
747 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
748 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);
749 {
750 struct __ecereNameSpace__ecere__sys__BTNode * n;
751
752 for(n = this->parent->parent; n; n = n->parent)
753 {
754 int __simpleStruct0, __simpleStruct1;
755 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
756
757 if(newDepth == n->depth)
758 break;
759 n->depth = newDepth;
760 }
761 }
762 }
763
764 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
765 {
766 int __simpleStruct2, __simpleStruct3;
767 int __simpleStruct0, __simpleStruct1;
768
769 if(this->parent)
770 {
771 if(this == this->parent->right)
772 this->parent->right = this->right;
773 else if(this == this->parent->left)
774 this->parent->left = this->right;
775 }
776 this->right->parent = this->parent;
777 this->parent = this->right;
778 this->right = this->parent->left;
779 if(this->right)
780 this->right->parent = this;
781 this->parent->left = this;
782 this->depth = (__simpleStruct0 = this->left ? (this->left->depth + 1) : 0, __simpleStruct1 = this->right ? (this->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
783 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);
784 {
785 struct __ecereNameSpace__ecere__sys__BTNode * n;
786
787 for(n = this->parent->parent; n; n = n->parent)
788 {
789 int __simpleStruct0, __simpleStruct1;
790 int newDepth = (__simpleStruct0 = n->left ? (n->left->depth + 1) : 0, __simpleStruct1 = n->right ? (n->right->depth + 1) : 0, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
791
792 if(newDepth == n->depth)
793 break;
794 n->depth = newDepth;
795 }
796 }
797 }
798
799 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateRight(struct __ecereNameSpace__ecere__sys__BTNode * this)
800 {
801 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this->left);
802 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this);
803 }
804
805 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_DoubleRotateLeft(struct __ecereNameSpace__ecere__sys__BTNode * this)
806 {
807 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateRight(this->right);
808 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_SingleRotateLeft(this);
809 }
810
811 extern char *  strcat(char * , const char * );
812
813 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char *  output, int wantedDepth, int curDepth, int maxDepth, unsigned int last);
814
815 char * __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int tps)
816 {
817 switch(tps)
818 {
819 case 0:
820 case 2:
821 case 1:
822 {
823 if(tps == 2)
824 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
825 if(this->left)
826 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->left, output, tps);
827 if(tps == 0)
828 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
829 if(this->right)
830 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Print(this->right, output, tps);
831 if(tps == 1)
832 __ecereNameSpace__ecere__sys__strcatf(output, "%d ", this->key);
833 return output;
834 }
835 case 3:
836 {
837 int maxDepth = this->depth;
838 int curDepth;
839
840 for(curDepth = 0; curDepth <= maxDepth; curDepth++)
841 {
842 int c;
843
844 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4 / 2; c++)
845 strcat(output, " ");
846 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(this, output, curDepth, 0, maxDepth, 0x1);
847 strcat(output, "\n");
848 }
849 return output;
850 }
851 }
852 return (((void *)0));
853 }
854
855 extern int sprintf(char * , char * , ...);
856
857 void __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth(struct __ecereNameSpace__ecere__sys__BTNode * this, char * output, int wantedDepth, int curDepth, int maxDepth, unsigned int last)
858 {
859 int c;
860
861 if(wantedDepth == curDepth)
862 {
863 char nodeString[10] = "";
864 int len;
865
866 if(this)
867 sprintf(nodeString, "%d", this->key);
868 len = strlen(nodeString);
869 for(c = 0; c < (4 - len) / 2; c++)
870 strcat(output, " ");
871 len += c;
872 strcat(output, nodeString);
873 for(c = len; c < 4; c++)
874 strcat(output, " ");
875 if(curDepth && !last)
876 {
877 for(c = 0; c < ((1 << (maxDepth - curDepth)) - 1) * 4; c++)
878 strcat(output, " ");
879 }
880 }
881 else if(curDepth <= maxDepth)
882 {
883 __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);
884 __ecereMethod___ecereNameSpace__ecere__sys__BTNode_PrintDepth((this ? this->right : (struct __ecereNameSpace__ecere__sys__BTNode *)(((void *)0))), output, wantedDepth, curDepth + 1, maxDepth, last);
885 }
886 }
887
888 extern int printf(char * , ...);
889
890 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(struct __ecereNameSpace__ecere__sys__BTNode * this, struct __ecereNameSpace__ecere__sys__BinaryTree * tree)
891 {
892 unsigned int valid = 0x1;
893 int leftHeight = this->left ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->left) + 1 : 0;
894 int rightHeight = this->right ? __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this->right) + 1 : 0;
895 int diffHeight = rightHeight - leftHeight;
896
897 if(this->left)
898 {
899 if(this->left->parent != this)
900 {
901 printf("Parent not set properly at node %d\n", this->left->key);
902 valid = 0x0;
903 }
904 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->left, tree);
905 }
906 if(this->right)
907 {
908 if(this->right->parent != this)
909 {
910 printf("Parent not set properly at node %d\n", this->right->key);
911 valid = 0x0;
912 }
913 valid *= __ecereMethod___ecereNameSpace__ecere__sys__BTNode_Check(this->right, tree);
914 }
915 if(this->depth != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(this))
916 {
917 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));
918 valid = (unsigned int)0;
919 }
920 if(diffHeight < -1 || diffHeight > 1)
921 {
922 valid = (unsigned int)0;
923 printf("Height difference is %d at node %d\n", diffHeight, this->key);
924 }
925 if(diffHeight != __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this))
926 {
927 valid = (unsigned int)0;
928 printf("Height difference %d doesnt match balance-factor of %d at node \n", diffHeight, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor(this), this->key);
929 }
930 if(this->left && tree->CompareKey(tree, this->left->key, this->key) > 0)
931 {
932 valid = 0x0;
933 printf("Node %d is *smaller* than left subtree %d\n", this->key, this->left->key);
934 }
935 if(this->right && tree->CompareKey(tree, this->right->key, this->key) < 0)
936 {
937 valid = 0x0;
938 printf("Node %d is *greater* than right subtree %d\n", this->key, this->right->key);
939 }
940 return valid;
941 }
942
943 struct __ecereNameSpace__ecere__sys__StringBTNode
944 {
945 char * key;
946 struct __ecereNameSpace__ecere__sys__StringBTNode * parent, * left, * right;
947 int depth;
948 };
949
950 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__StringBTNode;
951
952 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_String;
953
954 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)
955 {
956 if((struct __ecereNameSpace__ecere__sys__StringBTNode *)this)
957 {
958 unsigned int truth = 0x1;
959
960 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_bool, &truth);
961 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_String, this->key);
962 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->left);
963 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, this->right);
964 }
965 else
966 {
967 unsigned int nothing = 0;
968
969 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Serialize(channel, __ecereClass_uint, &nothing);
970 }
971 }
972
973 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)
974 {
975 unsigned int truth;
976
977 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_bool, &truth);
978 if(truth)
979 {
980 (*(this)) = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__StringBTNode);
981 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass_String, &(*(this))->key);
982 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, &(*(this))->left);
983 if((*(this))->left)
984 {
985 (*(this))->left->parent = (void *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
986 }
987 __ecereMethod___ecereNameSpace__ecere__com__IOChannel_Unserialize(channel, __ecereClass___ecereNameSpace__ecere__sys__StringBTNode, &(*(this))->right);
988 if((*(this))->right)
989 {
990 (*(this))->right->parent = (void *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this;
991 }
992 (*(this))->depth = __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp(((struct __ecereNameSpace__ecere__sys__BTNode *)((void *)*(struct __ecereNameSpace__ecere__sys__StringBTNode **)this)));
993 }
994 else
995 (*(this)) = (((void *)0));
996 }
997
998 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);
999
1000 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1001
1002 struct __ecereNameSpace__ecere__com__NameSpace
1003 {
1004 char *  name;
1005 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
1006 struct __ecereNameSpace__ecere__com__NameSpace *  left;
1007 struct __ecereNameSpace__ecere__com__NameSpace *  right;
1008 int depth;
1009 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
1010 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1011 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1012 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1013 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1014 };
1015
1016 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1017
1018 struct __ecereNameSpace__ecere__com__Module
1019 {
1020 struct __ecereNameSpace__ecere__com__Instance * application;
1021 struct __ecereNameSpace__ecere__sys__OldList classes;
1022 struct __ecereNameSpace__ecere__sys__OldList defines;
1023 struct __ecereNameSpace__ecere__sys__OldList functions;
1024 struct __ecereNameSpace__ecere__sys__OldList modules;
1025 struct __ecereNameSpace__ecere__com__Instance * prev;
1026 struct __ecereNameSpace__ecere__com__Instance * next;
1027 char *  name;
1028 void *  library;
1029 void *  Unload;
1030 int importType;
1031 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1032 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1033 };
1034
1035 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
1036
1037 extern void __ecereNameSpace__ecere__com__eEnum_AddFixedValue(struct __ecereNameSpace__ecere__com__Class * _class, char *  string, int value);
1038
1039 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
1040
1041 struct __ecereNameSpace__ecere__com__GlobalFunction;
1042
1043 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);
1044
1045 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);
1046
1047 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);
1048
1049 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);
1050
1051 void __ecereRegisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1052 {
1053 struct __ecereNameSpace__ecere__com__Class * class;
1054
1055 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(4, "ecere::sys::TreePrintStyle", 0, 0, 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__TreePrintStyle = class;
1058 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "inOrder", 0);
1059 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "postOrder", 1);
1060 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "preOrder", 2);
1061 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(class, "depthOrder", 3);
1062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::strcatf", "void ecere::sys::strcatf(char * string, char * format, ...)", __ecereNameSpace__ecere__sys__strcatf, module, 4);
1063 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::sys::BTNode", 0, sizeof(struct __ecereNameSpace__ecere__sys__BTNode), 0, 0, 0, module, 4, 1);
1064 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
1065 __ecereClass___ecereNameSpace__ecere__sys__BTNode = class;
1066 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnSerialize, 1);
1067 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__BTNode_OnUnserialize, 1);
1068 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "FindString", "ecere::sys::BTNode FindString(char * key)", __ecereMethod___ecereNameSpace__ecere__sys__BTNode_FindString, 1);
1069 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "uint", 4, 4, 1);
1070 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::BTNode", 4, 4, 1);
1071 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::BTNode", 4, 4, 1);
1072 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::BTNode", 4, 4, 1);
1073 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1074 __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);
1075 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1076 __ecereProp___ecereNameSpace__ecere__sys__BTNode_prev = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1077 __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);
1078 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1079 __ecereProp___ecereNameSpace__ecere__sys__BTNode_next = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1080 __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);
1081 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1082 __ecereProp___ecereNameSpace__ecere__sys__BTNode_minimum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1083 __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);
1084 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1085 __ecereProp___ecereNameSpace__ecere__sys__BTNode_maximum = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1086 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "count", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_count, 1);
1087 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1088 __ecereProp___ecereNameSpace__ecere__sys__BTNode_count = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1089 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "depthProp", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_depthProp, 1);
1090 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1091 __ecereProp___ecereNameSpace__ecere__sys__BTNode_depthProp = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1092 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecereNameSpace__ecere__com__eClass_AddProperty(class, "balanceFactor", "int", 0, __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_balanceFactor, 2);
1093 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application)
1094 __ecereProp___ecereNameSpace__ecere__sys__BTNode_balanceFactor = __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor, __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1095 if(class)
1096 class->fixed = (unsigned int)1;
1097 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::sys::StringBTNode", 0, sizeof(struct __ecereNameSpace__ecere__sys__StringBTNode), 0, 0, 0, module, 4, 1);
1098 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
1099 __ecereClass___ecereNameSpace__ecere__sys__StringBTNode = class;
1100 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnSerialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnSerialize, 1);
1101 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "OnUnserialize", 0, __ecereMethod___ecereNameSpace__ecere__sys__StringBTNode_OnUnserialize, 1);
1102 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "key", "String", 4, 4, 1);
1103 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::sys::StringBTNode", 4, 4, 1);
1104 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::sys::StringBTNode", 4, 4, 1);
1105 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::sys::StringBTNode", 4, 4, 1);
1106 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
1107 if(class)
1108 class->fixed = (unsigned int)1;
1109 }
1110
1111 void __ecereUnregisterModule_BTNode(struct __ecereNameSpace__ecere__com__Instance * module)
1112 {
1113
1114 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_prev = (void *)0;
1115 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_next = (void *)0;
1116 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_minimum = (void *)0;
1117 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_maximum = (void *)0;
1118 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_count = (void *)0;
1119 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_depthProp = (void *)0;
1120 __ecerePropM___ecereNameSpace__ecere__sys__BTNode_balanceFactor = (void *)0;
1121 }
1122