+/* Compatibility handling */
+
+void gedcom_set_compat_handling(int enable_compat)
+{
+ compat_enabled = enable_compat;
+}
+
+void set_compatibility(const char* program)
+{
+ /* Reinitialize compatibility */
+ compat_at = 0;
+ default_charset = "";
+ compatibility = 0;
+
+ if (compat_enabled) {
+ if (! strncmp(program, "ftree", 6)) {
+ gedcom_warning(_("Enabling compatibility with 'ftree'"));
+ compatibility = C_FTREE;
+ }
+ else if (! strncmp(program, "LIFELINES", 9)) {
+ /* Matches "LIFELINES 3.0.2" */
+ gedcom_warning(_("Enabling compatibility with 'Lifelines'"));
+ compatibility = C_LIFELINES;
+ default_charset = "ANSI";
+ compat_at = 1;
+ }
+ }
+}
+
+int compat_mode(int compat_flags)
+{
+ return (compat_flags & compatibility);
+}
+