dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More doxygen generation.
[gedcom-parse.git]
/
gom
/
source_description.c
diff --git
a/gom/source_description.c
b/gom/source_description.c
index 34ca5216f79f08f838cc3a106d7b0760cce4b519..02d093fbeb0cd6707e71e055fa06e55c921fa4e2 100644
(file)
--- a/
gom/source_description.c
+++ b/
gom/source_description.c
@@
-38,12
+38,8
@@
Gedcom_ctxt sub_sour_caln_start(_ELT_PARAMS_)
if (! ctxt)
NO_CONTEXT;
else {
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) {
desc->call_number = strdup(GEDCOM_STRING(parsed_value));
if (! desc->call_number) {
@@
-51,11
+47,12
@@
Gedcom_ctxt sub_sour_caln_start(_ELT_PARAMS_)
free(desc);
}
else {
free(desc);
}
else {
- switch (ctxt->ctxt_type) {
+ int type = ctxt_type(ctxt);
+ switch (type) {
case ELT_SUB_REPO:
ADDFUNC2(source,source_description)(ctxt, desc); break;
default:
case ELT_SUB_REPO:
ADDFUNC2(source,source_description)(ctxt, desc); break;
default:
- UNEXPECTED_CONTEXT(
ctxt->ctxt_
type);
+ UNEXPECTED_CONTEXT(type);
}
result = MAKE_GOM_CTXT(elt, source_description, desc);
}
}
result = MAKE_GOM_CTXT(elt, source_description, desc);
}
@@
-65,6
+62,12
@@
Gedcom_ctxt sub_sour_caln_start(_ELT_PARAMS_)
return (Gedcom_ctxt)result;
}
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(source_description)
+DEFINE_SUB_ADDFUNC(source_description)
+DEFINE_SUB_FINDFUNC(source_description)
+DEFINE_SUB_REMOVEFUNC(source_description)
+DEFINE_SUB_MOVEFUNC(source_description)
+
DEFINE_STRING_CB(source_description, sub_sour_caln_medi_start, media)
DEFINE_ADDFUNC2(source_description, user_data, extra)
DEFINE_STRING_CB(source_description, sub_sour_caln_medi_start, media)
DEFINE_ADDFUNC2(source_description, user_data, extra)
@@
-77,6
+80,16
@@
void source_description_subscribe()
sub_sour_caln_medi_start, def_elt_end);
}
sub_sour_caln_medi_start, def_elt_end);
}
+void UNREFALLFUNC(source_description)(struct source_description* obj)
+{
+ if (obj) {
+ struct source_description* runner;
+ for (runner = obj; runner; runner = runner->next) {
+ UNREFALLFUNC(user_data)(runner->extra);
+ }
+ }
+}
+
void CLEANFUNC(source_description)(struct source_description* desc)
{
if (desc) {
void CLEANFUNC(source_description)(struct source_description* desc)
{
if (desc) {