」 feat: Parsing of command kinda working

This commit is contained in:
2024-05-30 17:59:49 +02:00
parent d84749d009
commit 6bbdef9d7c
14 changed files with 248 additions and 33 deletions

View File

@ -6,14 +6,19 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/20 20:25:06 by adjoly #+# #+# */
/* Updated: 2024/05/20 21:00:45 by adjoly ### ########.fr */
/* Updated: 2024/05/30 12:53:09 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ERROR_MSG_H
# define ERROR_MSG_H
/**
* Here we define all the error message
*/
#define ERROR_SYNTAX ": syntax error"
#define ERROR_NO_REDIR ": need redirection file"
#define ERROR_NO_EOF ": need delimiter to heredoc"
#endif

View File

@ -32,5 +32,6 @@
char set_env(char **env, const char *name, char *content);
bool is_str(char *src, char *dst);
void print_cmd(t_cmd *cmd);
#endif

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/25 12:20:26 by adjoly #+# #+# */
/* Updated: 2024/05/23 19:56:20 by adjoly ### ########.fr */
/* Updated: 2024/05/30 16:31:48 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,7 +19,7 @@
typedef struct s_cmd
{
char *cmd;
char **argv;
char *argv;
int infile;
int outfile;
} t_cmd;
@ -32,6 +32,10 @@ typedef enum s_quote
DOUBLE
} t_quote;
void check_syntax(char *readline, char **argv);
void send_error(char *msg, char **argv);
void check_redir(t_list *redir, char **argv);
t_cmd *get_redir_fd(void *content);
/**
* @brief Take the argv of a command a split the argv and the
* command it self