From fed9fb7462a5ee8afcae8741cb66d8167f9372b1 Mon Sep 17 00:00:00 2001 From: Dmitri Pal Date: Wed, 28 Jul 2010 16:27:09 -0400 Subject: Add error codes for the new parser --- ini/ini_config.h | 12 ++++++++---- ini/ini_print.c | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ini/ini_config.h b/ini/ini_config.h index 28e1af8..c69e235 100644 --- a/ini/ini_config.h +++ b/ini/ini_config.h @@ -226,15 +226,19 @@ #define ERR_NOSECTION 3 /** @brief Section name too long (Error). */ #define ERR_SECTIONLONG 4 -/** @brief No equal sign (Warning). */ +/** @brief No equal sign (Error). */ #define ERR_NOEQUAL 5 -/** @brief No key before equal sign (Warning). */ +/** @brief No key before equal sign (Error). */ #define ERR_NOKEY 6 -/** @brief Key is too long (Warning). */ +/** @brief Key is too long (Error). */ #define ERR_LONGKEY 7 +/** @brief Failed to read line (Error). */ +#define ERR_READ 8 +/** @brief Line starts with space when it should not (Error). */ +#define ERR_SPACE 9 /** @brief Size of the error array. */ -#define ERR_MAXPARSE ERR_LONGKEY +#define ERR_MAXPARSE ERR_SPACE /** * @} diff --git a/ini/ini_print.c b/ini/ini_print.c index e8f9186..60771d3 100644 --- a/ini/ini_print.c +++ b/ini/ini_print.c @@ -75,7 +75,10 @@ const char *parsing_error_str(int parsing_error) _("Section name is too long."), _("Equal sign is missing."), _("Property name is missing."), - _("Property name is too long.") + _("Property name is too long."), + _("Failed to read line."), + _("Invalid space character at the " + "beginning of the line.") }; /* Check the range */ -- cgit