[ADD] multiple pipe

This commit is contained in:
joris schaft 2024-05-13 14:10:41 +02:00
parent 149bafef88
commit 9d70f4ccb2
4 changed files with 72 additions and 17 deletions

View file

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* include.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */
/* Updated: 2024/04/26 12:33:20 by mcolonna ### ########.fr */
/* Updated: 2024/05/13 10:22:54 by jschaft ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,6 +18,7 @@
# include <errno.h>
# include <string.h>
# include <sys/types.h>
# include <sys/wait.h>
# include <unistd.h>
# include <fcntl.h>
# include <stdlib.h>
@ -51,6 +52,14 @@ typedef struct s_command
int output_fd; // fd to use with '>' redirection (1 by default)
} t_command;
// To make a list of pipe when needed
typedef struct s_pipes
{
int pipe[2]; // simple pipe
int i; //index of the pipe
int inout; //in case of first or last pipe
} t_pipes;
// Return the t_command representing the command given by the user.
// If error, return a t_command wth the value .error = true.
t_command parse_command(const t_memclass mc, const char *command);
@ -70,6 +79,8 @@ void minishell_error(const char *msg);
// Call to write the error and exit the program.
void fatal_error(const char *msg);
// Call to write the error and return in exec_command
int exec_error(void);
///// PATH /////
// Get the PATH values.