System APIs.
More...
Go to the source code of this file.
|
| const char * | qgetenv (const char *envname, const char *defstr) |
| | Get a system environment variable.
|
| char * | qsyscmd (const char *cmd) |
| | Run an external command and return its output.
|
System APIs.
Definition in file qsystem.c.
◆ qgetenv()
| const char * qgetenv |
( |
const char * | envname, |
|
|
const char * | defstr ) |
Get a system environment variable.
- Parameters
-
| envname | environment variable name. |
| defstr | default string to return if the variable is not set. |
- Returns
- pointer to the environment variable value, or defstr if not found.
Definition at line 54 of file qsystem.c.
◆ qsyscmd()
| char * qsyscmd |
( |
const char * | cmd | ) |
|
Run an external command and return its output.
- Parameters
-
| cmd | command string to run. |
- Returns
- allocated string that contains the command output on success, or NULL on failure.
- Note
- If the command runs successfully but produces no output, this function returns an empty string, not NULL.
Definition at line 71 of file qsystem.c.