{
Gedcom_rec_start_cb cb = record_start_callback[rec];
if (cb != NULL)
- return (*cb)(level, xref, tag.string, raw_value, tag.value, parsed_value);
+ return (*cb)(rec, level, xref, tag.string, raw_value, tag.value,
+ parsed_value);
else
return NULL;
}
{
Gedcom_rec_end_cb cb = record_end_callback[rec];
if (cb != NULL)
- (*cb)(self);
+ (*cb)(rec, self);
}
Gedcom_ctxt start_element(Gedcom_elt elt, Gedcom_ctxt parent,
Gedcom_elt_start_cb cb = element_start_callback[elt];
Gedcom_ctxt ctxt = parent;
if (cb != NULL)
- ctxt = (*cb)(parent, level, tag.string, raw_value,
+ ctxt = (*cb)(elt, parent, level, tag.string, raw_value,
tag.value, parsed_value);
else if (default_cb != NULL && parent != NULL)
- (*default_cb)(parent, level, tag.string, raw_value, tag.value);
+ (*default_cb)(elt, parent, level, tag.string, raw_value, tag.value);
return ctxt;
}
{
Gedcom_elt_end_cb cb = element_end_callback[elt];
if (cb != NULL)
- (*cb)(parent, self, parsed_value);
+ (*cb)(elt, parent, self, parsed_value);
}
char* val_type_str[] = { N_("null value"),
char family_xreftags[100][255];
int family_nr = 1;
-Gedcom_ctxt family_start(int level, Gedcom_val xref, char *tag,
+Gedcom_ctxt family_start(Gedcom_rec rec, int level, Gedcom_val xref, char *tag,
char *raw_value, int tag_value,
Gedcom_val parsed_value)
{
return (Gedcom_ctxt)(family_nr++);
}
-Gedcom_ctxt rec_start(int level, Gedcom_val xref, char *tag,
+Gedcom_ctxt rec_start(Gedcom_rec rec, int level, Gedcom_val xref, char *tag,
char *raw_value, int tag_value,
Gedcom_val parsed_value)
{
return (Gedcom_ctxt)tag_value;
}
-Gedcom_ctxt note_start(int level, Gedcom_val xref, char *tag,
+Gedcom_ctxt note_start(Gedcom_rec rec, int level, Gedcom_val xref, char *tag,
char *raw_value, int tag_value,
Gedcom_val parsed_value)
{
return (Gedcom_ctxt)tag_value;
}
-void family_end(Gedcom_ctxt self)
+void family_end(Gedcom_rec rec, Gedcom_ctxt self)
{
output(1, "Family end, xref is %s\n", family_xreftags[(int)self]);
}
-Gedcom_ctxt submit_start(int level, Gedcom_val xref, char *tag,
+Gedcom_ctxt submit_start(Gedcom_rec rec, int level, Gedcom_val xref, char *tag,
char *raw_value, int tag_value,
Gedcom_val parsed_value)
{
return (Gedcom_ctxt)10000;
}
-Gedcom_ctxt source_start(Gedcom_ctxt parent, int level, char *tag,
- char* raw_value,
+Gedcom_ctxt source_start(Gedcom_elt elt, Gedcom_ctxt parent, int level,
+ char *tag, char* raw_value,
int tag_value, Gedcom_val parsed_value)
{
Gedcom_ctxt self = (Gedcom_ctxt)((int) parent + 1000);
return self;
}
-void source_end(Gedcom_ctxt parent, Gedcom_ctxt self, Gedcom_val parsed_value)
+void source_end(Gedcom_elt elt, Gedcom_ctxt parent, Gedcom_ctxt self,
+ Gedcom_val parsed_value)
{
output(1, "Source context %d in parent %d\n", (int)self, (int)parent);
}
-Gedcom_ctxt date_start(Gedcom_ctxt parent, int level, char *tag,
- char* raw_value,
+Gedcom_ctxt date_start(Gedcom_elt elt, Gedcom_ctxt parent, int level,
+ char *tag, char* raw_value,
int tag_value, Gedcom_val parsed_value)
{
struct date_value dv;
return self;
}
-void default_cb(Gedcom_ctxt ctxt, int level, char *tag, char *raw_value,
- int tag_value)
+void default_cb(Gedcom_elt elt, Gedcom_ctxt ctxt, int level, char *tag,
+ char *raw_value, int tag_value)
{
char *converted = NULL;
int conv_fails = 0;