|
PatchworkOS
10941b4
A non-POSIX operating system.
|
Environment variables. More...
Environment variables.
Data Structures | |
| struct | env_var_t |
| Environment variable structure. More... | |
| struct | env_t |
| Environment structure. More... | |
Functions | |
| void | env_init (env_t *env) |
| Initialize the environment. | |
| void | env_deinit (env_t *env) |
| Deinitialize the environment. | |
| uint64_t | env_copy (env_t *dest, env_t *src) |
| Copy environment variables from one environment to another. | |
| const char * | env_get (env_t *env, const char *key) |
| Get the value of an environment variable. | |
| uint64_t | env_set (env_t *env, const char *key, const char *value) |
| Set the value of an environment variable. | |
| uint64_t | env_unset (env_t *env, const char *key) |
| Unset an environment variable. | |
Copy environment variables from one environment to another.
| dest | The destination environment. |
| src | The source environment. |
0. On failure, returns ERR and errno is set. Definition at line 26 of file env.c.
Get the value of an environment variable.
| env | The environment to search in. |
| key | The name of the environment variable. |
NULL if it does not exist. Definition at line 47 of file env.c.
Set the value of an environment variable.
If the variable already exists, its value will be updated.
| env | The environment to modify. |
| key | The name of the environment variable. |
| value | The value to set the environment variable to. |
0. On failure, returns ERR and errno is set. Definition at line 67 of file env.c.
Unset an environment variable.
If the variable does not exist, this function does nothing.
| env | The environment to modify. |
| key | The name of the environment variable. |
0. On failure, returns ERR and errno is set. Definition at line 127 of file env.c.