mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-11 06:58:47 +02:00
「✨」 feat: Parsing of command kinda working
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user