X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gom%2Fchange_date.c;h=2b703f819185d2e10cf0cd4201f5a459af0b6785;hb=d069cfbd954ca8d53d780ce97d7da1d363bb51fe;hp=cca70675bdd842c0f434e70b105ba1f3c31b5ecb;hpb=bdf47fdee469d5a1d7ddfd06a0e4b26f3b40b0f4;p=gedcom-parse.git diff --git a/gom/change_date.c b/gom/change_date.c index cca7067..2b703f8 100644 --- a/gom/change_date.c +++ b/gom/change_date.c @@ -113,3 +113,25 @@ void change_date_cleanup(struct change_date *chan) } SAFE_FREE(chan); } + +int write_change_date(Gedcom_write_hndl hndl, int parent, + struct change_date *chan) +{ + int result = 0; + + if (!chan) return 1; + + result |= gedcom_write_element_str(hndl, ELT_SUB_CHAN, 0, parent, NULL); + if (chan->date) + result |= gedcom_write_element_date(hndl, ELT_SUB_CHAN_DATE, 0, + ELT_SUB_CHAN, chan->date); + if (chan->time) + result |= gedcom_write_element_str(hndl, ELT_SUB_CHAN_TIME, 0, + ELT_SUB_CHAN_DATE, chan->time); + if (chan->note) + result |= write_note_subs(hndl, ELT_SUB_CHAN, chan->note); + if (chan->extra) + result |= write_user_data(hndl, chan->extra); + + return result; +}