tgrekov-pipex
HIVE pipex May 2024
|
Definition in file dispatch.c.
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <libft.h>
#include <ft_printf.h>
#include "../utils/utils.h"
Go to the source code of this file.
Functions | |
char * | get_cmd (char **paths, char *name) |
Find and return the first existing file with called name from the array of paths . | |
void | dispatch (char **paths, char *args, char **envp, int *in_out) |
Dispatch child process with argument string args , environment envp , and stdin / stdout in_out [0] / in_out [1]. | |
void dispatch | ( | char ** | paths, |
char * | args, | ||
char ** | envp, | ||
int * | in_out | ||
) |
Dispatch child process with argument string args
, environment envp
, and stdin
/ stdout
in_out
[0] / in_out
[1].
paths | Null-terminated array of paths with trailing forward slashes to search for the executable name in |
args | String of arguments that will be split and passed as argv to the child process |
envp | Environment pointer for the child process |
in_out | stdin and stdout for the child process |
Definition at line 67 of file dispatch.c.
References arr_free(), ft_printf(), and ft_split().
char * get_cmd | ( | char ** | paths, |
char * | name | ||
) |
Find and return the first existing file with called name
from the array of paths
.
paths | Null-terminated array of paths with trailing forward slashes |
name | Name of command to search for |
char* | Full path to the command |
Definition at line 33 of file get_cmd.c.
References err(), ft_strdup(), and ft_strjoin().