+/** This function creates a new age_value struct and initializes it properly,
+ or copies an existing age value.
+
+ \param copy_from A given struct age_value to copy (or \c NULL).
+
+ \return If the parameter \c copy_from is NULL, a new value is created and
+ given initial values. If it is non-NULL, the given value is copied into
+ a new age value. In both cases, the new value is returned.
+*/
+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;
+}
+
+/** This function allows to convert the given \c line_value into a struct
+ age_value.
+
+ \param line_value A string containing the age to parse
+
+ \return The parsed age; note that this return value is statically
+ allocated, and is thus overwritten on each call.
+*/