9 printf("gedcom-parse test program for libgedcom\n\n");
10 printf("Usage: gedcom-parse [options] file\n");
12 printf(" -h Show this help text\n");
13 printf(" -nc Disable compatibility mode\n");
14 printf(" -fi Fail immediately on errors\n");
15 printf(" -fd Deferred fail on errors, but parse completely\n");
16 printf(" -fn No fail on errors\n");
17 printf(" -dg Debug setting: only libgedcom debug messages\n");
18 printf(" -da Debug setting: libgedcom + yacc debug messages\n");
21 int main(int argc, char* argv[])
23 MECHANISM mech = IMMED_FAIL;
24 int compat_enabled = 1;
26 char* file_name = NULL;
30 for (i=1; i<argc; i++) {
31 if (!strncmp(argv[i], "-da", 4))
33 else if (!strncmp(argv[i], "-dg", 4))
35 else if (!strncmp(argv[i], "-fi", 4))
37 else if (!strncmp(argv[i], "-fd", 4))
39 else if (!strncmp(argv[i], "-fn", 4))
41 else if (!strncmp(argv[i], "-nc", 4))
43 else if (!strncmp(argv[i], "-h", 3)) {
47 else if (strncmp(argv[i], "-", 1)) {
52 printf ("Unrecognized option: %s\n", argv[i]);
60 printf("No file name given\n");
65 gedcom_set_debug_level(debug_level);
66 gedcom_set_compat_handling(compat_enabled);
67 gedcom_set_error_handling(mech);
69 if (gedcom_parse_file(file_name) == 0) {
70 printf("Parse succeeded\n");
74 printf("Parse failed\n");