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