39 lines
1.6 KiB
C
39 lines
1.6 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* env.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/03/27 13:42:01 by cchauvet #+# #+# */
|
|
/* Updated: 2023/03/27 13:42:02 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef ENV_H
|
|
# define ENV_H
|
|
# include <stdbool.h>
|
|
# include "../libftx/libft/list.h"
|
|
# include "../data/data.h"
|
|
|
|
typedef struct s_env
|
|
{
|
|
char *key;
|
|
char *value;
|
|
bool original;
|
|
} t_env;
|
|
|
|
char *ft_env_filler(t_data *data, const char *str);
|
|
void env_del(void *content);
|
|
t_list **init_env(char **env);
|
|
char **env_to_strs(t_list **head);
|
|
int create_value_by_key(char *key, char *value, t_list **head);
|
|
int create_value_by_key_dup(char *key, char *value, t_list **head);
|
|
int set_value_by_key(char *key, char *value, t_list **head);
|
|
char *get_value_by_key(char *key, t_list **head);
|
|
void env_del(void *ptr);
|
|
int delete_by_key(char *key, t_list **head);
|
|
int possible_key(char *key);
|
|
|
|
#endif
|