lib: remove exec::kill and exec::term
[nit.git] / c_src / exec._sep.c
1 /* This C file is generated by NIT to compile module exec. */
2 #include "exec._sep.h"
3 val_t exec___Process___id(val_t self) {
4 struct trace_t trace = {NULL, NULL, 23, LOCATE_exec___Process___id};
5 val_t variable[3];
6 struct WBT_ **closurevariable = NULL;
7 trace.prev = tracehead; tracehead = &trace;
8 trace.file = LOCATE_exec;
9 /* Register variable[0]: Local variable */
10 variable[0] = self;
11 /* Register variable[1]: Method return value and escape marker */
12 /* Register variable[2]: Result */
13 variable[2] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
14 /* Register variable[2]: Result */
15 variable[2] = CALL_exec___NativeProcess___id(variable[2])(variable[2]) /*NativeProcess::id*/;
16 variable[1] = variable[2];
17 goto return_label0;
18 return_label0: while(false);
19 tracehead = trace.prev;
20 return variable[1];
21 }
22 val_t exec___Process___is_finished(val_t self) {
23 struct trace_t trace = {NULL, NULL, 26, LOCATE_exec___Process___is_finished};
24 val_t variable[3];
25 struct WBT_ **closurevariable = NULL;
26 trace.prev = tracehead; tracehead = &trace;
27 trace.file = LOCATE_exec;
28 /* Register variable[0]: Local variable */
29 variable[0] = self;
30 /* Register variable[1]: Method return value and escape marker */
31 /* Register variable[2]: Result */
32 variable[2] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
33 /* Register variable[2]: Result */
34 variable[2] = CALL_exec___NativeProcess___is_finished(variable[2])(variable[2]) /*NativeProcess::is_finished*/;
35 variable[1] = variable[2];
36 goto return_label1;
37 return_label1: while(false);
38 tracehead = trace.prev;
39 return variable[1];
40 }
41 void exec___Process___wait(val_t self) {
42 struct trace_t trace = {NULL, NULL, 29, LOCATE_exec___Process___wait};
43 val_t variable[3];
44 struct WBT_ **closurevariable = NULL;
45 trace.prev = tracehead; tracehead = &trace;
46 trace.file = LOCATE_exec;
47 /* Register variable[0]: Local variable */
48 variable[0] = self;
49 /* Register variable[1]: Method return value and escape marker */
50 /* Register variable[2]: Result */
51 variable[2] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
52 CALL_exec___NativeProcess___wait(variable[2])(variable[2]) /*NativeProcess::wait*/;
53 /* Register variable[2]: Result */
54 variable[2] = CALL_exec___Process___is_finished(variable[0])(variable[0]) /*Process::is_finished*/;
55 if (!UNTAG_Bool(variable[2])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_exec___Process___wait, LOCATE_exec, 33); nit_exit(1);}
56 return_label2: while(false);
57 tracehead = trace.prev;
58 return;
59 }
60 val_t exec___Process___status(val_t self) {
61 struct trace_t trace = {NULL, NULL, 36, LOCATE_exec___Process___status};
62 val_t variable[3];
63 struct WBT_ **closurevariable = NULL;
64 trace.prev = tracehead; tracehead = &trace;
65 trace.file = LOCATE_exec;
66 /* Register variable[0]: Local variable */
67 variable[0] = self;
68 /* Register variable[1]: Method return value and escape marker */
69 /* Register variable[2]: Result */
70 variable[2] = CALL_exec___Process___is_finished(variable[0])(variable[0]) /*Process::is_finished*/;
71 if (!UNTAG_Bool(variable[2])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_exec___Process___status, LOCATE_exec, 39); nit_exit(1);}
72 /* Register variable[2]: Result */
73 variable[2] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
74 /* Register variable[2]: Result */
75 variable[2] = CALL_exec___NativeProcess___status(variable[2])(variable[2]) /*NativeProcess::status*/;
76 variable[1] = variable[2];
77 goto return_label3;
78 return_label3: while(false);
79 tracehead = trace.prev;
80 return variable[1];
81 }
82 void exec___Process___kill(val_t self, val_t param0) {
83 struct trace_t trace = {NULL, NULL, 43, LOCATE_exec___Process___kill};
84 val_t variable[4];
85 struct WBT_ **closurevariable = NULL;
86 trace.prev = tracehead; tracehead = &trace;
87 trace.file = LOCATE_exec;
88 /* Register variable[0]: Local variable */
89 variable[0] = self;
90 /* Register variable[1]: Local variable */
91 variable[1] = param0;
92 /* Register variable[2]: Method return value and escape marker */
93 /* Register variable[3]: Result */
94 variable[3] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
95 CALL_exec___NativeProcess___kill(variable[3])(variable[3], variable[1] /*signal*/) /*NativeProcess::kill*/;
96 return_label4: while(false);
97 tracehead = trace.prev;
98 return;
99 }
100 void exec___Process___term(val_t self) {
101 struct trace_t trace = {NULL, NULL, 46, LOCATE_exec___Process___term};
102 val_t variable[2];
103 struct WBT_ **closurevariable = NULL;
104 trace.prev = tracehead; tracehead = &trace;
105 trace.file = LOCATE_exec;
106 /* Register variable[0]: Local variable */
107 variable[0] = self;
108 /* Register variable[1]: Method return value and escape marker */
109 CALL_exec___Process___kill(variable[0])(variable[0], TAG_Int(15)) /*Process::kill*/;
110 return_label5: while(false);
111 tracehead = trace.prev;
112 return;
113 }
114 void exec___Process___init(val_t self, val_t param0, val_t param1, int* init_table) {
115 struct trace_t trace = {NULL, NULL, 49, LOCATE_exec___Process___init};
116 val_t variable[4];
117 struct WBT_ **closurevariable = NULL;
118 trace.prev = tracehead; tracehead = &trace;
119 trace.file = LOCATE_exec;
120 /* Register variable[0]: Local variable */
121 variable[0] = self;
122 /* Register variable[1]: Local variable */
123 variable[1] = param0;
124 /* Register variable[2]: Local variable */
125 /* check if p<Array[String] with p:String */
126 if (( param1!=NIT_NULL) && !VAL_ISA( param1, COLOR_Array, ID_Array)) { fprintf(stderr, "Cast failled"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_exec___Process___init, LOCATE_exec, 50); nit_exit(1); } /*cast Array[String]*/;
127 variable[2] = param1;
128 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_Process].i]) return;
129 /* Register variable[3]: Method return value and escape marker */
130 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, variable[2] /*arguments*/, TAG_Int(0), init_table /*YYY*/) /*Process::execute*/;
131 return_label6: while(false);
132 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_Process].i] = 1;
133 tracehead = trace.prev;
134 return;
135 }
136 void exec___Process___init_(val_t self, val_t param0, int* init_table) {
137 struct trace_t trace = {NULL, NULL, 55, LOCATE_exec___Process___init_};
138 val_t variable[3];
139 struct WBT_ **closurevariable = NULL;
140 trace.prev = tracehead; tracehead = &trace;
141 trace.file = LOCATE_exec;
142 /* Register variable[0]: Local variable */
143 variable[0] = self;
144 /* Register variable[1]: Local variable */
145 variable[1] = param0;
146 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_Process].i]) return;
147 /* Register variable[2]: Method return value and escape marker */
148 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, NIT_NULL /*null*/, TAG_Int(0), init_table /*YYY*/) /*Process::execute*/;
149 return_label7: while(false);
150 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_Process].i] = 1;
151 tracehead = trace.prev;
152 return;
153 }
154 void exec___Process___execute(val_t self, val_t param0, val_t param1, val_t param2, int* init_table) {
155 struct trace_t trace = {NULL, NULL, 61, LOCATE_exec___Process___execute};
156 val_t variable[10];
157 struct WBT_ **closurevariable = NULL;
158 trace.prev = tracehead; tracehead = &trace;
159 trace.file = LOCATE_exec;
160 /* Register variable[0]: Local variable */
161 variable[0] = self;
162 /* Register variable[1]: Local variable */
163 variable[1] = param0;
164 /* Register variable[2]: Local variable */
165 variable[2] = param1;
166 /* Register variable[3]: Local variable */
167 variable[3] = param2;
168 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_Process].i]) return;
169 /* Register variable[4]: Method return value and escape marker */
170 /* Register variable[5]: Local variable */
171 /* Register variable[6]: Result */
172 variable[6] = NEW_Buffer_string___Buffer___init() /*new Buffer*/;
173 variable[5] = variable[6];
174 /* Register variable[6]: Local variable */
175 variable[6] = TAG_Int(1);
176 CALL_abstract_collection___IndexedCollection___append( variable[5] /*args*/)( variable[5] /*args*/, variable[1] /*command*/) /*Buffer::append*/;
177 /* Register variable[7]: Result */
178 variable[7] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[2] /*arguments*/ == NIT_NULL /*null*/) || (( variable[2] /*arguments*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[2] /*arguments*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[2] /*arguments*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[2] /*arguments*/)( variable[2] /*arguments*/, NIT_NULL /*null*/) /*Object::==*/)))))));
179 if (UNTAG_Bool(variable[7])) { /*if*/
180 /* Register variable[7]: For iterator */
181 variable[7] = CALL_abstract_collection___Collection___iterator( variable[2] /*arguments*/)( variable[2] /*arguments*/) /*AbstractArrayRead::iterator*/;
182 while (true) { /*for*/
183 /* Register variable[8]: For 'is_ok' result */
184 variable[8] = CALL_abstract_collection___Iterator___is_ok(variable[7])(variable[7]) /*ArrayIterator::is_ok*/;
185 if (!UNTAG_Bool(variable[8])) break; /*for*/
186 variable[8] = CALL_abstract_collection___Iterator___item(variable[7])(variable[7]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
187 /* Register variable[9]: Local variable */
188 variable[9] = variable[8];
189 CALL_abstract_collection___SimpleCollection___add( variable[5] /*args*/)( variable[5] /*args*/, TAG_Char('\0')) /*Buffer::add*/;
190 CALL_abstract_collection___IndexedCollection___append( variable[5] /*args*/)( variable[5] /*args*/, variable[9] /*a*/) /*Buffer::append*/;
191 continue_9: while(0);
192 CALL_abstract_collection___Iterator___next(variable[7])(variable[7]) /*ArrayIterator::next*/;
193 }
194 break_9: while(0);
195 /* Register variable[7]: Result */
196 variable[7] = CALL_abstract_collection___Collection___length( variable[2] /*arguments*/)( variable[2] /*arguments*/) /*AbstractArrayRead::length*/;
197 variable[6] = TAG_Int(UNTAG_Int(variable[6])+UNTAG_Int(variable[7])) /*l*/;
198 }
199 /* Register variable[7]: Result */
200 variable[7] = CALL_string___String___to_cstring( variable[1] /*command*/)( variable[1] /*command*/) /*String::to_cstring*/;
201 /* Register variable[8]: Result */
202 variable[8] = CALL_string___Object___to_s( variable[5] /*args*/)( variable[5] /*args*/) /*Buffer::to_s*/;
203 /* Register variable[8]: Result */
204 variable[8] = CALL_string___String___to_cstring(variable[8])(variable[8]) /*String::to_cstring*/;
205 /* Register variable[7]: Result */
206 variable[7] = CALL_exec___Process___basic_exec_execute(variable[0])(variable[0], variable[7], variable[8], variable[6] /*l*/, variable[3] /*pipeflags*/) /*Process::basic_exec_execute*/;
207 ATTR_exec___Process____data(variable[0]) /*Process::_data*/ = variable[7];
208 return_label8: while(false);
209 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_Process].i] = 1;
210 tracehead = trace.prev;
211 return;
212 }
213 val_t exec___Process___basic_exec_execute(val_t self, val_t param0, val_t param1, val_t param2, val_t param3) {
214 struct trace_t trace = {NULL, NULL, 78, LOCATE_exec___Process___basic_exec_execute};
215 val_t *variable = NULL;
216 struct WBT_ **closurevariable = NULL;
217 trace.prev = tracehead; tracehead = &trace;
218 trace.file = LOCATE_exec;
219 tracehead = trace.prev;
220 return BOX_NativeProcess(exec_Process_Process_basic_exec_execute_4( self, UNBOX_NativeString( param0), UNBOX_NativeString( param1), UNTAG_Int( param2), UNTAG_Int( param3)));
221 }
222 void exec___IProcess___close(val_t self) {
223 struct trace_t trace = {NULL, NULL, 87, LOCATE_exec___IProcess___close};
224 val_t variable[3];
225 struct WBT_ **closurevariable = NULL;
226 trace.prev = tracehead; tracehead = &trace;
227 trace.file = LOCATE_exec;
228 /* Register variable[0]: Local variable */
229 variable[0] = self;
230 /* Register variable[1]: Method return value and escape marker */
231 /* Register variable[2]: Result */
232 variable[2] = ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/;
233 CALL_stream___IOS___close(variable[2])(variable[2]) /*FDStream::close*/;
234 return_label10: while(false);
235 tracehead = trace.prev;
236 return;
237 }
238 val_t exec___IProcess___read_char(val_t self) {
239 struct trace_t trace = {NULL, NULL, 89, LOCATE_exec___IProcess___read_char};
240 val_t variable[3];
241 struct WBT_ **closurevariable = NULL;
242 trace.prev = tracehead; tracehead = &trace;
243 trace.file = LOCATE_exec;
244 /* Register variable[0]: Local variable */
245 variable[0] = self;
246 /* Register variable[1]: Method return value and escape marker */
247 /* Register variable[2]: Result */
248 variable[2] = ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/;
249 /* Register variable[2]: Result */
250 variable[2] = CALL_stream___IStream___read_char(variable[2])(variable[2]) /*FDIStream::read_char*/;
251 variable[1] = variable[2];
252 goto return_label11;
253 return_label11: while(false);
254 tracehead = trace.prev;
255 return variable[1];
256 }
257 val_t exec___IProcess___eof(val_t self) {
258 struct trace_t trace = {NULL, NULL, 91, LOCATE_exec___IProcess___eof};
259 val_t variable[3];
260 struct WBT_ **closurevariable = NULL;
261 trace.prev = tracehead; tracehead = &trace;
262 trace.file = LOCATE_exec;
263 /* Register variable[0]: Local variable */
264 variable[0] = self;
265 /* Register variable[1]: Method return value and escape marker */
266 /* Register variable[2]: Result */
267 variable[2] = ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/;
268 /* Register variable[2]: Result */
269 variable[2] = CALL_stream___IStream___eof(variable[2])(variable[2]) /*FDIStream::eof*/;
270 variable[1] = variable[2];
271 goto return_label12;
272 return_label12: while(false);
273 tracehead = trace.prev;
274 return variable[1];
275 }
276 void exec___IProcess___init(val_t self, val_t param0, val_t param1, int* init_table) {
277 struct trace_t trace = {NULL, NULL, 93, LOCATE_exec___IProcess___init};
278 val_t variable[5];
279 struct WBT_ **closurevariable = NULL;
280 trace.prev = tracehead; tracehead = &trace;
281 trace.file = LOCATE_exec;
282 /* Register variable[0]: Local variable */
283 variable[0] = self;
284 /* Register variable[1]: Local variable */
285 variable[1] = param0;
286 /* Register variable[2]: Local variable */
287 /* check if p<Array[String] with p:String */
288 if (( param1!=NIT_NULL) && !VAL_ISA( param1, COLOR_Array, ID_Array)) { fprintf(stderr, "Cast failled"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_exec___IProcess___init, LOCATE_exec, 93); nit_exit(1); } /*cast Array[String]*/;
289 variable[2] = param1;
290 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IProcess].i]) return;
291 /* Register variable[3]: Method return value and escape marker */
292 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, variable[2] /*arguments*/, TAG_Int(2), init_table /*YYY*/) /*Process::execute*/;
293 /* Register variable[4]: Result */
294 variable[4] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
295 /* Register variable[4]: Result */
296 variable[4] = CALL_exec___NativeProcess___out_fd(variable[4])(variable[4]) /*NativeProcess::out_fd*/;
297 /* Register variable[4]: Result */
298 variable[4] = NEW_FDIStream_stream___FDIStream___init(variable[4]) /*new FDIStream*/;
299 ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/ = variable[4];
300 return_label13: while(false);
301 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IProcess].i] = 1;
302 tracehead = trace.prev;
303 return;
304 }
305 void exec___IProcess___init_(val_t self, val_t param0, int* init_table) {
306 struct trace_t trace = {NULL, NULL, 99, LOCATE_exec___IProcess___init_};
307 val_t variable[4];
308 struct WBT_ **closurevariable = NULL;
309 trace.prev = tracehead; tracehead = &trace;
310 trace.file = LOCATE_exec;
311 /* Register variable[0]: Local variable */
312 variable[0] = self;
313 /* Register variable[1]: Local variable */
314 variable[1] = param0;
315 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IProcess].i]) return;
316 /* Register variable[2]: Method return value and escape marker */
317 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, NIT_NULL /*null*/, TAG_Int(2), init_table /*YYY*/) /*Process::execute*/;
318 /* Register variable[3]: Result */
319 variable[3] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
320 /* Register variable[3]: Result */
321 variable[3] = CALL_exec___NativeProcess___out_fd(variable[3])(variable[3]) /*NativeProcess::out_fd*/;
322 /* Register variable[3]: Result */
323 variable[3] = NEW_FDIStream_stream___FDIStream___init(variable[3]) /*new FDIStream*/;
324 ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/ = variable[3];
325 return_label14: while(false);
326 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IProcess].i] = 1;
327 tracehead = trace.prev;
328 return;
329 }
330 void exec___OProcess___close(val_t self) {
331 struct trace_t trace = {NULL, NULL, 112, LOCATE_exec___OProcess___close};
332 val_t variable[3];
333 struct WBT_ **closurevariable = NULL;
334 trace.prev = tracehead; tracehead = &trace;
335 trace.file = LOCATE_exec;
336 /* Register variable[0]: Local variable */
337 variable[0] = self;
338 /* Register variable[1]: Method return value and escape marker */
339 /* Register variable[2]: Result */
340 variable[2] = ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/;
341 CALL_stream___IOS___close(variable[2])(variable[2]) /*IOS::close*/;
342 return_label15: while(false);
343 tracehead = trace.prev;
344 return;
345 }
346 void exec___OProcess___write(val_t self, val_t param0) {
347 struct trace_t trace = {NULL, NULL, 116, LOCATE_exec___OProcess___write};
348 val_t variable[4];
349 struct WBT_ **closurevariable = NULL;
350 trace.prev = tracehead; tracehead = &trace;
351 trace.file = LOCATE_exec;
352 /* Register variable[0]: Local variable */
353 variable[0] = self;
354 /* Register variable[1]: Local variable */
355 variable[1] = param0;
356 /* Register variable[2]: Method return value and escape marker */
357 /* Register variable[3]: Result */
358 variable[3] = ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/;
359 CALL_stream___OStream___write(variable[3])(variable[3], variable[1] /*s*/) /*OStream::write*/;
360 return_label16: while(false);
361 tracehead = trace.prev;
362 return;
363 }
364 val_t exec___OProcess___is_writable(val_t self) {
365 struct trace_t trace = {NULL, NULL, 114, LOCATE_exec___OProcess___is_writable};
366 val_t variable[3];
367 struct WBT_ **closurevariable = NULL;
368 trace.prev = tracehead; tracehead = &trace;
369 trace.file = LOCATE_exec;
370 /* Register variable[0]: Local variable */
371 variable[0] = self;
372 /* Register variable[1]: Method return value and escape marker */
373 /* Register variable[2]: Result */
374 variable[2] = ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/;
375 /* Register variable[2]: Result */
376 variable[2] = CALL_stream___OStream___is_writable(variable[2])(variable[2]) /*OStream::is_writable*/;
377 variable[1] = variable[2];
378 goto return_label17;
379 return_label17: while(false);
380 tracehead = trace.prev;
381 return variable[1];
382 }
383 void exec___OProcess___init(val_t self, val_t param0, val_t param1, int* init_table) {
384 struct trace_t trace = {NULL, NULL, 118, LOCATE_exec___OProcess___init};
385 val_t variable[5];
386 struct WBT_ **closurevariable = NULL;
387 trace.prev = tracehead; tracehead = &trace;
388 trace.file = LOCATE_exec;
389 /* Register variable[0]: Local variable */
390 variable[0] = self;
391 /* Register variable[1]: Local variable */
392 variable[1] = param0;
393 /* Register variable[2]: Local variable */
394 /* check if p<Array[String] with p:String */
395 if (( param1!=NIT_NULL) && !VAL_ISA( param1, COLOR_Array, ID_Array)) { fprintf(stderr, "Cast failled"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_exec___OProcess___init, LOCATE_exec, 118); nit_exit(1); } /*cast Array[String]*/;
396 variable[2] = param1;
397 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_OProcess].i]) return;
398 /* Register variable[3]: Method return value and escape marker */
399 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, variable[2] /*arguments*/, TAG_Int(1), init_table /*YYY*/) /*Process::execute*/;
400 /* Register variable[4]: Result */
401 variable[4] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
402 /* Register variable[4]: Result */
403 variable[4] = CALL_exec___NativeProcess___in_fd(variable[4])(variable[4]) /*NativeProcess::in_fd*/;
404 /* Register variable[4]: Result */
405 variable[4] = NEW_FDOStream_stream___FDOStream___init(variable[4]) /*new FDOStream*/;
406 ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/ = variable[4];
407 return_label18: while(false);
408 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_OProcess].i] = 1;
409 tracehead = trace.prev;
410 return;
411 }
412 void exec___OProcess___init_(val_t self, val_t param0, int* init_table) {
413 struct trace_t trace = {NULL, NULL, 124, LOCATE_exec___OProcess___init_};
414 val_t variable[4];
415 struct WBT_ **closurevariable = NULL;
416 trace.prev = tracehead; tracehead = &trace;
417 trace.file = LOCATE_exec;
418 /* Register variable[0]: Local variable */
419 variable[0] = self;
420 /* Register variable[1]: Local variable */
421 variable[1] = param0;
422 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_OProcess].i]) return;
423 /* Register variable[2]: Method return value and escape marker */
424 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, NIT_NULL /*null*/, TAG_Int(1), init_table /*YYY*/) /*Process::execute*/;
425 /* Register variable[3]: Result */
426 variable[3] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
427 /* Register variable[3]: Result */
428 variable[3] = CALL_exec___NativeProcess___in_fd(variable[3])(variable[3]) /*NativeProcess::in_fd*/;
429 /* Register variable[3]: Result */
430 variable[3] = NEW_FDOStream_stream___FDOStream___init(variable[3]) /*new FDOStream*/;
431 ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/ = variable[3];
432 return_label19: while(false);
433 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_OProcess].i] = 1;
434 tracehead = trace.prev;
435 return;
436 }
437 void exec___IOProcess___close(val_t self) {
438 struct trace_t trace = {NULL, NULL, 137, LOCATE_exec___IOProcess___close};
439 val_t variable[3];
440 struct WBT_ **closurevariable = NULL;
441 trace.prev = tracehead; tracehead = &trace;
442 trace.file = LOCATE_exec;
443 /* Register variable[0]: Local variable */
444 variable[0] = self;
445 /* Register variable[1]: Method return value and escape marker */
446 /* Register variable[2]: Result */
447 variable[2] = ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/;
448 CALL_stream___IOS___close(variable[2])(variable[2]) /*FDStream::close*/;
449 /* Register variable[2]: Result */
450 variable[2] = ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/;
451 CALL_stream___IOS___close(variable[2])(variable[2]) /*IOS::close*/;
452 return_label20: while(false);
453 tracehead = trace.prev;
454 return;
455 }
456 void exec___IOProcess___init(val_t self, val_t param0, val_t param1, int* init_table) {
457 struct trace_t trace = {NULL, NULL, 143, LOCATE_exec___IOProcess___init};
458 val_t variable[5];
459 struct WBT_ **closurevariable = NULL;
460 trace.prev = tracehead; tracehead = &trace;
461 trace.file = LOCATE_exec;
462 /* Register variable[0]: Local variable */
463 variable[0] = self;
464 /* Register variable[1]: Local variable */
465 variable[1] = param0;
466 /* Register variable[2]: Local variable */
467 /* check if p<Array[String] with p:String */
468 if (( param1!=NIT_NULL) && !VAL_ISA( param1, COLOR_Array, ID_Array)) { fprintf(stderr, "Cast failled"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_exec___IOProcess___init, LOCATE_exec, 143); nit_exit(1); } /*cast Array[String]*/;
469 variable[2] = param1;
470 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IOProcess].i]) return;
471 /* Register variable[3]: Method return value and escape marker */
472 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, variable[2] /*arguments*/, TAG_Int(3), init_table /*YYY*/) /*Process::execute*/;
473 CALL_exec___IProcess___init(variable[0])(variable[0], variable[1], variable[2], init_table /*YYY*/) /*IProcess::init*/;
474 CALL_exec___OProcess___init(variable[0])(variable[0], variable[1], variable[2], init_table /*YYY*/) /*OProcess::init*/;
475 /* Register variable[4]: Result */
476 variable[4] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
477 /* Register variable[4]: Result */
478 variable[4] = CALL_exec___NativeProcess___out_fd(variable[4])(variable[4]) /*NativeProcess::out_fd*/;
479 /* Register variable[4]: Result */
480 variable[4] = NEW_FDIStream_stream___FDIStream___init(variable[4]) /*new FDIStream*/;
481 ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/ = variable[4];
482 /* Register variable[4]: Result */
483 variable[4] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
484 /* Register variable[4]: Result */
485 variable[4] = CALL_exec___NativeProcess___in_fd(variable[4])(variable[4]) /*NativeProcess::in_fd*/;
486 /* Register variable[4]: Result */
487 variable[4] = NEW_FDOStream_stream___FDOStream___init(variable[4]) /*new FDOStream*/;
488 ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/ = variable[4];
489 return_label21: while(false);
490 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IOProcess].i] = 1;
491 tracehead = trace.prev;
492 return;
493 }
494 void exec___IOProcess___init_(val_t self, val_t param0, int* init_table) {
495 struct trace_t trace = {NULL, NULL, 150, LOCATE_exec___IOProcess___init_};
496 val_t variable[4];
497 struct WBT_ **closurevariable = NULL;
498 trace.prev = tracehead; tracehead = &trace;
499 trace.file = LOCATE_exec;
500 /* Register variable[0]: Local variable */
501 variable[0] = self;
502 /* Register variable[1]: Local variable */
503 variable[1] = param0;
504 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IOProcess].i]) return;
505 /* Register variable[2]: Method return value and escape marker */
506 CALL_exec___Process___execute(variable[0])(variable[0], variable[1] /*command*/, NIT_NULL /*null*/, TAG_Int(3), init_table /*YYY*/) /*Process::execute*/;
507 CALL_exec___IProcess___init_(variable[0])(variable[0], variable[1], init_table /*YYY*/) /*IProcess::init_*/;
508 CALL_exec___OProcess___init_(variable[0])(variable[0], variable[1], init_table /*YYY*/) /*OProcess::init_*/;
509 /* Register variable[3]: Result */
510 variable[3] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
511 /* Register variable[3]: Result */
512 variable[3] = CALL_exec___NativeProcess___out_fd(variable[3])(variable[3]) /*NativeProcess::out_fd*/;
513 /* Register variable[3]: Result */
514 variable[3] = NEW_FDIStream_stream___FDIStream___init(variable[3]) /*new FDIStream*/;
515 ATTR_exec___IProcess____in(variable[0]) /*IProcess::_in*/ = variable[3];
516 /* Register variable[3]: Result */
517 variable[3] = ATTR_exec___Process____data(variable[0]) /*Process::_data*/;
518 /* Register variable[3]: Result */
519 variable[3] = CALL_exec___NativeProcess___in_fd(variable[3])(variable[3]) /*NativeProcess::in_fd*/;
520 /* Register variable[3]: Result */
521 variable[3] = NEW_FDOStream_stream___FDOStream___init(variable[3]) /*new FDOStream*/;
522 ATTR_exec___OProcess____out(variable[0]) /*OProcess::_out*/ = variable[3];
523 return_label22: while(false);
524 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_IOProcess].i] = 1;
525 tracehead = trace.prev;
526 return;
527 }
528 val_t exec___Sys___system(val_t self, val_t param0) {
529 struct trace_t trace = {NULL, NULL, 159, LOCATE_exec___Sys___system};
530 val_t variable[4];
531 struct WBT_ **closurevariable = NULL;
532 trace.prev = tracehead; tracehead = &trace;
533 trace.file = LOCATE_exec;
534 /* Register variable[0]: Local variable */
535 variable[0] = self;
536 /* Register variable[1]: Local variable */
537 variable[1] = param0;
538 /* Register variable[2]: Method return value and escape marker */
539 /* Register variable[3]: Result */
540 variable[3] = CALL_string___String___to_cstring( variable[1] /*command*/)( variable[1] /*command*/) /*String::to_cstring*/;
541 /* Register variable[3]: Result */
542 variable[3] = CALL_exec___NativeString___system(variable[3])(variable[3]) /*NativeString::system*/;
543 variable[2] = variable[3];
544 goto return_label23;
545 return_label23: while(false);
546 tracehead = trace.prev;
547 return variable[2];
548 }
549 val_t exec___NativeString___system(val_t self) {
550 struct trace_t trace = {NULL, NULL, 167, LOCATE_exec___NativeString___system};
551 val_t *variable = NULL;
552 struct WBT_ **closurevariable = NULL;
553 trace.prev = tracehead; tracehead = &trace;
554 trace.file = LOCATE_exec;
555 tracehead = trace.prev;
556 return TAG_Int(string_NativeString_NativeString_system_0(UNBOX_NativeString( self)));
557 }
558 val_t exec___NativeProcess___id(val_t self) {
559 struct trace_t trace = {NULL, NULL, 172, LOCATE_exec___NativeProcess___id};
560 val_t *variable = NULL;
561 struct WBT_ **closurevariable = NULL;
562 trace.prev = tracehead; tracehead = &trace;
563 trace.file = LOCATE_exec;
564 tracehead = trace.prev;
565 return TAG_Int(exec_NativeProcess_NativeProcess_id_0(UNBOX_NativeProcess( self)));
566 }
567 val_t exec___NativeProcess___is_finished(val_t self) {
568 struct trace_t trace = {NULL, NULL, 173, LOCATE_exec___NativeProcess___is_finished};
569 val_t *variable = NULL;
570 struct WBT_ **closurevariable = NULL;
571 trace.prev = tracehead; tracehead = &trace;
572 trace.file = LOCATE_exec;
573 tracehead = trace.prev;
574 return TAG_Bool(exec_NativeProcess_NativeProcess_is_finished_0(UNBOX_NativeProcess( self)));
575 }
576 val_t exec___NativeProcess___status(val_t self) {
577 struct trace_t trace = {NULL, NULL, 174, LOCATE_exec___NativeProcess___status};
578 val_t *variable = NULL;
579 struct WBT_ **closurevariable = NULL;
580 trace.prev = tracehead; tracehead = &trace;
581 trace.file = LOCATE_exec;
582 tracehead = trace.prev;
583 return TAG_Int(exec_NativeProcess_NativeProcess_status_0(UNBOX_NativeProcess( self)));
584 }
585 void exec___NativeProcess___wait(val_t self) {
586 struct trace_t trace = {NULL, NULL, 175, LOCATE_exec___NativeProcess___wait};
587 val_t *variable = NULL;
588 struct WBT_ **closurevariable = NULL;
589 trace.prev = tracehead; tracehead = &trace;
590 trace.file = LOCATE_exec;
591 exec_NativeProcess_NativeProcess_wait_0(UNBOX_NativeProcess( self));
592 tracehead = trace.prev;
593 return;
594 }
595 void exec___NativeProcess___kill(val_t self, val_t param0) {
596 struct trace_t trace = {NULL, NULL, 176, LOCATE_exec___NativeProcess___kill};
597 val_t *variable = NULL;
598 struct WBT_ **closurevariable = NULL;
599 trace.prev = tracehead; tracehead = &trace;
600 trace.file = LOCATE_exec;
601 tracehead = trace.prev;
602 return;
603 }
604 val_t exec___NativeProcess___in_fd(val_t self) {
605 struct trace_t trace = {NULL, NULL, 178, LOCATE_exec___NativeProcess___in_fd};
606 val_t *variable = NULL;
607 struct WBT_ **closurevariable = NULL;
608 trace.prev = tracehead; tracehead = &trace;
609 trace.file = LOCATE_exec;
610 tracehead = trace.prev;
611 return TAG_Int(exec_NativeProcess_NativeProcess_in_fd_0(UNBOX_NativeProcess( self)));
612 }
613 val_t exec___NativeProcess___out_fd(val_t self) {
614 struct trace_t trace = {NULL, NULL, 179, LOCATE_exec___NativeProcess___out_fd};
615 val_t *variable = NULL;
616 struct WBT_ **closurevariable = NULL;
617 trace.prev = tracehead; tracehead = &trace;
618 trace.file = LOCATE_exec;
619 tracehead = trace.prev;
620 return TAG_Int(exec_NativeProcess_NativeProcess_out_fd_0(UNBOX_NativeProcess( self)));
621 }
622 val_t exec___NativeProcess___err_fd(val_t self) {
623 struct trace_t trace = {NULL, NULL, 180, LOCATE_exec___NativeProcess___err_fd};
624 val_t *variable = NULL;
625 struct WBT_ **closurevariable = NULL;
626 trace.prev = tracehead; tracehead = &trace;
627 trace.file = LOCATE_exec;
628 tracehead = trace.prev;
629 return TAG_Int(exec_NativeProcess_NativeProcess_err_fd_0(UNBOX_NativeProcess( self)));
630 }