Added a function to check whether a string is a valid token.
[gedcom-parse.git] / gedcom / gedcom_internal.h
index abd80913302d2cbaae819e6245979adc9f7e754f..ea2bd6ef76599e1c2af3db4d945ddbc76a9e3619 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#ifdef WITH_DMALLOC
-#include <dmalloc.h>
-#endif
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include <libintl.h>
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
 
 #define _(string) gettext(string)
 #define N_(string) (string)
@@ -54,13 +54,20 @@ struct tag_struct {
   int value;
 };
 
-int        gedcom_error(char* s, ...);
-int        gedcom_warning(char* s, ...);
-int        gedcom_message(char* s, ...);
-int        gedcom_debug_print(char* s, ...);
+typedef enum _PARSE_STATE {
+  STATE_NORMAL,
+  STATE_INITIAL,
+  STATE_EXPECT_TAG
+} ParseState;
+
+int  gedcom_parse();
+int  gedcom_lex();
+int  gedcom_check_token(const char* str, ParseState state, int check_token);
+
+void gedcom_mem_error(const char *filename, int line);
 
-int        gedcom_parse();
-int        gedcom_lex();
+#define MEMORY_ERROR gedcom_mem_error(__FILE__, __LINE__)
 
 extern int line_no;
+extern int init_called;
 #endif /* __GEDCOM_INTERNAL_H */