-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipex.h
50 lines (44 loc) · 1.75 KB
/
pipex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pipex.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ymiao <ymiao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/26 18:30:10 by ymiao #+# #+# */
/* Updated: 2025/01/27 22:44:26 by ymiao ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PIPEX_H
# define PIPEX_H
# include <stdio.h>
# include <stdlib.h>
# include <sys/wait.h>
# include <unistd.h>
# include <string.h>
# include <fcntl.h>
# include <stddef.h>
# include <errno.h>
# include "./ft_printf/ft_printf.h"
# include "./GNL/get_next_line.h"
typedef struct s_cmd
{
char **cmd;
char *path;
char **env;
int left_pipe[2];
int right_pipe[2];
} t_cmd;
int ft_strcmp(char *s1, char *s2);
char *ft_strjoin_cmd(char *s1, char *s2);
char **ft_split(char const *s, char c);
void free_split(char **cmd);
char *all_path(char **env);
char *sep_path(char *path, char *cmd);
char *get_path(char **env, char **cmd);
int exam_arg(int argc, char **argv, char **env);
t_cmd assign_cmd(t_cmd cmd, char *now_arg, char **env);
void free_t_cmd(t_cmd cmd);
void ft_exec(int fd_read, int fd_write, t_cmd cmd);
void run_heredoc(int argc, char **argv, char **env, char *limiter);
#endif