ecere/com, bootstrap: Fixed memory leak; Using 'isInstanceClass' to determine Instanc...
[sdk] / compiler / bootstrap / ecere / bootstrap / DualPipe.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 #include <stdint.h>
31 #include <sys/types.h>
32
33 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
34 #define _64BIT 1
35 #else
36 #define _64BIT 0
37 #endif
38
39 #define arch_PointerSize                  sizeof(void *)
40 #define structSize_Instance               (_64BIT ? 24 : 12)
41
42 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
43
44 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
45
46 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
47
48 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
49
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
51
52 struct __ecereNameSpace__ecere__sys__BTNode;
53
54 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
55
56 struct __ecereNameSpace__ecere__sys__BinaryTree
57 {
58 struct __ecereNameSpace__ecere__sys__BTNode * root;
59 int count;
60 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
61 void (*  FreeKey)(void *  key);
62 } __attribute__ ((gcc_struct));
63
64 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
65
66 struct __ecereNameSpace__ecere__sys__OldList
67 {
68 void *  first;
69 void *  last;
70 int count;
71 unsigned int offset;
72 unsigned int circ;
73 } __attribute__ ((gcc_struct));
74
75 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
76
77 struct __ecereNameSpace__ecere__com__Class
78 {
79 struct __ecereNameSpace__ecere__com__Class * prev;
80 struct __ecereNameSpace__ecere__com__Class * next;
81 char *  name;
82 int offset;
83 int structSize;
84 int (* *  _vTbl)();
85 int vTblSize;
86 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
87 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
88 int offsetClass;
89 int sizeClass;
90 struct __ecereNameSpace__ecere__com__Class * base;
91 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
92 struct __ecereNameSpace__ecere__sys__BinaryTree members;
93 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
94 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
95 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
96 struct __ecereNameSpace__ecere__sys__OldList derivatives;
97 int memberID;
98 int startMemberID;
99 int type;
100 struct __ecereNameSpace__ecere__com__Instance * module;
101 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
102 char *  dataTypeString;
103 struct __ecereNameSpace__ecere__com__Instance * dataType;
104 int typeSize;
105 int defaultAlignment;
106 void (*  Initialize)();
107 int memberOffset;
108 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
109 char *  designerClass;
110 unsigned int noExpansion;
111 char *  defaultProperty;
112 unsigned int comRedefinition;
113 int count;
114 unsigned int isRemote;
115 unsigned int internalDecl;
116 void *  data;
117 unsigned int computeSize;
118 int structAlignment;
119 int destructionWatchOffset;
120 unsigned int fixed;
121 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
122 int inheritanceAccess;
123 char *  fullName;
124 void *  symbol;
125 struct __ecereNameSpace__ecere__sys__OldList conversions;
126 struct __ecereNameSpace__ecere__sys__OldList templateParams;
127 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
128 struct __ecereNameSpace__ecere__com__Class * templateClass;
129 struct __ecereNameSpace__ecere__sys__OldList templatized;
130 int numParams;
131 unsigned int isInstanceClass;
132 } __attribute__ ((gcc_struct));
133
134 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
135
136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
137
138 struct __ecereNameSpace__ecere__com__Instance
139 {
140 int (* *  _vTbl)();
141 struct __ecereNameSpace__ecere__com__Class * _class;
142 int _refCount;
143 } __attribute__ ((gcc_struct));
144
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
146
147 struct __ecereNameSpace__ecere__com__Property
148 {
149 struct __ecereNameSpace__ecere__com__Property * prev;
150 struct __ecereNameSpace__ecere__com__Property * next;
151 char *  name;
152 unsigned int isProperty;
153 int memberAccess;
154 int id;
155 struct __ecereNameSpace__ecere__com__Class * _class;
156 char *  dataTypeString;
157 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
158 struct __ecereNameSpace__ecere__com__Instance * dataType;
159 void (*  Set)(void * , int);
160 int (*  Get)(void * );
161 unsigned int (*  IsSet)(void * );
162 void *  data;
163 void *  symbol;
164 int vid;
165 unsigned int conversion;
166 unsigned int watcherOffset;
167 char *  category;
168 unsigned int compiled;
169 unsigned int selfWatchable;
170 unsigned int isWatchable;
171 } __attribute__ ((gcc_struct));
172
173 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
174
175 struct __ecereNameSpace__ecere__com__DataMember
176 {
177 struct __ecereNameSpace__ecere__com__DataMember * prev;
178 struct __ecereNameSpace__ecere__com__DataMember * next;
179 char *  name;
180 unsigned int isProperty;
181 int memberAccess;
182 int id;
183 struct __ecereNameSpace__ecere__com__Class * _class;
184 char *  dataTypeString;
185 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
186 struct __ecereNameSpace__ecere__com__Instance * dataType;
187 int type;
188 int offset;
189 int memberID;
190 struct __ecereNameSpace__ecere__sys__OldList members;
191 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
192 int memberOffset;
193 int structAlignment;
194 } __attribute__ ((gcc_struct));
195
196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
197
198 struct __ecereNameSpace__ecere__com__Method
199 {
200 char *  name;
201 struct __ecereNameSpace__ecere__com__Method * parent;
202 struct __ecereNameSpace__ecere__com__Method * left;
203 struct __ecereNameSpace__ecere__com__Method * right;
204 int depth;
205 int (*  function)();
206 int vid;
207 int type;
208 struct __ecereNameSpace__ecere__com__Class * _class;
209 void *  symbol;
210 char *  dataTypeString;
211 struct __ecereNameSpace__ecere__com__Instance * dataType;
212 int memberAccess;
213 } __attribute__ ((gcc_struct));
214
215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
216
217 struct __ecereNameSpace__ecere__com__SerialBuffer
218 {
219 unsigned char *  _buffer;
220 unsigned int count;
221 unsigned int _size;
222 unsigned int pos;
223 } __attribute__ ((gcc_struct));
224
225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
226
227 struct __ecereNameSpace__ecere__com__DataValue
228 {
229 union
230 {
231 char c;
232 unsigned char uc;
233 short s;
234 unsigned short us;
235 int i;
236 unsigned int ui;
237 void *  p;
238 float f;
239 double d;
240 long long i64;
241 uint64 ui64;
242 } __attribute__ ((gcc_struct));
243 } __attribute__ ((gcc_struct));
244
245 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
246
247 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
248 {
249 union
250 {
251 struct
252 {
253 char *  dataTypeString;
254 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
255 } __attribute__ ((gcc_struct));
256 struct __ecereNameSpace__ecere__com__DataValue expression;
257 struct
258 {
259 char *  memberString;
260 union
261 {
262 struct __ecereNameSpace__ecere__com__DataMember * member;
263 struct __ecereNameSpace__ecere__com__Property * prop;
264 struct __ecereNameSpace__ecere__com__Method * method;
265 } __attribute__ ((gcc_struct));
266 } __attribute__ ((gcc_struct));
267 } __attribute__ ((gcc_struct));
268 } __attribute__ ((gcc_struct));
269
270 typedef __builtin_va_list va_list;
271
272 void DualPipe_Destructor(struct __ecereNameSpace__ecere__com__Instance ** dp);
273
274 void DualPipe_CloseInput(struct __ecereNameSpace__ecere__com__Instance ** dp);
275
276 void DualPipe_CloseOutput(struct __ecereNameSpace__ecere__com__Instance ** dp);
277
278 int DualPipe_Read(struct __ecereNameSpace__ecere__com__Instance ** dp, unsigned char * buffer, unsigned int size, unsigned int count);
279
280 int DualPipe_Write(struct __ecereNameSpace__ecere__com__Instance ** dp, unsigned char * buffer, unsigned int size, unsigned int count);
281
282 unsigned int DualPipe_Getc(struct __ecereNameSpace__ecere__com__Instance ** dp, char * ch);
283
284 unsigned int DualPipe_Putc(struct __ecereNameSpace__ecere__com__Instance ** dp, char ch);
285
286 unsigned int DualPipe_Puts(struct __ecereNameSpace__ecere__com__Instance ** dp, char * string);
287
288 unsigned int DualPipe_Seek(struct __ecereNameSpace__ecere__com__Instance ** dp, int pos, int mode);
289
290 unsigned int DualPipe_Tell(struct __ecereNameSpace__ecere__com__Instance ** dp);
291
292 unsigned int DualPipe_Eof(struct __ecereNameSpace__ecere__com__Instance ** dp);
293
294 unsigned int DualPipe_GetSize(struct __ecereNameSpace__ecere__com__Instance ** dp);
295
296 unsigned int DualPipe_Peek(struct __ecereNameSpace__ecere__com__Instance ** dp);
297
298 void DualPipe_Terminate(struct __ecereNameSpace__ecere__com__Instance ** dp);
299
300 int DualPipe_GetExitCode(struct __ecereNameSpace__ecere__com__Instance ** dp);
301
302 int DualPipe_GetProcessID(struct __ecereNameSpace__ecere__com__Instance ** dp);
303
304 void DualPipe_Wait(struct __ecereNameSpace__ecere__com__Instance ** dp);
305
306 struct __ecereNameSpace__ecere__com__Instance ** _DualPipeOpen(unsigned int mode, char * commandLine, char * env, void ** inputPtr, void ** outputPtr);
307
308 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__PipeOpenMode;
309
310 struct __ecereNameSpace__ecere__sys__DualPipe
311 {
312 void * dp;
313 } __attribute__ ((gcc_struct));
314
315 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__DualPipe;
316
317 void __ecereDestructor___ecereNameSpace__ecere__sys__DualPipe(struct __ecereNameSpace__ecere__com__Instance * this)
318 {
319 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
320
321 {
322 DualPipe_Destructor(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
323 }
324 }
325
326 void *  __ecereProp___ecereNameSpace__ecere__sys__File_Get_input(struct __ecereNameSpace__ecere__com__Instance * this);
327
328 void __ecereProp___ecereNameSpace__ecere__sys__File_Set_input(struct __ecereNameSpace__ecere__com__Instance * this, void *  value);
329
330 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__File_input;
331
332 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_CloseInput;
333
334 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
335
336 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseInput(struct __ecereNameSpace__ecere__com__Instance * this)
337 {
338 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
339
340 (__ecereProp___ecereNameSpace__ecere__sys__File_Get_input(this) != (((void *)0))) ? ((void (*)(struct __ecereNameSpace__ecere__com__Instance *))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_CloseInput])(this) : DualPipe_CloseInput(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
341 }
342
343 void *  __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(struct __ecereNameSpace__ecere__com__Instance * this);
344
345 void __ecereProp___ecereNameSpace__ecere__sys__File_Set_output(struct __ecereNameSpace__ecere__com__Instance * this, void *  value);
346
347 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__File_output;
348
349 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_CloseOutput;
350
351 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseOutput(struct __ecereNameSpace__ecere__com__Instance * this)
352 {
353 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
354
355 (__ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this) != (((void *)0))) ? ((void (*)(struct __ecereNameSpace__ecere__com__Instance *))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_CloseOutput])(this) : DualPipe_CloseOutput(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
356 }
357
358 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Read(struct __ecereNameSpace__ecere__com__Instance * this, unsigned char * buffer, unsigned int size, unsigned int count)
359 {
360 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
361
362 return DualPipe_Read(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp, buffer, size, count);
363 }
364
365 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
366
367 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Write(struct __ecereNameSpace__ecere__com__Instance * this, unsigned char * buffer, unsigned int size, unsigned int count)
368 {
369 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
370
371 return __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this) ? ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(this, buffer, size, count) : DualPipe_Write(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp, buffer, size, count);
372 }
373
374 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Getc;
375
376 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Getc(struct __ecereNameSpace__ecere__com__Instance * this, char * ch)
377 {
378 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
379
380 return __ecereProp___ecereNameSpace__ecere__sys__File_Get_input(this) ? ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, char *  ch))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Getc])(this, ch) : DualPipe_Getc(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp, ch);
381 }
382
383 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Putc;
384
385 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Putc(struct __ecereNameSpace__ecere__com__Instance * this, char ch)
386 {
387 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
388
389 return __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this) ? ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, char ch))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Putc])(this, ch) : DualPipe_Putc(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp, ch);
390 }
391
392 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts;
393
394 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__File_Flush(struct __ecereNameSpace__ecere__com__Instance * this);
395
396 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Puts(struct __ecereNameSpace__ecere__com__Instance * this, char * string)
397 {
398 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
399
400 return __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this) ? (((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, const char *  string))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts])(this, string), __ecereMethod___ecereNameSpace__ecere__sys__File_Flush(this)) : DualPipe_Puts(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp, string);
401 }
402
403 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
404
405 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Seek(struct __ecereNameSpace__ecere__com__Instance * this, int pos, int mode)
406 {
407 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
408
409 return (__ecereProp___ecereNameSpace__ecere__sys__File_Get_input(this) || __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this)) ? ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(this, pos, mode) : DualPipe_Seek(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp, pos, mode);
410 }
411
412 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Tell;
413
414 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Tell(struct __ecereNameSpace__ecere__com__Instance * this)
415 {
416 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
417
418 return (__ecereProp___ecereNameSpace__ecere__sys__File_Get_input(this) || __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this)) ? ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Tell])(this) : DualPipe_Tell(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
419 }
420
421 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Eof(struct __ecereNameSpace__ecere__com__Instance * this)
422 {
423 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
424
425 return DualPipe_Eof(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
426 }
427
428 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_GetSize;
429
430 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetSize(struct __ecereNameSpace__ecere__com__Instance * this)
431 {
432 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
433
434 return (__ecereProp___ecereNameSpace__ecere__sys__File_Get_input(this) || __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(this)) ? (unsigned int)((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))__ecereClass___ecereNameSpace__ecere__sys__File->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_GetSize])(this) : DualPipe_GetSize(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
435 }
436
437 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Peek(struct __ecereNameSpace__ecere__com__Instance * this)
438 {
439 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
440
441 return DualPipe_Peek(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
442 }
443
444 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Terminate(struct __ecereNameSpace__ecere__com__Instance * this)
445 {
446 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
447
448 DualPipe_Terminate(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
449 }
450
451 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode(struct __ecereNameSpace__ecere__com__Instance * this)
452 {
453 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
454
455 return DualPipe_GetExitCode(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
456 }
457
458 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetProcessID(struct __ecereNameSpace__ecere__com__Instance * this)
459 {
460 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
461
462 return DualPipe_GetProcessID(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
463 }
464
465 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Wait(struct __ecereNameSpace__ecere__com__Instance * this)
466 {
467 struct __ecereNameSpace__ecere__sys__DualPipe * __ecerePointer___ecereNameSpace__ecere__sys__DualPipe = (struct __ecereNameSpace__ecere__sys__DualPipe *)(this ? (((char *)this) + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset) : 0);
468
469 DualPipe_Wait(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
470 }
471
472 extern int vsnprintf(char * , size_t, const char * , __builtin_va_list);
473
474 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, char *  commandLine);
475
476 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenf(unsigned int mode, char * command, ...)
477 {
478 char commandLine[1025];
479 va_list args;
480
481 __builtin_va_start(args, command);
482 vsnprintf(commandLine, sizeof commandLine, command, args);
483 commandLine[sizeof commandLine - 1] = (char)0;
484 __builtin_va_end(args);
485 return __ecereNameSpace__ecere__sys__DualPipeOpen(mode, commandLine);
486 }
487
488 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
489
490 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, char * commandLine)
491 {
492 void * input, * output;
493 void * f = _DualPipeOpen(mode, commandLine, (((void *)0)), &input, &output);
494
495 if(f)
496 return __extension__ ({
497 struct __ecereNameSpace__ecere__com__Instance * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__DualPipe);
498
499 ((struct __ecereNameSpace__ecere__sys__DualPipe *)(((char *)__ecereInstance1 + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset)))->dp = f, __ecereProp___ecereNameSpace__ecere__sys__File_Set_input(__ecereInstance1, input), __ecereProp___ecereNameSpace__ecere__sys__File_Set_output(__ecereInstance1, output), __ecereInstance1;
500 });
501 return (((void *)0));
502 }
503
504 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenEnv(unsigned int mode, char *  env, char *  commandLine);
505
506 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenEnvf(unsigned int mode, char * env, char * command, ...)
507 {
508 char commandLine[1025];
509 va_list args;
510
511 __builtin_va_start(args, command);
512 vsnprintf(commandLine, sizeof commandLine, command, args);
513 commandLine[sizeof commandLine - 1] = (char)0;
514 __builtin_va_end(args);
515 return __ecereNameSpace__ecere__sys__DualPipeOpenEnv(mode, env, commandLine);
516 }
517
518 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenEnv(unsigned int mode, char * env, char * commandLine)
519 {
520 void * input, * output;
521 void * f = _DualPipeOpen(mode, commandLine, env, &input, &output);
522
523 if(f)
524 return __extension__ ({
525 struct __ecereNameSpace__ecere__com__Instance * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__DualPipe);
526
527 ((struct __ecereNameSpace__ecere__sys__DualPipe *)(((char *)__ecereInstance1 + __ecereClass___ecereNameSpace__ecere__sys__DualPipe->offset)))->dp = f, __ecereProp___ecereNameSpace__ecere__sys__File_Set_input(__ecereInstance1, input), __ecereProp___ecereNameSpace__ecere__sys__File_Set_output(__ecereInstance1, output), __ecereInstance1;
528 });
529 return (((void *)0));
530 }
531
532 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);
533
534 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
535
536 struct __ecereNameSpace__ecere__com__NameSpace
537 {
538 char *  name;
539 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
540 struct __ecereNameSpace__ecere__com__NameSpace *  left;
541 struct __ecereNameSpace__ecere__com__NameSpace *  right;
542 int depth;
543 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
544 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
545 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
546 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
547 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
548 } __attribute__ ((gcc_struct));
549
550 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
551
552 struct __ecereNameSpace__ecere__com__Module
553 {
554 struct __ecereNameSpace__ecere__com__Instance * application;
555 struct __ecereNameSpace__ecere__sys__OldList classes;
556 struct __ecereNameSpace__ecere__sys__OldList defines;
557 struct __ecereNameSpace__ecere__sys__OldList functions;
558 struct __ecereNameSpace__ecere__sys__OldList modules;
559 struct __ecereNameSpace__ecere__com__Instance * prev;
560 struct __ecereNameSpace__ecere__com__Instance * next;
561 char *  name;
562 void *  library;
563 void *  Unload;
564 int importType;
565 int origImportType;
566 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
567 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
568 } __attribute__ ((gcc_struct));
569
570 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
571
572 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
573
574 struct __ecereNameSpace__ecere__com__BitMember;
575
576 extern struct __ecereNameSpace__ecere__com__BitMember * __ecereNameSpace__ecere__com__eClass_AddBitMember(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, int bitSize, int bitPos, int declMode);
577
578 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);
579
580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
581
582 struct __ecereNameSpace__ecere__com__GlobalFunction;
583
584 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);
585
586 void __ecereRegisterModule_DualPipe(struct __ecereNameSpace__ecere__com__Instance * module)
587 {
588 struct __ecereNameSpace__ecere__com__Class * class;
589
590 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(2, "ecere::sys::PipeOpenMode", 0, 0, 0, 0, 0, module, 1, 1);
591 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
592 __ecereClass___ecereNameSpace__ecere__sys__PipeOpenMode = class;
593 __ecereNameSpace__ecere__com__eClass_AddBitMember(class, "output", "bool", 1, 0, 1);
594 __ecereNameSpace__ecere__com__eClass_AddBitMember(class, "error", "bool", 1, 1, 1);
595 __ecereNameSpace__ecere__com__eClass_AddBitMember(class, "input", "bool", 1, 2, 1);
596 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "ecere::sys::DualPipe", "ecere::sys::File", sizeof(struct __ecereNameSpace__ecere__sys__DualPipe), 0, 0, __ecereDestructor___ecereNameSpace__ecere__sys__DualPipe, module, 1, 1);
597 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
598 __ecereClass___ecereNameSpace__ecere__sys__DualPipe = class;
599 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Seek", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Seek, 1);
600 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Tell", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Tell, 1);
601 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Read", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Read, 1);
602 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Write", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Write, 1);
603 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Getc", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Getc, 1);
604 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Putc", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Putc, 1);
605 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Puts", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Puts, 1);
606 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Eof", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Eof, 1);
607 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetSize", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetSize, 1);
608 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "CloseInput", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseInput, 1);
609 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "CloseOutput", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseOutput, 1);
610 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetExitCode", "int GetExitCode()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode, 1);
611 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetProcessID", "int GetProcessID()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetProcessID, 1);
612 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Peek", "bool Peek()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Peek, 1);
613 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Terminate", "void Terminate()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Terminate, 1);
614 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Wait", "void Wait()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Wait, 1);
615 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::DualPipeOpenf", "ecere::sys::DualPipe ecere::sys::DualPipeOpenf(ecere::sys::PipeOpenMode mode, char * command, ...)", __ecereNameSpace__ecere__sys__DualPipeOpenf, module, 1);
616 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::DualPipeOpen", "ecere::sys::DualPipe ecere::sys::DualPipeOpen(ecere::sys::PipeOpenMode mode, char * commandLine)", __ecereNameSpace__ecere__sys__DualPipeOpen, module, 1);
617 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::DualPipeOpenEnvf", "ecere::sys::DualPipe ecere::sys::DualPipeOpenEnvf(ecere::sys::PipeOpenMode mode, char * env, char * command, ...)", __ecereNameSpace__ecere__sys__DualPipeOpenEnvf, module, 1);
618 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::sys::DualPipeOpenEnv", "ecere::sys::DualPipe ecere::sys::DualPipeOpenEnv(ecere::sys::PipeOpenMode mode, char * env, char * commandLine)", __ecereNameSpace__ecere__sys__DualPipeOpenEnv, module, 1);
619 }
620
621 void __ecereUnregisterModule_DualPipe(struct __ecereNameSpace__ecere__com__Instance * module)
622 {
623
624 }
625