![]() |
DDraceNetwork Documentation
|
Classes | |
| class | CCmdlineFix |
Typedefs | |
| typedef pid_t | PROCESS |
Enumerations | |
| enum class | EShellExecuteWindowState { EShellExecuteWindowState::FOREGROUND , EShellExecuteWindowState::BACKGROUND } |
Functions | |
| int | pid () |
| void | cmdline_fix (int *argc, const char ***argv) |
| void | cmdline_free (int argc, const char **argv) |
| PROCESS | shell_execute (const char *file, EShellExecuteWindowState window_state, const char **arguments=nullptr, size_t num_arguments=0) |
| int | kill_process (PROCESS process) |
| bool | is_process_alive (PROCESS process) |
| int | open_link (const char *link) |
| int | open_file (const char *path) |
| bool | os_version_str (char *version, size_t length) |
| void | os_locale_str (char *locale, size_t length) |
Variables | |
| constexpr PROCESS | INVALID_PROCESS = 0 |
Shell, process management, OS specific functionality.
| typedef pid_t PROCESS |
A handle for a process.
|
strong |
Determines the initial window state when using shell_execute to execute a process.
| Enumerator | |
|---|---|
| FOREGROUND | The process window is opened in the foreground and activated. |
| BACKGROUND | The process window is opened in the background without focus. |
| void cmdline_fix | ( | int * | argc, |
| const char *** | argv ) |
Fixes the command line arguments to be encoded in UTF-8 on all systems.
| argc | A pointer to the argc parameter that was passed to the main function. |
| argv | A pointer to the argv parameter that was passed to the main function. |
| void cmdline_free | ( | int | argc, |
| const char ** | argv ) |
Frees memory that was allocated by cmdline_fix.
| argc | The argc obtained from cmdline_fix. |
| argv | The argv obtained from cmdline_fix. |
| bool is_process_alive | ( | PROCESS | process | ) |
Checks if a process is alive.
| process | Handle/PID of the process. |
| int kill_process | ( | PROCESS | process | ) |
Sends kill signal to a process.
| process | Handle of the process to kill. |
| int open_file | ( | const char * | path | ) |
Opens a file or directory with the default program.
| path | The file or folder to open with the default program. |
| int open_link | ( | const char * | link | ) |
Opens a link in the browser.
| link | The link to open in a browser. |
| void os_locale_str | ( | char * | locale, |
| size_t | length ) |
Returns a string of the preferred locale of the user / operating system. The string conforms to RFC 3066 and only contains the characters a-z, A-Z, 0-9 and -. If the preferred locale could not be determined this function falls back to the locale "en-US".
| locale | Buffer to use for the output. |
| length | Length of the output buffer. |
| bool os_version_str | ( | char * | version, |
| size_t | length ) |
Returns a human-readable version string of the operating system.
| version | Buffer to use for the output. |
| length | Length of the output buffer. |
| int pid | ( | ) |
Returns the ID of the current process.
| PROCESS shell_execute | ( | const char * | file, |
| EShellExecuteWindowState | window_state, | ||
| const char ** | arguments = nullptr, | ||
| size_t | num_arguments = 0 ) |
Executes a given file.
| file | The file to execute. |
| window_state | The window state how the process window should be shown. |
| arguments | Optional array of arguments to pass to the process. |
| num_arguments | The number of arguments. |
|
constexpr |
A handle that denotes an invalid process.