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