X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gedcom%2Fgedcom_internal.h;h=7e4fc78716c372066caa5f77ef579de04490f252;hb=dac8a4dd167210b17ef6cd727ebd3a6db0cde738;hp=1250340b07e166134d0e3b674f7ada88ec1a80c6;hpb=8093e53a57e174b019f07760f5bf815271ceee9b;p=gedcom-parse.git diff --git a/gedcom/gedcom_internal.h b/gedcom/gedcom_internal.h index 1250340..7e4fc78 100644 --- a/gedcom/gedcom_internal.h +++ b/gedcom/gedcom_internal.h @@ -1,25 +1,40 @@ -/* This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * +/* General header for the Gedcom parser. + Copyright (C) 2001, 2002 The Genes Development Team + This file is part of the Gedcom parser library. + Contributed by Peter Verthez , 2001. - (C) 2001 by The Genes Development Team - Original author: Peter Verthez (Peter.Verthez@advalvas.be) -*/ + The Gedcom parser library is free software; you can redistribute it + and/or modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The Gedcom parser library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the Gedcom parser library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ /* $Id$ */ /* $Name$ */ -#ifndef __GEDCOM_H -#define __GEDCOM_H +#ifndef __GEDCOM_INTERNAL_H +#define __GEDCOM_INTERNAL_H #include #include #include #include #include -#ifdef DMALLOC -#include +#ifdef HAVE_CONFIG_H +#include #endif +#include + +#define _(string) dgettext(PACKAGE, string) +#define N_(string) (string) #define MAXGEDCLEVEL 99 #define MAXGEDCLINELEN 255 @@ -27,14 +42,35 @@ #define MAXSTDTAGLEN 4 #define MAXGEDCPTRLEN 22 #define GEDCOMTAGOFFSET 257 +#define INTERNAL_ENCODING "UTF-8" + +#define GEDCOM_INTERNAL 1 + +#ifdef __GNUC__ +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif + +struct tag_struct { + char *string; + int value; +}; + +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); -int gedcom_error(char* s, ...); -int gedcom_warning(char* s, ...); -int gedcom_message(char* s, ...); -int gedcom_debug_print(char* s, ...); +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; -#endif /* __GEDCOM_H */ +extern int init_called; +#endif /* __GEDCOM_INTERNAL_H */