Checked in external.h as gedcom.h (forgot to check in before...)
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 9 Dec 2001 09:30:42 +0000 (09:30 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 9 Dec 2001 09:30:42 +0000 (09:30 +0000)
gedcom.h [new file with mode: 0644]
gedcom_lex_common.c
interface.h
message.c
standalone.c

diff --git a/gedcom.h b/gedcom.h
new file mode 100644 (file)
index 0000000..afaec3b
--- /dev/null
+++ b/gedcom.h
@@ -0,0 +1,100 @@
+#ifndef __EXTERNAL_H
+#define __EXTERNAL_H
+
+#include <stdio.h>
+
+typedef enum _REC {
+  REC_HEAD,
+  REC_FAM,
+  REC_INDI,
+  REC_OBJE,
+  REC_NOTE,
+  REC_REPO,
+  REC_SOUR,
+  REC_SUBN,
+  REC_SUBM,
+  REC_USER,
+  LAST_REC
+} Gedcom_rec;
+
+typedef enum _ELT {
+  ELT_HEAD_SOUR,
+  ELT_HEAD_SOUR_VERS,
+  ELT_HEAD_SOUR_NAME,
+  ELT_HEAD_SOUR_CORP,
+  ELT_HEAD_SOUR_DATA,
+  ELT_HEAD_SOUR_DATA_DATE,
+  ELT_HEAD_SOUR_DATA_COPR,
+  ELT_HEAD_DEST,
+  ELT_HEAD_DATE,
+  ELT_HEAD_DATE_TIME,
+  ELT_HEAD_SUBM,
+  ELT_HEAD_SUBN,
+  ELT_HEAD_FILE,
+  ELT_HEAD_COPR,
+  ELT_HEAD_GEDC,
+  ELT_HEAD_GEDC_VERS,
+  ELT_HEAD_GEDC_FORM,
+  ELT_HEAD_CHAR,
+  ELT_HEAD_CHAR_VERS,
+  ELT_HEAD_LANG,
+  ELT_HEAD_PLAC,
+  ELT_HEAD_PLAC_FORM,
+  ELT_HEAD_NOTE,
+  ELT_USER,
+  LAST_ELT
+} Gedcom_elt;
+
+typedef enum _MECH {
+  IMMED_FAIL,
+  DEFER_FAIL,
+  IGNORE_ERRORS
+} Gedcom_err_mech;
+
+typedef enum _MSG {
+  ERROR,
+  WARNING,
+  MESSAGE
+} Gedcom_msg_type;
+
+typedef void* Gedcom_ctxt;
+typedef void* Gedcom_val;
+
+typedef void
+        (*Gedcom_msg_handler)
+        (Gedcom_msg_type type, char *msg);
+
+typedef Gedcom_ctxt
+        (*Gedcom_rec_start_cb)
+        (int level, char *xref, char *tag);
+typedef void
+        (*Gedcom_rec_end_cb)
+        (Gedcom_ctxt self);
+
+typedef Gedcom_ctxt
+        (*Gedcom_elt_start_cb)
+        (Gedcom_ctxt parent,
+        int level, char *tag, char *raw_value, Gedcom_val parsed_value);
+typedef void
+        (*Gedcom_elt_end_cb)
+        (Gedcom_ctxt parent, Gedcom_ctxt self, Gedcom_val parsed_value);
+
+typedef void
+        (*Gedcom_def_cb)
+        (Gedcom_ctxt parent, int level, char *tag, char *raw_value);
+
+int     gedcom_parse_file(char* file_name);
+void    gedcom_set_debug_level(int level, FILE* trace_output);
+void    gedcom_set_error_handling(Gedcom_err_mech mechanism);
+void    gedcom_set_compat_handling(int enable_compat);
+void    gedcom_set_message_handler(Gedcom_msg_handler func);
+void    gedcom_set_default_callback(Gedcom_def_cb func);
+
+void    gedcom_subscribe_to_record(Gedcom_rec rec,
+                                  Gedcom_rec_start_cb cb_start,
+                                  Gedcom_rec_end_cb cb_end);
+void    gedcom_subscribe_to_element(Gedcom_elt elt,
+                                   Gedcom_elt_start_cb cb_start,
+                                   Gedcom_elt_end_cb cb_end);
+
+#endif /* __EXTERNAL_H */
index 5ea80d18f18552bdeeb1bae06ba4bb3e35e8dc07..5d734c44689adb6e8fe9ae0b46c9bb15594af1f9 100644 (file)
 
 #ifndef IN_LEX
 
-#include "external.h"
 #include "gedcom_internal.h"
-#include "gedcom.tab.h"
 #include "multilex.h"
 #include "encoding.h"
+#include "gedcom.h"
+#include "gedcom.tab.h"
 
 #define YY_NO_UNPUT
 
index f6f410223851d33a9931131b36fe949d41d1509f..db1a048f218b099dee36d795749fb82adc9757e3 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef __INTERFACE_H
 #define __INTERFACE_H
 
-#include "external.h"
+#include "gedcom.h"
 
 Gedcom_ctxt start_record(Gedcom_rec rec, int level, char *xref, char *tag);
 void        end_record(Gedcom_rec rec, Gedcom_ctxt self);
index 49c9c7d354cc3d7a3e8a2017b1c9f525076b257f..6d44530ace816e769ddbfc0593a8ee03d1e4e9ef 100644 (file)
--- a/message.c
+++ b/message.c
@@ -11,7 +11,7 @@
 /* $Name$ */
 
 #include "gedcom_internal.h"
-#include "external.h"
+#include "gedcom.h"
 
 #define INITIAL_BUF_SIZE 256
 char *mess_buffer = NULL;
index 0f9ba791d5fee64b2f087b3a9fa2591d05ca5d90..e29e67ea7bd91291f3a13a30c197c1213952937e 100644 (file)
@@ -13,7 +13,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include "external.h"
+#include "gedcom.h"
 
 void show_help ()
 {