-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsyntax_utils.c
More file actions
42 lines (36 loc) · 1.34 KB
/
Copy pathsyntax_utils.c
File metadata and controls
42 lines (36 loc) · 1.34 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
40
41
42
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* syntax_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ojamal <ojamal@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/06/10 04:40:53 by ojamal #+# #+# */
/* Updated: 2023/07/18 18:54:56 by ojamal ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void push_quote(t_quote **stack, char quote)
{
t_quote *new_node;
new_node = malloc(sizeof(t_quote));
new_node->quote = quote;
new_node->next = *stack;
*stack = new_node;
}
int msg_er(char *str)
{
ft_putstr_fd("\033[1;31m[Minishell]\033[0m:", 2);
ft_putstr_fd(str, 2);
ft_putstr_fd("\n", 2);
return (1);
}
void pop_quote(t_quote **stack)
{
t_quote *temp;
if (*stack == NULL)
return ;
temp = *stack;
*stack = (*stack)->next;
free(temp);
}