+ TODO : need refactoring and fix to valgrind invalid read size + redirections() WIP + Generic ft_dup_2d_arr(), ft_split_quotes(), ft_strdup_quotes() + shell_loop() continue on error + various small fix
66 lines
1.7 KiB
C
66 lines
1.7 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* minishell_structs.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/10/08 02:35:52 by lperrey #+# #+# */
|
|
/* Updated: 2021/11/11 07:21:47 by lperrey ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef MINISHELL_STRUCTS_H
|
|
# define MINISHELL_STRUCTS_H
|
|
|
|
struct s_all *g_all;
|
|
|
|
enum e_token_id
|
|
{
|
|
T_TOKEN = 0,
|
|
T_LESS = '<',
|
|
T_GREAT = '>',
|
|
T_PIPE = '|',
|
|
T_DLESS,
|
|
T_DGREAT,
|
|
T_WORD,
|
|
T_REDIRECTION_WORD
|
|
};
|
|
// T_DLESS == '<<'
|
|
// T_DGREAT == '>>'
|
|
|
|
typedef struct s_token
|
|
{
|
|
char *content;
|
|
struct s_token *next;
|
|
enum e_token_id id;
|
|
} t_token;
|
|
|
|
typedef int (*t_builtin_ptr)(int,char **,struct s_all *);
|
|
|
|
typedef struct s_cmd
|
|
{
|
|
char **argv;
|
|
pid_t pid;
|
|
t_builtin_ptr *builtin_command;
|
|
int fd_in;
|
|
int fd_out;
|
|
} t_cmd;
|
|
|
|
typedef struct s_all
|
|
{
|
|
t_cmd **cmd_arr;
|
|
char **envp;
|
|
char *prompt_base;
|
|
char *prompt;
|
|
t_token *token_list;
|
|
int last_exit_status;
|
|
struct termios ori_termios;
|
|
struct termios interactive_termios;
|
|
int termios_changed;
|
|
struct sigaction ori_signal_behaviour;
|
|
struct sigaction signal_behaviour;
|
|
} t_all;
|
|
|
|
#endif
|