Pushing ohter sep
This commit is contained in:
parent
a07e35afb1
commit
713f0f0302
5 changed files with 68 additions and 9 deletions
21
sources/exec/separator/and_and.c
Normal file
21
sources/exec/separator/and_and.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* and_and.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/12 19:16:12 by rparodi #+# #+# */
|
||||
/* Updated: 2024/05/12 19:19:08 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "separator.h"
|
||||
|
||||
t_error and_and_exec(t_node *first, t_node *second, t_i32 *ret_value)
|
||||
{
|
||||
if (ft_command_exec(first, ret_value) == ERROR)
|
||||
return (ERROR);
|
||||
ft_command_exec(second, ret_value);
|
||||
return (NO_ERROR);
|
||||
}
|
||||
23
sources/exec/separator/pipe_pipe.c
Normal file
23
sources/exec/separator/pipe_pipe.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* pipe_pipe.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/12 19:21:01 by rparodi #+# #+# */
|
||||
/* Updated: 2024/05/12 19:44:46 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "separator.h"
|
||||
|
||||
t_error pipe_pipe(t_node *first, t_node *second, t_i32 *ret_value)
|
||||
{
|
||||
if (first || ft_command_exec(first, ret_value))
|
||||
return (NO_ERROR);
|
||||
else if (second || ft_command_exec(second, ret_value))
|
||||
return (NO_ERROR);
|
||||
else
|
||||
return (ERROR);
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/12 16:00:33 by rparodi #+# #+# */
|
||||
/* Updated: 2024/05/12 16:21:34 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/05/12 19:13:26 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -21,13 +21,6 @@
|
|||
#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)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/12 16:53:15 by rparodi #+# #+# */
|
||||
/* Updated: 2024/05/12 16:54:01 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/05/12 19:57:14 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -16,6 +16,8 @@
|
|||
# include "minishell.h"
|
||||
|
||||
t_error ft_command_exec(t_node *node, t_i32 *ret_value);
|
||||
t_error pipe_pipe(t_node *first, t_node *second, t_i32 *ret_value);
|
||||
t_error and_and_exec(t_node *first, t_node *second, t_i32 *ret_value);
|
||||
t_error semicolon_exec(t_node *first, t_node *second, t_i32 *ret_value);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
20
sources/exec/separator/simple_cmd.c
Normal file
20
sources/exec/separator/simple_cmd.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* simple_cmd.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/12 19:13:42 by rparodi #+# #+# */
|
||||
/* Updated: 2024/05/12 19:14:19 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "separator.h"
|
||||
|
||||
t_error ft_command_exec(t_node *node, t_i32 *ret_value)
|
||||
{
|
||||
printf("execve : %s\n", node->single_str);
|
||||
|
||||
return (NO_ERROR);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue