| 326 | }; |
| 327 | |
| 328 | kwsysProcess* kwsysProcess_New(void) |
| 329 | { |
| 330 | /* Allocate a process control structure. */ |
| 331 | kwsysProcess* cp = (kwsysProcess*)malloc(sizeof(kwsysProcess)); |
| 332 | if (!cp) { |
| 333 | return 0; |
| 334 | } |
| 335 | memset(cp, 0, sizeof(kwsysProcess)); |
| 336 | |
| 337 | /* Share stdin with the parent process by default. */ |
| 338 | cp->PipeSharedSTDIN = 1; |
| 339 | |
| 340 | /* No native pipes by default. */ |
| 341 | cp->PipeNativeSTDIN[0] = -1; |
| 342 | cp->PipeNativeSTDIN[1] = -1; |
| 343 | cp->PipeNativeSTDOUT[0] = -1; |
| 344 | cp->PipeNativeSTDOUT[1] = -1; |
| 345 | cp->PipeNativeSTDERR[0] = -1; |
| 346 | cp->PipeNativeSTDERR[1] = -1; |
| 347 | |
| 348 | /* Set initial status. */ |
| 349 | cp->State = kwsysProcess_State_Starting; |
| 350 | |
| 351 | return cp; |
| 352 | } |
| 353 | |
| 354 | void kwsysProcess_Delete(kwsysProcess* cp) |
| 355 | { |
no outgoing calls
searching dependent graphs…