Go to the source code of this file.
Macro Definition Documentation
#define GWEN_PROCESS_FLAGS_DEFAULT 0 |
#define GWEN_PROCESS_FLAGS_REDIR_STDERR 0x00000004 |
redirect the child processes stderr channel
Definition at line 40 of file process.h.
#define GWEN_PROCESS_FLAGS_REDIR_STDIN 0x00000001 |
redirect the child processes stdin channel
Definition at line 36 of file process.h.
#define GWEN_PROCESS_FLAGS_REDIR_STDOUT 0x00000002 |
redirect the child processes stdout channel
Definition at line 38 of file process.h.
Typedef Documentation
Enumeration Type Documentation
States a process can assume.
- Enumerator:
GWEN_ProcessStateNotStarted |
process has not yet been started
|
GWEN_ProcessStateRunning |
process is running
|
GWEN_ProcessStateExited |
process exited normally
|
GWEN_ProcessStateAborted |
process terminated abnormally (on POSIX systems this is in most cases an uncaught signal)
|
GWEN_ProcessStateStopped |
process has been stopped (unused for now)
|
GWEN_ProcessStateUnknown |
process is in an unknown state
|
Definition at line 54 of file process.h.
Function Documentation
Checks for the current state of the given process.
Frees process data. This does not stop the process represented by this data. You should only free this data after the process has terminated or if you are not interested in the result of the process (because after freeing this data there is no way to communicate with the process).
Returns the result of a process. This process must have terminated in order to return a result.
Returns a GWEN_BUFFEREDIO which can be used to read data written by the process via stderr. Returns 0 if the process does not have the flag GWEN_PROCESS_FLAGS_REDIR_STDERR set.
Returns a GWEN_BUFFEREDIO which can be used to write data to be received by the process via stdin. Returns 0 if the process does not have the flag GWEN_PROCESS_FLAGS_REDIR_STDIN set.
Returns a GWEN_BUFFEREDIO which can be used to read data written by the process via stdout. Returns 0 if the process does not have the flag GWEN_PROCESS_FLAGS_REDIR_STDOUT set.
Creates a process representation. This does not start a process, it simply prepares some data for starting a process.
Starts the given process.
- Parameters
-
pr | pointer to process data |
prg | path and name of the program to start |
args | command line arguments for the program (MUST NOT contain the name of the program) |
Terminates a process immediately (on POSIX systems this is performed by sending a KILL signal). This function waits for the process to terminate.
Waits for the termination of the given process.