mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 02:58:01 +02:00
Implement doctype check in the trivial parser
This is needed for the libxml parser backend.
This commit is contained in:
parent
882a2e11a9
commit
085e7730b8
2 changed files with 22 additions and 0 deletions
|
|
@ -130,6 +130,25 @@ bus_config_parser_unref (BusConfigParser *parser)
|
|||
dbus_free (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,
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ BusConfigParser* bus_config_parser_new (const DBusString *basedir,
|
|||
|
||||
BusConfigParser* bus_config_parser_ref (BusConfigParser *parser);
|
||||
void bus_config_parser_unref (BusConfigParser *parser);
|
||||
dbus_bool_t bus_config_parser_check_doctype (BusConfigParser *parser,
|
||||
const char *doctype,
|
||||
DBusError *error);
|
||||
dbus_bool_t bus_config_parser_start_element (BusConfigParser *parser,
|
||||
const char *element_name,
|
||||
const char **attribute_names,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue