From a4d0326fa98c78baf149e3c8ca7e4cbe7454a2f8 Mon Sep 17 00:00:00 2001 From: EniumRaphael Date: Sun, 12 May 2024 15:56:36 +0200 Subject: [PATCH 1/3] Update the clangd files --- .clangd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.clangd b/.clangd index 3232f215..9b7684c1 100644 --- a/.clangd +++ b/.clangd @@ -17,6 +17,13 @@ CompileFlags: # Tweak the parse settings - "-I/home/maix/school/shcat/includes/" - "-I/home/maix/school/shcat/output/include/" - "-I/home/maix/school/shcat/generic_sources/header/" + - "-I/home/raphael/42/shcat/vendor/" + - "-I/home/raphael/42/shcat/stdme/include/" + - "-I/home/raphael/42/shcat/stdme/vendor/" + - "-I/home/raphael/42/shcat/stdme/output/include/" + - "-I/home/raphael/42/shcat/stdme/generic_sources/header/" + - "-I/home/raphael/42/shcat/includes/" + - "-I/home/raphael/42/shcat/output/include/" - "-I/home/rparodi/Documents/shcat/vendor/" - "-I/home/rparodi/Documents/shcat/stdme/include/" - "-I/home/rparodi/Documents/shcat/stdme/vendor/" @@ -24,7 +31,6 @@ CompileFlags: # Tweak the parse settings - "-I/home/rparodi/Documents/shcat/stdme/generic_sources/header/" - "-I/home/rparodi/Documents/shcat/includes/" - "-I/home/rparodi/Documents/shcat/output/include/" - - "-I/Users/raphael/Documents/42/cursus/shcat/generic_sources/header/" - "-I/Users/raphael/Documents/42/cursus/shcat/vendor/" - "-I/Users/raphael/Documents/42/cursus/shcat/stdme/include/" - "-I/Users/raphael/Documents/42/cursus/shcat/stdme/vendor/" From 771deeb02ab64dfacf7e8b691a6a8df508d11b78 Mon Sep 17 00:00:00 2001 From: EniumRaphael Date: Sun, 12 May 2024 16:12:43 +0200 Subject: [PATCH 2/3] Starting to work on the differents semicolon --- sources/exec/separator/semicolon.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sources/exec/separator/semicolon.c diff --git a/sources/exec/separator/semicolon.c b/sources/exec/separator/semicolon.c new file mode 100644 index 00000000..2657d6b1 --- /dev/null +++ b/sources/exec/separator/semicolon.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* semicolon.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/05/12 16:00:33 by rparodi #+# #+# */ +/* Updated: 2024/05/12 16:03:31 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "app/env.h" +#include "app/state.h" +#include "me/types.h" +#include "gmr/symbols.h" +#include "app/node.h" +#include "me/vec/vec_str.h" +// #include "app/node/handle_program.h" +#include "app/node/handle_command.h" +#include "minishell.h" +#include "me/string/str_clone.h" + +t_error semicolon_exec(t_node *first, t_node *second, t_i32 ret_value) +{ + return (NO_ERROR); +} From 4e4a448d7532b1bd1b60dd5254b9ea8142ecc8fc Mon Sep 17 00:00:00 2001 From: EniumRaphael Date: Sun, 12 May 2024 16:54:29 +0200 Subject: [PATCH 3/3] Adding the semicolons --- sources/exec/separator/semicolon.c | 22 ++++++++++++++++++++-- sources/exec/separator/separator.h | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 sources/exec/separator/separator.h diff --git a/sources/exec/separator/semicolon.c b/sources/exec/separator/semicolon.c index 2657d6b1..1b7e1fb7 100644 --- a/sources/exec/separator/semicolon.c +++ b/sources/exec/separator/semicolon.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/12 16:00:33 by rparodi #+# #+# */ -/* Updated: 2024/05/12 16:03:31 by rparodi ### ########.fr */ +/* Updated: 2024/05/12 16:21:34 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -21,7 +21,25 @@ #include "minishell.h" #include "me/string/str_clone.h" -t_error semicolon_exec(t_node *first, t_node *second, t_i32 ret_value) +t_error ft_command_exec(t_node *node, t_i32 *ret_value) { + printf("execve : %s\n", node->single_str); + + return (NO_ERROR); +} + +t_error semicolon_exec(t_node *first, t_node *second, t_i32 *ret_value) +{ + if (!first && !second) + return (ERROR); + if (!first) + ft_command_exec(second, ret_value); + else if (!second) + ft_command_exec(first, ret_value); + else + { + ft_command_exec(first, ret_value); + ft_command_exec(second, ret_value); + } return (NO_ERROR); } diff --git a/sources/exec/separator/separator.h b/sources/exec/separator/separator.h new file mode 100644 index 00000000..f8c924b6 --- /dev/null +++ b/sources/exec/separator/separator.h @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* separator.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/05/12 16:53:15 by rparodi #+# #+# */ +/* Updated: 2024/05/12 16:54:01 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef SEPARATOR_H +# define SEPARATOR_H + +# include "minishell.h" + +t_error ft_command_exec(t_node *node, t_i32 *ret_value); +t_error semicolon_exec(t_node *first, t_node *second, t_i32 *ret_value); + +#endif +