***********************
** FILE NAME : configuration.cpp
** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
-** VERSION NUMBER : $Revision: 1.2 $
+** VERSION NUMBER : $Revision: 1.3 $
**
** DESCRIPTION : Implementation of configuration class
**
********************************
** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
** CREATION DATE : Jul 23, 2002
-** LAST UPDATE : Jul 24, 2002
+** LAST UPDATE : Nov 02, 2002
** MODIFICATIONS :
**************************************************************************/
/*****************************
$Log: configuration.cpp,v $
- Revision 1.2 2002-09-28 06:48:46 arjen
+ Revision 1.3 2002-11-02 14:35:15 arjen
+ Uses the XML2 library
+ BugFix: segfault when finding a parameters that is not in the user-sepcific
+ config tree.
+
+ Revision 1.2 2002/09/28 06:48:46 arjen
Bugfix: In configuration::find_parameter(), check if the parameter node exists
before retrieving its contents.
*****************************/
-static const char *RCSID = "$Id: configuration.cpp,v 1.2 2002-09-28 06:48:46 arjen Exp $";
+static const char *RCSID = "$Id: configuration.cpp,v 1.3 2002-11-02 14:35:15 arjen Exp $";
#include "configuration.h"
** VARS CHANGED :
** FUNCTIONS USED :
** SEE ALSO :
-** LAST MODIFIED : Jul 24, 2002
+** LAST MODIFIED : Nov 02, 2002
**=========================================================================
*/
if (system)
{
root_node = xmlDocGetRootElement(system);
- section_node = xmlFindTag(root_node->childs, section);
+ section_node = xmlFindTag(root_node->children, section);
if (section_node != NULL)
{
- param_node = xmlFindTag(section_node->childs, parameter);
+ param_node = xmlFindTag(section_node->children, parameter);
if (param_node != NULL)
{
- param_node = param_node->childs;
+ param_node = param_node->children;
}
if (param_node != NULL)
{
if (user)
{
root_node = xmlDocGetRootElement(user);
- section_node = xmlFindTag(root_node->childs, section);
+ section_node = xmlFindTag(root_node->children, section);
if (section_node != NULL)
{
- param_node = xmlFindTag(section_node->childs, parameter);
- param_node = param_node->childs;
+ param_node = xmlFindTag(section_node->children, parameter);
+ if (param_node != NULL)
+ {
+ param_node = param_node->children;
+ }
if (param_node != NULL)
{
param_value = (char *)param_node->content;
***********************
** FILE NAME : configuration.h
** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
-** VERSION NUMBER : $Revision: 1.2 $
+** VERSION NUMBER : $Revision: 1.3 $
**
** DESCRIPTION : Definition of configuration class
**
** ADMINISTRATIVE INFORMATION *
********************************
** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
-** CREATION DATE : Jul 24, 2002
+** CREATION DATE : Nov 02, 2002
** LAST UPDATE :
** MODIFICATIONS :
**************************************************************************/
/*****************************
$Log: configuration.h,v $
- Revision 1.2 2002-09-02 06:18:20 arjen
+ Revision 1.3 2002-11-02 14:35:15 arjen
+ Uses the XML2 library
+ BugFix: segfault when finding a parameters that is not in the user-sepcific
+ config tree.
+
+ Revision 1.2 2002/09/02 06:18:20 arjen
Fixed some date and time conversion functions
Revision 1.1 2002/07/25 08:01:26 arjen
*****************************/
-/* static const char *RCSID = "$Id: configuration.h,v 1.2 2002-09-02 06:18:20 arjen Exp $"; */
+/* static const char *RCSID = "$Id: configuration.h,v 1.3 2002-11-02 14:35:15 arjen Exp $"; */
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
-#include <parser.h> // usually in /usr/include/gnome-xml, see xml-config
+#include <libxml/parser.h> // usually in /usr/include/libxml2, see xml2-config
#include "String.h"