Rename 'add' functions to 'new'.
[gedcom-parse.git] / include / gedcom.h.in
index 33c0ec59dc7a12cdeab9410b4c1d37ad92a5a929..7625ef4075f68515e687f384b85c7bb25a8ff00b 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
 
 #define GEDCOM_PARSE_VERSION_MAJOR @VERSION_MAJOR@
 #define GEDCOM_PARSE_VERSION_MINOR @VERSION_MINOR@
-#define GEDCOM_PARSE_VERSION_PATCH 0
+#define GEDCOM_PARSE_VERSION_PATCH @VERSION_PATCH@
 #define GEDCOM_PARSE_VERSION \
   (GEDCOM_PARSE_VERSION_MAJOR * 1000 + GEDCOM_PARSE_VERSION_MINOR)
 
@@ -385,6 +385,12 @@ typedef enum _ENC_LINE_END {
   END_LF_CR = 3
 } Enc_line_end;
 
+typedef enum _DATE_INPUT {
+  DI_FROM_STRINGS,
+  DI_FROM_NUMBERS,
+  DI_FROM_SDN
+} Date_input;
+
 /**************************************************************************/
 /***  Things meant to be internal, susceptible to changes               ***/
 /***  Use the GEDCOM_STRING/GEDCOM_DATE interface instead of relying    ***/
@@ -514,9 +520,13 @@ void    gedcom_subscribe_to_element(Gedcom_elt elt,
                                    Gedcom_elt_end_cb cb_end);
 
 /* Separate value parsing functions */
-struct date_value gedcom_parse_date(const char* line_value);
-char*             gedcom_date_to_string(struct date_value* val);
+struct date_value  gedcom_parse_date(const char* line_value);
+char*              gedcom_date_to_string(struct date_value* val);
+struct date_value* gedcom_new_date_value(struct date_value* copy_from);
+int   gedcom_normalize_date(Date_input compute_from, struct date_value *val);
+
 struct age_value  gedcom_parse_age(const char* line_value);
+struct age_value* gedcom_new_age_value(struct age_value* copy_from);
 char*             gedcom_age_to_string(struct age_value* val);
 
 /* Handling cross-references */
@@ -535,15 +545,11 @@ int  gedcom_write_set_encoding(const char* charset, Encoding width,
 int  gedcom_write_set_line_terminator(Enc_line_end end);
 
 int  gedcom_write_record_str(Gedcom_write_hndl hndl,
-                            Gedcom_rec rec, int parsed_tag,
-                            char* xrefstr, char* val);
-int  gedcom_write_element_str(Gedcom_write_hndl hndl, Gedcom_elt elt,
-                             int parsed_tag, int parent_rec_or_elt,
-                             char* val);
-
-int gedcom_write_record_xref(Gedcom_write_hndl hndl,
-                            Gedcom_rec rec, int parsed_tag,
-                            char* xrefstr, struct xref_value* val);
+                            Gedcom_rec rec, char* xrefstr, char* val);
+  
+int gedcom_write_element_str(Gedcom_write_hndl hndl, Gedcom_elt elt,
+                            int parsed_tag, int parent_rec_or_elt,
+                            char* val);
 int gedcom_write_element_xref(Gedcom_write_hndl hndl, Gedcom_elt elt,
                               int parsed_tag, int parent_rec_or_elt,
                              struct xref_value* val);