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