X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gom%2Fsource.c;h=57520eda9b1fc6443d38be5c39a2cd5f06169aa9;hb=f8536669a2c38054a067bfe1596f90744b6c58da;hp=7ecb9777cf402834596d730e3ac679e5a307b0b3;hpb=5b045164f4a11b1f4d709820e784e1ca77b61b3f;p=gedcom-parse.git diff --git a/gom/source.c b/gom/source.c index 7ecb977..57520ed 100644 --- a/gom/source.c +++ b/gom/source.c @@ -43,88 +43,16 @@ GET_REC_BY_XREF(source, XREF_SOUR, gom_get_source_by_xref) NULL_CB(source, sour_data_start) STRING_CB(source, sour_data_agnc_start, data.agency) NULL_CB(source, sour_auth_start) /* value set by end callback */ +STRING_END_CB(source, sour_auth_end, author) NULL_CB(source, sour_titl_start) /* value set by end callback */ +STRING_END_CB(source, sour_titl_end, title) STRING_CB(source, sour_abbr_start, abbreviation) NULL_CB(source, sour_publ_start) /* value set by end callback */ +STRING_END_CB(source, sour_publ_end, publication) NULL_CB(source, sour_text_start) /* value set by end callback */ +STRING_END_CB(source, sour_text_end, text) XREF_CB(source, sour_repo_start, repository.link, make_repository_record) -void sour_auth_end(_ELT_END_PARAMS_) -{ - Gom_ctxt ctxt = (Gom_ctxt)self; - - if (! ctxt) - NO_CONTEXT; - else { - struct source *sour = SAFE_CTXT_CAST(source, ctxt); - if (sour) { - char *str = GEDCOM_STRING(parsed_value); - char *newvalue = strdup(str); - if (! newvalue) - MEMORY_ERROR; - else - sour->author = newvalue; - } - } -} - -void sour_titl_end(_ELT_END_PARAMS_) -{ - Gom_ctxt ctxt = (Gom_ctxt)self; - - if (! ctxt) - NO_CONTEXT; - else { - struct source *sour = SAFE_CTXT_CAST(source, ctxt); - if (sour) { - char *str = GEDCOM_STRING(parsed_value); - char *newvalue = strdup(str); - if (! newvalue) - MEMORY_ERROR; - else - sour->title = newvalue; - } - } -} - -void sour_publ_end(_ELT_END_PARAMS_) -{ - Gom_ctxt ctxt = (Gom_ctxt)self; - - if (! ctxt) - NO_CONTEXT; - else { - struct source *sour = SAFE_CTXT_CAST(source, ctxt); - if (sour) { - char *str = GEDCOM_STRING(parsed_value); - char *newvalue = strdup(str); - if (! newvalue) - MEMORY_ERROR; - else - sour->publication = newvalue; - } - } -} - -void sour_text_end(_ELT_END_PARAMS_) -{ - Gom_ctxt ctxt = (Gom_ctxt)self; - - if (! ctxt) - NO_CONTEXT; - else { - struct source *sour = SAFE_CTXT_CAST(source, ctxt); - if (sour) { - char *str = GEDCOM_STRING(parsed_value); - char *newvalue = strdup(str); - if (! newvalue) - MEMORY_ERROR; - else - sour->text = newvalue; - } - } -} - void source_subscribe() { gedcom_subscribe_to_record(REC_SOUR, sour_start, def_rec_end);