Crate nstd_env

Source

Functions§

nstd_env_args
Returns a vector of strings that contain the cmd args that the program was started with. Returns: NSTDVec args - The command line arguments.
nstd_env_current_dir
nstd_env_free_args
Frees memory allocated by nstd_env_args. Parameters: NSTDVec *const args - Returned from nstd_env_args. Returns: int errc - Nonzero on error.
nstd_env_free_path
Frees memory allocated by nstd_env_path_to_exe, nstd_env_current_dir or nstd_env_temp_dir. Parameters: char **path - String from nstd_env_path_to_exe or nstd_env_current_dir.
nstd_env_free_var
Frees memory allocated by nstd_env_get_var. Parameters: char **v - The value returned from nstd_env_get_var.
nstd_env_free_vars
Frees memory allocated by nstd_env_vars. Parameters: char **vars - Returned from nstd_env_vars.
nstd_env_get_var
Gets an environment variable. Parameters: const char *const k - The var key. Returns: char *v - The value of the variable.
nstd_env_path_to_exe
nstd_env_remove_var
Removes an environment variable. This will not free memory allocated by nstd_env_get_var. Parameters: const char *const k - The var key.
nstd_env_set_current_dir
Sets the current working directory. Parameters: const char *const path - The new working directory. Returns: int errc - Nonzero on error.
nstd_env_set_var
Sets an environment variable. Parameters: const char *const k - The var key. const char *const v - The var value.
nstd_env_temp_dir
Returns the path of a temporary directory. Use nstd_env_free_path to free memory allocated by this function. Returns: char *path - The path of the temp dir.
nstd_env_vars
Returns an array of strings that contain the environment variables. Parameters: NSTDUSize *size - Number of variables. Returns: char *vars - The environment variables keys.