aboutsummaryrefslogtreecommitdiff
path: root/include/minishell.h
diff options
context:
space:
mode:
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