diff options
author | Dmitri Pal <dpal@redhat.com> | 2012-03-15 21:30:41 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-04-05 11:20:08 -0700 |
commit | 100d9ed10ce27cf98abfbb6f4236bb3577b27913 (patch) | |
tree | 7f6f4a55101995d7f446834aeacd323408c9c77f | |
parent | 09fc9d21c5dd42d0fe59bcd4794acaf76945a54c (diff) | |
download | ding-libs-100d9ed10ce27cf98abfbb6f4236bb3577b27913.tar.gz ding-libs-100d9ed10ce27cf98abfbb6f4236bb3577b27913.tar.xz ding-libs-100d9ed10ce27cf98abfbb6f4236bb3577b27913.zip |
Add save_error function
Create a function to add error into error list.
-rw-r--r-- | ini/ini_parse.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ini/ini_parse.c b/ini/ini_parse.c index 9667a02..b16b9d1 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, + const char *err_txt); + int is_just_spaces(const char *str, uint32_t len) { @@ -946,6 +953,27 @@ static int parser_post(struct parser_obj *po) return EOK; } + +static int save_error(struct collection_item *el, + unsigned line, + int inerr, + const char *err_txt) +{ + int error = EOK; + 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, + err_txt, &pe, sizeof(pe)); + TRACE_FLOW_RETURN(error); + return error; +} + + /* Error and warning processing */ static int parser_error(struct parser_obj *po) { |