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