Files
42_INT_07_minishell/headers/minishell_structs.h
LuckyLaszlo 843b6d84c5 "extern char **environ" in header file
+ global var g_all deleted, renamed switch_heredoc_sigint
2021-11-26 21:58:52 +01:00

74 lines
1.8 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell_structs.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 02:35:52 by lperrey #+# #+# */
/* Updated: 2021/11/26 21:53:39 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_STRUCTS_H
# define MINISHELL_STRUCTS_H
struct s_all;
enum e_token_id
{
T_LESS = '<',
T_GREAT = '>',
T_PIPE = '|',
T_DLESS,
T_DGREAT,
T_WORD,
T_REDIRECTION_WORD
};
// T_DLESS == '<<'
// T_DGREAT == '>>'
enum e_quotes_state
{
IN_QUOTES = '\'',
IN_DQUOTES = '\"'
};
typedef struct s_token
{
char *content;
struct s_token *next;
enum e_token_id id;
} t_token;
typedef int (*t_builtin_f)(int,char **,struct s_all *);
typedef struct s_cmd
{
char **argv;
char *path;
t_builtin_f builtin_func;
int fd_in;
int fd_out;
pid_t pid;
int error;
} t_cmd;
typedef struct s_all
{
t_cmd **cmd_arr;
// char **envp;
char **path;
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