X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gom%2Fpersonal_name.c;h=02de333272d2f58cbcb171eb7c726ec554093c67;hb=8073f669d16f11bfd50d42bb2cf6fdb79d358565;hp=18f3efbb3e134fdfadd7ec6dd99cf09822d61285;hpb=327069289a45ed1e91d8bfc07d7d89cfbad057d6;p=gedcom-parse.git diff --git a/gom/personal_name.c b/gom/personal_name.c index 18f3efb..02de333 100644 --- a/gom/personal_name.c +++ b/gom/personal_name.c @@ -47,11 +47,12 @@ Gedcom_ctxt sub_name_start(_ELT_PARAMS_) free(name); } else { - switch (ctxt->ctxt_type) { + int type = ctxt_type(ctxt); + switch (type) { case REC_INDI: ADDFUNC2(individual,personal_name)(ctxt, name); break; default: - UNEXPECTED_CONTEXT(ctxt->ctxt_type); + UNEXPECTED_CONTEXT(type); } result = MAKE_GOM_CTXT(elt, personal_name, name); } @@ -62,6 +63,10 @@ Gedcom_ctxt sub_name_start(_ELT_PARAMS_) } DEFINE_SUB_MAKEFUNC(personal_name) +DEFINE_SUB_ADDFUNC(personal_name) +DEFINE_SUB_FINDFUNC(personal_name) +DEFINE_SUB_REMOVEFUNC(personal_name) +DEFINE_SUB_MOVEFUNC(personal_name) DEFINE_STRING_CB(personal_name, sub_name_npfx_start, prefix) DEFINE_STRING_CB(personal_name, sub_name_givn_start, given) @@ -132,22 +137,23 @@ int write_names(Gedcom_write_hndl hndl, int parent, parent, obj->name); if (obj->prefix) result |= gedcom_write_element_str(hndl, ELT_SUB_PERS_NAME_NPFX, 0, - parent, obj->prefix); + ELT_SUB_PERS_NAME, obj->prefix); if (obj->given) result |= gedcom_write_element_str(hndl, ELT_SUB_PERS_NAME_GIVN, 0, - parent, obj->given); + ELT_SUB_PERS_NAME, obj->given); if (obj->nickname) result |= gedcom_write_element_str(hndl, ELT_SUB_PERS_NAME_NICK, 0, - parent, obj->nickname); + ELT_SUB_PERS_NAME, obj->nickname); if (obj->surname_prefix) result |= gedcom_write_element_str(hndl, ELT_SUB_PERS_NAME_SPFX, 0, - parent, obj->surname_prefix); + ELT_SUB_PERS_NAME, + obj->surname_prefix); if (obj->surname) result |= gedcom_write_element_str(hndl, ELT_SUB_PERS_NAME_SURN, 0, - parent, obj->surname); + ELT_SUB_PERS_NAME, obj->surname); if (obj->suffix) result |= gedcom_write_element_str(hndl, ELT_SUB_PERS_NAME_NSFX, 0, - parent, obj->suffix); + ELT_SUB_PERS_NAME, obj->suffix); if (obj->citation) result |= write_citations(hndl, ELT_SUB_PERS_NAME, obj->citation); if (obj->note)