if (!ctxt)
NO_CONTEXT;
else {
- struct association *assoc;
- assoc = (struct association *)malloc(sizeof(struct association));
- if (! assoc)
- MEMORY_ERROR;
- else {
- memset (assoc, 0, sizeof(struct association));
+ struct association *assoc = SUB_MAKEFUNC(association)();
+ if (assoc) {
assoc->to = GEDCOM_XREF_PTR(parsed_value);
switch (ctxt->ctxt_type) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(association)
+
DEFINE_STRING_CB(association, sub_assoc_rela_start, relation)
DEFINE_ADDFUNC2(association, note_sub, note)
if (! ctxt)
NO_CONTEXT;
else {
- struct event *evt = (struct event *)malloc(sizeof(struct event));
- if (! evt)
- MEMORY_ERROR;
- else {
- memset (evt, 0, sizeof(struct event));
+ struct event *evt = SUB_MAKEFUNC(event)();
+ if (evt) {
evt->event = parsed_tag;
evt->event_name = strdup(tag);
if (! evt->event_name) {
if (! ctxt)
NO_CONTEXT;
else {
- struct event *evt = (struct event *)malloc(sizeof(struct event));
- if (! evt)
- MEMORY_ERROR;
- else {
- memset (evt, 0, sizeof(struct event));
+ struct event *evt = SUB_MAKEFUNC(event)();
+ if (evt) {
evt->event = parsed_tag;
evt->event_name = strdup(tag);
if (! evt->event_name) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(event)
+
DEFINE_STRING_CB(event, sub_evt_type_start, type)
DEFINE_DATE_CB(event, sub_evt_date_start, date)
DEFINE_AGE_CB(event, sub_evt_age_start, age)
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_ADDFUNC2(family_link, note_sub, note)
DEFINE_ADDFUNC2(family_link, user_data, extra)
if (! ctxt)
NO_CONTEXT;
else {
- struct lds_event *lds_evt
- = (struct lds_event*)malloc(sizeof(struct lds_event));
- if (! lds_evt)
- MEMORY_ERROR;
- else {
- memset (lds_evt, 0, sizeof(struct lds_event));
+ struct lds_event *lds_evt = SUB_MAKEFUNC(lds_event)();
+ if (lds_evt) {
lds_evt->event = parsed_tag;
lds_evt->event_name = strdup(tag);
if (! lds_evt->event_name) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(lds_event)
+
DEFINE_STRING_CB(lds_event, sub_lds_event_stat_start, date_status)
DEFINE_DATE_CB(lds_event, sub_lds_event_date_start, date)
DEFINE_STRING_CB(lds_event, sub_lds_event_temp_start, temple_code)
if (! ctxt)
NO_CONTEXT;
else {
- struct multimedia_link *mm
- = (struct multimedia_link *)malloc(sizeof(struct multimedia_link));
- if (! mm)
- MEMORY_ERROR;
- else {
- memset (mm, 0, sizeof(struct multimedia_link));
+ struct multimedia_link *mm = SUB_MAKEFUNC(multimedia_link)();
+ if (mm) {
if (GEDCOM_IS_XREF_PTR(parsed_value))
mm->reference = GEDCOM_XREF_PTR(parsed_value);
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(multimedia_link)
+
DEFINE_STRING_CB(multimedia_link, sub_obje_form_start, form)
DEFINE_STRING_CB(multimedia_link, sub_obje_titl_start, title)
DEFINE_STRING_CB(multimedia_link, sub_obje_file_start, file)
if (! ctxt)
NO_CONTEXT;
else {
- struct note_sub *note = (struct note_sub *)malloc(sizeof(struct note_sub));
- if (! note)
- MEMORY_ERROR;
- else {
- memset (note, 0, sizeof(struct note_sub));
+ struct note_sub *note = SUB_MAKEFUNC(note_sub)();
+ if (note) {
if (GEDCOM_IS_XREF_PTR(parsed_value))
note->reference = GEDCOM_XREF_PTR(parsed_value);
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(note_sub)
+
DEFINE_STRING_END_CB(note_sub, sub_note_end, text)
DEFINE_ADDFUNC2(note_sub, source_citation, citation)
Gom_ctxt result = NULL;
if (ctxt) {
- struct personal_name *name
- = (struct personal_name *)malloc(sizeof(struct personal_name));
- if (! name)
- MEMORY_ERROR;
- else {
- memset (name, 0, sizeof(struct personal_name));
+ struct personal_name *name = SUB_MAKEFUNC(personal_name)();
+ if (name) {
name->name = strdup(GEDCOM_STRING(parsed_value));
if (! name->name) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(personal_name)
+
DEFINE_STRING_CB(personal_name, sub_name_npfx_start, prefix)
DEFINE_STRING_CB(personal_name, sub_name_givn_start, given)
DEFINE_STRING_CB(personal_name, sub_name_nick_start, nickname)
if (! ctxt)
NO_CONTEXT;
else {
- struct source_citation *cit
- = (struct source_citation *)malloc(sizeof(struct source_citation));
-
- if (! cit)
- MEMORY_ERROR;
- else {
- memset (cit, 0, sizeof(struct source_citation));
+ struct source_citation *cit = SUB_MAKEFUNC(source_citation)();
+ if (cit) {
if (GEDCOM_IS_XREF_PTR(parsed_value))
cit->reference = GEDCOM_XREF_PTR(parsed_value);
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(source_citation)
+
DEFINE_STRING_CB(source_citation, sub_cit_page_start, page)
DEFINE_STRING_CB(source_citation, sub_cit_even_start, event)
DEFINE_STRING_CB(source_citation, sub_cit_even_role_start, role)
if (! ctxt)
NO_CONTEXT;
else {
- struct source_description *desc
- = (struct source_description *)malloc(sizeof(struct source_description));
- if (! desc)
- MEMORY_ERROR;
- else {
- memset (desc, 0, sizeof(struct source_description));
+ struct source_description *desc = SUB_MAKEFUNC(source_description)();
+ if (desc) {
desc->call_number = strdup(GEDCOM_STRING(parsed_value));
if (! desc->call_number) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(source_description)
+
DEFINE_STRING_CB(source_description, sub_sour_caln_medi_start, media)
DEFINE_ADDFUNC2(source_description, user_data, extra)
if (! ctxt)
NO_CONTEXT;
else {
- struct source_event *evt
- = (struct source_event *)malloc(sizeof(struct source_event));
- if (! evt)
- MEMORY_ERROR;
- else {
- memset (evt, 0, sizeof(struct source_event));
+ struct source_event *evt = SUB_MAKEFUNC(source_event)();
+ if (evt) {
evt->recorded_events = strdup(GEDCOM_STRING(parsed_value));
if (! evt->recorded_events) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(source_event)
+
DEFINE_DATE_CB(source_event, sub_sour_even_date_start, date_period)
DEFINE_STRING_CB(source_event, sub_sour_even_plac_start, jurisdiction)
if (! ctxt)
NO_CONTEXT;
else {
- struct user_ref_number *refn
- = (struct user_ref_number *)malloc(sizeof(struct user_ref_number));
-
- if (! refn)
- MEMORY_ERROR;
- else {
- memset (refn, 0, sizeof(struct user_ref_number));
+ struct user_ref_number *refn = SUB_MAKEFUNC(user_ref_number)();
+ if (refn) {
refn->value = strdup(GEDCOM_STRING(parsed_value));
if (! refn->value) {
MEMORY_ERROR;
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(user_ref_number)
+
DEFINE_STRING_CB(user_ref_number, sub_user_ref_type_start, type)
DEFINE_ADDFUNC2(user_ref_number, user_data, extra)