Signature for function used in g_dbus_connection_add_filter().
A filter function is passed a #GDBusMessage and expected to return
a #GDBusMessage too. Passive filter functions that don't modify the
message can simply return the message object:
|[
static GDBusMessage *
passive_filter (GDBusConnection *connection
GDBusMessage *message,
gboolean incoming,
gpointer user_data)
{
// inspect message
return message;
}
Signature for function used in g_dbus_connection_add_filter().
A filter function is passed a #GDBusMessage and expected to return a #GDBusMessage too. Passive filter functions that don't modify the message can simply return the
message
object: |[ static GDBusMessage * passive_filter (GDBusConnection *connection GDBusMessage *message, gboolean incoming, gpointer user_data) { // inspectmessage
return message; }Finally, a filter function may modify a message by copying it: |[ static GDBusMessage * modifying_filter (GDBusConnection *connection GDBusMessage *message, gboolean incoming, gpointer user_data) { GDBusMessage *copy; GError *error;
error = NULL; copy = g_dbus_message_copy (message, &error); // handle
error
being set g_object_unref (message);// modify
copy
return copy; }