From 0c115941610604f62f53b2e4f1dfb67427863f13 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 21 Dec 2002 15:37:26 +0000 Subject: [PATCH] New function for handling age values. --- gedcom/age.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; -- 2.30.2