1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
15 #include <fc_config.h>
19 #ifdef FREECIV_HAVE_XML_REGISTRY
20 #include <libxml/parser.h>
21 #endif /* FREECIV_HAVE_XML_REGISTRY */
23 #include "registry_xml.h"
27 /*************************************************************************
28 Initialize registry module
29 *************************************************************************/
30 void registry_module_init(void)
32 #ifdef FREECIV_HAVE_XML_REGISTRY
34 #endif /* FREECIV_HAVE_XML_REGISTRY */
37 /*************************************************************************
38 Closes registry module
39 *************************************************************************/
40 void registry_module_close(void)
42 #ifdef FREECIV_HAVE_XML_REGISTRY
44 #endif /* FREECIV_HAVE_XML_REGISTRY */
47 /**************************************************************************
48 Create a section file from a file. Returns NULL on error.
49 **************************************************************************/
50 struct section_file
*secfile_load(const char *filename
,
51 bool allow_duplicates
)
53 #ifdef FREECIV_HAVE_XML_REGISTRY
56 if (fc_stat(filename
, &buf
) == 0) {
59 sec_doc
= xmlReadFile(filename
, NULL
, XML_PARSE_NOERROR
);
60 if (sec_doc
!= NULL
) {
61 return xmlfile_load(sec_doc
, filename
);
64 #endif /* FREECIV_HAVE_XML_REGISTRY */
66 return secfile_load_section(filename
, NULL
, allow_duplicates
);