data->xref_value = GEDCOM_XREF_PTR(parsed_value);
if (! err) {
- switch (ctxt->obj_type) {
+ switch (ctxt_obj_type(ctxt)) {
case T_header:
ADDFUNC2(header,user_data)(ctxt, data); break;
case T_submission:
case T_source_description:
ADDFUNC2(source_description,user_data)(ctxt, data); break;
default:
- UNEXPECTED_CONTEXT(ctxt->ctxt_type);
+ UNEXPECTED_CONTEXT(ctxt_type(ctxt));
}
- result = make_gom_ctxt(elt, ctxt->obj_type, ctxt->ctxt_ptr);
+ result = dup_gom_ctxt(ctxt, elt);
}
}
}
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(user_data)
+DEFINE_SUB_ADDFUNC(user_data)
+DEFINE_SUB_FINDFUNC(user_data)
+DEFINE_SUB_REMOVEFUNC(user_data)
+DEFINE_SUB_MOVEFUNC(user_data)
+
void user_rec_subscribe()
{
gedcom_subscribe_to_record(REC_USER, user_rec_start, def_rec_end);
gedcom_subscribe_to_element(ELT_USER, user_elt_start, def_elt_end);
}
+void UNREFALLFUNC(user_data)(struct user_data *obj)
+{
+ if (obj) {
+ struct user_data* runner;
+ for (runner = obj; runner; runner = runner->next)
+ unref_xref_value(runner->xref_value);
+ }
+}
+
void CLEANFUNC(user_data)(struct user_data* data)
{
if (data) {
}
}
+void UNREFALLFUNC(user_rec)(struct user_rec *obj)
+{
+ if (obj) {
+ unref_xref_value(obj->xref_value);
+ UNREFALLFUNC(user_data)(obj->extra);
+ }
+}
+
void CLEANFUNC(user_rec)(struct user_rec* rec)
{
if (rec) {
if (!data) return 1;
- for (obj = data; data; data = data->next) {
+ for (obj = data; obj; obj = obj->next) {
if (obj->xref_value)
result |= gedcom_write_user_xref(hndl, obj->level, obj->tag, NULL,
obj->xref_value);
- else
+ else {
result |= gedcom_write_user_str(hndl, obj->level, obj->tag, NULL,
obj->str_value);
+ }
}
return result;
}