/**** Header ****/
/*********************************************************************/
head_sect : OPEN DELIM TAG_HEAD
- { $<ctxt>$ = start_record(REC_HEAD, $1, NULL, $3);
+ { $<ctxt>$ = start_record(REC_HEAD, $1, GEDCOM_MAKE_NULL(), $3);
START(HEAD, $<ctxt>$) }
head_subs
{ if (compat_mode(C_FTREE))
/**** Family record ****/
/*********************************************************************/
fam_rec : OPEN DELIM POINTER DELIM TAG_FAM
- { $<ctxt>$ = start_record(REC_FAM, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_FAM,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(FAM, $<ctxt>$) }
fam_subs
{ CHECK0 }
/**** Individual record ****/
/*********************************************************************/
indiv_rec : OPEN DELIM POINTER DELIM TAG_INDI
- { $<ctxt>$ = start_record(REC_INDI, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_INDI,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(INDI, $<ctxt>$) }
indi_subs
{ CHECK0 }
/**** Multimedia record ****/
/*********************************************************************/
multim_rec : OPEN DELIM POINTER DELIM TAG_OBJE
- { $<ctxt>$ = start_record(REC_OBJE, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_OBJE,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(OBJE, $<ctxt>$) }
obje_subs
{ CHECK2(FORM, BLOB) }
/**** Note record ****/
/*********************************************************************/
note_rec : OPEN DELIM POINTER DELIM TAG_NOTE note_line_item
- { $<ctxt>$ = start_record(REC_NOTE, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_NOTE,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(NOTE, $<ctxt>$) }
note_subs
{ CHECK0 }
/**** Repository record ****/
/*********************************************************************/
repos_rec : OPEN DELIM POINTER DELIM TAG_REPO
- { $<ctxt>$ = start_record(REC_REPO, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_REPO,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(REPO, $<ctxt>$) }
repo_subs
{ CHECK0 }
/**** Source record ****/
/*********************************************************************/
source_rec : OPEN DELIM POINTER DELIM TAG_SOUR
- { $<ctxt>$ = start_record(REC_SOUR, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_SOUR,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(SOUR, $<ctxt>$) }
sour_subs
{ CHECK0 }
/**** Submission record ****/
/*********************************************************************/
submis_rec : OPEN DELIM POINTER DELIM TAG_SUBN
- { $<ctxt>$ = start_record(REC_SUBN, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_SUBN,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(SUBN, $<ctxt>$) }
subn_subs
{ CHECK0 }
/**** Submitter record ****/
/*********************************************************************/
submit_rec : OPEN DELIM POINTER DELIM TAG_SUBM
- { $<ctxt>$ = start_record(REC_SUBM, $1, $3, $5);
+ { $<ctxt>$ = start_record(REC_SUBM,
+ $1, GEDCOM_MAKE_STRING($3), $5);
START(SUBM, $<ctxt>$) }
subm_subs
{ CHECK1(NAME) }
}
}
opt_value
- { $<ctxt>$ = start_record(REC_USER, $1, $3, $4);
+ { $<ctxt>$ = start_record(REC_USER,
+ $1, GEDCOM_MAKE_STRING($3), $4);
START($4, $<ctxt>$)
}
user_sects
Gedcom_rec_start_cb cb_start,
Gedcom_rec_end_cb cb_end)
{
- record_start_callback[rec] = cb_start;
- record_end_callback[rec] = cb_end;
+ if (cb_start) {
+ record_start_callback[rec] = cb_start;
+ record_end_callback[rec] = cb_end;
+ }
}
void gedcom_subscribe_to_element(Gedcom_elt elt,
Gedcom_elt_start_cb cb_start,
Gedcom_elt_end_cb cb_end)
{
- element_start_callback[elt] = cb_start;
- element_end_callback[elt] = cb_end;
+ if (cb_start) {
+ element_start_callback[elt] = cb_start;
+ element_end_callback[elt] = cb_end;
+ }
}
Gedcom_ctxt start_record(Gedcom_rec rec,
- int level, char *xref, char *tag)
+ int level, Gedcom_val xref, char *tag)
{
Gedcom_rec_start_cb cb = record_start_callback[rec];
if (cb != NULL)