[ADD] parse_command()
This commit is contained in:
parent
24d8b38510
commit
af6488534b
10 changed files with 225 additions and 13 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/24 13:19:28 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/25 16:53:06 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ typedef struct s_call
|
|||
// Represents a command given by the user.
|
||||
typedef struct s_command
|
||||
{
|
||||
bool error; // true means an error occured in interpret_command().
|
||||
bool error; // true if an error occured in interpret_command().
|
||||
const t_call *calls; // all calls to programs.
|
||||
int input_fd; // fd to use with '<' redirection (0 by default)
|
||||
int output_fd; // fd to use with '>' redirection (1 by default)
|
||||
|
|
@ -53,7 +53,7 @@ typedef struct s_command
|
|||
|
||||
// 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 char *command);
|
||||
t_command parse_command(const t_memclass mc, const char *command);
|
||||
|
||||
///// EXECUTE COMMAND /////
|
||||
|
||||
|
|
@ -66,6 +66,9 @@ int execute_command(t_command command);
|
|||
// If msg == "errno", use strerror(errno)
|
||||
void minishell_error(const char *msg);
|
||||
|
||||
// Call to write the error and exit the program.
|
||||
void fatal_error(const char *msg);
|
||||
|
||||
///// PATH /////
|
||||
|
||||
// Get the PATH values.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue