| D-Bus GLib bindings - Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <dbus/dbus-glib.h> struct DBusGMethodInfo; DBusGMethodInvocation; gchar * dbus_g_method_get_sender (DBusGMethodInvocation *context); DBusMessage * dbus_g_method_get_reply (DBusGMethodInvocation *context); void dbus_g_method_send_reply (DBusGMethodInvocation *context,DBusMessage *reply); void dbus_g_method_return (DBusGMethodInvocation *context,...); void dbus_g_method_return_error (DBusGMethodInvocation *context,const GError *error);
struct DBusGMethodInfo {
GCallback function;
GClosureMarshal marshaller;
int data_offset;
};
Object typically generated by dbus-binding-tool that stores a mapping from introspection data to a function pointer for a C method to be invoked.
GCallback |
C method to invoke |
GClosureMarshal |
Marshaller to invoke method |
| Offset into the introspection data |
typedef struct _DBusGMethodInvocation DBusGMethodInvocation;
The context of an asynchronous method call. See dbus_g_method_return() and
dbus_g_method_return_error().
gchar * dbus_g_method_get_sender (DBusGMethodInvocation *context);
Get the sender of a message so we can send a "reply" later (i.e. send a message directly to a service which invoked the method at a later time).
|
the method context |
Returns : |
the unique name of the sender. It is up to the caller to free the returned string. |
DBusMessage * dbus_g_method_get_reply (DBusGMethodInvocation *context);
Get the reply message to append reply values Used as a sidedoor when you can't generate dbus values of the correct type due to glib binding limitations
|
the method context |
Returns : |
a DBusMessage with the reply |
void dbus_g_method_send_reply (DBusGMethodInvocation *context,DBusMessage *reply);
Send a manually created reply message.
Used as a sidedoor when you can't generate dbus values of the correct type due to glib binding limitations
|
the method context |
|
the reply message, will be unreffed |
void dbus_g_method_return (DBusGMethodInvocation *context,...);
Send a return message for a given method invocation, with arguments. This function also frees the sending context.
|
the method context |
|
zero or more values to return from the method, with their number and types given by its DBusGObjectInfo |
void dbus_g_method_return_error (DBusGMethodInvocation *context,const GError *error);
Send a error message for a given method invocation. This function also frees the sending context.
|
the method context |
|
the error to send |