Main Page   Modules   Data Structures   File List   Data Fields   Related Pages  

DBusMessageHandler
[D-BUS message system public API]

Message processor. More...

Typedefs

typedef DBusMessageHandler DBusMessageHandler
 Opaque data type representing a message handler.


Functions

DBusMessageHandler * dbus_message_handler_new (DBusHandleMessageFunction function, void *user_data, DBusFreeFunction free_user_data)
 Creates a new message handler.

void dbus_message_handler_ref (DBusMessageHandler *handler)
 Increments the reference count on a message handler.

void dbus_message_handler_unref (DBusMessageHandler *handler)
 Decrements the reference count on a message handler, freeing the handler if the count reaches 0.

void * dbus_message_handler_get_data (DBusMessageHandler *handler)
 Gets the user data for the handler (the same user data passed to the handler function.).

void dbus_message_handler_set_data (DBusMessageHandler *handler, void *user_data, DBusFreeFunction free_user_data)
 Sets the user data for the handler (the same user data to be passed to the handler function).

void dbus_message_handler_set_function (DBusMessageHandler *handler, DBusHandleMessageFunction function)
 Sets the handler function.


Detailed Description

Message processor.

A DBusMessageHandler is an object that can send and receive messages. Typically the handler is registered with one or more DBusConnection objects and processes some types of messages received from the connection.


Function Documentation

void* dbus_message_handler_get_data DBusMessageHandler   handler
 

Gets the user data for the handler (the same user data passed to the handler function.).

Parameters:
handler the handler
Returns:
the user data

Definition at line 247 of file dbus-message-handler.c.

References _DBUS_LOCK, and _DBUS_UNLOCK.

DBusMessageHandler* dbus_message_handler_new DBusHandleMessageFunction    function,
void *    user_data,
DBusFreeFunction    free_user_data
 

Creates a new message handler.

The handler function may be NULL for a no-op handler or a handler to be assigned a function later.

Parameters:
function function to call to handle a message
user_data data to pass to the function
free_user_data function to call to free the user data
Returns:
a new DBusMessageHandler or NULL if no memory.

Definition at line 168 of file dbus-message-handler.c.

References dbus_new, and NULL.

void dbus_message_handler_ref DBusMessageHandler   handler
 

Increments the reference count on a message handler.

Parameters:
handler the handler

Definition at line 194 of file dbus-message-handler.c.

References _dbus_atomic_inc().

Referenced by dbus_connection_send_with_reply().

void dbus_message_handler_set_data DBusMessageHandler   handler,
void *    user_data,
DBusFreeFunction    free_user_data
 

Sets the user data for the handler (the same user data to be passed to the handler function).

Frees any previously-existing user data with the previous free_user_data function.

Parameters:
handler the handler
user_data the user data
free_user_data free function for the data

Definition at line 269 of file dbus-message-handler.c.

References _DBUS_LOCK, _DBUS_UNLOCK, and DBusFreeFunction.

void dbus_message_handler_set_function DBusMessageHandler   handler,
DBusHandleMessageFunction    function
 

Sets the handler function.

Call dbus_message_handler_set_data() to set the user data for the function.

Parameters:
handler the handler
function the function

Definition at line 299 of file dbus-message-handler.c.

References _DBUS_LOCK, and _DBUS_UNLOCK.

void dbus_message_handler_unref DBusMessageHandler   handler
 

Decrements the reference count on a message handler, freeing the handler if the count reaches 0.

Parameters:
handler the handler

Definition at line 208 of file dbus-message-handler.c.

References _dbus_atomic_dec(), _dbus_connection_handler_destroyed_locked(), _dbus_list_clear(), _dbus_list_get_first_link(), _dbus_list_get_next_link, DBusList::data, dbus_bool_t, dbus_free(), and NULL.


Generated on Wed Oct 22 14:05:08 2003 for D-BUS by doxygen1.3-rc3