X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gedcom%2Finterface.h;h=d766d945eb62c743787abe7821b63bb18ced5583;hb=2907044621b5be3f7c0eab6b364da6f07e74e6be;hp=db1a048f218b099dee36d795749fb82adc9757e3;hpb=8093e53a57e174b019f07760f5bf815271ceee9b;p=gedcom-parse.git diff --git a/gedcom/interface.h b/gedcom/interface.h index db1a048..d766d94 100644 --- a/gedcom/interface.h +++ b/gedcom/interface.h @@ -1,11 +1,22 @@ -/* 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. * - - (C) 2001 by The Genes Development Team - Original author: Peter Verthez (Peter.Verthez@advalvas.be) -*/ +/* Header for interface.c + Copyright (C) 2001, 2002 The Genes Development Team + This file is part of the Gedcom parser library. + Contributed by Peter Verthez , 2001. + + 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$ */ @@ -13,16 +24,37 @@ #ifndef __INTERFACE_H #define __INTERFACE_H +#include "gedcom_internal.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); +Gedcom_ctxt start_record(Gedcom_rec rec, + int level, Gedcom_val xref, struct tag_struct tag, + char *raw_value, Gedcom_val parsed_value); +void end_record(Gedcom_rec rec, Gedcom_ctxt self, + Gedcom_val parsed_value); Gedcom_ctxt start_element(Gedcom_elt elt, Gedcom_ctxt parent, - int level, char *tag, char *raw_value, + int level, struct tag_struct tag, char *raw_value, Gedcom_val parsed_value); void end_element(Gedcom_elt elt, Gedcom_ctxt parent, Gedcom_ctxt self, Gedcom_val parsed_value); +extern Gedcom_val_struct val1; +extern Gedcom_val_struct val2; + +#define GEDCOM_MAKE(VAR, VALUE, TYPE, MEMBER) \ + (VAR.type = TYPE, VAR.value.MEMBER = VALUE, &VAR) + +#define GEDCOM_MAKE_NULL(VAR) \ + GEDCOM_MAKE(VAR, NULL, GV_NULL, string_val) + +#define GEDCOM_MAKE_STRING(VAR, STRING) \ + GEDCOM_MAKE(VAR, STRING, GV_CHAR_PTR, string_val) + +#define GEDCOM_MAKE_NULL_OR_STRING(VAR, STRING) \ + (STRING == NULL ? \ + GEDCOM_MAKE_NULL(VAR) : \ + GEDCOM_MAKE_STRING(VAR, STRING)) + #endif /* __INTERFACE_H */