/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* s_struct.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #ifndef S_STRUCT_H #define S_STRUCT_H #include #include "d_define.h" /* ** redir(int8_t) index ** ------------------- ** -1: < ** 1: > ** 2: >> ** 0: means no redirection */ typedef struct s_lvars { char *name; char *val; struct s_lvars *next; } t_lvars; typedef struct s_com { char *bin; char **argv; int8_t redir; int32_t rdrfd; char *rdrpath; char **env_fork; } t_com; struct s_lpipes { struct s_com *com; struct s_lpipes *next; }; /* ** nextif(uint8_t) index ** --------------------- ** 0: ; ** 1: && ** 2: || */ typedef struct s_line { uint8_t nextif; struct s_com *com; struct s_lpipes *pipes; struct s_line *next; } t_line; typedef struct s_msh { char **envp; char ps[4][1024]; uint8_t ret; char *shname; char **bu_ref; char *cwd; char env_fork_tmp[128][1024]; char sqb_ref[FT_ID_SQB_COUNT][4]; uint8_t (*bu_ptr[FT_BUILTINS_COUNT])(char **, struct s_msh*); struct s_line *curr; struct s_lvars *vars; } t_msh; #endif