Main Page   Modules   Data Structures   File List   Data Fields   Related Pages  

DBusTimeout implementation details
[D-BUS internal implementation details]

implementation details for DBusTimeout. More...

Data Structures

struct  DBusTimeout
 Internals of DBusTimeout. More...

struct  DBusTimeoutList
 DBusTimeoutList implementation details. More...


Typedefs

typedef DBusTimeoutList DBusTimeoutList
 Opaque data type representing a list of timeouts and a set of DBusAddTimeoutFunction/DBusRemoveTimeoutFunction. More...


Functions

DBusTimeout_dbus_timeout_new (int interval, DBusTimeoutHandler handler, void *data, DBusFreeFunction free_data_function)
 Creates a new DBusTimeout, enabled by default. More...

DBusTimeout_dbus_timeout_ref (DBusTimeout *timeout)
 Increments the reference count of a DBusTimeout object. More...

void _dbus_timeout_unref (DBusTimeout *timeout)
 Decrements the reference count of a DBusTimeout object and finalizes the object if the count reaches zero. More...

void _dbus_timeout_set_interval (DBusTimeout *timeout, int interval)
 Changes the timeout interval. More...

void _dbus_timeout_set_enabled (DBusTimeout *timeout, dbus_bool_t enabled)
 Changes the timeout's enabled-ness. More...

DBusTimeoutList_dbus_timeout_list_new (void)
 Creates a new timeout list. More...

void _dbus_timeout_list_free (DBusTimeoutList *timeout_list)
 Frees a DBusTimeoutList. More...

dbus_bool_t _dbus_timeout_list_set_functions (DBusTimeoutList *timeout_list, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)
 Sets the timeout functions. More...

dbus_bool_t _dbus_timeout_list_add_timeout (DBusTimeoutList *timeout_list, DBusTimeout *timeout)
 Adds a new timeout to the timeout list, invoking the application DBusAddTimeoutFunction if appropriate. More...

void _dbus_timeout_list_remove_timeout (DBusTimeoutList *timeout_list, DBusTimeout *timeout)
 Removes a timeout from the timeout list, invoking the application's DBusRemoveTimeoutFunction if appropriate. More...

void _dbus_timeout_list_toggle_timeout (DBusTimeoutList *timeout_list, DBusTimeout *timeout, dbus_bool_t enabled)
 Sets a timeout to the given enabled state, invoking the application's DBusTimeoutToggledFunction if appropriate. More...


Detailed Description

implementation details for DBusTimeout.


Typedef Documentation

DBusTimeoutList
 

Opaque data type representing a list of timeouts and a set of DBusAddTimeoutFunction/DBusRemoveTimeoutFunction.

Automatically handles removing/re-adding timeouts when the DBusAddTimeoutFunction is updated or changed. Holds a reference count to each timeout.

Definition at line 31 of file dbus-timeout.h.


Function Documentation

dbus_bool_t _dbus_timeout_list_add_timeout DBusTimeoutList   timeout_list,
DBusTimeout   timeout
 

Adds a new timeout to the timeout list, invoking the application DBusAddTimeoutFunction if appropriate.

Parameters:
timeout_list  the timeout list.
timeout  the timeout to add.
Returns:
TRUE on success, FALSE If no memory.

Definition at line 309 of file dbus-timeout.c.

References DBusTimeoutList::add_timeout_function, DBusTimeoutList::timeout_data, and DBusTimeoutList::timeouts.

void _dbus_timeout_list_free DBusTimeoutList   timeout_list
 

Frees a DBusTimeoutList.

Parameters:
timeout_list  the timeout list.

Definition at line 210 of file dbus-timeout.c.

References DBusTimeoutList::timeouts.

DBusTimeoutList* _dbus_timeout_list_new void   
 

Creates a new timeout list.

Returns NULL if insufficient memory exists.

Returns:
the new timeout list, or NULL on failure.

Definition at line 193 of file dbus-timeout.c.

void _dbus_timeout_list_remove_timeout DBusTimeoutList   timeout_list,
DBusTimeout   timeout
 

Removes a timeout from the timeout list, invoking the application's DBusRemoveTimeoutFunction if appropriate.

Parameters:
timeout_list  the timeout list.
timeout  the timeout to remove.

Definition at line 339 of file dbus-timeout.c.

References DBusTimeoutList::remove_timeout_function, DBusTimeoutList::timeout_data, and DBusTimeoutList::timeouts.

dbus_bool_t _dbus_timeout_list_set_functions DBusTimeoutList   timeout_list,
DBusAddTimeoutFunction    add_function,
DBusRemoveTimeoutFunction    remove_function,
DBusTimeoutToggledFunction    toggled_function,
void *    data,
DBusFreeFunction    free_data_function
 

Sets the timeout functions.

This function is the "backend" for dbus_connection_set_timeout_functions().

Parameters:
timeout_list  the timeout list
add_function  the add timeout function.
remove_function  the remove timeout function.
toggled_function  toggle notify function, or NULL
data  the data for those functions.
free_data_function  the function to free the data.
Returns:
FALSE if no memory

Definition at line 238 of file dbus-timeout.c.

References DBusTimeoutList::add_timeout_function, DBusList::data, DBusTimeoutList::remove_timeout_function, DBusTimeoutList::timeout_data, DBusTimeoutList::timeout_free_data_function, DBusTimeoutList::timeout_toggled_function, and DBusTimeoutList::timeouts.

void _dbus_timeout_list_toggle_timeout DBusTimeoutList   timeout_list,
DBusTimeout   timeout,
dbus_bool_t    enabled
 

Sets a timeout to the given enabled state, invoking the application's DBusTimeoutToggledFunction if appropriate.

Parameters:
timeout_list  the timeout list.
timeout  the timeout to toggle.
enabled  TRUE to enable

Definition at line 361 of file dbus-timeout.c.

References DBusTimeout::enabled, DBusTimeoutList::timeout_data, and DBusTimeoutList::timeout_toggled_function.

DBusTimeout* _dbus_timeout_new int    interval,
DBusTimeoutHandler    handler,
void *    data,
DBusFreeFunction    free_data_function
 

Creates a new DBusTimeout, enabled by default.

Parameters:
interval  the timeout interval in milliseconds.
handler  function to call when the timeout occurs.
data  data to pass to the handler
free_data_function  function to be called to free the data.
Returns:
the new DBusTimeout object,

Definition at line 62 of file dbus-timeout.c.

References DBusTimeout::enabled, DBusTimeout::free_handler_data_function, DBusTimeout::handler, DBusTimeout::handler_data, DBusTimeout::interval, and DBusTimeout::refcount.

DBusTimeout* _dbus_timeout_ref DBusTimeout   timeout
 

Increments the reference count of a DBusTimeout object.

Parameters:
timeout  the timeout object.
Returns:
the timeout object.

Definition at line 92 of file dbus-timeout.c.

References DBusTimeout::refcount.

void _dbus_timeout_set_enabled DBusTimeout   timeout,
dbus_bool_t    enabled
 

Changes the timeout's enabled-ness.

Note that you should use _dbus_connection_toggle_timeout() etc. instead, if the timeout is passed out to an application main loop. i.e. you can't use this function in the D-BUS library, it's only used in the message bus daemon implementation.

Parameters:
timeout  the timeout
enabled  TRUE if timeout should be enabled.

Definition at line 152 of file dbus-timeout.c.

References DBusTimeout::enabled.

void _dbus_timeout_set_interval DBusTimeout   timeout,
int    interval
 

Changes the timeout interval.

Note that you have to disable and re-enable the timeout using the timeout toggle function (_dbus_connection_toggle_timeout() etc.) to notify the application of this change.

Parameters:
timeout  the timeout
interval  the new interval

Definition at line 133 of file dbus-timeout.c.

References DBusTimeout::interval.

void _dbus_timeout_unref DBusTimeout   timeout
 

Decrements the reference count of a DBusTimeout object and finalizes the object if the count reaches zero.

Parameters:
timeout  the timeout object.

Definition at line 106 of file dbus-timeout.c.

References DBusTimeout::free_handler_data_function, DBusTimeout::handler_data, and DBusTimeout::refcount.


Generated on Wed Jun 9 05:01:28 2004 for D-BUS by doxygen1.2.15