-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmake_command_redir.c
More file actions
38 lines (33 loc) · 1.45 KB
/
make_command_redir.c
File metadata and controls
38 lines (33 loc) · 1.45 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* make_command_redir.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jkong <jkong@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/26 18:10:34 by jkong #+# #+# */
/* Updated: 2022/06/19 03:24:17 by jkong ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
#include "safe_mem.h"
#include "generic_list.h"
void set_redirect(t_redirect *item, int src, t_redirection ins, t_word *dest)
{
item->redirectee = src;
item->instruction = ins;
item->word = *dest;
}
t_list_redirect *append_redirect(t_list_redirect **list, t_redirect *item)
{
t_list_redirect *elem;
elem = calloc_safe(1, sizeof(t_list_redirect));
elem->redirect = *item;
list_append((void *)list, (void *)elem);
return (elem);
}
void subshell_apply_redirect(t_subshell_command *subshell,
t_list_redirect *r_list)
{
subshell->redirect_list = r_list;
}