-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.h
39 lines (33 loc) · 1.42 KB
/
env.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* env.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: facetint <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/31 09:27:13 by hamza #+# #+# */
/* Updated: 2024/04/02 17:34:27 by facetint ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ENV_H
# define ENV_H
# include "../libft/libft.h"
typedef struct s_entry
{
char *key;
char *value;
} t_entry;
// env
t_list *to_node(char *env);
t_list *to_list(char **env);
char **to_arr(t_list *lst);
t_list **get_env(void);
t_list *create_node(char *key, char *value);
char *find_env(char *key);
t_list *find_node(t_list *env, char *key);
void free_list(t_list *lst);
// builtin
void builtin_env(t_list *env, int fd[2]);
void unset_env(char *varname);
char *ft_unsafe_substr(char const *s, unsigned int start, size_t len);
#endif