Freeciv-3.3
Loading...
Searching...
No Matches
registry.c
Go to the documentation of this file.
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)
6 any later version.
7
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***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* libxml2 */
19#ifdef FREECIV_HAVE_XML_REGISTRY
20#include <libxml/parser.h>
21#endif /* FREECIV_HAVE_XML_REGISTRY */
22
23/* utility */
24#include "registry_xml.h"
25
26#include "registry.h"
27
28/*********************************************************************/
32{
33#ifdef FREECIV_HAVE_XML_REGISTRY
35#endif /* FREECIV_HAVE_XML_REGISTRY */
36}
37
38/*********************************************************************/
42{
43#ifdef FREECIV_HAVE_XML_REGISTRY
45#endif /* FREECIV_HAVE_XML_REGISTRY */
46}
47
48/*********************************************************************/
51struct section_file *secfile_load(const char *filename,
53{
54#ifdef FREECIV_HAVE_XML_REGISTRY
55 struct stat buf;
56
57 if (fc_stat(filename, &buf) == 0) {
59
60 sec_doc = xmlReadFile(filename, nullptr, XML_PARSE_NOERROR);
61 if (sec_doc != nullptr) {
62 return xmlfile_load(sec_doc, filename);
63 }
64 }
65#endif /* FREECIV_HAVE_XML_REGISTRY */
66
67 return secfile_load_section(filename, nullptr, allow_duplicates);
68}
char * incite_cost
Definition comments.c:76
struct section_file * secfile_load(const char *filename, bool allow_duplicates)
Definition registry.c:51
void registry_module_init(void)
Definition registry.c:31
void registry_module_close(void)
Definition registry.c:41
struct section_file * secfile_load_section(const char *filename, const char *section, bool allow_duplicates)
bool allow_duplicates
int fc_stat(const char *filename, struct stat *buf)
Definition support.c:574