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_SETFUNC(place)
+DEFINE_SUB_DELETEFUNC(place)
+
DEFINE_STRING_CB(place, sub_place_form_start, place_hierarchy)
DEFINE_ADDFUNC2(place, source_citation, citation)
sub_place_form_start, def_elt_end);
}
+void UNREFALLFUNC(place)(struct place* obj)
+{
+ if (obj) {
+ UNREFALLFUNC(source_citation)(obj->citation);
+ UNREFALLFUNC(note_sub)(obj->note);
+ UNREFALLFUNC(user_data)(obj->extra);
+ }
+}
+
void CLEANFUNC(place)(struct place* place)
{
if (place) {