Moved gedcom_set_error_handling from gedcom.y to make doxygen conversion
[gedcom-parse.git] / gedcom / interface.c
index 24cf4e646e3f1704e4e7cf485643f948e7db440d..aae15e485dcf73182cb11763b5d2f280fbd80061 100644 (file)
@@ -32,8 +32,9 @@ static Gedcom_def_cb       default_cb                         = NULL;
 
 void gedcom_set_default_callback(Gedcom_def_cb func)
 {
-  if (default_cb)
+  if (default_cb) {
     gedcom_error(_("Internal error: Duplicate registration for default callback"));
+  }
   default_cb = func;
 }
 
@@ -125,3 +126,14 @@ void gedcom_cast_error(const char* file, int line,
     (_("Wrong cast of value in file %s, at line %d: %s instead of %s"),
      file, line, _(val_type_str[tried_bit]), _(val_type_str[real_bit]));
 }
+
+/** This function allows to customize what happens on an error.  It doesn't
+    influence the generation of error or warning messages, only the behaviour
+    of the parser and its return code.  See \ref Gedcom_err_mech for the
+    possible mechanisms.
+ */
+
+void gedcom_set_error_handling(Gedcom_err_mech mechanism)
+{
+  error_mechanism = mechanism;
+}