Commit 7190af43 authored by David Zeuthen's avatar David Zeuthen

GDBus: Remove constness from introspection data structures

Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 4a1c5a1b
......@@ -2541,6 +2541,13 @@ g_dbus_interface_info_generate_xml
g_dbus_node_info_new_for_xml
g_dbus_node_info_lookup_interface
g_dbus_node_info_generate_xml
G_TYPE_DBUS_NODE_INFO
G_TYPE_DBUS_INTERFACE_INFO
G_TYPE_DBUS_METHOD_INFO
G_TYPE_DBUS_SIGNAL_INFO
G_TYPE_DBUS_PROPERTY_INFO
G_TYPE_DBUS_ARG_INFO
G_TYPE_DBUS_ANNOTATION_INFO
g_dbus_node_info_ref
g_dbus_interface_info_ref
g_dbus_method_info_ref
......@@ -2555,14 +2562,6 @@ g_dbus_signal_info_unref
g_dbus_property_info_unref
g_dbus_arg_info_unref
g_dbus_annotation_info_unref
<SUBSECTION Standard>
G_TYPE_DBUS_NODE_INFO
G_TYPE_DBUS_INTERFACE_INFO
G_TYPE_DBUS_METHOD_INFO
G_TYPE_DBUS_SIGNAL_INFO
G_TYPE_DBUS_PROPERTY_INFO
G_TYPE_DBUS_ARG_INFO
G_TYPE_DBUS_ANNOTATION_INFO
<SUBSECTION Private>
g_dbus_annotation_info_get_type
g_dbus_arg_info_get_type
......
......@@ -425,8 +425,8 @@ call_helper_get_method_in_signature (GDBusConnection *c,
GVariant *result;
GDBusNodeInfo *node_info;
const gchar *xml_data;
const GDBusInterfaceInfo *interface_info;
const GDBusMethodInfo *method_info;
GDBusInterfaceInfo *interface_info;
GDBusMethodInfo *method_info;
guint n;
ret = NULL;
......
......@@ -307,7 +307,7 @@ _g_application_platform_register (GApplication *app,
registration_id = g_dbus_connection_register_object (app->priv->session_bus,
app->priv->dbus_path,
&application_dbus_interface_info,
(GDBusInterfaceInfo *) &application_dbus_interface_info,
&application_dbus_vtable,
app,
NULL,
......
......@@ -3521,7 +3521,7 @@ typedef struct
gpointer user_data;
const gchar *property_name;
const GDBusInterfaceVTable *vtable;
const GDBusInterfaceInfo *interface_info;
GDBusInterfaceInfo *interface_info;
const GDBusPropertyInfo *property_info;
guint registration_id;
guint subtree_registration_id;
......@@ -3666,7 +3666,7 @@ validate_and_maybe_schedule_property_getset (GDBusConnection *connect
guint registration_id,
guint subtree_registration_id,
gboolean is_get,
const GDBusInterfaceInfo *interface_info,
GDBusInterfaceInfo *interface_info,
const GDBusInterfaceVTable *vtable,
GMainContext *main_context,
gpointer user_data)
......@@ -3837,7 +3837,7 @@ typedef struct
GDBusMessage *message;
gpointer user_data;
const GDBusInterfaceVTable *vtable;
const GDBusInterfaceInfo *interface_info;
GDBusInterfaceInfo *interface_info;
guint registration_id;
guint subtree_registration_id;
} PropertyGetAllData;
......@@ -3924,7 +3924,7 @@ validate_and_maybe_schedule_property_get_all (GDBusConnection *connec
GDBusMessage *message,
guint registration_id,
guint subtree_registration_id,
const GDBusInterfaceInfo *interface_info,
GDBusInterfaceInfo *interface_info,
const GDBusInterfaceVTable *vtable,
GMainContext *main_context,
gpointer user_data)
......@@ -4236,7 +4236,7 @@ validate_and_maybe_schedule_method_call (GDBusConnection *connection,
GDBusMessage *message,
guint registration_id,
guint subtree_registration_id,
const GDBusInterfaceInfo *interface_info,
GDBusInterfaceInfo *interface_info,
const GDBusInterfaceVTable *vtable,
GMainContext *main_context,
gpointer user_data)
......@@ -4472,7 +4472,7 @@ obj_message_func (GDBusConnection *connection,
guint
g_dbus_connection_register_object (GDBusConnection *connection,
const gchar *object_path,
const GDBusInterfaceInfo *interface_info,
GDBusInterfaceInfo *interface_info,
const GDBusInterfaceVTable *vtable,
gpointer user_data,
GDestroyNotify user_data_free_func,
......@@ -4523,7 +4523,7 @@ g_dbus_connection_register_object (GDBusConnection *connection,
ei->user_data = user_data;
ei->user_data_free_func = user_data_free_func;
ei->vtable = _g_dbus_interface_vtable_copy (vtable);
ei->interface_info = g_dbus_interface_info_ref ((GDBusInterfaceInfo *) interface_info);
ei->interface_info = g_dbus_interface_info_ref (interface_info);
ei->interface_name = g_strdup (interface_info->name);
ei->context = g_main_context_get_thread_default ();
if (ei->context != NULL)
......@@ -5263,7 +5263,7 @@ handle_subtree_method_invocation (GDBusConnection *connection,
const gchar *requested_object_path;
const gchar *requested_node;
gboolean is_root;
const GDBusInterfaceInfo *interface_info;
GDBusInterfaceInfo *interface_info;
const GDBusInterfaceVTable *interface_vtable;
gpointer interface_user_data;
guint n;
......
......@@ -287,7 +287,7 @@ struct _GDBusInterfaceVTable
guint g_dbus_connection_register_object (GDBusConnection *connection,
const gchar *object_path,
const GDBusInterfaceInfo *interface_info,
GDBusInterfaceInfo *interface_info,
const GDBusInterfaceVTable *vtable,
gpointer user_data,
GDestroyNotify user_data_free_func,
......
......@@ -39,7 +39,7 @@
* generate D-Bus introspection XML. Introspection information is
* used when registering objects with g_dbus_connection_register_object().
*
* The format of D-BUs introspection XML is specified in the
* The format of D-Bus introspection XML is specified in the
* <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html&num;introspection-format">D-Bus specification</link>.
*/
......@@ -637,7 +637,7 @@ g_dbus_node_info_set (ParseData *data,
/* ---------------------------------------------------------------------------------------------------- */
static void
g_dbus_annotation_info_generate_xml (const GDBusAnnotationInfo *info,
g_dbus_annotation_info_generate_xml (GDBusAnnotationInfo *info,
guint indent,
GString *string_builder)
{
......@@ -668,7 +668,7 @@ g_dbus_annotation_info_generate_xml (const GDBusAnnotationInfo *info,
}
static void
g_dbus_arg_info_generate_xml (const GDBusArgInfo *info,
g_dbus_arg_info_generate_xml (GDBusArgInfo *info,
guint indent,
const gchar *extra_attributes,
GString *string_builder)
......@@ -704,7 +704,7 @@ g_dbus_arg_info_generate_xml (const GDBusArgInfo *info,
}
static void
g_dbus_method_info_generate_xml (const GDBusMethodInfo *info,
g_dbus_method_info_generate_xml (GDBusMethodInfo *info,
guint indent,
GString *string_builder)
{
......@@ -744,7 +744,7 @@ g_dbus_method_info_generate_xml (const GDBusMethodInfo *info,
}
static void
g_dbus_signal_info_generate_xml (const GDBusSignalInfo *info,
g_dbus_signal_info_generate_xml (GDBusSignalInfo *info,
guint indent,
GString *string_builder)
{
......@@ -778,7 +778,7 @@ g_dbus_signal_info_generate_xml (const GDBusSignalInfo *info,
}
static void
g_dbus_property_info_generate_xml (const GDBusPropertyInfo *info,
g_dbus_property_info_generate_xml (GDBusPropertyInfo *info,
guint indent,
GString *string_builder)
{
......@@ -843,7 +843,7 @@ g_dbus_property_info_generate_xml (const GDBusPropertyInfo *info,
* Since: 2.26
*/
void
g_dbus_interface_info_generate_xml (const GDBusInterfaceInfo *info,
g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info,
guint indent,
GString *string_builder)
{
......@@ -890,7 +890,7 @@ g_dbus_interface_info_generate_xml (const GDBusInterfaceInfo *info,
* Since: 2.26
*/
void
g_dbus_node_info_generate_xml (const GDBusNodeInfo *info,
g_dbus_node_info_generate_xml (GDBusNodeInfo *info,
guint indent,
GString *string_builder)
{
......@@ -1898,8 +1898,8 @@ g_dbus_node_info_new_for_xml (const gchar *xml_data,
* Since: 2.26
*/
const gchar *
g_dbus_annotation_info_lookup (const GDBusAnnotationInfo **annotations,
const gchar *name)
g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations,
const gchar *name)
{
guint n;
const gchar *ret;
......@@ -1933,16 +1933,16 @@ g_dbus_annotation_info_lookup (const GDBusAnnotationInfo **annotations,
*
* Since: 2.26
*/
const GDBusMethodInfo *
g_dbus_interface_info_lookup_method (const GDBusInterfaceInfo *info,
const gchar *name)
GDBusMethodInfo *
g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
const gchar *name)
{
guint n;
const GDBusMethodInfo *result;
GDBusMethodInfo *result;
for (n = 0; info->methods != NULL && info->methods[n] != NULL; n++)
{
const GDBusMethodInfo *i = info->methods[n];
GDBusMethodInfo *i = info->methods[n];
if (g_strcmp0 (i->name, name) == 0)
{
......@@ -1972,16 +1972,16 @@ g_dbus_interface_info_lookup_method (const GDBusInterfaceInfo *info,
*
* Since: 2.26
*/
const GDBusSignalInfo *
g_dbus_interface_info_lookup_signal (const GDBusInterfaceInfo *info,
const gchar *name)
GDBusSignalInfo *
g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
const gchar *name)
{
guint n;
const GDBusSignalInfo *result;
GDBusSignalInfo *result;
for (n = 0; info->signals != NULL && info->signals[n] != NULL; n++)
{
const GDBusSignalInfo *i = info->signals[n];
GDBusSignalInfo *i = info->signals[n];
if (g_strcmp0 (i->name, name) == 0)
{
......@@ -2011,16 +2011,16 @@ g_dbus_interface_info_lookup_signal (const GDBusInterfaceInfo *info,
*
* Since: 2.26
*/
const GDBusPropertyInfo *
g_dbus_interface_info_lookup_property (const GDBusInterfaceInfo *info,
const gchar *name)
GDBusPropertyInfo *
g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info,
const gchar *name)
{
guint n;
const GDBusPropertyInfo *result;
GDBusPropertyInfo *result;
for (n = 0; info->properties != NULL && info->properties[n] != NULL; n++)
{
const GDBusPropertyInfo *i = info->properties[n];
GDBusPropertyInfo *i = info->properties[n];
if (g_strcmp0 (i->name, name) == 0)
{
......@@ -2050,16 +2050,16 @@ g_dbus_interface_info_lookup_property (const GDBusInterfaceInfo *info,
*
* Since: 2.26
*/
const GDBusInterfaceInfo *
g_dbus_node_info_lookup_interface (const GDBusNodeInfo *info,
const gchar *name)
GDBusInterfaceInfo *
g_dbus_node_info_lookup_interface (GDBusNodeInfo *info,
const gchar *name)
{
guint n;
const GDBusInterfaceInfo *result;
GDBusInterfaceInfo *result;
for (n = 0; info->interfaces != NULL && info->interfaces[n] != NULL; n++)
{
const GDBusInterfaceInfo *i = info->interfaces[n];
GDBusInterfaceInfo *i = info->interfaces[n];
if (g_strcmp0 (i->name, name) == 0)
{
......
......@@ -174,42 +174,41 @@ struct _GDBusNodeInfo
GDBusAnnotationInfo **annotations;
};
const gchar *g_dbus_annotation_info_lookup (const GDBusAnnotationInfo **annotations,
const gchar *name);
const GDBusMethodInfo *g_dbus_interface_info_lookup_method (const GDBusInterfaceInfo *info,
const gchar *name);
const GDBusSignalInfo *g_dbus_interface_info_lookup_signal (const GDBusInterfaceInfo *info,
const gchar *name);
const GDBusPropertyInfo *g_dbus_interface_info_lookup_property (const GDBusInterfaceInfo *info,
const gchar *name);
void g_dbus_interface_info_generate_xml (const GDBusInterfaceInfo *info,
guint indent,
GString *string_builder);
const gchar *g_dbus_annotation_info_lookup (GDBusAnnotationInfo **annotations,
const gchar *name);
GDBusMethodInfo *g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
const gchar *name);
GDBusSignalInfo *g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
const gchar *name);
GDBusPropertyInfo *g_dbus_interface_info_lookup_property (GDBusInterfaceInfo *info,
const gchar *name);
void g_dbus_interface_info_generate_xml (GDBusInterfaceInfo *info,
guint indent,
GString *string_builder);
GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data,
GError **error);
const GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (const GDBusNodeInfo *info,
const gchar *name);
void g_dbus_node_info_generate_xml (const GDBusNodeInfo *info,
guint indent,
GString *string_builder);
GDBusNodeInfo *g_dbus_node_info_new_for_xml (const gchar *xml_data,
GError **error);
GDBusInterfaceInfo *g_dbus_node_info_lookup_interface (GDBusNodeInfo *info,
const gchar *name);
void g_dbus_node_info_generate_xml (GDBusNodeInfo *info,
guint indent,
GString *string_builder);
GDBusNodeInfo *g_dbus_node_info_ref (GDBusNodeInfo *info);
GDBusInterfaceInfo *g_dbus_interface_info_ref (GDBusInterfaceInfo *info);
GDBusMethodInfo *g_dbus_method_info_ref (GDBusMethodInfo *info);
GDBusSignalInfo *g_dbus_signal_info_ref (GDBusSignalInfo *info);
GDBusPropertyInfo *g_dbus_property_info_ref (GDBusPropertyInfo *info);
GDBusArgInfo *g_dbus_arg_info_ref (GDBusArgInfo *info);
GDBusAnnotationInfo *g_dbus_annotation_info_ref (GDBusAnnotationInfo *info);
void g_dbus_node_info_unref (GDBusNodeInfo *info);
void g_dbus_interface_info_unref (GDBusInterfaceInfo *info);
void g_dbus_method_info_unref (GDBusMethodInfo *info);
void g_dbus_signal_info_unref (GDBusSignalInfo *info);
void g_dbus_property_info_unref (GDBusPropertyInfo *info);
void g_dbus_arg_info_unref (GDBusArgInfo *info);
void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info);
GDBusNodeInfo *g_dbus_node_info_ref (GDBusNodeInfo *info);
GDBusInterfaceInfo *g_dbus_interface_info_ref (GDBusInterfaceInfo *info);
GDBusMethodInfo *g_dbus_method_info_ref (GDBusMethodInfo *info);
GDBusSignalInfo *g_dbus_signal_info_ref (GDBusSignalInfo *info);
GDBusPropertyInfo *g_dbus_property_info_ref (GDBusPropertyInfo *info);
GDBusArgInfo *g_dbus_arg_info_ref (GDBusArgInfo *info);
GDBusAnnotationInfo *g_dbus_annotation_info_ref (GDBusAnnotationInfo *info);
void g_dbus_node_info_unref (GDBusNodeInfo *info);
void g_dbus_interface_info_unref (GDBusInterfaceInfo *info);
void g_dbus_method_info_unref (GDBusMethodInfo *info);
void g_dbus_signal_info_unref (GDBusSignalInfo *info);
void g_dbus_property_info_unref (GDBusPropertyInfo *info);
void g_dbus_arg_info_unref (GDBusArgInfo *info);
void g_dbus_annotation_info_unref (GDBusAnnotationInfo *info);
/**
* G_TYPE_DBUS_NODE_INFO:
......
......@@ -986,7 +986,7 @@ test_object_registration (void)
registration_id = g_dbus_connection_register_object (c,
"/foo/boss",
&foo_interface_info,
(GDBusInterfaceInfo *) &foo_interface_info,
&foo_vtable,
&data,
on_object_unregistered,
......@@ -998,7 +998,7 @@ test_object_registration (void)
registration_id = g_dbus_connection_register_object (c,
"/foo/boss",
&bar_interface_info,
(GDBusInterfaceInfo *) &bar_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1010,7 +1010,7 @@ test_object_registration (void)
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/worker1",
&foo_interface_info,
(GDBusInterfaceInfo *) &foo_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1022,7 +1022,7 @@ test_object_registration (void)
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/worker1p1",
&foo_interface_info,
(GDBusInterfaceInfo *) &foo_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1034,7 +1034,7 @@ test_object_registration (void)
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/worker2",
&bar_interface_info,
(GDBusInterfaceInfo *) &bar_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1046,7 +1046,7 @@ test_object_registration (void)
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/interns/intern1",
&foo_interface_info,
(GDBusInterfaceInfo *) &foo_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1059,7 +1059,7 @@ test_object_registration (void)
/* ... and try again at another path */
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/interns/intern2",
&bar_interface_info,
(GDBusInterfaceInfo *) &bar_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1072,7 +1072,7 @@ test_object_registration (void)
/* register at the same path/interface - this should fail */
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/interns/intern2",
&bar_interface_info,
(GDBusInterfaceInfo *) &bar_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1086,7 +1086,7 @@ test_object_registration (void)
/* register at different interface - shouldn't fail */
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/interns/intern2",
&foo_interface_info,
(GDBusInterfaceInfo *) &foo_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1104,7 +1104,7 @@ test_object_registration (void)
/* register it back */
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/interns/intern2",
&foo_interface_info,
(GDBusInterfaceInfo *) &foo_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1116,7 +1116,7 @@ test_object_registration (void)
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/interns/intern3",
&bar_interface_info,
(GDBusInterfaceInfo *) &bar_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1172,7 +1172,7 @@ test_object_registration (void)
*/
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/executives/non_subtree_object",
&bar_interface_info,
(GDBusInterfaceInfo *) &bar_interface_info,
NULL,
&data,
on_object_unregistered,
......@@ -1183,7 +1183,7 @@ test_object_registration (void)
num_successful_registrations++;
registration_id = g_dbus_connection_register_object (c,
"/foo/boss/executives/non_subtree_object",
&foo_interface_info,
(GDBusInterfaceInfo *) &foo_interface_info,
NULL,
&data,
on_object_unregistered,
......
......@@ -39,9 +39,9 @@ test_introspection (GDBusProxy *proxy)
GError *error;
const gchar *xml_data;
GDBusNodeInfo *node_info;
const GDBusInterfaceInfo *interface_info;
const GDBusMethodInfo *method_info;
const GDBusSignalInfo *signal_info;
GDBusInterfaceInfo *interface_info;
GDBusMethodInfo *method_info;
GDBusSignalInfo *signal_info;
GVariant *result;
error = NULL;
......
......@@ -81,7 +81,7 @@ static const gchar *test_interface_introspection_xml =
" <property type='s' name='PeerProperty' access='read'/>"
" </interface>"
"</node>";
static const GDBusInterfaceInfo *test_interface_introspection_data = NULL;
static GDBusInterfaceInfo *test_interface_introspection_data = NULL;
static void
test_interface_method_call (GDBusConnection *connection,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment