From 57d206d7c751484c017c0b0667e22200f29e27de Mon Sep 17 00:00:00 2001 From: gwojda Date: Fri, 24 Mar 2017 16:59:36 +0100 Subject: [PATCH] norme --- 42sh/includes/job_control.h | 4 ++-- 42sh/includes/types.h | 8 +++----- 42sh/libft/src/btree/btree_map.c | 4 ++-- 42sh/libft/src/error/error.c | 7 ++++--- 42sh/src/builtin/builtin_func.c | 5 +---- 42sh/src/builtin/builtin_read.c | 4 ++-- 42sh/src/main/data_init.c | 6 +++--- 42sh/src/main/ft_putast.c | 8 ++++---- 8 files changed, 21 insertions(+), 25 deletions(-) diff --git a/42sh/includes/job_control.h b/42sh/includes/job_control.h index 7a947624..ddf9e390 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/24 15:07:50 by gwojda ### ########.fr */ +/* Updated: 2017/03/24 16:17:40 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -81,7 +81,7 @@ void process_format(t_list **p, int firstp, int opts); */ void pprint(t_process *p); -int pprint_subshell(t_process *p);; +int pprint_subshell(t_process *p); int pprint_brace(t_process *p); int pprint_while(t_process *p); int pprint_if(t_process *p); diff --git a/42sh/includes/types.h b/42sh/includes/types.h index fc142314..99be9273 100644 --- a/42sh/includes/types.h +++ b/42sh/includes/types.h @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* types.h :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: jhalford +#+ +:+ +#+ */ +/* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/13 17:11:48 by jhalford #+# #+# */ -/* Updated: 2017/03/22 19:36:55 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 16:21:12 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -55,7 +55,7 @@ typedef struct s_ld t_ld; ** Execution types */ -typedef int t_condition; +typedef int t_condition; typedef struct s_job t_job; typedef struct s_process t_process; typedef int (t_execf)(const char *path, @@ -67,8 +67,6 @@ typedef union u_process_data t_process_data; typedef struct s_process_map t_process_map; typedef struct s_data_cond t_data_while; typedef struct s_data_cond t_data_if; -typedef struct s_data_cond t_data_if; - /* ** Parser types diff --git a/42sh/libft/src/btree/btree_map.c b/42sh/libft/src/btree/btree_map.c index 85439a1a..47b92852 100644 --- a/42sh/libft/src/btree/btree_map.c +++ b/42sh/libft/src/btree/btree_map.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* btree_map.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: jhalford +#+ +:+ +#+ */ +/* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 11:50:46 by jhalford #+# #+# */ -/* Updated: 2017/03/21 15:42:18 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 15:49:42 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/libft/src/error/error.c b/42sh/libft/src/error/error.c index 4b743cea..1f8b980d 100644 --- a/42sh/libft/src/error/error.c +++ b/42sh/libft/src/error/error.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* error.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: jhalford +#+ +:+ +#+ */ +/* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/14 16:47:00 by jhalford #+# #+# */ -/* Updated: 2017/03/24 15:36:34 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 16:22:55 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,6 +39,7 @@ int error_set(int n, ...) int ft_perror(char *utility) { - ft_dprintf(2, "{red}%s: %s{eoc}\n", utility ? utility : g_argv[0], g_errmsg); + ft_dprintf(2, "{red}%s: %s{eoc}\n", utility ? utility : g_argv[0], + g_errmsg); return (g_errnum); } diff --git a/42sh/src/builtin/builtin_func.c b/42sh/src/builtin/builtin_func.c index efbe3cc8..f9129d66 100644 --- a/42sh/src/builtin/builtin_func.c +++ b/42sh/src/builtin/builtin_func.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/24 15:03:02 by wescande #+# #+# */ -/* Updated: 2017/03/24 15:30:13 by wescande ### ########.fr */ +/* Updated: 2017/03/24 16:22:13 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,11 +26,8 @@ int builtin_func(const char *path, if (!argv || !argv[0] || argv[1]) return (SH_ERR("usage: %s", FUNC_USAGE) ? 1 : 1); list = data_singleton()->lst_func; - DG(); - int toto = 0; while (list) { - DG(">>>>>>>%d", toto++); if (!(ast = list->content)) return (SH_ERR("unexpected error")); name = token_to_argv(((t_astnode *)(*ast)->item)->data.cmd.token, 1); diff --git a/42sh/src/builtin/builtin_read.c b/42sh/src/builtin/builtin_read.c index abea9035..d003a988 100644 --- a/42sh/src/builtin/builtin_read.c +++ b/42sh/src/builtin/builtin_read.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/20 15:01:45 by jhalford #+# #+# */ -/* Updated: 2017/03/24 15:10:57 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 16:23:51 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,7 +39,7 @@ int bt_read_init(t_read *data, char **av) if (isatty(STDIN)) data->opts |= BT_READ_INTER; if (bt_read_terminit(data) < 0) - exit (1); + exit(1); if ((cliopts_get(av, g_read_opts, data))) return (ft_perror("read")); return (0); diff --git a/42sh/src/main/data_init.c b/42sh/src/main/data_init.c index 46104d14..2594da36 100644 --- a/42sh/src/main/data_init.c +++ b/42sh/src/main/data_init.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/28 19:26:32 by jhalford #+# #+# */ -/* Updated: 2017/03/24 13:51:24 by wescande ### ########.fr */ +/* Updated: 2017/03/24 16:27:51 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -92,12 +92,12 @@ int data_init(int ac, char **av) term_name = "dumb"; if (tgetent(NULL, term_name) != 1) { - ft_dprintf(2, "{red}TERM name is not a tty\n{eoc}"); + SH_ERR("TERM name is not a tty"); return (-1); } if (path_binary_save(av[0])) { - ft_dprintf(2, "{red}Failed to resolve binary name\n{eoc}"); + SH_ERR("Failed to resolve binary name"); return (-1); } return (0); diff --git a/42sh/src/main/ft_putast.c b/42sh/src/main/ft_putast.c index 0d830c1c..30df296b 100644 --- a/42sh/src/main/ft_putast.c +++ b/42sh/src/main/ft_putast.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* tree_type.c :+: :+: :+: */ +/* ft_putast.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: jhalford +#+ +:+ +#+ */ +/* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/14 18:18:04 by jhalford #+# #+# */ -/* Updated: 2017/03/14 22:11:26 by ariard ### ########.fr */ +/* Updated: 2017/03/24 16:28:14 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,7 +16,7 @@ char *ft_putast(void *nodein) { t_astnode *node; node = nodein; - + if (node->type == TK_BANG) return ("TK_BANG"); if (node->type == TK_DSEMI)