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