1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * Configuration file access
5 * This file is part of monster
7 * Copyright (C) 2006,2007 Nedko Arnaudov <nedko@arnaudov.name>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 *****************************************************************************/
24 #include <libxml/parser.h>
26 #define DISABLE_DEBUG_OUTPUT
37 DEBUG_OUT("conf_file_parse() called.");
39 g_conf_ptr
= xmlParseFile("/etc/monster.xml");
40 if (g_conf_ptr
== NULL
)
42 ERROR_OUT("Failed to parse conf file");
52 DEBUG_OUT("conf_file_cleanup() called.");
53 xmlFreeDoc(g_conf_ptr
);
62 DEBUG_OUT("conf_file_get_string() called.");
63 return xml_get_string(g_conf_ptr
, xpath
, buffer_ptr
, buffer_size
);
71 DEBUG_OUT("conf_file_get_int() called.");
72 return xml_get_int(g_conf_ptr
, xpath
, value_ptr
);
78 unsigned int * value_ptr
)
80 DEBUG_OUT("conf_file_get_uint() called.");
81 return xml_get_uint(g_conf_ptr
, xpath
, value_ptr
);