X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gom%2Fnote.c;h=41dab5f5697bb3df1e6d639c6ed36f6e5ea0590d;hb=f8536669a2c38054a067bfe1596f90744b6c58da;hp=b3ff3700ef9ea159bf2abdf1cdf5bd97580227a8;hpb=5b045164f4a11b1f4d709820e784e1ca77b61b3f;p=gedcom-parse.git diff --git a/gom/note.c b/gom/note.c index b3ff370..41dab5f 100644 --- a/gom/note.c +++ b/gom/note.c @@ -46,35 +46,12 @@ Gedcom_ctxt note_start(_REC_PARAMS_) note = make_note_record(xr->string); xr->object = (Gedcom_ctxt) note; } - if (note) { - note->text = strdup(GEDCOM_STRING(parsed_value)); - if (! note->text) - MEMORY_ERROR; - else - result = MAKE_GOM_CTXT(rec, note, xr->object); - } + if (note) + result = MAKE_GOM_CTXT(rec, note, xr->object); return (Gedcom_ctxt)result; } -void note_end(_REC_END_PARAMS_) -{ - Gom_ctxt ctxt = (Gom_ctxt)self; - - if (! ctxt) - NO_CONTEXT; - else { - struct note *note = SAFE_CTXT_CAST(note, ctxt); - if (note) { - char *str = GEDCOM_STRING(parsed_value); - char *newvalue = strdup(str); - if (! newvalue) - MEMORY_ERROR; - else - note->text = newvalue; - } - } -} - +STRING_END_REC_CB(note, note_end, text) GET_REC_BY_XREF(note, XREF_NOTE, gom_get_note_by_xref) Gedcom_ctxt sub_cont_conc_start(_ELT_PARAMS_)