if (!ctxt)
NO_CONTEXT;
else {
- struct address *addr = (struct address *)malloc(sizeof(struct address));
- if (!addr)
- MEMORY_ERROR;
- else {
- memset (addr, 0, sizeof(struct address));
+ struct address *addr = SUB_MAKEFUNC(address)();
+ if (addr) {
switch (ctxt->ctxt_type) {
case ELT_HEAD_SOUR_CORP:
ADDFUNC2_NOLIST(header,address)(ctxt, addr); break;
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(address)
+DEFINE_SUB_ADDFUNC(address)
+DEFINE_SUB_DELETEFUNC(address)
+
DEFINE_STRING_END_CB(address, sub_addr_end, full_label)
DEFINE_STRING_CB(address, sub_addr_adr1_start, line1)
DEFINE_STRING_CB(address, sub_addr_adr2_start, line2)
if (! ctxt)
NO_CONTEXT;
else {
- struct change_date *chan
- = (struct change_date *)malloc(sizeof(struct change_date));
- if (! chan)
- MEMORY_ERROR;
- else {
- memset (chan, 0, sizeof(struct change_date));
-
+ struct change_date *chan = SUB_MAKEFUNC(change_date)();
+ if (chan) {
switch (ctxt->ctxt_type) {
case REC_FAM:
ADDFUNC2_NOLIST(family,change_date)(ctxt, chan); break;
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(change_date)
+DEFINE_SUB_ADDFUNC(change_date)
+DEFINE_SUB_DELETEFUNC(change_date)
+
DEFINE_DATE_CB(change_date, sub_chan_date_start, date)
DEFINE_STRING_CB(change_date, sub_chan_time_start, time)
SAFE_FREE(chan);
}
-struct change_date* gom_add_change_date(struct change_date** chan)
-{
- struct change_date *obj = NULL;
- if (chan && ! *chan) {
- obj = (struct change_date*) malloc(sizeof(struct change_date));
- if (! obj)
- MEMORY_ERROR;
- else {
- memset(obj, 0, sizeof(struct change_date));
- *chan = obj;
- }
- }
- return obj;
-}
-
-int gom_delete_change_date(struct change_date** chan)
-{
- int result = 1;
- if (chan && *chan) {
- CLEANFUNC(change_date)(*chan);
- free(*chan);
- *chan = NULL;
- result = 0;
- }
- return result;
-}
-
int update_date(struct date_value** dv, struct tm* tm_ptr)
{
int result;
if (! ctxt)
NO_CONTEXT;
else {
- struct place *place = (struct place *)malloc(sizeof(struct place));
- if (! place)
- MEMORY_ERROR;
- else {
- memset (place, 0, sizeof(struct place));
+ struct place *place = SUB_MAKEFUNC(place)();
+ if (place) {
place->value = strdup(GEDCOM_STRING(parsed_value));
if (!place->value) {
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(place)
+DEFINE_SUB_ADDFUNC(place)
+DEFINE_SUB_DELETEFUNC(place)
+
DEFINE_STRING_CB(place, sub_place_form_start, place_hierarchy)
DEFINE_ADDFUNC2(place, source_citation, citation)