X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gom%2Fnote_sub.c;h=63ef644150a4348dacc569cfbb20d502da1a11bb;hb=4946f8418bfa1c41bb410995dbc9c5ac272c4c74;hp=662cf9fd54c80db5124e0688e8eb845fa10933bf;hpb=d7e4149f2d99ab6eed88685eeeaac614b7139a01;p=gedcom-parse.git diff --git a/gom/note_sub.c b/gom/note_sub.c index 662cf9f..63ef644 100644 --- a/gom/note_sub.c +++ b/gom/note_sub.c @@ -142,3 +142,28 @@ void note_sub_cleanup(struct note_sub* note) DESTROY_CHAIN_ELTS(user_data, note->extra, user_data_cleanup); } } + +int write_note_subs(Gedcom_write_hndl hndl, int parent, struct note_sub* note) +{ + int result = 0; + struct note_sub* obj; + + if (!note) return 1; + + for (obj = note; obj; obj = obj->next) { + if (obj->reference) { + result |= gedcom_write_element_xref(hndl, ELT_SUB_NOTE, 0, + parent, obj->reference); + } + else { + result |= gedcom_write_element_str(hndl, ELT_SUB_NOTE, 0, + parent, obj->text); + } + if (obj->citation) + result |= write_citations(hndl, ELT_SUB_NOTE, obj->citation); + if (obj->extra) + result |= write_user_data(hndl, obj->extra); + } + + return result; +}