diff --git a/42sh/includes/builtin_read.h b/42sh/includes/builtin_read.h index 76fd5695..3e7e356e 100644 --- a/42sh/includes/builtin_read.h +++ b/42sh/includes/builtin_read.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/20 15:02:39 by jhalford #+# #+# */ -/* Updated: 2017/03/22 16:12:31 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:25:08 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,7 +29,7 @@ typedef struct s_read t_read; typedef struct s_readopt t_readopt; -struct s_read +struct s_read { t_flag opts; char **names; diff --git a/42sh/includes/job_control.h b/42sh/includes/job_control.h index 13e3c824..8840d4b0 100644 --- a/42sh/includes/job_control.h +++ b/42sh/includes/job_control.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/10 16:55:09 by jhalford #+# #+# */ -/* Updated: 2017/03/21 14:40:26 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:24:08 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,7 +27,7 @@ # define JOBS_OPT_L (1 << 0) -struct s_jobc +struct s_jobc { t_list *first_job; pid_t shell_pgid; @@ -75,9 +75,11 @@ void sigttou_handler(int signo); int process_cmp_pid(t_process *p, pid_t *pid); void process_format(t_list **p, int firstp, int opts); + /* ** Mapping pour afficher les process */ + void pprint(t_process *p); int pprint_subshell(t_process *p);; int pprint_brace(t_process *p); diff --git a/42sh/includes/lexer.h b/42sh/includes/lexer.h index 13622138..5f60cc83 100644 --- a/42sh/includes/lexer.h +++ b/42sh/includes/lexer.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/01 12:15:50 by jhalford #+# #+# */ -/* Updated: 2017/03/20 16:44:48 by ariard ### ########.fr */ +/* Updated: 2017/03/22 17:25:09 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,7 +17,7 @@ # include "libft.h" # include "types.h" -enum e_lexstate +enum e_lexstate { DEFAULT, PAREN, @@ -37,7 +37,7 @@ enum e_lexstate END, }; -struct s_token +struct s_token { t_type type; char *data; @@ -46,7 +46,7 @@ struct s_token int size; }; -struct s_lexer +struct s_lexer { char *str; int pos; @@ -55,7 +55,7 @@ struct s_lexer t_list *heredoc_stack; }; -struct s_rvwords +struct s_rvwords { char *word; int type; diff --git a/42sh/includes/minishell.h b/42sh/includes/minishell.h index 31949f0a..2dd823c0 100644 --- a/42sh/includes/minishell.h +++ b/42sh/includes/minishell.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/10 13:07:44 by jhalford #+# #+# */ -/* Updated: 2017/03/22 16:32:46 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:23:54 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -31,17 +31,10 @@ # include "glob.h" # include "completion.h" # include "hash.h" -/* # define malloc(x) NULL */ # define SH_MSG(s, ...) "{red}%s: " s "{eoc}\n", g_argv[0], ##__VA_ARGS__ # define SH_ERR(s, ...) ft_dprintf(STDERR, SH_MSG(s, ##__VA_ARGS__)) -#ifndef DEBUG -# define DEBUG_MODE 0 -#else -# define DEBUG_MODE 1 -#endif - struct s_data { t_flag opts; @@ -61,6 +54,7 @@ struct s_data t_list *lst_func; }; +t_data *data_singleton(); int shell_init(int ac, char **av); void shell_exit(void); int data_init(int ac, char **av); @@ -69,7 +63,6 @@ int get_c_arg(char ***av, t_data *data); void shell_resetfds(void); void shell_resetsig(void); -/* void content_free(void *data, size_t content_size); */ char *ft_putast(void *node); void ft_putast2(void *node); diff --git a/42sh/includes/types.h b/42sh/includes/types.h index 726270b3..6540196b 100644 --- a/42sh/includes/types.h +++ b/42sh/includes/types.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/13 17:11:48 by jhalford #+# #+# */ -/* Updated: 2017/03/20 10:38:12 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:22:52 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,7 +26,7 @@ # define SH_IS_INTERACTIVE(b) (b & SH_INTERACTIVE) # define SH_NO_INTERACTIVE(b) !(b & SH_INTERACTIVE) -# define SH_MSG_NOJOBC "no job-control" +# define SH_MSG_NOJOBC "no job-control" typedef long long t_type; typedef long long t_flag; @@ -88,8 +88,6 @@ typedef struct s_errormatch t_errormatch; typedef struct s_treematch t_treematch; typedef struct s_distrostree t_distrostree; -t_data *data_singleton(); - enum e_sym { LINEBREAK = 1, diff --git a/42sh/src/builtin/builtin_env.c b/42sh/src/builtin/builtin_env.c index f6297f59..08c29937 100644 --- a/42sh/src/builtin/builtin_env.c +++ b/42sh/src/builtin/builtin_env.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/22 16:20:31 by gwojda #+# #+# */ -/* Updated: 2017/03/22 16:21:12 by gwojda ### ########.fr */ +/* Updated: 2017/03/22 17:17:28 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 17a21519..e65dc3e9 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */ -/* Updated: 2017/03/22 17:13:06 by jhalford ### ########.fr */ +/* Updated: 2017/03/22 17:25:20 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,8 +43,7 @@ static int handle_instruction(t_list **token, t_btree **ast) return (ret); if (do_lexer_routine(token, stream) > 0) continue ; - token_print(*token); - exit(1); + /* token_print(*token); */ if ((ret = do_parser_routine(token, ast)) == 1 && SH_NO_INTERACTIVE(data->opts)) return (ret);