From: Peter Verthez Date: Sun, 25 Aug 2002 11:19:23 +0000 (+0000) Subject: Added extra argument to callback functions: the record/element identifier. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=9705cb493154688749e58b9c626e23973ddb49f7;p=gedcom-parse.git Added extra argument to callback functions: the record/element identifier. Avoid overlap between record/element identifiers. --- diff --git a/include/gedcom.h.in b/include/gedcom.h.in index 20a300a..b2662fb 100644 --- a/include/gedcom.h.in +++ b/include/gedcom.h.in @@ -56,7 +56,7 @@ typedef enum _REC { } Gedcom_rec; typedef enum _ELT { - ELT_HEAD_SOUR, + ELT_HEAD_SOUR = NR_OF_RECS + 1, ELT_HEAD_SOUR_VERS, ELT_HEAD_SOUR_NAME, ELT_HEAD_SOUR_CORP, @@ -414,25 +414,26 @@ typedef void typedef Gedcom_ctxt (*Gedcom_rec_start_cb) - (int level, Gedcom_val xref, char *tag, char *raw_value, - int tag_value, Gedcom_val parsed_value); + (Gedcom_rec rec, int level, Gedcom_val xref, char *tag, + char *raw_value, int tag_value, Gedcom_val parsed_value); typedef void (*Gedcom_rec_end_cb) - (Gedcom_ctxt self); + (Gedcom_rec rec, Gedcom_ctxt self); typedef Gedcom_ctxt (*Gedcom_elt_start_cb) - (Gedcom_ctxt parent, + (Gedcom_elt elt, Gedcom_ctxt parent, int level, char *tag, char *raw_value, int tag_value, Gedcom_val parsed_value); typedef void (*Gedcom_elt_end_cb) - (Gedcom_ctxt parent, Gedcom_ctxt self, Gedcom_val parsed_value); + (Gedcom_elt elt, Gedcom_ctxt parent, Gedcom_ctxt self, + Gedcom_val parsed_value); typedef void (*Gedcom_def_cb) - (Gedcom_ctxt parent, int level, char *tag, char *raw_value, - int tag_value); + (Gedcom_elt elt, Gedcom_ctxt parent, int level, char *tag, + char *raw_value, int tag_value); void gedcom_init(); int gedcom_parse_file(char* file_name);