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/" diff --git a/sources/exec/separator/semicolon.c b/sources/exec/separator/semicolon.c new file mode 100644 index 00000000..1b7e1fb7 --- /dev/null +++ b/sources/exec/separator/semicolon.c @@ -0,0 +1,45 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* semicolon.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/05/12 16:00:33 by rparodi #+# #+# */ +/* Updated: 2024/05/12 16:21:34 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 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 +