This commit is contained in:
Loic Deridder
2025-01-28 10:56:15 +01:00
parent 5c3cd44e5a
commit 66ebd61d6f
17 changed files with 252 additions and 254 deletions

View File

@@ -1,25 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* env.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lderidde <lderidde@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/28 10:11:07 by lderidde #+# #+# */
/* Updated: 2025/01/28 10:31:54 by lderidde ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ENV_H
# define ENV_H
# include "../lib/libft/libft.h"
# include "ast.h"
# include <unistd.h>
# include <stdlib.h>
# include <stdbool.h>
typedef struct s_data
{
char **env;
} t_data;
//VAR
int count_var(char **envp);
int get_var_index(char *key, t_data *data);
int get_var_index(char *key, t_ast_n *head);
void free_null_ptr(void *ptr);
char **copy_env_var(char **envp, int count);
char *get_var_value(char *key, char **envp);
bool is_valid_key(char *key, t_data *data);
int remove_env_var(char *key, t_data *data);
void set_var_env(char *key, char *value, t_data *t_data);
bool is_valid_key(char *key, t_ast_n *head);
int remove_env_var(char *key, t_ast_n *head);
void set_var_env(char *key, char *value, t_ast_n *head);
char **init_env(char **envp);
#endif