Shell, process management, OS specific functionality.
◆ PROCESS
◆ EShellExecuteWindowState
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.
|
◆ cmdline_fix()
void cmdline_fix |
( |
int * |
argc, |
|
|
const char *** |
argv |
|
) |
| |
Fixes the command line arguments to be encoded in UTF-8 on all systems.
- Parameters
-
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. |
◆ cmdline_free()
void cmdline_free |
( |
int |
argc, |
|
|
const char ** |
argv |
|
) |
| |
Frees memory that was allocated by cmdline_fix.
- Parameters
-
argc | The argc obtained from cmdline_fix . |
argv | The argv obtained from cmdline_fix . |
◆ is_process_alive()
bool is_process_alive |
( |
PROCESS |
process | ) |
|
Checks if a process is alive.
- Parameters
-
process | Handle/PID of the process. |
- Returns
true
if the process is currently running, false
if the process is not running (dead).
◆ kill_process()
int kill_process |
( |
PROCESS |
process | ) |
|
Sends kill signal to a process.
- Parameters
-
process | Handle of the process to kill. |
- Returns
1
on success, 0
on error.
◆ open_file()
int open_file |
( |
const char * |
path | ) |
|
Opens a file or directory with the default program.
- Parameters
-
path | The file or folder to open with the default program. |
- Returns
1
on success, 0
on failure.
◆ open_link()
int open_link |
( |
const char * |
link | ) |
|
Opens a link in the browser.
- Parameters
-
link | The link to open in a browser. |
- Returns
1
on success, 0
on failure.
◆ os_locale_str()
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"
.
- Parameters
-
locale | Buffer to use for the output. |
length | Length of the output buffer. |
◆ os_version_str()
bool os_version_str |
( |
char * |
version, |
|
|
size_t |
length |
|
) |
| |
Returns a human-readable version string of the operating system.
- Parameters
-
version | Buffer to use for the output. |
length | Length of the output buffer. |
- Returns
true
on success, false
on failure.
◆ pid()
Returns the ID of the current process.
- Returns
- PID of the current process.
◆ shell_execute()
Executes a given file.
- Parameters
-
file | The file to execute. |
window_state | The window state how the process window should be shown. |
- Returns
- Handle of the new process, or INVALID_PROCESS on error.
◆ INVALID_PROCESS
constexpr PROCESS INVALID_PROCESS = 0 |
|
constexpr |
A handle that denotes an invalid process.