compiler/libec Improvements to conversion from AST->Type class, and to outputting...
[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 } __attribute__ ((gcc_struct));
132
133 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
134
135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
136
137 struct __ecereNameSpace__ecere__com__Instance
138 {
139 int (* *  _vTbl)();
140 struct __ecereNameSpace__ecere__com__Class * _class;
141 int _refCount;
142 } __attribute__ ((gcc_struct));
143
144 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
145
146 struct __ecereNameSpace__ecere__com__Property
147 {
148 struct __ecereNameSpace__ecere__com__Property * prev;
149 struct __ecereNameSpace__ecere__com__Property * next;
150 char *  name;
151 unsigned int isProperty;
152 int memberAccess;
153 int id;
154 struct __ecereNameSpace__ecere__com__Class * _class;
155 char *  dataTypeString;
156 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
157 struct __ecereNameSpace__ecere__com__Instance * dataType;
158 void (*  Set)(void * , int);
159 int (*  Get)(void * );
160 unsigned int (*  IsSet)(void * );
161 void *  data;
162 void *  symbol;
163 int vid;
164 unsigned int conversion;
165 unsigned int watcherOffset;
166 char *  category;
167 unsigned int compiled;
168 unsigned int selfWatchable;
169 unsigned int isWatchable;
170 } __attribute__ ((gcc_struct));
171
172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
173
174 struct __ecereNameSpace__ecere__com__DataMember
175 {
176 struct __ecereNameSpace__ecere__com__DataMember * prev;
177 struct __ecereNameSpace__ecere__com__DataMember * next;
178 char *  name;
179 unsigned int isProperty;
180 int memberAccess;
181 int id;
182 struct __ecereNameSpace__ecere__com__Class * _class;
183 char *  dataTypeString;
184 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
185 struct __ecereNameSpace__ecere__com__Instance * dataType;
186 int type;
187 int offset;
188 int memberID;
189 struct __ecereNameSpace__ecere__sys__OldList members;
190 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
191 int memberOffset;
192 int structAlignment;
193 } __attribute__ ((gcc_struct));
194
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
196
197 struct __ecereNameSpace__ecere__com__Method
198 {
199 char *  name;
200 struct __ecereNameSpace__ecere__com__Method * parent;
201 struct __ecereNameSpace__ecere__com__Method * left;
202 struct __ecereNameSpace__ecere__com__Method * right;
203 int depth;
204 int (*  function)();
205 int vid;
206 int type;
207 struct __ecereNameSpace__ecere__com__Class * _class;
208 void *  symbol;
209 char *  dataTypeString;
210 struct __ecereNameSpace__ecere__com__Instance * dataType;
211 int memberAccess;
212 } __attribute__ ((gcc_struct));
213
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
215
216 struct __ecereNameSpace__ecere__com__SerialBuffer
217 {
218 unsigned char *  _buffer;
219 unsigned int count;
220 unsigned int _size;
221 unsigned int pos;
222 } __attribute__ ((gcc_struct));
223
224 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
225
226 struct __ecereNameSpace__ecere__com__DataValue
227 {
228 union
229 {
230 char c;
231 unsigned char uc;
232 short s;
233 unsigned short us;
234 int i;
235 unsigned int ui;
236 void *  p;
237 float f;
238 double d;
239 long long i64;
240 uint64 ui64;
241 } __attribute__ ((gcc_struct));
242 } __attribute__ ((gcc_struct));
243
244 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
245
246 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
247 {
248 union
249 {
250 struct
251 {
252 char *  dataTypeString;
253 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
254 } __attribute__ ((gcc_struct));
255 struct __ecereNameSpace__ecere__com__DataValue expression;
256 struct
257 {
258 char *  memberString;
259 union
260 {
261 struct __ecereNameSpace__ecere__com__DataMember * member;
262 struct __ecereNameSpace__ecere__com__Property * prop;
263 struct __ecereNameSpace__ecere__com__Method * method;
264 } __attribute__ ((gcc_struct));
265 } __attribute__ ((gcc_struct));
266 } __attribute__ ((gcc_struct));
267 } __attribute__ ((gcc_struct));
268
269 typedef __builtin_va_list va_list;
270
271 void DualPipe_Destructor(struct __ecereNameSpace__ecere__com__Instance ** dp);
272
273 void DualPipe_CloseInput(struct __ecereNameSpace__ecere__com__Instance ** dp);
274
275 void DualPipe_CloseOutput(struct __ecereNameSpace__ecere__com__Instance ** dp);
276
277 int DualPipe_Read(struct __ecereNameSpace__ecere__com__Instance ** dp, unsigned char * buffer, unsigned int size, unsigned int count);
278
279 int DualPipe_Write(struct __ecereNameSpace__ecere__com__Instance ** dp, unsigned char * buffer, unsigned int size, unsigned int count);
280
281 unsigned int DualPipe_Getc(struct __ecereNameSpace__ecere__com__Instance ** dp, char * ch);
282
283 unsigned int DualPipe_Putc(struct __ecereNameSpace__ecere__com__Instance ** dp, char ch);
284
285 unsigned int DualPipe_Puts(struct __ecereNameSpace__ecere__com__Instance ** dp, char * string);
286
287 unsigned int DualPipe_Seek(struct __ecereNameSpace__ecere__com__Instance ** dp, int pos, int mode);
288
289 unsigned int DualPipe_Tell(struct __ecereNameSpace__ecere__com__Instance ** dp);
290
291 unsigned int DualPipe_Eof(struct __ecereNameSpace__ecere__com__Instance ** dp);
292
293 unsigned int DualPipe_GetSize(struct __ecereNameSpace__ecere__com__Instance ** dp);
294
295 unsigned int DualPipe_Peek(struct __ecereNameSpace__ecere__com__Instance ** dp);
296
297 void DualPipe_Terminate(struct __ecereNameSpace__ecere__com__Instance ** dp);
298
299 int DualPipe_GetExitCode(struct __ecereNameSpace__ecere__com__Instance ** dp);
300
301 int DualPipe_GetProcessID(struct __ecereNameSpace__ecere__com__Instance ** dp);
302
303 void DualPipe_Wait(struct __ecereNameSpace__ecere__com__Instance ** dp);
304
305 struct __ecereNameSpace__ecere__com__Instance ** _DualPipeOpen(unsigned int mode, char * commandLine, char * env, void ** inputPtr, void ** outputPtr);
306
307 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__PipeOpenMode;
308
309 struct __ecereNameSpace__ecere__sys__DualPipe
310 {
311 void * dp;
312 } __attribute__ ((gcc_struct));
313
314 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__DualPipe;
315
316 void __ecereDestructor___ecereNameSpace__ecere__sys__DualPipe(struct __ecereNameSpace__ecere__com__Instance * this)
317 {
318 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);
319
320 {
321 DualPipe_Destructor(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
322 }
323 }
324
325 void *  __ecereProp___ecereNameSpace__ecere__sys__File_Get_input(struct __ecereNameSpace__ecere__com__Instance * this);
326
327 void __ecereProp___ecereNameSpace__ecere__sys__File_Set_input(struct __ecereNameSpace__ecere__com__Instance * this, void *  value);
328
329 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__File_input;
330
331 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_CloseInput;
332
333 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
334
335 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseInput(struct __ecereNameSpace__ecere__com__Instance * this)
336 {
337 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);
338
339 (__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);
340 }
341
342 void *  __ecereProp___ecereNameSpace__ecere__sys__File_Get_output(struct __ecereNameSpace__ecere__com__Instance * this);
343
344 void __ecereProp___ecereNameSpace__ecere__sys__File_Set_output(struct __ecereNameSpace__ecere__com__Instance * this, void *  value);
345
346 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__File_output;
347
348 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_CloseOutput;
349
350 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseOutput(struct __ecereNameSpace__ecere__com__Instance * this)
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 (__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);
355 }
356
357 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Read(struct __ecereNameSpace__ecere__com__Instance * this, unsigned char * buffer, unsigned int size, unsigned int count)
358 {
359 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);
360
361 return DualPipe_Read(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp, buffer, size, count);
362 }
363
364 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
365
366 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Write(struct __ecereNameSpace__ecere__com__Instance * this, unsigned char * buffer, unsigned int size, unsigned int count)
367 {
368 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);
369
370 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);
371 }
372
373 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Getc;
374
375 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Getc(struct __ecereNameSpace__ecere__com__Instance * this, char * ch)
376 {
377 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);
378
379 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);
380 }
381
382 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Putc;
383
384 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Putc(struct __ecereNameSpace__ecere__com__Instance * this, char ch)
385 {
386 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);
387
388 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);
389 }
390
391 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Puts;
392
393 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__File_Flush(struct __ecereNameSpace__ecere__com__Instance * this);
394
395 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Puts(struct __ecereNameSpace__ecere__com__Instance * this, char * string)
396 {
397 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);
398
399 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);
400 }
401
402 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
403
404 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Seek(struct __ecereNameSpace__ecere__com__Instance * this, int pos, int mode)
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 (__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);
409 }
410
411 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Tell;
412
413 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Tell(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 (*)(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);
418 }
419
420 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Eof(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_Eof(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
425 }
426
427 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_GetSize;
428
429 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetSize(struct __ecereNameSpace__ecere__com__Instance * this)
430 {
431 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);
432
433 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);
434 }
435
436 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Peek(struct __ecereNameSpace__ecere__com__Instance * this)
437 {
438 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);
439
440 return DualPipe_Peek(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
441 }
442
443 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Terminate(struct __ecereNameSpace__ecere__com__Instance * this)
444 {
445 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);
446
447 DualPipe_Terminate(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
448 }
449
450 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode(struct __ecereNameSpace__ecere__com__Instance * this)
451 {
452 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);
453
454 return DualPipe_GetExitCode(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
455 }
456
457 int __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetProcessID(struct __ecereNameSpace__ecere__com__Instance * this)
458 {
459 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);
460
461 return DualPipe_GetProcessID(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
462 }
463
464 void __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Wait(struct __ecereNameSpace__ecere__com__Instance * this)
465 {
466 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);
467
468 DualPipe_Wait(__ecerePointer___ecereNameSpace__ecere__sys__DualPipe->dp);
469 }
470
471 extern int vsnprintf(char * , size_t, const char * , __builtin_va_list);
472
473 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, char *  commandLine);
474
475 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenf(unsigned int mode, char * command, ...)
476 {
477 char commandLine[1025];
478 va_list args;
479
480 __builtin_va_start(args, command);
481 vsnprintf(commandLine, sizeof commandLine, command, args);
482 commandLine[sizeof commandLine - 1] = (char)0;
483 __builtin_va_end(args);
484 return __ecereNameSpace__ecere__sys__DualPipeOpen(mode, commandLine);
485 }
486
487 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
488
489 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, char * commandLine)
490 {
491 void * input, * output;
492 void * f = _DualPipeOpen(mode, commandLine, (((void *)0)), &input, &output);
493
494 if(f)
495 return __extension__ ({
496 struct __ecereNameSpace__ecere__com__Instance * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__DualPipe);
497
498 ((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;
499 });
500 return (((void *)0));
501 }
502
503 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenEnv(unsigned int mode, char *  env, char *  commandLine);
504
505 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenEnvf(unsigned int mode, char * env, char * command, ...)
506 {
507 char commandLine[1025];
508 va_list args;
509
510 __builtin_va_start(args, command);
511 vsnprintf(commandLine, sizeof commandLine, command, args);
512 commandLine[sizeof commandLine - 1] = (char)0;
513 __builtin_va_end(args);
514 return __ecereNameSpace__ecere__sys__DualPipeOpenEnv(mode, env, commandLine);
515 }
516
517 struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpenEnv(unsigned int mode, char * env, char * commandLine)
518 {
519 void * input, * output;
520 void * f = _DualPipeOpen(mode, commandLine, env, &input, &output);
521
522 if(f)
523 return __extension__ ({
524 struct __ecereNameSpace__ecere__com__Instance * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__DualPipe);
525
526 ((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;
527 });
528 return (((void *)0));
529 }
530
531 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);
532
533 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
534
535 struct __ecereNameSpace__ecere__com__NameSpace
536 {
537 char *  name;
538 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
539 struct __ecereNameSpace__ecere__com__NameSpace *  left;
540 struct __ecereNameSpace__ecere__com__NameSpace *  right;
541 int depth;
542 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
543 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
544 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
545 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
546 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
547 } __attribute__ ((gcc_struct));
548
549 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
550
551 struct __ecereNameSpace__ecere__com__Module
552 {
553 struct __ecereNameSpace__ecere__com__Instance * application;
554 struct __ecereNameSpace__ecere__sys__OldList classes;
555 struct __ecereNameSpace__ecere__sys__OldList defines;
556 struct __ecereNameSpace__ecere__sys__OldList functions;
557 struct __ecereNameSpace__ecere__sys__OldList modules;
558 struct __ecereNameSpace__ecere__com__Instance * prev;
559 struct __ecereNameSpace__ecere__com__Instance * next;
560 char *  name;
561 void *  library;
562 void *  Unload;
563 int importType;
564 int origImportType;
565 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
566 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
567 } __attribute__ ((gcc_struct));
568
569 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
570
571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
572
573 struct __ecereNameSpace__ecere__com__BitMember;
574
575 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);
576
577 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);
578
579 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
580
581 struct __ecereNameSpace__ecere__com__GlobalFunction;
582
583 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);
584
585 void __ecereRegisterModule_DualPipe(struct __ecereNameSpace__ecere__com__Instance * module)
586 {
587 struct __ecereNameSpace__ecere__com__Class * class;
588
589 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(2, "ecere::sys::PipeOpenMode", 0, 0, 0, 0, 0, module, 1, 1);
590 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
591 __ecereClass___ecereNameSpace__ecere__sys__PipeOpenMode = class;
592 __ecereNameSpace__ecere__com__eClass_AddBitMember(class, "output", "bool", 1, 0, 1);
593 __ecereNameSpace__ecere__com__eClass_AddBitMember(class, "error", "bool", 1, 1, 1);
594 __ecereNameSpace__ecere__com__eClass_AddBitMember(class, "input", "bool", 1, 2, 1);
595 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);
596 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
597 __ecereClass___ecereNameSpace__ecere__sys__DualPipe = class;
598 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Seek", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Seek, 1);
599 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Tell", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Tell, 1);
600 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Read", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Read, 1);
601 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Write", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Write, 1);
602 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Getc", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Getc, 1);
603 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Putc", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Putc, 1);
604 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Puts", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Puts, 1);
605 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Eof", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Eof, 1);
606 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetSize", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetSize, 1);
607 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "CloseInput", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseInput, 1);
608 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "CloseOutput", 0, __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_CloseOutput, 1);
609 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetExitCode", "int GetExitCode()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode, 1);
610 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "GetProcessID", "int GetProcessID()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetProcessID, 1);
611 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Peek", "bool Peek()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Peek, 1);
612 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Terminate", "void Terminate()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Terminate, 1);
613 __ecereNameSpace__ecere__com__eClass_AddMethod(class, "Wait", "void Wait()", __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_Wait, 1);
614 __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);
615 __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);
616 __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);
617 __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);
618 }
619
620 void __ecereUnregisterModule_DualPipe(struct __ecereNameSpace__ecere__com__Instance * module)
621 {
622
623 }
624