Copied from old documentation. Removed all Gedcom_val details.
[gedcom-parse.git] / gedcom / xref.h
1 /* Header for cross-reference manipulation routines.
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 __XREF_H
25 #define __XREF_H
26
27 #include "gedcom.h"
28
29 typedef enum _XREF_CTXT {
30   XREF_DEFINED,
31   XREF_USED
32 } Xref_ctxt;
33
34 void make_xref_table();
35 int check_xref_table();
36
37 struct xref_value *gedcom_parse_xref(const char *raw_value,
38                                      Xref_ctxt ctxt, Xref_type type);
39
40 #define GEDCOM_MAKE_XREF_PTR(VAR, XREF) \
41    GEDCOM_MAKE(VAR, XREF, GV_XREF_PTR, xref_val)
42
43 #define GEDCOM_MAKE_NULL_OR_XREF_PTR(VAR, XREF) \
44    (XREF == NULL ? \
45     GEDCOM_MAKE_NULL(VAR) : \
46     GEDCOM_MAKE_XREF_PTR(VAR, XREF))
47
48 #endif /* __XREF_H */