if (! ctxt)
NO_CONTEXT;
else {
- struct family_link *link
- = (struct family_link *)malloc(sizeof(struct family_link));
- if (! link)
- MEMORY_ERROR;
- else {
- memset (link, 0, sizeof(struct family_link));
+ struct family_link *link = SUB_MAKEFUNC(family_link)();
+ if (link) {
link->family = GEDCOM_XREF_PTR(parsed_value);
switch (ctxt->ctxt_type) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(family_link)
+DEFINE_SUB_ADDFUNC(family_link)
+DEFINE_SUB_FINDFUNC(family_link)
+DEFINE_SUB_REMOVEFUNC(family_link)
+DEFINE_SUB_MOVEFUNC(family_link)
+
DEFINE_ADDFUNC2(family_link, note_sub, note)
DEFINE_ADDFUNC2(family_link, user_data, extra)
def_elt_end);
}
+void UNREFALLFUNC(pedigree)(struct pedigree* obj)
+{
+ if (obj) {
+ struct pedigree* runner;
+ for (runner = obj; runner; runner = runner->next) {
+ UNREFALLFUNC(user_data)(runner->extra);
+ }
+ }
+}
+
void CLEANFUNC(pedigree)(struct pedigree* ped)
{
if (ped) {
}
}
+DEFINE_SUB_MAKEFUNC(pedigree)
+DEFINE_SUB_ADDFUNC(pedigree)
+DEFINE_SUB_FINDFUNC(pedigree)
+DEFINE_SUB_REMOVEFUNC(pedigree)
+DEFINE_SUB_MOVEFUNC(pedigree)
+
+void UNREFALLFUNC(family_link)(struct family_link* obj)
+{
+ if (obj) {
+ struct family_link* runner;
+ for (runner = obj; runner; runner = runner->next) {
+ unref_xref_value(runner->family);
+ UNREFALLFUNC(pedigree)(runner->pedigree);
+ UNREFALLFUNC(note_sub)(runner->note);
+ UNREFALLFUNC(user_data)(runner->extra);
+ }
+ }
+}
+
void CLEANFUNC(family_link)(struct family_link *link)
{
if (link) {