Bugfix.
[gedcom-parse.git] / gedcom / multilex.c
index 175a7be6cb3dbddc0222ec95983b2414c9d65619..af36069b436c0e0c596d54cad174c444ec33333c 100644 (file)
@@ -171,7 +171,7 @@ int gedcom_parse_file(const char* file_name)
       enc = determine_encoding(file);
       
       if (lexer_init(enc, file)) {
-       line_no = 1;
+       line_no = 0;
        make_xref_table();
        result = gedcom_parse();
        line_no = 0;
@@ -215,3 +215,19 @@ int gedcom_new_model()
   }
   return result;
 }
+
+int gedcom_check_version(int major, int minor, int patch)
+{
+  if (major < GEDCOM_PARSE_VERSION_MAJOR)
+    return 1;
+  else if (major > GEDCOM_PARSE_VERSION_MAJOR)
+    return 0;
+  else if (minor < GEDCOM_PARSE_VERSION_MINOR)
+    return 1;
+  else if (minor > GEDCOM_PARSE_VERSION_MINOR)
+    return 0;
+  else if (patch <= GEDCOM_PARSE_VERSION_PATCH)
+    return 1;
+  else
+    return 0;
+}