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