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