Added function gedcom_check_version.
[gedcom-parse.git] / include / gedcom.h.in
index 223dc0fb5ee72f0d176535df97038d84178df831..f9a6bd4ff793e90fa9f156aedaec85f1c70ced30 100644 (file)
@@ -27,7 +27,9 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #ifndef GEDCOM_INTERNAL
 #include <gedcom-tags.h>
@@ -35,9 +37,12 @@ __BEGIN_DECLS
 
 #define GEDCOM_PARSE_VERSION_MAJOR @VERSION_MAJOR@
 #define GEDCOM_PARSE_VERSION_MINOR @VERSION_MINOR@
+#define GEDCOM_PARSE_VERSION_PATCH 0
 #define GEDCOM_PARSE_VERSION \
   (GEDCOM_PARSE_VERSION_MAJOR * 1000 + GEDCOM_PARSE_VERSION_MINOR)
 
+int gedcom_check_version(int major, int minor, int patch);
+
 /**************************************************************************/
 /***  First the records and elements to subscribe upon                  ***/
 /**************************************************************************/
@@ -472,6 +477,7 @@ typedef void
 
 void    gedcom_init();
 int     gedcom_parse_file(const char* file_name);
+int     gedcom_new_model();
 void    gedcom_set_debug_level(int level, FILE* trace_output);
 void    gedcom_set_error_handling(Gedcom_err_mech mechanism);
 void    gedcom_set_compat_handling(int enable_compat);
@@ -488,7 +494,14 @@ void    gedcom_subscribe_to_element(Gedcom_elt elt,
 /* Separate value parsing functions */
 struct date_value gedcom_parse_date(const char* line_value);
 struct age_value  gedcom_parse_age(const char* line_value);
+
+/* Handling cross-references */
 struct xref_value *gedcom_get_by_xref(const char *key);
+struct xref_value *gedcom_add_xref(Xref_type type, const char* xrefstr,
+                                   Gedcom_ctxt object);
+struct xref_value *gedcom_link_xref(Xref_type type, const char* xrefstr);
+struct xref_value *gedcom_unlink_xref(Xref_type type, const char* xrefstr);
+int                gedcom_delete_xref(const char* xrefstr);
 
 /* For use in gom */
 int        gedcom_error(const char* s, ...);
@@ -496,6 +509,8 @@ int        gedcom_warning(const char* s, ...);
 int        gedcom_message(const char* s, ...);
 int        gedcom_debug_print(const char* s, ...);
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* __GEDCOM_H */