-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct.h
99 lines (87 loc) · 2.05 KB
/
struct.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* struct.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mlongo <mlongo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/09 12:41:13 by abuonomo #+# #+# */
/* Updated: 2023/11/11 13:46:21 by mlongo ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef STRUCT_H
# define STRUCT_H
typedef enum e_token_enum
{
CMD_NAME,
CMD_ARG,
IN_FILE_TRUNC,
HERE_DOC,
OUT_FILE_TRUNC,
OUT_FILE_APPEND,
OPERATOR,
ENV_VAR_DECL,
ENV_VAR_UNSET,
PARENTHESIS,
NONE
} t_token_enum;
typedef struct s_declaration
{
int concatenation;
char *name;
char *value;
struct s_declaration *next;
} t_declaration;
typedef struct s_token
{
t_token_enum token;
void *value;
struct s_token *prev;
struct s_token *next;
} t_token;
typedef enum e_tree_enum
{
SIMPLE_CMD,
OP,
PARENTHESI,
} t_tree_enum;
typedef struct s_cmd
{
t_token *cmd_name;
t_token *cmd_arg;
} t_cmd;
typedef struct s_simple_cmd
{
t_token *redir_list;
struct s_cmd *cmd;
t_token *env;
} t_simple_cmd;
typedef struct s_tree
{
t_tree_enum type;
void *content;
struct s_tree *right;
struct s_tree *left;
struct s_tree *prev;
char **env;
} t_tree;
typedef struct s_parenthesis
{
t_token *redir_list;
t_tree *tree;
} t_parenthesis;
typedef struct s_mini
{
char **env;
char **splitcmd;
t_tree *tree;
t_token *token_list;
} t_mini;
typedef struct s_wild_split
{
char *expanded;
char **split_expanded;
int end;
int end_new;
} t_wild_split;
#endif