DDraceNetwork Documentation
Loading...
Searching...
No Matches
Process

Typedefs

typedef pid_t PROCESS

Enumerations

enum class  EShellExecuteWindowState { EShellExecuteWindowState::FOREGROUND , EShellExecuteWindowState::BACKGROUND }

Functions

int process_id ()
PROCESS process_execute (const char *file, EShellExecuteWindowState window_state, const char **arguments=nullptr, size_t num_arguments=0)
int process_kill (PROCESS process)
bool process_is_alive (PROCESS process)

Variables

constexpr PROCESS INVALID_PROCESS = 0

Detailed Description

Process management.

Typedef Documentation

◆ PROCESS

typedef pid_t PROCESS

A handle for a process.

Enumeration Type Documentation

◆ EShellExecuteWindowState

enum class EShellExecuteWindowState
strong

Determines the initial window state when using process_execute to execute a process.

Remarks
Currently only supported on Windows.
Enumerator
FOREGROUND 

The process window is opened in the foreground and activated.

BACKGROUND 

The process window is opened in the background without focus.

Function Documentation

◆ process_execute()

PROCESS process_execute ( const char * file,
EShellExecuteWindowState window_state,
const char ** arguments = nullptr,
size_t num_arguments = 0 )

Executes a given file.

Parameters
fileThe file to execute.
window_stateThe window state how the process window should be shown.
argumentsOptional array of arguments to pass to the process.
num_argumentsThe number of arguments.
Returns
Handle of the new process, or INVALID_PROCESS on error.

◆ process_id()

int process_id ( )

Returns the ID of the current process.

Returns
PID of the current process.

◆ process_is_alive()

bool process_is_alive ( PROCESS process)

Checks if a process is alive.

Parameters
processHandle/PID of the process.
Returns
true if the process is currently running,
false if the process is not running (dead).

◆ process_kill()

int process_kill ( PROCESS process)

Sends kill signal to a process.

Parameters
processHandle of the process to kill.
Returns
1 on success, 0 on error.

Variable Documentation

◆ INVALID_PROCESS

PROCESS INVALID_PROCESS = 0
constexpr

A handle that denotes an invalid process.