minishell
Minishell Project for École 42
Loading...
Searching...
No Matches
minishell.h
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* minishell.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: phnowak <phnowak@student.42vienna.com> +#+ +:+ +#+ */
7/* By: dzauner <dzauner@student.42vienna.com> +#+#+#+#+#+ +#+ */
8/* Created: 2023/09/20 20:55:19 by phnowak #+# #+# */
9/* Updated: 2023/10/02 13:28:57 by dzauner ### ########.fr */
10/* */
11/* ************************************************************************** */
12
18#ifndef MINISHELL_H
19# define MINISHELL_H
20
21# include <stdio.h>
22# include <errno.h>
23# include <fcntl.h>
24# include <readline/readline.h>
25# include <readline/history.h>
26# include <signal.h>
27# include <stdbool.h>
28# include <stdlib.h>
29# include <sys/types.h>
30# include <sys/wait.h>
31# include <sysexits.h>
32# include <unistd.h>
33# include "../libft/libft.h"
34
35// Macros
36
37// General
38# define PARENT 1
39# define CHILD 2
40# define IGNORE 3
41# define ERR_SYN_QUOTES "Syntax error: quotes unclosed\n"
42# define ERR_SYN_RD "Syntax error: redirections\n"
43# define ERR_SYN_PIPE "Syntax error: pipes\n"
44# define EXIT_SYN_QUOTES 2
45# define EXIT_SYN_RD 2
46# define EXIT_SYN_PIPE 2
47
48// fill_executor_list()
49# define OK 100
50# define NOT_FOUND 101
51# define FAILED 102
52
53// handle_multi()
54# define FAIL_SYSCALL -1
55# define OKAY 0
56# define FAIL_SYSCALL_PARENT 1
57# define FAIL_SYSCALL_CHILD 2
58
59// Structs
60
64typedef struct s_shell
65{
66 char *rl_input;
67 char *rl_copy;
68 struct s_environ_list *environ;
69 struct s_lexer_list *lex_head;
70 struct s_executor *executor;
72
76typedef struct s_environ_list
77{
78 struct s_environ_node *head;
79 int size;
81
85typedef struct s_environ_node
86{
87 char *key;
88 char *value;
89 struct s_environ_node *next;
91
95typedef enum s_token
96{
97 NONE = 0,
98 PIPE = 1,
99 TRUNCATE = 2,
100 APPEND = 3,
101 REDIRECT_INPUT = 4,
102 HEREDOC = 5,
104
108typedef struct s_lexer_list
109{
110 char *str;
111 t_token type;
112 int index;
113 struct s_lexer_list *prev;
114 struct s_lexer_list *next;
116
120typedef struct s_executor
121{
122 int id;
123 int size;
124 int fd_in;
125 int fd_out;
126 bool truncate;
127 bool append;
128 bool redirect_input;
129 bool heredoc;
130 char **path;
131 char **execs;
132 struct s_executor *prev;
133 struct s_executor *next;
135
139typedef struct s_expander
140{
141 char *beginning;
142 char *res;
143 char *invalid;
144 char *env_val;
145 char *var;
146 char *str;
147 char *conv;
148 int pos;
149 int len;
150 int recently_invalid;
151 int expanded;
152 int flag;
154
158typedef struct s_info
159{
160 int wstatus;
161 t_shell *shell;
162 int stdin_copy;
163 pid_t *pids;
165
166// Global Variables
167
168extern int g_exit_code;
169
170// Debug Functions
171
172// debug_prints.c
173
174// void print_env(t_environ_list *environ);
175// void printlexerlist(t_lexer_list *head);
176// void print_executor_list(t_executor *list);
177
178// Function Prototypes
179
180// ft_getpid.c
181
182pid_t ft_getpid(void);
183
184// signal_setup.c
185
186void signal_setup(int process);
187
188// check_exitcode.c
189
190void check_exitcode(int wstatus, bool *is_print);
191
192// init_shell.c
193
194t_shell *init_shell(char **envp);
195t_environ_list *init_environ(char **envp);
197void lvl_up(t_shell *shell);
198
199// environ_list_utils.c
200
203 t_environ_node *node);
204t_environ_node *get_node(t_environ_list *environ, char *key);
205
206// free_heap.c
207
208char **free_str_arr(char **arr);
209void free_environ(t_environ_list *environ);
212void free_heap(t_shell *shell);
213
214// parser.c
215
217t_lexer_list *lexer(t_shell *shell);
218bool parser(t_shell *shell);
219
220// check_quote_syntax.c
221
222int get_end_quote(const char *input, char c);
223bool check_quote_syntax(const char *input);
224
225// clean_rl_copy.c
226
227int ft_isspace(int c);
228char *replace_with_clean(char *rl_copy, size_t start, size_t end);
229char *clean_rl_copy(char *rl_copy);
230
231// tokenize.c
232
233t_token assign_type(char tok);
234t_token which_type(char *s);
235t_lexer_list *create_lexer_list(char **input_array);
236t_lexer_list *fill_lexer_list(char **input_array);
238
239// create_input_array.c
240
241int len_substr(char *str);
242int count_elements(char *rl_copy);
243int find_token(char **input_array, char **input, int index);
244char **fill_input_array(char **input_array, char *input);
245char **create_input_array(t_shell *shell);
246
247// input_array_utils.c
248
249int skip_quotes(char *str);
250void no_delim_found(char *str, int *len);
251bool is_token(char to_check);
252bool is_token2(char to_check);
253
254// prep_executor.c
255
261
262// check_execs_after_expand.c
263
264char **combine_execs(char **resplit, char **new_execs, char **execs);
265int after_expand(t_executor *current);
267
268// set_path_executor.c
269
270void set_path_executor(t_executor *list, t_environ_list *environ);
271
272// fill_executor_list.c
273
280
281// process_out_append.c
282
283bool close_outputfile(int fd);
285
286// process_in_heredoc.c
287
288bool get_input(int fd, char *delimiter);
289int create_heredoc(char *delimiter);
291
292// process_command.c
293
295char **get_execs_array(t_lexer_list *lexer, int size);
296
297// cd_builtin.c
298
299void update_old(t_shell *shell, char *old);
300int env_var_update(t_shell *shell, char *old, char *new);
301int cd_no_args(t_shell *shell);
302int cd(t_shell *shell, char **args);
303
304// pwd_builtin.c
305
306int get_sizeof_args(char **args);
307int pwd(void);
308
309// export_builtin.c
310
311int export_no_args(t_shell *shell);
312void exporting(t_shell *shell, char *str);
313int export_args(t_shell *shell, char **args);
314int export(t_shell *shell, char **args);
315
316// env_builtin.c
317
318int env(t_shell *shell, char **args);
319
320// exit_builtin_utils.c
321
322void child(t_shell *shell, char **args, int number);
323void handle_child(t_shell *shell, char **args, int number);
324void parent(t_shell *shell, char **args, int number);
325int handle_parent(t_shell *shell, char **args, int number);
326
327// exit_builtin.c
328
329bool is_arg_number(char *arg);
330int exit_builtin(t_shell *shell, char **args, bool in_child);
331
332// unset_builtin.c
333
334void delete_variable(t_shell *shell, char *arg);
335void unset_arg(t_shell *shell, char *arg, int *fails);
336int unset(t_shell *shell, char **args);
337
338// echo_builtin.c
339
340int echo(char **args);
341
342// expander.c
343
344bool expander(t_shell *shell);
345int expand_var(t_shell *shell, char **str, t_expander *exp,
346 int pos);
347
348// handle_quotes.c
349
350char *handle_quotes(t_shell *shell, char **str, char end_quote,
351 t_expander *inter);
352
353// interpolate.c
354
355char *interpolate(t_shell *shell, char *str);
356
357// expander_utils.c
358
359t_expander *init_expander(char *str);
360char *realloc_str(char *res, int pos);
361void free_exp(t_expander *exp);
362char *ft_strjoin_expander(char const *s1, char const *s2);
363char *ft_charjoin_expander(char const *s, char const c);
364
365// executor.c
366
367void close_fds(t_executor *current);
368void handle_single(t_shell *shell);
369void executor(t_shell *shell);
370
371// handle_single_builtin.c
372
373bool is_builtin(char *exec);
374void execute_builtin(t_shell *shell);
376
377// single_builtin_utils.c
378
380void saving_stds(int *stdin_cpy, int *stdout_cpy);
381bool restore_stds(int stdin_cpy, int stdout_cpy);
382
383// handle_single_child.c
384
385void handle_single_child(t_shell *shell);
386
387// single_child_utils.c
388
390char *get_absolute_path(t_shell *shell);
391void check_errno(t_shell *shell, char *path);
392void get_path_error(char *str);
393char *get_path(t_shell *shell, bool printerror);
394
395// single_child_utils_2.c
396
397int get_size_environ(t_environ_node *current);
398char **create_environ_array(t_environ_list *environ);
399void transform_error(char **environ_array);
400void transform_helper(t_environ_node *current, char **environ_array);
401char **transform_environ_array(t_shell *shell);
402
403// handle_multi.c
404
405t_info *init_info(t_shell *shell);
406void wait_pipeline(t_info *info, int number);
407void ft_error(t_executor *current, t_info *info);
408void handle_multi(t_shell *shell, t_executor *current);
409
410// child_handler_multi.c
411
412int handle_redirections_pipeline(int *fildes, t_executor *current,
413 t_info *info);
414void execute_builtin_child(t_executor *current, t_info *info);
415char *execute_other_helper(t_executor *current);
416int execute_other(t_executor *current, t_info *info);
417int child_handler_multi(int *fildes, t_executor *current,
418 t_info *info);
419
420// handle_pipeline.c
421
422int handle_pipes(int fildes[2]);
423pid_t handle_forks(void);
424int parent_handler_multi(int *fildes, t_executor *current);
425int handle_pipeline(int *fildes, t_executor *current,
426 t_info *info, int i);
427
428#endif
void executor(t_shell *shell)
Primary entrypoint of command execution.
Definition executor.c:76
bool handle_redirections_single_builtin(t_shell *shell)
Handle redirections for a single non-builtin command.
Definition single_builtin_utils.c:36
char ** create_input_array(t_shell *shell)
Create an array of input strings for tokenization.
Definition create_input_array.c:172
bool parser(t_shell *shell)
Parses the input using the lexer.
Definition parser.c:96
int create_heredoc(char *delimiter)
Creates a here-document file and gathers input.
Definition process_in_heredoc.c:69
void wait_pipeline(t_info *info, int number)
Wait for child processes to finish execution + update the exit code.
Definition handle_multi.c:59
void free_exp(t_expander *exp)
Frees resources associated with the expander struct.
Definition expander_utils.c:155
t_shell * init_shell(char **envp)
Initializes the main data structure (shell environment).
Definition init_shell.c:114
void delete_variable(t_shell *shell, char *arg)
Deletes an environment variable.
Definition unset_builtin.c:69
void handle_single_child(t_shell *shell)
Process creation for execution of non-builtin command.
Definition handle_single_child.c:165
void execute_builtin(t_shell *shell)
Execute a builtin-command.
Definition handle_single_builtin.c:56
int exit_builtin(t_shell *shell, char **args, bool in_child)
Handles the exit command when executed in a child process.
Definition exit_builtin.c:65
void no_delim_found(char *str, int *len)
Checks if there is a quote('\'' or '"') at the current position the given string.
Definition input_array_utils.c:62
void handle_multi(t_shell *shell, t_executor *current)
Handles the execution of multiple commands.
Definition handle_multi.c:116
int get_end_quote(const char *input, char c)
Find the index of the end of a quoted part in a string.
Definition check_quote_syntax.c:33
char * ft_strjoin_expander(char const *s1, char const *s2)
Concatenates two strings and expands the memory as needed.
Definition expander_utils.c:65
char * get_absolute_path(t_shell *shell)
Transform the non-absolut path into one.
Definition single_child_utils.c:64
int cd_no_args(t_shell *shell)
Handles the case when changing to a directory with no arguments.
Definition cd_builtin.c:124
bool restore_stds(int stdin_cpy, int stdout_cpy)
Restore the stdin and stdout file descriptors.
Definition single_builtin_utils.c:83
char ** free_str_arr(char **arr)
Frees the allocated memory of a string array.
Definition free_heap.c:28
t_executor * prepare_executor(t_shell *shell)
Prepare a linked list of t_executor elements for the executor.
Definition prep_executor.c:138
void transform_error(char **environ_array)
Error handling while copying the environment list into the array.
Definition single_child_utils_2.c:83
char ** transform_environ_array(t_shell *shell)
Copy the environment variables into an array for execve.
Definition single_child_utils_2.c:137
void get_path_error(char *str)
Handle errors when obtaining an empty path to an executable.
Definition single_child_utils.c:132
t_lexer_list * fill_lexer_list(char **input_array)
Fills the lexer list using the input array.
Definition tokenize.c:110
char ** create_environ_array(t_environ_list *environ)
Create the environment array based on the list size.
Definition single_child_utils_2.c:57
bool is_builtin(char *exec)
Check if a given command is a builtin-command.
Definition handle_single_builtin.c:34
void free_heap(t_shell *shell)
Frees the memory used by the main data structure (shell environment).
Definition free_heap.c:143
bool close_outputfile(int fd)
Closes and file descriptor.
Definition process_out_append.c:29
int get_size_executor(t_lexer_list *head)
Calculates the number of t_executor elements/nodes needed.
Definition prep_executor.c:32
int find_token(char **input_array, char **input, int index)
Finds predefined tokens in the input string and adds it to the input_array.
Definition create_input_array.c:101
void set_executor_defaults(t_executor *node)
Sets default values for a t_executor node.
Definition prep_executor.c:77
void set_path_executor(t_executor *list, t_environ_list *environ)
Sets the path variable for t_executor nodes.
Definition set_path_executor.c:29
int echo(char **args)
Implements the "echo" command to display text to the standard output.
Definition echo_builtin.c:85
int len_substr(char *str)
Calculates the length of a substring('token') until a delimiter or a token is found.
Definition create_input_array.c:33
struct s_environ_node t_environ_node
Structure representing an environment variable node.
char * execute_other_helper(t_executor *current)
Helper function to find the executable path.
Definition child_handler_multi.c:98
int handle_pipeline(int *fildes, t_executor *current, t_info *info, int i)
Handles the execution of a pipeline of commands.
Definition handle_pipeline.c:96
void child(t_shell *shell, char **args, int number)
Handles the exit command when executed within a child process.
Definition exit_builtin_utils.c:50
bool check_pipe_syntax(t_lexer_list *lexer)
Performs a pipe syntax check on the given list of lexems t_lexer_list *lexer.
Definition parser.c:30
void check_errno(t_shell *shell, char *path)
Check and handle errors related to command execution.
Definition single_child_utils.c:98
char * replace_with_clean(char *rl_copy, size_t start, size_t end)
Removes characters from a string that are before and after a given index.
Definition clean_rl_copy.c:50
void close_fds(t_executor *current)
Close file descriptors based on command redirection settings.
Definition executor.c:29
t_expander * init_expander(char *str)
Initializes the expander struct for variable expansion.
Definition expander_utils.c:125
void check_exitcode(int wstatus, bool *is_print)
Checks the exit code of a child process and update g_exit_code.
Definition check_exitcode.c:36
void executor(t_shell *shell)
Primary entrypoint of command execution.
Definition executor.c:76
int count_elements(char *rl_copy)
Count the number of elements in the input string.
Definition create_input_array.c:58
int handle_redirections_pipeline(int *fildes, t_executor *current, t_info *info)
Handles file redirections and file descriptor setup.
Definition child_handler_multi.c:32
void signal_setup(int process)
Sets up signal handlers.
Definition signal_setup.c:56
int env_var_update(t_shell *shell, char *old, char *new)
Update PWD after directory change.
Definition cd_builtin.c:83
int process_command(t_executor *current, t_lexer_list *lexer)
Processes the command part for the given node of the executor list.
Definition fill_executor_list.c:101
t_executor * fill_executor_list(t_shell *shell, t_executor *list)
Fills the t_executor linked list with info about the parsed commands.
Definition fill_executor_list.c:169
t_token which_type(char *s)
Set the type of token.
Definition tokenize.c:48
int get_size_execs(t_lexer_list *lexer)
Calculates the number of consecutive NONE type lexer list nodes.
Definition process_command.c:32
char ** get_execs_array(t_lexer_list *lexer, int size)
Creates an array of the found NONE type tokens from the lexer list.
Definition process_command.c:56
struct s_expander t_expander
Structure used in variable expansion.
int get_size_environ(t_environ_node *current)
Get the size of the environment list.
Definition single_child_utils_2.c:33
t_lexer_list * tokenize(t_shell *shell)
Tokenizes the input string and creates the lexer list.
Definition tokenize.c:149
int parent_handler_multi(int *fildes, t_executor *current)
Handles the parent process during multi-command execution.
Definition handle_pipeline.c:67
int export_no_args(t_shell *shell)
Handles the "export" command without arguments.
Definition export_builtin.c:32
t_executor * init_executor_list(int size)
Initializes the t_executor linked list.
Definition prep_executor.c:101
t_token assign_type(char tok)
Assign a type based on the input char.
Definition tokenize.c:26
int handle_parent(t_shell *shell, char **args, int number)
Handles the exit command when executed within the parent process.
Definition exit_builtin_utils.c:149
int ft_isspace(int c)
Checks if the given character is a whitespace.
Definition clean_rl_copy.c:30
int execute_other(t_executor *current, t_info *info)
Executes a non-built-in command in a child process using execve.
Definition child_handler_multi.c:137
int cd(t_shell *shell, char **args)
Handles changing the current working directory with specified arguments.
Definition cd_builtin.c:163
void exporting(t_shell *shell, char *str)
Updates or creates environment variables based on user-provided arguments.
Definition export_builtin.c:76
void update_old(t_shell *shell, char *old)
Update OLDPWD.
Definition cd_builtin.c:50
bool check_quote_syntax(const char *input)
Check the syntax of quotes in the input string.
Definition check_quote_syntax.c:59
t_executor * free_executor_list(t_executor *list)
Frees the allocated memory of a linked list of t_executor elements.
Definition free_heap.c:112
bool check_execs_after_expand(t_shell *shell)
Checks and processes execution commands after expansion.
Definition check_execs_after_expand.c:139
void ft_error(t_executor *current, t_info *info)
Handle errors during command execution and set the exit code accordingly.
Definition handle_multi.c:88
void handle_child(t_shell *shell, char **args, int number)
Handles the exit command when executed within a child process.
Definition exit_builtin_utils.c:86
t_lexer_list * lexer(t_shell *shell)
Lexical analysis and tokenization of the input string.
Definition parser.c:64
bool expander(t_shell *shell)
Starting point of variable expansion.
Definition expander.c:167
void free_environ(t_environ_list *environ)
Frees the memory used by the environment list and its nodes.
Definition free_heap.c:52
bool is_token2(char to_check)
Check if a character is a token.
Definition input_array_utils.c:97
t_executor * process_lexemes(t_executor *list, t_executor *current, t_lexer_list **lexer)
Processes lexemes and sets values in the given t_executor node.
Definition fill_executor_list.c:132
void transform_helper(t_environ_node *current, char **environ_array)
Copy environment variables into the env array.
Definition single_child_utils_2.c:100
char * get_path(t_shell *shell, bool printerror)
Get the path to an executable or convert it to an absolute path.
Definition single_child_utils.c:151
int process_out_append(t_executor *current, t_lexer_list *lexer)
Processes output redirections and append for the given node of the executor list.
Definition fill_executor_list.c:33
char * interpolate(t_shell *shell, char *str)
Interpolates variables and handles quotes within a shell command.
Definition interpolate.c:142
struct s_environ_list t_environ_list
Structure representing a list of environment variables.
t_environ_list * init_environ(char **envp)
Initializes the environment variables linked list.
Definition init_shell.c:81
int env(t_shell *shell, char **args)
Displays the environment variables and their values.
Definition env_builtin.c:61
int handle_pipes(int fildes[2])
Creates a pipe and sets the file descriptors in the given array.
Definition handle_pipeline.c:29
int handle_single_builtin(t_shell *shell)
Handle the execution of a single builtin-command.
Definition handle_single_builtin.c:88
int expand_var(t_shell *shell, char **str, t_expander *exp, int pos)
Expand variables.
Definition expander.c:129
int export_args(t_shell *shell, char **args)
Handles the export command with specified arguments.
Definition export_builtin.c:114
char ** fill_input_array(char **input_array, char *input)
Fills the array of strings with substrings('tokens') from the input string.
Definition create_input_array.c:133
void execute_builtin_child(t_executor *current, t_info *info)
Executes a built-in command in a child process and exits.
Definition child_handler_multi.c:62
void lvl_up(t_shell *shell)
Increases the shell level (SHLVL) environment variable.
Definition init_shell.c:146
struct s_executor t_executor
Structure representing an executor node.
t_info * init_info(t_shell *shell)
Initializes the t_info structure.
Definition handle_multi.c:30
int process_in_heredoc(t_executor *current, t_lexer_list *lexer)
Processes input redirections and heredoc for the given node of the executor list.
Definition fill_executor_list.c:70
void unset_arg(t_shell *shell, char *arg, int *fails)
Unsets an environment variable or prints an error message.
Definition unset_builtin.c:108
int after_expand(t_executor *current)
Process the execs array of the current executor node after expansion.
Definition check_execs_after_expand.c:105
bool is_token(char to_check)
Check if a character is a token.
Definition input_array_utils.c:80
int get_sizeof_args(char **args)
Retrieves the number of arguments in an array of strings.
Definition pwd_builtin.c:33
void handle_single(t_shell *shell)
Handle the execution of a single command.
Definition executor.c:50
s_token
Enumeration representing different token types.
Definition minishell.h:96
int pwd(void)
Executes the "pwd" command to print the current working directory.
Definition pwd_builtin.c:54
bool handle_redirections_single_child(t_shell *shell)
Handle redirections for single non-builtin command in child process.
Definition single_child_utils.c:36
int child_handler_multi(int *fildes, t_executor *current, t_info *info)
Handles the execution of a child process in a multi-command.
Definition child_handler_multi.c:175
pid_t handle_forks(void)
Creates a child process using fork() and returns the process ID.
Definition handle_pipeline.c:47
char * realloc_str(char *res, int pos)
Reallocates memory for a string.
Definition expander_utils.c:104
char * ft_charjoin_expander(char const *s, char const c)
Concatenates character to the end of a string.
Definition expander_utils.c:33
int skip_quotes(char *str)
Skips over a quoted section ('\'' or '"') of a string.
Definition input_array_utils.c:32
struct s_lexer_list t_lexer_list
Structure representing a list of lexemes.
t_environ_node * get_node(t_environ_list *environ, char *key)
Find an node by the key from an environment variables linked list.
Definition environ_list_utils.c:96
t_lexer_list * free_lex(t_lexer_list *lex_head)
Frees the allocated memory of a linked list of lexer elements.
Definition free_heap.c:82
t_environ_list * empty_environ(t_environ_list *environ)
Initializes environment variables for an empty environment.
Definition init_shell.c:50
bool is_arg_number(char *arg)
Checks if a string represents a valid numeric argument.
Definition exit_builtin.c:34
t_environ_node * create_environ_node(char *var)
Creates an node for an environment variable linked list.
Definition environ_list_utils.c:60
struct s_shell t_shell
Structure representing the main data structure.
void saving_stds(int *stdin_cpy, int *stdout_cpy)
Save the stdin and stdout file descriptors.
Definition single_builtin_utils.c:64
struct s_info t_info
Structure representing information for pipeline execution.
t_environ_node * add_back_environ_node(t_environ_list *environ, t_environ_node *node)
Adds an node to the end of an environment variables linked list.
Definition environ_list_utils.c:30
char * handle_quotes(t_shell *shell, char **str, char end_quote, t_expander *inter)
Handles quoted strings within a shell command.
Definition handle_quotes.c:78
pid_t ft_getpid(void)
Retrieves the process id (PID) of the current process.
Definition ft_getpid.c:97
void parent(t_shell *shell, char **args, int number)
Handles the exit command when executed within the parent process.
Definition exit_builtin_utils.c:111
char ** combine_execs(char **resplit, char **new_execs, char **execs)
Combine resplit array with execs array into new_execs array.
Definition check_execs_after_expand.c:72
enum s_token t_token
Enumeration representing different token types.
int export(t_shell *shell, char **args)
Implements the export builtin function.
Definition export_builtin.c:158
bool open_inputfile(t_executor *current, t_lexer_list *lexer)
Handles opening an input file.
Definition process_in_heredoc.c:96
int unset(t_shell *shell, char **args)
Executes the "unset" command to remove environment variables.
Definition unset_builtin.c:130
t_lexer_list * create_lexer_list(char **input_array)
Allocates memory for the lexer list.
Definition tokenize.c:83
bool open_outputfile(t_executor *current, t_lexer_list *lexer)
Handles opening an output file.
Definition process_out_append.c:48
bool get_input(int fd, char *delimiter)
Reads input for a here-document until a specified delimiter.
Definition process_in_heredoc.c:32
char * clean_rl_copy(char *rl_copy)
Create a copy of the input string with its leading and trailing whitespaces removed.
Definition clean_rl_copy.c:89
t_executor * create_executor_list(int size)
Create a linked list of t_executor nodes/elements.
Definition prep_executor.c:56
Structure representing a list of environment variables.
Definition minishell.h:77
Structure representing an environment variable node.
Definition minishell.h:86
Structure representing an executor node.
Definition minishell.h:121
Structure used in variable expansion.
Definition minishell.h:140
Structure representing information for pipeline execution.
Definition minishell.h:159
Structure representing a list of lexemes.
Definition minishell.h:109
Structure representing the main data structure.
Definition minishell.h:65