From bac6e9d6d85c49e0596f77f5e714a3622160374b Mon Sep 17 00:00:00 2001 From: wescande Date: Tue, 7 Mar 2017 21:25:40 +0100 Subject: [PATCH] permet de compiler --- 42sh/Makefile | 1 + 42sh/includes/exec.h | 19 ++++++++++++++----- 42sh/includes/minishell.h | 4 ++-- 42sh/src/exec/ast_copy.c | 4 ++-- 42sh/src/exec/launch_case.c | 4 ++-- 42sh/src/exec/launch_for.c | 4 ++-- 42sh/src/exec/launch_if.c | 4 ++-- 42sh/src/exec/launch_process.c | 2 +- 42sh/src/exec/process_redirect.c | 8 ++++---- 42sh/src/exec/set_process.c | 6 +++--- 42sh/src/exec/set_process_case.c | 5 +++-- 42sh/src/exec/set_process_cmd.c | 3 ++- 42sh/src/exec/set_process_for.c | 5 +++-- 42sh/src/exec/set_process_if.c | 7 ++++--- 42sh/src/exec/set_process_while.c | 3 ++- 42sh/src/glob/gen_tab_esc.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_clear.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_copy.c | 8 ++++---- 42sh/src/glob/lib_perso/ft_ld_del.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_new.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_order.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_pushback.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_pushfront.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_reverse.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_size.c | 4 ++-- 42sh/src/glob/lib_perso/ft_ld_to_tab.c | 4 ++-- 42sh/src/glob/lib_perso/ft_memrealloc.c | 4 ++-- 42sh/src/glob/lib_perso/ft_strjoinf.c | 4 ++-- 42sh/src/glob/lib_perso/ft_strsubf.c | 4 ++-- 42sh/src/glob/lib_perso/ft_tabdel.c | 4 ++-- 42sh/src/glob/lib_perso/ft_tablen.c | 4 ++-- 42sh/src/glob/word_is_assignment.c | 4 ++-- 42sh/src/job-control/process_format.c | 10 +++++----- 42sh/src/parser/produce_sym.c | 4 ++-- 34 files changed, 90 insertions(+), 75 deletions(-) diff --git a/42sh/Makefile b/42sh/Makefile index 7400f7e3..c7bc80e0 100644 --- a/42sh/Makefile +++ b/42sh/Makefile @@ -58,6 +58,7 @@ completion/c_rematch.c\ completion/c_sizing.c\ completion/c_terminal.c\ completion/completion.c\ +exec/ast_copy.c\ exec/ast_free.c\ exec/bad_fd.c\ exec/error_badidentifier.c\ diff --git a/42sh/includes/exec.h b/42sh/includes/exec.h index 40df13ae..9d3936ea 100644 --- a/42sh/includes/exec.h +++ b/42sh/includes/exec.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */ -/* Updated: 2017/03/07 20:55:11 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:08:54 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,6 +14,7 @@ # define EXEC_H # include +# include "minishell.h" # define PIPE_READ 0 # define PIPE_WRITE 1 @@ -146,8 +147,6 @@ int exec_var(t_btree **ast); int exec_case_branch(t_btree **ast); int exec_math(t_btree **ast); -int launch_process(t_process *p); -int set_process(t_process *p, t_btree *ast); int process_setexec(t_process *p); int process_setgroup(t_process *p, pid_t pid); void process_setsig(void); @@ -175,15 +174,25 @@ void redir_free(void *data, size_t content_size); char **token_to_argv(t_ld *ld, int do_match); -# include int add_new_job(t_job *job); int error_badidentifier(char *name); +/* +** Mapping pour launch les process +*/ +int launch_process(t_process *p); +int launch_if(t_process *p); +int launch_while(t_process *p); +int launch_for(t_process *p); +int launch_case(t_process *p); +int launch_file(t_process *p); +int launch_builtin(t_process *p); + /* ** Mapping pour set les process */ +int set_process(t_process *p, t_btree *ast); int set_process_map(t_process *p, t_btree *ast, t_cmd *cmd); - int set_process_cmd(t_process *p, t_btree *ast, t_cmd *cmd); #endif diff --git a/42sh/includes/minishell.h b/42sh/includes/minishell.h index 2a98dd10..deac19e8 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/07 18:38:08 by jhalford ### ########.fr */ +/* Updated: 2017/03/07 21:13:31 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,7 +20,7 @@ # include # include -# include "libft.h" +# include "../libft/includes/libft.h" # include "types.h" # include "lexer.h" # include "parser.h" diff --git a/42sh/src/exec/ast_copy.c b/42sh/src/exec/ast_copy.c index 2776bb49..76fa0417 100644 --- a/42sh/src/exec/ast_copy.c +++ b/42sh/src/exec/ast_copy.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 20:44:42 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:50:43 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:25:15 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "exec.h" +#include "minishell.h" t_btree *ast_copy(t_btree *tree) { diff --git a/42sh/src/exec/launch_case.c b/42sh/src/exec/launch_case.c index ed10dcd2..a7c096ff 100644 --- a/42sh/src/exec/launch_case.c +++ b/42sh/src/exec/launch_case.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 19:02:23 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:38:19 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:02:46 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "exec.h" +#include "minishell.h" /* int exec_case(t_btree **ast) { diff --git a/42sh/src/exec/launch_for.c b/42sh/src/exec/launch_for.c index 059448c9..6de71af2 100644 --- a/42sh/src/exec/launch_for.c +++ b/42sh/src/exec/launch_for.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 17:34:43 by wescande #+# #+# */ -/* Updated: 2017/03/07 19:00:56 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:02:18 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "exec.h" +#include "minishell.h" static int do_for(t_process *p) { diff --git a/42sh/src/exec/launch_if.c b/42sh/src/exec/launch_if.c index e8eca419..ca80fffb 100644 --- a/42sh/src/exec/launch_if.c +++ b/42sh/src/exec/launch_if.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 17:26:53 by wescande #+# #+# */ -/* Updated: 2017/03/07 18:36:02 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:03:04 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "exec.h" +#include "minishell.h" static int do_if(t_process *p) { diff --git a/42sh/src/exec/launch_process.c b/42sh/src/exec/launch_process.c index 11d1b619..a677f76d 100644 --- a/42sh/src/exec/launch_process.c +++ b/42sh/src/exec/launch_process.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/13 14:20:45 by jhalford #+# #+# */ -/* Updated: 2017/03/07 20:58:52 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:07:33 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/exec/process_redirect.c b/42sh/src/exec/process_redirect.c index 3e9b2460..c62cc0c8 100644 --- a/42sh/src/exec/process_redirect.c +++ b/42sh/src/exec/process_redirect.c @@ -6,13 +6,13 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/29 16:04:18 by jhalford #+# #+# */ -/* Updated: 2017/03/06 15:12:23 by ariard ### ########.fr */ +/* Updated: 2017/03/07 21:04:38 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -t_redirmap g_redirmap[] = +t_itof g_redirmap[] = { {TK_LESS, redirect_less}, {TK_GREAT, redirect_great}, @@ -38,10 +38,10 @@ int process_redirect(t_process *p) if (redir->n > 9) return (bad_fd(redir->n)); i = 0; - while (g_redirmap[i].type) + while (g_redirmap[i].id) { DG("process redirect"); - if (g_redirmap[i].type == redir->type) + if (g_redirmap[i].id == redir->type) { if ((g_redirmap[i].f)(redir)) return (1); diff --git a/42sh/src/exec/set_process.c b/42sh/src/exec/set_process.c index 9e9f1764..336bd5bb 100644 --- a/42sh/src/exec/set_process.c +++ b/42sh/src/exec/set_process.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/05 14:54:45 by jhalford #+# #+# */ -/* Updated: 2017/03/07 15:34:31 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:12:02 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,7 +41,7 @@ int set_process(t_process *p, t_btree *ast) p->redirs = ft_lstmap(cmd->redir, ft_id); if (set_process_map(p, ast, cmd)) return (1); - if (exec->control_count) - p->attrs |= PROCESS_CONTROL; +// if (exec->control_count) +// p->attrs |= PROCESS_CONTROL; return (0); } diff --git a/42sh/src/exec/set_process_case.c b/42sh/src/exec/set_process_case.c index b69cce86..d8dcaba8 100644 --- a/42sh/src/exec/set_process_case.c +++ b/42sh/src/exec/set_process_case.c @@ -6,14 +6,15 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 20:36:04 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:51:41 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:14:19 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "exec.h" +#include "minishell.h" int set_process_case(t_process *p, t_btree *ast, t_cmd *cmd) { + (void)cmd; p->data.d_case.list_word = ft_ld_copy(((t_astnode *)ast->item)->data.cmd.wordlist, tab_esc_copy); p->data.d_case.content = ast_copy(ast->right); return (0); diff --git a/42sh/src/exec/set_process_cmd.c b/42sh/src/exec/set_process_cmd.c index 022e0305..e66d1645 100644 --- a/42sh/src/exec/set_process_cmd.c +++ b/42sh/src/exec/set_process_cmd.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 15:06:05 by wescande #+# #+# */ -/* Updated: 2017/03/07 15:50:51 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:12:31 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,6 +14,7 @@ int set_process_cmd(t_process *p, t_btree *ast, t_cmd *cmd) { + (void)ast; if (!(p->data.cmd.av = token_to_argv(cmd->token, 1))) return (1); process_setexec(p); diff --git a/42sh/src/exec/set_process_for.c b/42sh/src/exec/set_process_for.c index c3bfb0e8..34134a33 100644 --- a/42sh/src/exec/set_process_for.c +++ b/42sh/src/exec/set_process_for.c @@ -6,14 +6,15 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 19:38:05 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:51:57 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:14:33 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "exec.h" +#include "minishell.h" int set_process_for(t_process *p, t_btree *ast, t_cmd *cmd) { + (void)cmd; p->data.d_for.list_word = ft_ld_copy(((t_astnode *)ast->item)->data.cmd.wordlist, tab_esc_copy); p->data.d_for.content = ast_copy(ast->right); return (0); diff --git a/42sh/src/exec/set_process_if.c b/42sh/src/exec/set_process_if.c index bdf46274..3f8d721a 100644 --- a/42sh/src/exec/set_process_if.c +++ b/42sh/src/exec/set_process_if.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 19:19:50 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:35:16 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:10:47 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,8 @@ int set_process_if(t_process *p, t_btree *ast, t_cmd *cmd) { - p->data.d_if.condition = btree_map(ast->left, ast_copy); - p->data.d_if.content = btree_map(ast->right, ast_copy); + (void)cmd; + p->data.d_if.condition = ast_copy(ast->left); + p->data.d_if.content = ast_copy(ast->right); return (0); } diff --git a/42sh/src/exec/set_process_while.c b/42sh/src/exec/set_process_while.c index 4743d859..f0908887 100644 --- a/42sh/src/exec/set_process_while.c +++ b/42sh/src/exec/set_process_while.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 19:38:10 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:51:24 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:11:38 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,6 +14,7 @@ int set_process_while(t_process *p, t_btree *ast, t_cmd *cmd) { + (void)cmd; p->data.d_while.condition = ast_copy(ast->left); p->data.d_while.content = ast_copy(ast->right); return (0); diff --git a/42sh/src/glob/gen_tab_esc.c b/42sh/src/glob/gen_tab_esc.c index c9f5f8e4..39c8e342 100644 --- a/42sh/src/glob/gen_tab_esc.c +++ b/42sh/src/glob/gen_tab_esc.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 20:04:40 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:07:31 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:14:55 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" char **gen_tab(const char *pat, const unsigned char *esc, diff --git a/42sh/src/glob/lib_perso/ft_ld_clear.c b/42sh/src/glob/lib_perso/ft_ld_clear.c index 962d3c11..c36d9695 100644 --- a/42sh/src/glob/lib_perso/ft_ld_clear.c +++ b/42sh/src/glob/lib_perso/ft_ld_clear.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/06 19:56:49 by wescande #+# #+# */ -/* Updated: 2017/01/05 14:17:11 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:18:59 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void ft_ld_clear(t_ld **ld, void (*del)()) { diff --git a/42sh/src/glob/lib_perso/ft_ld_copy.c b/42sh/src/glob/lib_perso/ft_ld_copy.c index 7cc67659..941e4c5f 100644 --- a/42sh/src/glob/lib_perso/ft_ld_copy.c +++ b/42sh/src/glob/lib_perso/ft_ld_copy.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 19:42:23 by wescande #+# #+# */ -/* Updated: 2017/03/07 20:29:28 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:21:30 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" t_ld *ft_ld_copy(t_ld *src, void *(*f)(void *elem)) { @@ -21,9 +21,9 @@ t_ld *ft_ld_copy(t_ld *src, void *(*f)(void *elem)) while (src) { content = (*f)(src->content); - ft_ld_pushfront(dst, content); + ft_ld_pushfront(&dst, content); src = src->next; } - ft_ld_reverse(dst); + ft_ld_reverse(&dst); return (dst); } diff --git a/42sh/src/glob/lib_perso/ft_ld_del.c b/42sh/src/glob/lib_perso/ft_ld_del.c index 69852e67..50667e81 100644 --- a/42sh/src/glob/lib_perso/ft_ld_del.c +++ b/42sh/src/glob/lib_perso/ft_ld_del.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/06 15:54:53 by wescande #+# #+# */ -/* Updated: 2017/01/05 14:17:18 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:17:50 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void ft_ld_del(t_ld **ld, void (*del)()) { diff --git a/42sh/src/glob/lib_perso/ft_ld_new.c b/42sh/src/glob/lib_perso/ft_ld_new.c index b292702b..76000294 100644 --- a/42sh/src/glob/lib_perso/ft_ld_new.c +++ b/42sh/src/glob/lib_perso/ft_ld_new.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/01 18:17:34 by wescande #+# #+# */ -/* Updated: 2017/02/03 14:38:19 by ariard ### ########.fr */ +/* Updated: 2017/03/07 21:17:20 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void ft_ld_new(t_ld **alst, void *content) { diff --git a/42sh/src/glob/lib_perso/ft_ld_order.c b/42sh/src/glob/lib_perso/ft_ld_order.c index 6f6b2a9c..2adbeba7 100644 --- a/42sh/src/glob/lib_perso/ft_ld_order.c +++ b/42sh/src/glob/lib_perso/ft_ld_order.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/24 19:20:45 by wescande #+# #+# */ -/* Updated: 2017/01/24 19:40:54 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:19:13 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" t_ld *ft_ld_order(t_ld *ld, int (*f)(), void (*del)()) { diff --git a/42sh/src/glob/lib_perso/ft_ld_pushback.c b/42sh/src/glob/lib_perso/ft_ld_pushback.c index 5ec29624..e1dd629c 100644 --- a/42sh/src/glob/lib_perso/ft_ld_pushback.c +++ b/42sh/src/glob/lib_perso/ft_ld_pushback.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/16 15:59:38 by wescande #+# #+# */ -/* Updated: 2017/02/17 23:33:37 by ariard ### ########.fr */ +/* Updated: 2017/03/07 21:17:28 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void ft_ld_pushback(t_ld **alst, void *content) { diff --git a/42sh/src/glob/lib_perso/ft_ld_pushfront.c b/42sh/src/glob/lib_perso/ft_ld_pushfront.c index 5f830ee1..067db748 100644 --- a/42sh/src/glob/lib_perso/ft_ld_pushfront.c +++ b/42sh/src/glob/lib_perso/ft_ld_pushfront.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/01 18:32:40 by wescande #+# #+# */ -/* Updated: 2017/01/05 14:17:46 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:15:42 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void ft_ld_pushfront(t_ld **alst, void *content) { diff --git a/42sh/src/glob/lib_perso/ft_ld_reverse.c b/42sh/src/glob/lib_perso/ft_ld_reverse.c index 62ffe670..7dc87189 100644 --- a/42sh/src/glob/lib_perso/ft_ld_reverse.c +++ b/42sh/src/glob/lib_perso/ft_ld_reverse.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/12 14:16:04 by wescande #+# #+# */ -/* Updated: 2017/01/05 14:17:53 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:20:35 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void ft_ld_reverse(t_ld **lst) { diff --git a/42sh/src/glob/lib_perso/ft_ld_size.c b/42sh/src/glob/lib_perso/ft_ld_size.c index 1a2d8852..ae12022d 100644 --- a/42sh/src/glob/lib_perso/ft_ld_size.c +++ b/42sh/src/glob/lib_perso/ft_ld_size.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/01 18:33:48 by wescande #+# #+# */ -/* Updated: 2017/02/03 14:38:07 by ariard ### ########.fr */ +/* Updated: 2017/03/07 21:19:26 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" size_t ft_ld_size(t_ld *ld) { diff --git a/42sh/src/glob/lib_perso/ft_ld_to_tab.c b/42sh/src/glob/lib_perso/ft_ld_to_tab.c index e6db262d..286e3b3f 100644 --- a/42sh/src/glob/lib_perso/ft_ld_to_tab.c +++ b/42sh/src/glob/lib_perso/ft_ld_to_tab.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/05 16:17:00 by wescande #+# #+# */ -/* Updated: 2017/01/05 16:22:12 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:20:05 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" char **ft_ld_to_tab(t_ld *ld) { diff --git a/42sh/src/glob/lib_perso/ft_memrealloc.c b/42sh/src/glob/lib_perso/ft_memrealloc.c index 2ea59d78..50cbeb11 100644 --- a/42sh/src/glob/lib_perso/ft_memrealloc.c +++ b/42sh/src/glob/lib_perso/ft_memrealloc.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/05 13:44:36 by wescande #+# #+# */ -/* Updated: 2017/02/09 17:01:01 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:19:39 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void *ft_memrealloc(void *ptr, size_t old_s, size_t new_s) { diff --git a/42sh/src/glob/lib_perso/ft_strjoinf.c b/42sh/src/glob/lib_perso/ft_strjoinf.c index 3bc72d56..d860b34c 100644 --- a/42sh/src/glob/lib_perso/ft_strjoinf.c +++ b/42sh/src/glob/lib_perso/ft_strjoinf.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/05 13:33:24 by wescande #+# #+# */ -/* Updated: 2017/01/24 16:53:13 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:19:55 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" char *ft_strjoinf(char *s1, char *s2, int state) { diff --git a/42sh/src/glob/lib_perso/ft_strsubf.c b/42sh/src/glob/lib_perso/ft_strsubf.c index 2e6d5b51..72bcb016 100644 --- a/42sh/src/glob/lib_perso/ft_strsubf.c +++ b/42sh/src/glob/lib_perso/ft_strsubf.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/15 17:20:08 by wescande #+# #+# */ -/* Updated: 2017/02/07 13:01:55 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:20:19 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" char *ft_strsubf(char *s, unsigned int start, size_t len, short int mode) { diff --git a/42sh/src/glob/lib_perso/ft_tabdel.c b/42sh/src/glob/lib_perso/ft_tabdel.c index d4f9cff0..680c7b83 100644 --- a/42sh/src/glob/lib_perso/ft_tabdel.c +++ b/42sh/src/glob/lib_perso/ft_tabdel.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/04 16:29:54 by wescande #+# #+# */ -/* Updated: 2017/02/02 14:22:46 by jhalford ### ########.fr */ +/* Updated: 2017/03/07 21:18:08 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" void ft_tabdel(char ***mytab) { diff --git a/42sh/src/glob/lib_perso/ft_tablen.c b/42sh/src/glob/lib_perso/ft_tablen.c index 3efbee0b..149cd7ca 100644 --- a/42sh/src/glob/lib_perso/ft_tablen.c +++ b/42sh/src/glob/lib_perso/ft_tablen.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/28 16:54:07 by wescande #+# #+# */ -/* Updated: 2016/12/28 16:55:46 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:18:23 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "libft.h" +#include "minishell.h" int ft_tablen(char **mytab) { diff --git a/42sh/src/glob/word_is_assignment.c b/42sh/src/glob/word_is_assignment.c index de819dd1..d0908d23 100644 --- a/42sh/src/glob/word_is_assignment.c +++ b/42sh/src/glob/word_is_assignment.c @@ -6,11 +6,11 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 18:59:11 by wescande #+# #+# */ -/* Updated: 2017/03/07 18:59:38 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:20:53 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ -#include "glob.h" +#include "minishell.h" int word_is_assignment(char **content) { diff --git a/42sh/src/job-control/process_format.c b/42sh/src/job-control/process_format.c index 8954b13d..96052289 100644 --- a/42sh/src/job-control/process_format.c +++ b/42sh/src/job-control/process_format.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/09 13:05:55 by jhalford #+# #+# */ -/* Updated: 2017/03/07 14:46:12 by wescande ### ########.fr */ +/* Updated: 2017/03/07 21:24:17 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -42,7 +42,7 @@ static void process_format_com_long(t_list **plist) t_process *p; p = (*plist)->content; - if (p->attrs & PROCESS_CONTROL) +/* if (p->attrs & PROCESS_CONTROL) ft_putstr("script"); else if (p->attrs & PROCESS_SUBSHELL) { @@ -50,7 +50,7 @@ static void process_format_com_long(t_list **plist) // ft_putstr(p->data.cmd.av[2]); ft_putstr(" )"); } - else + else*/ ft_sstrprint(p->data.cmd.av, ' '); if ((*plist)->next) ft_putstr(" |"); @@ -72,7 +72,7 @@ static void process_format_com_short(t_list **plist, t_flag state) p->attrs &= ~PROCESS_STATE_MASK; p->attrs &= ~PROCESS_RUNNING; } - if (p->attrs & PROCESS_CONTROL) +/* if (p->attrs & PROCESS_CONTROL) ft_putstr("script"); else if (p->attrs & PROCESS_SUBSHELL) { @@ -80,7 +80,7 @@ static void process_format_com_short(t_list **plist, t_flag state) ft_putstr(p->data.cmd.av[2]); ft_putstr(" )"); } - else + else*/ ft_sstrprint(p->data.cmd.av, ' '); if ((*plist)->next) ft_putstr(" | "); diff --git a/42sh/src/parser/produce_sym.c b/42sh/src/parser/produce_sym.c index 8cf01e20..6881847c 100644 --- a/42sh/src/parser/produce_sym.c +++ b/42sh/src/parser/produce_sym.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/09 17:58:34 by ariard #+# #+# */ -/* Updated: 2017/03/07 18:47:55 by ariard ### ########.fr */ +/* Updated: 2017/03/07 21:24:40 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -60,7 +60,7 @@ t_prodmatch g_prodmatch[] = {TK_ASSIGNEMENT_WORD, TK_BANG, CMD_PREFIX}, {TK_ASSIGNEMENT_WORD, SEPARATOR_OP, CMD_PREFIX}, {TK_ASSIGNEMENT_WORD, NEWLINE_LIST, CMD_PREFIX}, - {TK_NAME, TK_BAMG, FNAME}, + {TK_NAME, TK_BANG, FNAME}, {TK_NAME, LINEBREAK, FNAME}, {TK_NAME, TK_PAREN_OPEN, FNAME}, {TK_NAME, TK_LBRACE, FNAME},