Completed doxygen conversion of the documentation for the libgedcom part.
[gedcom-parse.git] / gedcom / gedcom_internal.h
1 /* General header for the Gedcom parser.
2    Copyright (C) 2001, 2002 The Genes Development Team
3    This file is part of the Gedcom parser library.
4    Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
5
6    The Gedcom parser library is free software; you can redistribute it
7    and/or modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The Gedcom parser library is distributed in the hope that it will be
12    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the Gedcom parser library; if not, write to the
18    Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 /* $Id$ */
22 /* $Name$ */
23
24 #ifndef __GEDCOM_INTERNAL_H
25 #define __GEDCOM_INTERNAL_H
26 #include <stdarg.h>
27 #include <stdlib.h>
28 #include <stdio.h>
29 #include <string.h>
30 #include <errno.h>
31 #ifdef HAVE_CONFIG_H
32 #include <config.h>
33 #endif
34 #include <libintl.h>
35
36 #define _(string) dgettext(PACKAGE, string)
37 #define N_(string) (string)
38
39 #define MAXGEDCLEVEL    99
40 #define MAXGEDCLINELEN  255
41 #define MAXGEDCTAGLEN   31
42 #define MAXSTDTAGLEN    4
43 #define MAXGEDCPTRLEN   22
44 #define GEDCOMTAGOFFSET 257
45 #define INTERNAL_ENCODING "UTF-8"
46
47 #define GEDCOM_INTERNAL 1
48
49 #ifdef __GNUC__
50 #define UNUSED __attribute__((unused))
51 #else
52 #define UNUSED
53 #endif
54
55 struct tag_struct {
56   char *string;
57   int value;
58 };
59
60 typedef enum _PARSE_STATE {
61   STATE_NORMAL,
62   STATE_INITIAL,
63   STATE_EXPECT_TAG
64 } ParseState;
65
66 int  gedcom_parse();
67 int  gedcom_lex();
68 int  gedcom_check_token(const char* str, ParseState state, int check_token);
69 void gedcom_enable_internal_debug();
70
71 void gedcom_mem_error(const char *filename, int line);
72
73 #define MEMORY_ERROR gedcom_mem_error(__FILE__, __LINE__)
74 #define VALUE_IF_MISSING "-" 
75
76 extern int line_no;
77 extern int init_called;
78 extern int gedcom_high_level_debug; 
79 extern FILE* trace_output;
80
81
82 #endif /* __GEDCOM_INTERNAL_H */