Main Page   Modules   Data Structures   File List   Data Fields   Related Pages  

config-parser.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* config-parser.h  XML-library-agnostic configuration file parser
00003  *
00004  * Copyright (C) 2003 Red Hat, Inc.
00005  *
00006  * Licensed under the Academic Free License version 1.2
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 #ifndef BUS_CONFIG_PARSER_H
00025 #define BUS_CONFIG_PARSER_H
00026 
00027 #include <config.h>
00028 
00029 #include <dbus/dbus.h>
00030 #include <dbus/dbus-string.h>
00031 #include <dbus/dbus-list.h>
00032 #include "bus.h"
00033 
00034 /* Whatever XML library we're using just pushes data into this API */
00035 
00036 typedef struct BusConfigParser BusConfigParser;
00037 
00038 BusConfigParser* bus_config_parser_new           (const DBusString  *basedir,
00039                                                   dbus_bool_t        is_toplevel);
00040 void             bus_config_parser_ref           (BusConfigParser   *parser);
00041 void             bus_config_parser_unref         (BusConfigParser   *parser);
00042 dbus_bool_t      bus_config_parser_check_doctype (BusConfigParser   *parser,
00043                                                   const char        *doctype,
00044                                                   DBusError         *error);
00045 dbus_bool_t      bus_config_parser_start_element (BusConfigParser   *parser,
00046                                                   const char        *element_name,
00047                                                   const char       **attribute_names,
00048                                                   const char       **attribute_values,
00049                                                   DBusError         *error);
00050 dbus_bool_t      bus_config_parser_end_element   (BusConfigParser   *parser,
00051                                                   const char        *element_name,
00052                                                   DBusError         *error);
00053 dbus_bool_t      bus_config_parser_content       (BusConfigParser   *parser,
00054                                                   const DBusString  *content,
00055                                                   DBusError         *error);
00056 dbus_bool_t      bus_config_parser_finished      (BusConfigParser   *parser,
00057                                                   DBusError         *error);
00058 
00059 /* Functions for extracting the parse results */
00060 const char* bus_config_parser_get_user         (BusConfigParser *parser);
00061 const char* bus_config_parser_get_type         (BusConfigParser *parser);
00062 DBusList**  bus_config_parser_get_addresses    (BusConfigParser *parser);
00063 DBusList**  bus_config_parser_get_mechanisms   (BusConfigParser *parser);
00064 dbus_bool_t bus_config_parser_get_fork         (BusConfigParser *parser);
00065 const char* bus_config_parser_get_pidfile      (BusConfigParser *parser);
00066 DBusList**  bus_config_parser_get_service_dirs (BusConfigParser *parser);
00067 BusPolicy*  bus_config_parser_steal_policy     (BusConfigParser *parser);
00068 void        bus_config_parser_get_limits       (BusConfigParser *parser,
00069                                                 BusLimits       *limits);
00070 
00071 /* Loader functions (backended off one of the XML parsers).  Returns a
00072  * finished ConfigParser.
00073  */
00074 BusConfigParser* bus_config_load (const DBusString *file,
00075                                   dbus_bool_t       is_toplevel,
00076                                   DBusError        *error);
00077 
00078 
00079 #endif /* BUS_CONFIG_PARSER_H */

Generated on Wed Oct 22 14:05:00 2003 for D-BUS by doxygen1.3-rc3