From: Peter Verthez Date: Sat, 21 Dec 2002 15:37:26 +0000 (+0000) Subject: New function for handling age values. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=0c115941610604f62f53b2e4f1dfb67427863f13;p=gedcom-parse.git New function for handling age values. --- diff --git a/gedcom/age.c b/gedcom/age.c index 1de1d53..37a49fe 100644 --- a/gedcom/age.c +++ b/gedcom/age.c @@ -103,6 +103,21 @@ int parse_numeric_age(struct age_value *age, const char *ptr) return 0; } +struct age_value* gedcom_new_age_value(struct age_value* copy_from) +{ + struct age_value* age_ptr; + age_ptr = (struct age_value*) malloc(sizeof(struct age_value)); + if (! age_ptr) + MEMORY_ERROR; + else { + if (copy_from) + memcpy(age_ptr, copy_from, sizeof(struct age_value)); + else + init_age(age_ptr); + } + return age_ptr; +} + struct age_value gedcom_parse_age(const char* line_value) { const char *ptr = line_value;