-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype.h
More file actions
92 lines (80 loc) · 1.85 KB
/
type.h
File metadata and controls
92 lines (80 loc) · 1.85 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
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* type.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: almelo <almelo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/11 17:50:50 by almelo #+# #+# */
/* Updated: 2023/03/28 20:15:13 by almelo ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef TYPE_H
# define TYPE_H
enum e_label
{
WORD,
PIPE,
IN,
OUT,
HEREDOC,
APPEND,
};
enum e_bool
{
FALSE,
TRUE,
};
typedef struct s_token
{
void *content;
enum e_label label;
struct s_token *next;
} t_token;
typedef struct s_tokenl
{
t_token *head;
t_token *tail;
size_t length;
size_t pipe_count;
} t_tokenl;
typedef struct s_env
{
void *key;
void *value;
struct s_env *next;
} t_env;
typedef struct s_envl
{
t_env *head;
t_env *tail;
size_t length;
} t_envl;
typedef struct s_lexer_state
{
char *input;
size_t curr;
enum e_bool is_word;
enum e_bool is_quoted;
} t_lexer_state;
typedef struct s_parser_state
{
char **keys;
char *new;
size_t len_new;
enum e_bool prevent_default;
enum e_bool prevent_expand;
} t_parser_state;
typedef struct s_index
{
size_t old;
size_t new;
size_t key;
size_t start;
} t_index;
typedef struct s_quote_state
{
enum e_bool prevent_default;
enum e_bool prevent_expand;
} t_quote_state;
#endif