Minishell
 
Loading...
Searching...
No Matches
data_structure.h
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* data_structure.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: ppontet <ppontet@student.42lyon.fr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/05/22 11:19:09 by ppontet #+# #+# */
9/* Updated: 2025/05/30 11:06:46 by ppontet ### ########lyon.fr */
10/* */
11/* ************************************************************************** */
12
13#ifndef DATA_STRUCTURE_H
14# define DATA_STRUCTURE_H
15
16# include "libft.h"
17# include "garbage.h"
18# include "env.h"
19
20// FROM file.h
21typedef struct s_tmp t_tmp;
22typedef struct s_file t_file;
23
24// FROM garbage.h
25typedef struct s_element t_element;
26typedef struct s_garbage t_garbage;
27
28// FROM env.h
29typedef struct s_env_vars t_env_vars;
30typedef struct s_var t_var;
31
32// For lexer.c
34
35typedef struct s_command t_command;
36typedef struct s_params t_params;
37typedef struct s_token t_token;
38typedef struct s_data t_data;
39
51
57{
58 struct s_command *next;
60 char **toks;
61 char *path;
62 char **envp;
65 int fd[2];
66 t_bool file_error;
69};
70
75struct s_token
76{
77 char *str;
78 struct s_token *next;
79};
80
86# ifndef MAX_TOKENS_LEX
87# define MAX_TOKENS_LEX 1024
88# endif
89
96{
97 unsigned int i;
98 unsigned int j;
99 unsigned int start;
102 char **tokens;
103 const char *line;
104};
105
106
107#endif
struct s_var t_var
Definition data_structure.h:30
struct s_data t_data
Definition data_structure.h:38
struct s_params t_params
Definition data_structure.h:36
struct s_command t_command
Definition data_structure.h:35
struct s_element t_element
Definition data_structure.h:25
struct s_garbage t_garbage
Definition data_structure.h:26
struct s_env_vars t_env_vars
Definition data_structure.h:29
struct s_tmp t_tmp
Definition data_structure.h:21
struct s_file t_file
Definition data_structure.h:22
struct s_token t_token
Definition data_structure.h:37
struct s_lexer_state t_lexer_state
Definition data_structure.h:33
Structure that handles all the command and there contents.
Definition data_structure.h:57
t_bool file_error
Definition data_structure.h:66
t_bool parse_error
Definition data_structure.h:67
char * path
Definition data_structure.h:61
int fd[2]
Definition data_structure.h:65
t_file * file_in
Definition data_structure.h:63
t_token * tokens
Definition data_structure.h:59
t_file * file_out
Definition data_structure.h:64
char ** envp
Definition data_structure.h:62
char ** toks
Definition data_structure.h:60
int return_value
Definition data_structure.h:68
struct s_command * next
Definition data_structure.h:58
General structure that have access to all needed in minishell.
Definition data_structure.h:45
t_env_vars env
Definition data_structure.h:47
t_garbage garbage
Definition data_structure.h:46
int ret
Definition data_structure.h:49
t_command * command
Definition data_structure.h:48
Basic node for an element of a linked list.
Definition garbage.h:26
Definition env.h:39
Structure to handle all the data of a file.
Definition file.h:39
Head of the linked list.
Definition garbage.h:36
Structure used by lexer to efficiently have access to a bunch of variables.
Definition data_structure.h:96
unsigned int start
Definition data_structure.h:99
t_bool in_double_quote
Definition data_structure.h:101
char ** tokens
Definition data_structure.h:102
unsigned int j
Definition data_structure.h:98
t_bool in_single_quote
Definition data_structure.h:100
unsigned int i
Definition data_structure.h:97
const char * line
Definition data_structure.h:103
Definition env.h:53
Basic structure to help manipulating heredocs (tmp file)
Definition file.h:29
Basic structure of linked list of strings.
Definition data_structure.h:76
char * str
Definition data_structure.h:77
struct s_token * next
Definition data_structure.h:78
Definition env.h:45