MiniDevil
As beautiful as a shell
Environment utilities: handles SHLVL increment & PWD validation. More...
Include dependency graph for env_utils.c:Environment utilities: handles SHLVL increment & PWD validation.
Definition in file env_utils.c.
Functions | |
| void | handle_shlvl (t_env **env_list) |
| Increment the SHLVL environment variable. More... | |
| void | ensure_pwd (t_env **env_list) |
| Ensure PWD exists in the environment. More... | |
| void | free_env_list (t_env **env_list) |
| Free all nodes in the env linked list. More... | |
| int | env_list_size (t_env *env_list) |
| Count the number of nodes in the environment list. More... | |
| void handle_shlvl | ( | t_env ** | env_list | ) |
Increment the SHLVL environment variable.
| env_list | Pointer to list head pointer |
Definition at line 24 of file env_utils.c.
References get_env_value(), and set_env_value().
Referenced by init_env().
Here is the call graph for this function:
Here is the caller graph for this function:| void ensure_pwd | ( | t_env ** | env_list | ) |
Ensure PWD exists in the environment.
If it's not already set, it reads the current working directory via getcwd() and creates the variable
| env_list | Pointer to list head pointer |
Definition at line 51 of file env_utils.c.
References get_env_value(), and set_env_value().
Referenced by init_env().
Here is the call graph for this function:
Here is the caller graph for this function:| void free_env_list | ( | t_env ** | env_list | ) |
Free all nodes in the env linked list.
| env_list | Pointer to list head pointer |
Definition at line 69 of file env_utils.c.
References t_env::key, t_env::next, and t_env::value.
Referenced by child_execute(), exec_child(), exec_left_pipe_child(), exec_right_pipe_child(), init_env(), and main().
Here is the caller graph for this function:| int env_list_size | ( | t_env * | env_list | ) |
Count the number of nodes in the environment list.
| env_list | List head |
Definition at line 91 of file env_utils.c.
References t_env::next.
Referenced by env_to_array().
Here is the caller graph for this function: