aboutsummaryrefslogtreecommitdiff
path: root/src/error.c
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-07-14 13:12:55 +0200
committernass1pro <nass1pro@gmail.com>2020-07-14 13:12:55 +0200
commit2025376e43a174586f087ff284d1f65798f555b2 (patch)
tree7621906fd15b8075a147fe298ead79c4053a2b28 /src/error.c
parent29e1af2b65d097e533189db4e7d5e20534c17b35 (diff)
downloadminishell-2025376e43a174586f087ff284d1f65798f555b2.tar.gz
minishell-2025376e43a174586f087ff284d1f65798f555b2.tar.bz2
minishell-2025376e43a174586f087ff284d1f65798f555b2.zip
update lexer
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/error.c b/src/error.c
deleted file mode 100644
index f5848a6..0000000
--- a/src/error.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* error.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/06/14 11:02:52 by charles #+# #+# */
-/* Updated: 2020/07/14 09:23:38 by charles ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "eval.h"
-
-static t_error g_errors[] =
-{
- {ERROR_AMBIGUOUS_REDIR, 1, "ambiguous redirect"},
- {ERROR_OPEN, 1, NULL},
- {ERROR_CMD_NOT_FOUND, 127, "command not found"},
- /* {ERROR_CMD_FOUND_ERROR, 126, NULL}, */
- {ERROR_SYNTAX, 2, "syntax error near unexpected token "},
-};
-
-t_error *st_error_get(enum e_error id)
-{
- size_t i;
- t_error *match;
-
- match = NULL;
- i = 0;
- while (i < sizeof(g_errors) / sizeof(t_error))
- {
- if (g_errors[i].id == id)
- match = &g_errors[i];
- i++;
- }
- return (match);
-}
-
-void error_eval_put(enum e_error id, char *unexpected)
-{
- t_error *err;
-
- err = st_error_get(id);
- ft_putstr_fd("minishell: ", STDERR_FILENO);
- ft_putstr_fd(unexpected, STDERR_FILENO);
- ft_putstr_fd(": ", STDERR_FILENO);
- if (err->msg == NULL)
- ft_putendl_fd(strerror(errno), STDERR_FILENO);
- else
- ft_putendl_fd(err->msg, STDERR_FILENO);
-}
-
-int error_status(enum e_error id)
-{
- return (st_error_get(id)->status);
-}