An assortment of system-level functions.
More...
Go to the source code of this file.
|
int | run_system (const char *c) |
| run a command, similar to system() More...
|
|
int | run_system_output (const char *c, char **out) |
| run a command, similar to system(), collecting the program output More...
|
|
int | run_unprivileged (const char *c, void *input, void *output) |
| run a command, similar to system(), returning pipes to the standard input and output of the process More...
|
|
int | run_privileged (const char *c, const char *p, int *ret) |
| run a command, similar to system(), with administrator privileges More...
|
|
const char * | get_command_line () |
| find the command line of this program More...
|
|
char * | get_windows_path () |
| get the path of the Windows folder More...
|
|
char * | get_windows_drive_path () |
| get the path of the drive Windows is installed on More...
|
|
char * | get_program_path () |
| find the path of this program More...
|
|
char * | get_config_path () |
| find the path of this ProgramData folder More...
|
|
An assortment of system-level functions.
const char* get_command_line |
( |
| ) |
|
find the command line of this program
- Returns
- a string. Do not pass this to free
char* get_config_path |
( |
| ) |
|
find the path of this ProgramData folder
On Windows 95 - ME, and Vista+, this will be similar to 'C:/ProgramData'. On other systems, it will be similar to 'C:/Documets and Settings/All Users/Application Data'
- Returns
- a string. Must be freed using free
char* get_program_path |
( |
| ) |
|
find the path of this program
- Returns
- a string. Must be freed using free
char* get_windows_drive_path |
( |
| ) |
|
get the path of the drive Windows is installed on
- Returns
- the drive structure corresponding to the drive Windows is installed on. must be freed using #free
char* get_windows_path |
( |
| ) |
|
get the path of the Windows folder
- Returns
- the path to the Windows folder. Must be freed using free
int run_privileged |
( |
const char * |
c, |
|
|
const char * |
p, |
|
|
int * |
ret |
|
) |
| |
run a command, similar to system(), with administrator privileges
- Parameters
-
[in] | c | the command to run |
[in] | p | the parameters |
[out] | ret | the return code from the process |
- Returns
- whether the process started correctly
int run_system |
( |
const char * |
c | ) |
|
run a command, similar to system()
- Parameters
-
- Returns
- 1 if the program finished correctly
int run_system_output |
( |
const char * |
c, |
|
|
char ** |
out |
|
) |
| |
run a command, similar to system(), collecting the program output
- Parameters
-
[in] | c | the command to run |
[out] | out | the standard output and standard error output of the program, if it finished correctly. Must be freed using free() |
- Returns
- 1 if the program finished correctly
int run_unprivileged |
( |
const char * |
c, |
|
|
void * |
input, |
|
|
void * |
output |
|
) |
| |
run a command, similar to system(), returning pipes to the standard input and output of the process
- Parameters
-
[in] | c | the command to run |
[out] | input | a pointer to a handle to hold the input pipe |
[out] | output | a pointer to a handle to hold the output pipe |
- Returns
- 1 if the program starts correctly