index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
DBusWatch implementation details
[
group__DBusInternals.html
D-BUS internal implementation details
]
implementation details for
structDBusWatch.html
DBusWatch
#_details
More...
Data Structures
struct
structDBusWatch.html
DBusWatch
Implementation of DBusWatch.
structDBusWatch.html#_details
More...
struct
structDBusWatchList.html
DBusWatchList
DBusWatchList implementation details.
structDBusWatchList.html#_details
More...
Typedefs
typedef
structDBusWatchList.html
DBusWatchList
group__DBusWatchInternals.html#ga12
DBusWatchList
Opaque data type representing a list of watches and a set of DBusAddWatchFunction/DBusRemoveWatchFunction.
#ga12
Functions
structDBusWatch.html
DBusWatch
*
group__DBusWatchInternals.html#ga0
_dbus_watch_new
(int fd, unsigned int flags,
group__DBusTypes.html#ga2
dbus_bool_t
enabled, DBusWatchHandler handler, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
Creates a new
structDBusWatch.html
DBusWatch
.
#ga0
structDBusWatch.html
DBusWatch
*
group__DBusWatchInternals.html#ga1
_dbus_watch_ref
(
structDBusWatch.html
DBusWatch
*watch)
Increments the reference count of a
structDBusWatch.html
DBusWatch
object.
#ga1
void
group__DBusWatchInternals.html#ga2
_dbus_watch_unref
(
structDBusWatch.html
DBusWatch
*watch)
Decrements the reference count of a
structDBusWatch.html
DBusWatch
object and finalizes the object if the count reaches zero.
#ga2
void
group__DBusWatchInternals.html#ga3
_dbus_watch_invalidate
(
structDBusWatch.html
DBusWatch
*watch)
Clears the file descriptor from a now-invalid watch object so that no one tries to use it.
#ga3
void
group__DBusWatchInternals.html#ga4
_dbus_watch_sanitize_condition
(
structDBusWatch.html
DBusWatch
*watch, unsigned int *condition)
Sanitizes the given condition so that it only contains flags that the
structDBusWatch.html
DBusWatch
requested.
#ga4
structDBusWatchList.html
DBusWatchList
*
group__DBusWatchInternals.html#ga5
_dbus_watch_list_new
(void)
Creates a new watch list.
#ga5
void
group__DBusWatchInternals.html#ga6
_dbus_watch_list_free
(
structDBusWatchList.html
DBusWatchList
*watch_list)
Frees a
structDBusWatchList.html
DBusWatchList
.
#ga6
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusWatchInternals.html#ga7
_dbus_watch_list_set_functions
(
structDBusWatchList.html
DBusWatchList
*watch_list, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
Sets the watch functions.
#ga7
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusWatchInternals.html#ga8
_dbus_watch_list_add_watch
(
structDBusWatchList.html
DBusWatchList
*watch_list,
structDBusWatch.html
DBusWatch
*watch)
Adds a new watch to the watch list, invoking the application DBusAddWatchFunction if appropriate.
#ga8
void
group__DBusWatchInternals.html#ga9
_dbus_watch_list_remove_watch
(
structDBusWatchList.html
DBusWatchList
*watch_list,
structDBusWatch.html
DBusWatch
*watch)
Removes a watch from the watch list, invoking the application's DBusRemoveWatchFunction if appropriate.
#ga9
void
group__DBusWatchInternals.html#ga10
_dbus_watch_list_toggle_watch
(
structDBusWatchList.html
DBusWatchList
*watch_list,
structDBusWatch.html
DBusWatch
*watch,
group__DBusTypes.html#ga2
dbus_bool_t
enabled)
Sets a watch to the given enabled state, invoking the application's DBusWatchToggledFunction if appropriate.
#ga10
void
group__DBusWatchInternals.html#ga11
_dbus_watch_set_handler
(
structDBusWatch.html
DBusWatch
*watch, DBusWatchHandler handler, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
Sets the handler for the watch.
#ga11
Detailed Description
implementation details for
structDBusWatch.html
DBusWatch
Typedef Documentation
structDBusWatchList.html
DBusWatchList
Opaque data type representing a list of watches and a set of DBusAddWatchFunction/DBusRemoveWatchFunction.
Automatically handles removing/re-adding watches when the DBusAddWatchFunction is updated or changed. Holds a reference count to each watch.
Used in the implementation of both
structDBusServer.html
DBusServer
and DBusClient.
Definition at line
dbus-watch_8h-source.html#l00033
33
of file
dbus-watch_8h-source.html
dbus-watch.h
.
Function Documentation
void _dbus_watch_invalidate
(
structDBusWatch.html
DBusWatch
*
watch
)
Clears the file descriptor from a now-invalid watch object so that no one tries to use it.
This is because a watch may stay alive due to reference counts after the file descriptor is closed. Invalidation makes it easier to catch bugs. It also keeps people from doing dorky things like assuming file descriptors are unique (never recycled).
Parameters:
watch
the watch object.
Definition at line
dbus-watch_8c-source.html#l00145
145
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-watch_8c-source.html#l00042
DBusWatch::fd
, and
dbus-watch_8c-source.html#l00043
DBusWatch::flags
.
Referenced by
dbus-spawn_8c-source.html#l00262
_dbus_babysitter_unref()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_watch_list_add_watch
(
structDBusWatchList.html
DBusWatchList
*
watch_list
,
structDBusWatch.html
DBusWatch
*
watch
)
Adds a new watch to the watch list, invoking the application DBusAddWatchFunction if appropriate.
Parameters:
watch_list
the watch list.
watch
the watch to add.
Returns:
group__DBusMacros.html#ga2
TRUE
on success,
group__DBusMacros.html#ga3
FALSE
if no memory.
Definition at line
dbus-watch_8c-source.html#l00351
351
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-list_8c-source.html#l00249
_dbus_list_append()
,
dbus-list_8c-source.html#l00460
_dbus_list_remove_last()
,
dbus-watch_8c-source.html#l00103
_dbus_watch_ref()
,
dbus-watch_8c-source.html#l00117
_dbus_watch_unref()
,
dbus-watch_8c-source.html#l00194
DBusWatchList::add_watch_function
,
dbus-watch_8c-source.html#l00487
dbus_watch_get_fd()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
,
group__DBusMacros.html#ga2
TRUE
,
dbus-watch_8c-source.html#l00197
DBusWatchList::watch_data
, and
dbus-watch_8c-source.html#l00192
DBusWatchList::watches
.
Referenced by
dbus-connection_8c-source.html#l00603
_dbus_connection_add_watch()
,
dbus-server_8c-source.html#l00287
_dbus_server_add_watch()
, and
dbus-spawn_8c-source.html#l01030
_dbus_spawn_async_with_babysitter()
.
void _dbus_watch_list_free
(
structDBusWatchList.html
DBusWatchList
*
watch_list
)
Frees a
structDBusWatchList.html
DBusWatchList
.
Parameters:
watch_list
the watch list.
Definition at line
dbus-watch_8c-source.html#l00225
225
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-list_8c-source.html#l00556
_dbus_list_clear()
,
dbus-list_8c-source.html#l00796
_dbus_list_foreach()
,
dbus-watch_8c-source.html#l00253
_dbus_watch_list_set_functions()
,
dbus-watch_8c-source.html#l00117
_dbus_watch_unref()
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
group__DBusMacros.html#ga4
NULL
, and
dbus-watch_8c-source.html#l00192
DBusWatchList::watches
.
Referenced by
dbus-spawn_8c-source.html#l00262
_dbus_babysitter_unref()
,
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
,
dbus-server_8c-source.html#l00195
_dbus_server_finalize_base()
, and
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
.
structDBusWatchList.html
DBusWatchList
* _dbus_watch_list_new
(
void
)
Creates a new watch list.
Returns
group__DBusMacros.html#ga4
NULL
if insufficient memory exists.
Returns:
the new watch list, or
group__DBusMacros.html#ga4
NULL
on failure.
Definition at line
dbus-watch_8c-source.html#l00208
208
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-memory_8h-source.html#l00042
dbus_new0
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
, and
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
.
void _dbus_watch_list_remove_watch
(
structDBusWatchList.html
DBusWatchList
*
watch_list
,
structDBusWatch.html
DBusWatch
*
watch
)
Removes a watch from the watch list, invoking the application's DBusRemoveWatchFunction if appropriate.
Parameters:
watch_list
the watch list.
watch
the watch to remove.
Definition at line
dbus-watch_8c-source.html#l00384
384
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-list_8c-source.html#l00429
_dbus_list_remove()
,
dbus-watch_8c-source.html#l00117
_dbus_watch_unref()
,
dbus-watch_8c-source.html#l00487
dbus_watch_get_fd()
,
group__DBusMacros.html#ga4
NULL
,
dbus-watch_8c-source.html#l00195
DBusWatchList::remove_watch_function
,
dbus-watch_8c-source.html#l00197
DBusWatchList::watch_data
, and
dbus-watch_8c-source.html#l00192
DBusWatchList::watches
.
Referenced by
dbus-connection_8c-source.html#l00620
_dbus_connection_remove_watch()
, and
dbus-server_8c-source.html#l00303
_dbus_server_remove_watch()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_watch_list_set_functions
(
structDBusWatchList.html
DBusWatchList
*
watch_list
,
DBusAddWatchFunction
add_function
,
DBusRemoveWatchFunction
remove_function
,
DBusWatchToggledFunction
toggled_function
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function
)
Sets the watch functions.
This function is the "backend" for
group__DBusConnection.html#ga41
dbus_connection_set_watch_functions()
and
group__DBusServer.html#ga10
dbus_server_set_watch_functions()
.
Parameters:
watch_list
the watch list.
add_function
the add watch function.
remove_function
the remove watch function.
toggled_function
function on toggling enabled flag, or
group__DBusMacros.html#ga4
NULL
data
the data for those functions.
free_data_function
the function to free the data.
Returns:
group__DBusMacros.html#ga3
FALSE
if not enough memory
Definition at line
dbus-watch_8c-source.html#l00253
253
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-list_8c-source.html#l00796
_dbus_list_foreach()
,
dbus-list_8c-source.html#l00581
_dbus_list_get_first_link()
,
dbus-list_8h-source.html#l00094
_dbus_list_get_next_link
,
dbus-watch_8c-source.html#l00194
DBusWatchList::add_watch_function
,
dbus-list_8h-source.html#l00039
DBusList::data
,
dbus-watch_8c-source.html#l00487
dbus_watch_get_fd()
,
dbus-watch_8c-source.html#l00506
dbus_watch_get_flags()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
,
dbus-watch_8c-source.html#l00195
DBusWatchList::remove_watch_function
,
group__DBusMacros.html#ga2
TRUE
,
dbus-watch_8c-source.html#l00197
DBusWatchList::watch_data
,
dbus-watch_8c-source.html#l00198
DBusWatchList::watch_free_data_function
,
dbus-watch_8c-source.html#l00196
DBusWatchList::watch_toggled_function
, and
dbus-watch_8c-source.html#l00192
DBusWatchList::watches
.
Referenced by
dbus-spawn_8c-source.html#l00691
_dbus_babysitter_set_watch_functions()
,
dbus-watch_8c-source.html#l00225
_dbus_watch_list_free()
,
dbus-connection_8c-source.html#l03785
dbus_connection_set_watch_functions()
, and
dbus-server_8c-source.html#l00914
dbus_server_set_watch_functions()
.
void _dbus_watch_list_toggle_watch
(
structDBusWatchList.html
DBusWatchList
*
watch_list
,
structDBusWatch.html
DBusWatch
*
watch
,
group__DBusTypes.html#ga2
dbus_bool_t
enabled
)
Sets a watch to the given enabled state, invoking the application's DBusWatchToggledFunction if appropriate.
Parameters:
watch_list
the watch list.
watch
the watch to toggle.
enabled
group__DBusMacros.html#ga2
TRUE
to enable
Definition at line
dbus-watch_8c-source.html#l00411
411
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-watch_8c-source.html#l00487
dbus_watch_get_fd()
,
dbus-watch_8c-source.html#l00051
DBusWatch::enabled
,
group__DBusMacros.html#ga4
NULL
,
dbus-watch_8c-source.html#l00197
DBusWatchList::watch_data
, and
dbus-watch_8c-source.html#l00196
DBusWatchList::watch_toggled_function
.
Referenced by
dbus-connection_8c-source.html#l00640
_dbus_connection_toggle_watch()
, and
dbus-server_8c-source.html#l00323
_dbus_server_toggle_watch()
.
structDBusWatch.html
DBusWatch
* _dbus_watch_new
(
int
fd
,
unsigned int
flags
,
group__DBusTypes.html#ga2
dbus_bool_t
enabled
,
DBusWatchHandler
handler
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function
)
Creates a new
structDBusWatch.html
DBusWatch
.
Used to add a file descriptor to be polled by a main loop.
Parameters:
fd
the file descriptor to be watched.
flags
the conditions to watch for on the descriptor.
enabled
the initial enabled state
handler
the handler function
data
data for handler function
free_data_function
function to free the data
Returns:
the new
structDBusWatch.html
DBusWatch
object.
Definition at line
dbus-watch_8c-source.html#l00067
67
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-memory_8h-source.html#l00042
dbus_new0
,
dbus-watch_8c-source.html#l00051
DBusWatch::enabled
,
dbus-watch_8c-source.html#l00042
DBusWatch::fd
,
dbus-watch_8c-source.html#l00043
DBusWatch::flags
,
dbus-watch_8c-source.html#l00047
DBusWatch::free_handler_data_function
,
dbus-watch_8c-source.html#l00045
DBusWatch::handler
,
dbus-watch_8c-source.html#l00046
DBusWatch::handler_data
,
group__DBusMacros.html#ga4
NULL
, and
dbus-watch_8c-source.html#l00041
DBusWatch::refcount
.
Referenced by
dbus-server-unix_8c-source.html#l00254
_dbus_server_new_for_fd()
,
dbus-spawn_8c-source.html#l01030
_dbus_spawn_async_with_babysitter()
, and
dbus-transport-unix_8c-source.html#l01122
_dbus_transport_new_for_fd()
.
structDBusWatch.html
DBusWatch
* _dbus_watch_ref
(
structDBusWatch.html
DBusWatch
*
watch
)
Increments the reference count of a
structDBusWatch.html
DBusWatch
object.
Parameters:
watch
the watch object.
Returns:
the watch object.
Definition at line
dbus-watch_8c-source.html#l00103
103
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-watch_8c-source.html#l00041
DBusWatch::refcount
.
Referenced by
dbus-transport_8c-source.html#l00603
_dbus_transport_handle_watch()
, and
dbus-watch_8c-source.html#l00351
_dbus_watch_list_add_watch()
.
void _dbus_watch_sanitize_condition
(
structDBusWatch.html
DBusWatch
*
watch
,
unsigned int *
condition
)
Sanitizes the given condition so that it only contains flags that the
structDBusWatch.html
DBusWatch
requested.
e.g. if the watch is a DBUS_WATCH_READABLE watch then DBUS_WATCH_WRITABLE will be stripped from the condition.
Parameters:
watch
the watch object.
condition
address of the condition to sanitize.
Definition at line
dbus-watch_8c-source.html#l00161
161
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-watch_8c-source.html#l00043
DBusWatch::flags
.
Referenced by
dbus-transport_8c-source.html#l00603
_dbus_transport_handle_watch()
, and
dbus-watch_8c-source.html#l00591
dbus_watch_handle()
.
void _dbus_watch_set_handler
(
structDBusWatch.html
DBusWatch
*
watch
,
DBusWatchHandler
handler
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function
)
Sets the handler for the watch.
todo.html#_todo000086
Todo:
this function only exists because of the weird way connection watches are done, see the note in docs for
group__DBusConnectionInternals.html#ga46
_dbus_connection_handle_watch()
.
Parameters:
watch
the watch
handler
the new handler
data
the data
free_data_function
free data with this
Definition at line
dbus-watch_8c-source.html#l00445
445
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-watch_8c-source.html#l00047
DBusWatch::free_handler_data_function
,
dbus-watch_8c-source.html#l00045
DBusWatch::handler
, and
dbus-watch_8c-source.html#l00046
DBusWatch::handler_data
.
void _dbus_watch_unref
(
structDBusWatch.html
DBusWatch
*
watch
)
Decrements the reference count of a
structDBusWatch.html
DBusWatch
object and finalizes the object if the count reaches zero.
Parameters:
watch
the watch object.
Definition at line
dbus-watch_8c-source.html#l00117
117
of file
dbus-watch_8c-source.html
dbus-watch.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-watch_8c-source.html#l00538
dbus_watch_set_data()
,
dbus-watch_8c-source.html#l00047
DBusWatch::free_handler_data_function
,
dbus-watch_8c-source.html#l00046
DBusWatch::handler_data
,
group__DBusMacros.html#ga4
NULL
, and
dbus-watch_8c-source.html#l00041
DBusWatch::refcount
.
Referenced by
dbus-spawn_8c-source.html#l00262
_dbus_babysitter_unref()
,
dbus-server-unix_8c-source.html#l00254
_dbus_server_new_for_fd()
,
dbus-transport_8c-source.html#l00603
_dbus_transport_handle_watch()
,
dbus-transport-unix_8c-source.html#l01122
_dbus_transport_new_for_fd()
,
dbus-watch_8c-source.html#l00351
_dbus_watch_list_add_watch()
,
dbus-watch_8c-source.html#l00225
_dbus_watch_list_free()
, and
dbus-watch_8c-source.html#l00384
_dbus_watch_list_remove_watch()
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
