aboutsummaryrefslogtreecommitdiff
path: root/include/minishell.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-07-14 10:04:44 +0200
committerCharles <sircharlesaze@gmail.com>2020-07-14 10:05:57 +0200
commit29e1af2b65d097e533189db4e7d5e20534c17b35 (patch)
treec3f3033d18cab22e6715e2e57817d72028ae4627 /include/minishell.h
parent3ea9f3e7e9b40c8e0b17ab394576c82f7b92c0b4 (diff)
downloadminishell-29e1af2b65d097e533189db4e7d5e20534c17b35.tar.gz
minishell-29e1af2b65d097e533189db4e7d5e20534c17b35.tar.bz2
minishell-29e1af2b65d097e533189db4e7d5e20534c17b35.zip
Refactoring error handling during parsing
Diffstat (limited to 'include/minishell.h')
-rw-r--r--include/minishell.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/minishell.h b/include/minishell.h
index f2b237f..9405109 100644
--- a/include/minishell.h
+++ b/include/minishell.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/26 15:33:51 by cacharle #+# #+# */
-/* Updated: 2020/06/23 08:32:46 by charles ### ########.fr */
+/* Updated: 2020/07/14 09:35:14 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -47,6 +47,8 @@
typedef t_ftht* t_path;
typedef t_ftvec* t_env;
+extern int g_last_status_code;
+
/*
** path.c
*/
@@ -103,4 +105,27 @@ int builtin_exit(char **argv, t_env env);
char **preprocess(t_ftlst **tokens, t_env env);
char *preprocess_filename(t_ftlst **tokens, t_env env);
+/*
+** error.c
+*/
+
+enum e_error
+{
+ ERROR_AMBIGUOUS_REDIR,
+ ERROR_OPEN,
+ ERROR_CMD_NOT_FOUND,
+ ERROR_SYNTAX,
+ ERROR_CMD_FOUND_ERROR,
+};
+
+typedef struct
+{
+ enum e_error id;
+ int status;
+ char *msg; // if NULL call strerror
+ // char basename;
+} t_error;
+
+void error_eval_put(enum e_error id, char *unexpected);
+
#endif