maxishell
Implementation of a shell for Linux-like systems
|
Go to the source code of this file.
Classes | |
struct | s_env |
Typedefs | |
typedef struct s_env | t_env |
Functions | |
void | init_env (t_env **data_envp, char **envp) |
void | add_env_node (t_env **data_envp, char *line) |
char * | get_env (t_env *envp, const char *key) |
void | set_env (t_env **env, const char *key, const char *value) |
int | unset_env (t_env **env, const char *name) |
char ** | env_to_array (t_env *envp) |
char * | ft_strcdup (const char *s, int c) |
void | free_env (t_env *envp) |
void | print_t_env (t_env *tokens) |
int | handle_add_set_shell_variable (t_env **shell_var, char *line) |
void | set_shell_var (t_env **shell_var, const char *key, const char *value) |
void | add_shell_var_node (t_env **shell_var, const char *line) |
char * | get_shell_variable (t_env *shell_var, const char *key) |
void add_env_node | ( | t_env ** | data_envp, |
char * | line | ||
) |
Definition at line 55 of file env.c.
References ft_strchr(), ft_strdup(), ft_strndup(), s_env::key, s_env::next, and s_env::value.
Referenced by init_env().
void add_shell_var_node | ( | t_env ** | shell_var, |
const char * | line | ||
) |
Definition at line 26 of file shell_variables_utils.c.
References ft_strcdup(), ft_strchr(), ft_strdup(), s_env::key, s_env::next, and s_env::value.
Referenced by handle_add_set_shell_variable().
char ** env_to_array | ( | t_env * | envp | ) |
Definition at line 23 of file utils.c.
References ft_strjoin(), s_env::key, s_env::next, and s_env::value.
Referenced by handle_exec_errors(), and test_init_env().
void free_env | ( | t_env * | envp | ) |
Definition at line 73 of file utils.c.
References s_env::key, s_env::next, and s_env::value.
Referenced by env_tests().
char * ft_strcdup | ( | const char * | s, |
int | c | ||
) |
Definition at line 52 of file utils.c.
Referenced by add_env(), add_shell_var_node(), and handle_add_set_shell_variable().
char * get_env | ( | t_env * | envp, |
const char * | key | ||
) |
Definition at line 81 of file env.c.
References ft_strcmp(), s_env::key, s_env::next, and s_env::value.
Referenced by builtin_cd(), ft_find_path(), generate_prompt_string(), get_env_variable(), handle_get_shell_variable(), test_get_env(), test_set_env(), and test_unset_env().
char * get_shell_variable | ( | t_env * | shell_var, |
const char * | key | ||
) |
Definition at line 76 of file shell_variables_utils.c.
References ft_strcmp(), s_env::key, s_env::next, and s_env::value.
Referenced by get_exit_status().
int handle_add_set_shell_variable | ( | t_env ** | shell_var, |
char * | line | ||
) |
Definition at line 24 of file shell_variables.c.
References add_shell_var_node(), ft_remove_quotes(), ft_strcdup(), ft_strchr(), and set_shell_var().
Referenced by handle_local_vars(), and init_ms_data().
void init_env | ( | t_env ** | data_envp, |
char ** | envp | ||
) |
Definition at line 46 of file env.c.
References add_env_node().
Referenced by init_ms_data(), test_get_env(), test_init_env(), and test_set_env().
void print_t_env | ( | t_env * | tokens | ) |
Definition at line 89 of file utils.c.
References ft_printf(), s_env::key, s_env::next, and s_env::value.
void set_env | ( | t_env ** | env, |
const char * | key, | ||
const char * | value | ||
) |
Definition at line 44 of file utils_utils.c.
References add_new_env(), ft_strcmp(), ft_strdup(), s_env::key, s_env::next, remove_quotes(), and s_env::value.
Referenced by add_env(), builtin_cd(), test_set_env(), and test_unset_env().
void set_shell_var | ( | t_env ** | shell_var, |
const char * | key, | ||
const char * | value | ||
) |
Definition at line 53 of file shell_variables_utils.c.
References ft_strcmp(), ft_strdup(), s_env::key, s_env::next, and s_env::value.
Referenced by builtin_env(), handle_add_set_shell_variable(), init_ms_data(), set_shell_var_handler(), and shell_variable_update().
int unset_env | ( | t_env ** | env, |
const char * | name | ||
) |
Definition at line 95 of file env.c.
References ft_strcmp(), s_env::key, s_env::next, and s_env::value.
Referenced by builtin_unset(), and test_unset_env().