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