48 lines
1.6 KiB
C
48 lines
1.6 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* pipex.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/01/11 15:33:34 by erey-bet #+# #+# */
|
|
/* Updated: 2023/01/20 14:55:13 by erey-bet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef PIPEX_H
|
|
# define PIPEX_H
|
|
|
|
# include "../libft/libft.h"
|
|
# include "../get_next_line/get_next_line.h"
|
|
# include <fcntl.h>
|
|
# include <unistd.h>
|
|
# include <sys/types.h>
|
|
# include <sys/wait.h>
|
|
|
|
typedef struct s_data
|
|
{
|
|
char *cmd1;
|
|
char **flg1;
|
|
char *cmd2;
|
|
char **flg2;
|
|
char *fl1;
|
|
char *fl2;
|
|
char *ct_fl1;
|
|
int fd1;
|
|
int fd2;
|
|
char **env;
|
|
} t_data;
|
|
|
|
int get_next(char *cmd, char c);
|
|
int print_error(int type, char *error);
|
|
char **get_flags(char *cmd);
|
|
char *get_command(char *cmd);
|
|
char **add_cmd(char **flg, char *cmd);
|
|
int parsing(char *argv[], t_data *data);
|
|
char *test_acces(char **s, char **cmd, char **path, int *y);
|
|
char *cmd_exist(char **env, char **cmd, int y, char **s);
|
|
char *find_command(char **env, char *cmd);
|
|
|
|
#endif
|