This commit is contained in:
mcolonna 2024-07-01 11:23:31 +02:00
parent 0bcb738496
commit 147743058d
4 changed files with 29 additions and 28 deletions

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */
/* Updated: 2024/06/28 14:01:25 by mcolonna ### ########.fr */
/* Updated: 2024/07/01 11:12:51 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,11 +17,11 @@
typedef struct s_env
{
t_memclass mc_global; // open during all the runtime
t_memclass mc_command; // open during the execution of a command
int errorstatus; // Error status of the last executed command
t_list *variables; // Shell variables
bool exit; // Set to true to exit minishell
t_memclass mc_global;
t_memclass mc_command;
int errorstatus;
t_list *variables;
bool exit;
} t_env;
#endif

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */
/* Updated: 2024/06/27 13:47:56 by mcolonna ### ########.fr */
/* Updated: 2024/07/01 11:16:02 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,26 +18,25 @@
// Represents a call to a program (the program name and its arguments)
typedef struct s_call
{
const char *program; // path of the program to call.
int argc; // number of arguments given
char *const *argv; // arguments given (ended by NULL)
// (argc and argv must include the program name)
const char *program;
int argc;
char *const *argv;
} t_call;
// Represents a command given by the user.
typedef struct s_command
{
int error; // 0 if parse_command() succeded, error status if not
bool empty; // true if there isn't anything to do
const t_call *calls; // all calls to programs (ended by .program == NULL)
int input_fd; // fd to use with '<' redirection (0 by default)
int output_fd; // fd to use with '>' redirection (1 by default)
int error;
bool empty;
const t_call *calls;
int input_fd;
int output_fd;
} t_command;
// An element of a list of pipes
typedef struct s_pipes
{
int pipe[2]; // Simple pipe, we write on pipe[1] and we read on pipe[0]
int pipe[2];
} t_pipes;
// Return the t_command representing the command given by the user.