return 0;
}
+struct age_value* gedcom_new_age_value(const 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;
return age_s;
}
-char* gedcom_age_to_string(struct age_value* val)
+char* gedcom_age_to_string(const struct age_value* val)
{
int num = 0;
reset_buffer(&age_buffer);
switch (val->type) {
case AGE_UNRECOGNIZED:
- return val->phrase; break;
+ reset_buffer(&age_buffer);
+ safe_buf_append(&age_buffer, val->phrase); break;
case AGE_CHILD:
safe_buf_append(&age_buffer, "CHILD"); break;
case AGE_INFANT: