minishell
Minishell Project for École 42
|
Functions for initializing the shell's main data structure. More...
#include "minishell.h"
Functions | |
t_environ_list * | empty_environ (t_environ_list *environ) |
Initializes environment variables for an empty environment. | |
t_environ_list * | init_environ (char **envp) |
Initializes the environment variables linked list. | |
t_shell * | init_shell (char **envp) |
Initializes the main data structure (shell environment). | |
void | lvl_up (t_shell *shell) |
Increases the shell level (SHLVL) environment variable. | |
Functions for initializing the shell's main data structure.
t_environ_list * empty_environ | ( | t_environ_list * | environ | ) |
Initializes environment variables for an empty environment.
Initializes environment variables for an empty environment, such as adding the "PWD" and "SHLVL" variables to the provided environment variables linked list.
[in] | environ | A pointer to the environment variables linked list. |
t_environ_list * init_environ | ( | char ** | envp | ) |
Initializes the environment variables linked list.
Initializes a linked list to store environment variables based on the provided 2D array of environment variables.
[in] | envp | A 2D array of environment variables. |
t_shell * init_shell | ( | char ** | envp | ) |
Initializes the main data structure (shell environment).
Starts the process of initializing the shell's main data structure, which includes components such as the environment variables in a linked list and other relevant information.
[in] | envp | A 2D char array of environment variables. |
void lvl_up | ( | t_shell * | shell | ) |
Increases the shell level (SHLVL) environment variable.
Increments the value of the shell level (SHLVL) environment variable. If the variable doesn't exist, it is added with a value of 1.
[in,out] | shell | A pointer to the shell data structure. |