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