From ecd23e205de52d84d9a843fc891d7890d1046682 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 15 Jul 2020 12:44:15 +0200 Subject: Added g_basename global for error message prefix --- include/minishell.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'include/minishell.h') diff --git a/include/minishell.h b/include/minishell.h index 9405109..67c2266 100644 --- a/include/minishell.h +++ b/include/minishell.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/26 15:33:51 by cacharle #+# #+# */ -/* Updated: 2020/07/14 09:35:14 by charles ### ########.fr */ +/* Updated: 2020/07/14 11:06:50 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -48,6 +48,7 @@ typedef t_ftht* t_path; typedef t_ftvec* t_env; extern int g_last_status_code; +extern char *g_basename; /* ** path.c @@ -85,7 +86,6 @@ typedef struct { char *name; t_builtin_func func; - bool child_process; } t_builtin_entry; t_builtin_entry *builtin_search_func(char *name); @@ -118,14 +118,20 @@ enum e_error ERROR_CMD_FOUND_ERROR, }; +/* +** \brief Error specification +** \param id Error type +** \param status Status code returned +** \param msg Error message to print, if is NULL, use strerror as a msg +*/ + typedef struct { enum e_error id; int status; - char *msg; // if NULL call strerror - // char basename; + char *msg; } t_error; -void error_eval_put(enum e_error id, char *unexpected); +void error_eval_put(enum e_error id, char *content); #endif -- cgit