Allow elements out of context in GOM.
[gedcom-parse.git] / gom / gom.c
index 3e604159bc9f5a7849e88d003204c72e20302cad..e00af9a948317ef57c9046643113eeee0a21b40b 100644 (file)
--- a/gom/gom.c
+++ b/gom/gom.c
@@ -111,10 +111,10 @@ int gom_parse_file(const char* file_name)
     gom_cleanup();
   }
   else {
+    gedcom_set_compat_options(COMPAT_ALLOW_OUT_OF_CONTEXT);
     subscribe_all();
   }
   gom_active = 1;
-  gedcom_set_compat_options(0);
   return gedcom_parse_file(file_name);
 }
 
@@ -174,6 +174,26 @@ void gom_default_callback (Gedcom_elt elt UNUSED, Gedcom_ctxt parent UNUSED,
                  level, tag, raw_value);
 }
 
+void gom_mem_error(const char *filename, int line)
+{
+  gedcom_error(_("Could not allocate memory at %s, %d"), filename, line);
+}
+
+void gom_xref_already_in_use(const char *xrefstr)
+{
+  gedcom_error(_("Cross-reference key '%s' is already in use"), xrefstr);
+}
+
+void gom_move_error(const char* type)
+{
+  gedcom_warning(_("Could not move struct of type %s"), type);
+}
+
+void gom_find_error(const char* type)
+{
+  gedcom_warning(_("Could not find struct of type %s in chain"), type);
+}
+
 void set_xref_type(struct xref_value* xr, const char *str)
 {
   if (!strcasecmp(str, "FAM"))