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