summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ini/ini_parse.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/ini/ini_parse.c b/ini/ini_parse.c
index 9667a02..a2e05f9 100644
--- a/ini/ini_parse.c
+++ b/ini/ini_parse.c
@@ -99,6 +99,13 @@ typedef int (*action_fn)(struct parser_obj *);
#define PARSE_ERROR 3 /* Handle error */
#define PARSE_DONE 4 /* We are done */
+/* Declarations of the reusble functions: */
+static int complete_value_processing(struct parser_obj *po);
+static int save_error(struct collection_item *el,
+ unsigned line,
+ int error,
+ int idx);
+
int is_just_spaces(const char *str, uint32_t len)
{
@@ -946,6 +953,28 @@ static int parser_post(struct parser_obj *po)
return EOK;
}
+
+static int save_error(struct collection_item *el,
+ unsigned line,
+ int inerr,
+ int idx)
+{
+ int error = EOK;
+ const char *errtxt[] = { ERROR_TXT, WARNING_TXT };
+ struct ini_parse_error pe;
+
+ TRACE_FLOW_ENTRY();
+
+ /* Clear the warning bit */
+ pe.error = inerr;
+ pe.line = line;
+ error = col_add_binary_property(el, NULL,
+ errtxt[idx], &pe, sizeof(pe));
+ TRACE_FLOW_RETURN(error);
+ return error;
+}
+
+
/* Error and warning processing */
static int parser_error(struct parser_obj *po)
{