summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2010-12-25 23:36:06 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-04-05 11:20:08 -0700
commit09fc9d21c5dd42d0fe59bcd4794acaf76945a54c (patch)
tree8362f7354e5079afb20e6b3aeebd417bc09d351e
parent6aa1f3b84bc42d98916ec6410d5901c1bd46041d (diff)
downloadding-libs-09fc9d21c5dd42d0fe59bcd4794acaf76945a54c.tar.gz
ding-libs-09fc9d21c5dd42d0fe59bcd4794acaf76945a54c.tar.xz
ding-libs-09fc9d21c5dd42d0fe59bcd4794acaf76945a54c.zip
Add new vars to parse structure
Adding new varibles to the internal parsing structure and initializing them.
-rw-r--r--ini/ini_parse.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ini/ini_parse.c b/ini/ini_parse.c
index 18edc62..9667a02 100644
--- a/ini/ini_parse.c
+++ b/ini/ini_parse.c
@@ -69,8 +69,11 @@ struct parser_obj {
uint32_t linenum;
/* Line number of the last found key */
uint32_t keylinenum;
+ /* Line number of the last found section */
+ uint32_t seclinenum;
/* Internal variables */
struct collection_item *sec;
+ struct collection_item *merge_sec;
struct ini_comment *ic;
char *last_read;
uint32_t last_read_len;
@@ -78,12 +81,15 @@ struct parser_obj {
uint32_t key_len;
struct ref_array *raw_lines;
struct ref_array *raw_lengths;
+ char *merge_key;
+ struct value_obj *merge_vo;
+ /* Merge error */
+ uint32_t merge_error;
int ret;
};
typedef int (*action_fn)(struct parser_obj *);
-
#define PARSE_ACTION "action"
/* Actions */
@@ -181,9 +187,12 @@ static int parser_create(FILE *file,
/* Initialize internal varibles */
new_po->sec = NULL;
+ new_po->merge_sec = NULL;
new_po->ic = NULL;
new_po->last_error = 0;
new_po->linenum = 0;
+ new_po->keylinenum = 0;
+ new_po->seclinenum = 0;
new_po->last_read = NULL;
new_po->last_read_len = 0;
new_po->key = NULL;
@@ -191,6 +200,9 @@ static int parser_create(FILE *file,
new_po->raw_lines = NULL;
new_po->raw_lengths = NULL;
new_po->ret = EOK;
+ new_po->merge_key = NULL;
+ new_po->merge_vo = NULL;
+ new_po->merge_error = 0;
/* Create a queue */
new_po->queue = NULL;