summaryrefslogtreecommitdiffstats
path: root/src/e_externs_pipes.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/e_externs_pipes.c (renamed from src/ft_e_externs_pipes.c)42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/ft_e_externs_pipes.c b/src/e_externs_pipes.c
index c1c57b5..c8f8404 100644
--- a/src/ft_e_externs_pipes.c
+++ b/src/e_externs_pipes.c
@@ -1,7 +1,7 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
-/* ft_e_externs_pipes.c :+: :+: :+: */
+/* e_externs_pipes.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
@@ -18,26 +18,26 @@
#include <string.h>
#include <errno.h>
-#include "ft_d_define.h"
-#include "ft_e_externs_next.h"
-#include "ft_f_fail.h"
-#include "ft_m_redirs.h"
-#include "ft_s_destroy.h"
-#include "ft_s_lcom.h"
-#include "ft_s_struct.h"
+#include "d_define.h"
+#include "e_externs_next.h"
+#include "f_fail.h"
+#include "m_redirs.h"
+#include "s_destroy.h"
+#include "s_lcom.h"
+#include "s_struct.h"
static void
- ft_e_extern_child(const char *fullpath,
+ e_extern_child(const char *fullpath,
t_lcom *ptr,
t_msh *msh)
{
- ft_dup_redirs(ptr, msh);
+ dup_redirs(ptr, msh);
execve(fullpath, ptr->argv, msh->envp);
/* TODO: handle execve failed */
}
static size_t
-ft_e_get_pipes_count(struct s_lpipes *ptr)
+ e_get_pipes_count(struct s_lpipes *ptr)
{
struct s_lpipes *rptr;
size_t pipes;
@@ -53,7 +53,7 @@ ft_e_get_pipes_count(struct s_lpipes *ptr)
}
static void
- ft_exec_path(const char *fullpath[],
+ exec_path(const char *fullpath[],
struct s_lpipes *head,
t_msh *msh)
{
@@ -65,7 +65,7 @@ static void
int status;
/* TODO: norm, error mgmnt */
- pipes = ft_e_get_pipes_count(head);
+ pipes = e_get_pipes_count(head);
i = 0;
while (i < pipes)
{
@@ -88,7 +88,7 @@ static void
close(fd[j][FT_READ_END]);
j++;
}
- ft_e_extern_child(fullpath[i], head->one, msh);
+ e_extern_child(fullpath[i], head->one, msh);
}
head = head->next;
i++;
@@ -108,7 +108,7 @@ static void
}
void
- ft_e_externs_pipes(struct s_lpipes *ptr,
+ e_externs_pipes(struct s_lpipes *ptr,
t_msh *msh)
{
struct s_lpipes *head;
@@ -120,9 +120,9 @@ void
head = ptr;
rptr = ptr;
- pipes = ft_e_get_pipes_count(head);
+ pipes = e_get_pipes_count(head);
if (!(fullpath = (char **)malloc((pipes + 2) * sizeof(char *))))
- ft_fail_alloc(msh);
+ fail_alloc(msh);
fullpath[pipes + 1] = NULL;
i = 0;
while (rptr != NULL)
@@ -130,11 +130,11 @@ void
if (ft_ischarset("/.", rptr->one->com[0]))
{
if (!(fullpath[i] = ft_strdup(rptr->one->com)))
- ft_fail_alloc(msh);
+ fail_alloc(msh);
}
- else if ((envpath = ft_get_env_path(msh)) != NULL)
+ else if ((envpath = get_env_path(msh)) != NULL)
{
- fullpath[i] = ft_search_in_path(rptr->one->com, envpath, msh);
+ fullpath[i] = search_in_path(rptr->one->com, envpath, msh);
ft_delwords(envpath);
}
/* TODO: deal if not found etc */
@@ -142,6 +142,6 @@ void
rptr = rptr->next;
}
i = 0;
- ft_exec_path((const char**)fullpath, head, msh);
+ exec_path((const char**)fullpath, head, msh);
ft_delwords(fullpath);
}