-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv_queue.c
More file actions
39 lines (35 loc) · 1.26 KB
/
env_queue.c
File metadata and controls
39 lines (35 loc) · 1.26 KB
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_queue.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: almelo <almelo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/04 14:20:09 by almelo #+# #+# */
/* Updated: 2023/03/22 19:37:30 by almelo ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_env *new_env(void *key, void *value)
{
t_env *node;
node = malloc(sizeof(t_env));
node->key = key;
node->value = value;
node->next = NULL;
return (node);
}
void queue_env(t_envl *env_lst, t_env *new)
{
if (env_lst->head == NULL)
{
env_lst->head = new;
env_lst->tail = new;
}
else
{
env_lst->tail->next = new;
env_lst->tail = new;
}
env_lst->length++;
}