Added extra argument to callback functions: the record/element identifier.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 25 Aug 2002 11:19:23 +0000 (11:19 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 25 Aug 2002 11:19:23 +0000 (11:19 +0000)
Avoid overlap between record/element identifiers.

include/gedcom.h.in

index 20a300aa55d84cce773b794c8d060a6560c03d2f..b2662fb22f99d79a1b94d6e8e397349fb5e84d18 100644 (file)
@@ -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);