summaryrefslogtreecommitdiff
path: root/bus/config-parser-trivial.c
diff options
context:
space:
mode:
authorChristian Dywan <christian.dywan@lanedo.com>2010-06-21 07:13:47 +0200
committerWill Thompson <will.thompson@collabora.co.uk>2010-06-22 16:59:26 +0100
commit085e7730b88a0c4a42a325c3ed4dd99f0b67185b (patch)
treeb4cb2079b9d021ed29637b9550f8b41a129e5953 /bus/config-parser-trivial.c
parent882a2e11a9ea41ce3704c23cc60875fcbe00caf3 (diff)
downloaddbus-085e7730b88a0c4a42a325c3ed4dd99f0b67185b.tar.gz
Implement doctype check in the trivial parser
This is needed for the libxml parser backend.
Diffstat (limited to 'bus/config-parser-trivial.c')
-rw-r--r--bus/config-parser-trivial.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/bus/config-parser-trivial.c b/bus/config-parser-trivial.c
index fd016a84..8a1f504c 100644
--- a/bus/config-parser-trivial.c
+++ b/bus/config-parser-trivial.c
@@ -131,6 +131,25 @@ bus_config_parser_unref (BusConfigParser *parser)
}
dbus_bool_t
+bus_config_parser_check_doctype (BusConfigParser *parser,
+ const char *doctype,
+ DBusError *error)
+{
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ if (strcmp (doctype, "busconfig") != 0)
+ {
+ dbus_set_error (error,
+ DBUS_ERROR_FAILED,
+ "Configuration file has the wrong document type %s",
+ doctype);
+ return FALSE;
+ }
+ else
+ return TRUE;
+}
+
+dbus_bool_t
bus_config_parser_start_element (BusConfigParser *parser,
const char *element_name,
const char **attribute_names,