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
Data slots
[
group__DBusInternals.html
D-BUS internal implementation details
]
Storing data by ID.
#_details
More...
Functions
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusDataSlot.html#ga0
_dbus_data_slot_allocator_init
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*allocator)
Initializes a data slot allocator object, used to assign integer IDs for data slots.
#ga0
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusDataSlot.html#ga1
_dbus_data_slot_allocator_alloc
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*allocator, DBusMutex *mutex,
group__DBusTypes.html#ga4
dbus_int32_t
*slot_id_p)
Allocates an integer ID to be used for storing data in a
structDBusDataSlotList.html
DBusDataSlotList
.
#ga1
void
group__DBusDataSlot.html#ga2
_dbus_data_slot_allocator_free
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*allocator,
group__DBusTypes.html#ga4
dbus_int32_t
*slot_id_p)
Deallocates an ID previously allocated with
group__DBusDataSlot.html#ga1
_dbus_data_slot_allocator_alloc()
.
#ga2
void
group__DBusDataSlot.html#ga3
_dbus_data_slot_list_init
(
structDBusDataSlotList.html
DBusDataSlotList
*list)
Initializes a slot list.
#ga3
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusDataSlot.html#ga4
_dbus_data_slot_list_set
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*allocator,
structDBusDataSlotList.html
DBusDataSlotList
*list, int slot, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func,
group__DBusMemory.html#ga8
DBusFreeFunction
*old_free_func, void **old_data)
Stores a pointer in the data slot list, along with an optional function to be used for freeing the data when the data is set again, or when the slot list is finalized.
#ga4
void *
group__DBusDataSlot.html#ga5
_dbus_data_slot_list_get
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*allocator,
structDBusDataSlotList.html
DBusDataSlotList
*list, int slot)
Retrieves data previously set with _dbus_data_slot_list_set_data().
#ga5
void
group__DBusDataSlot.html#ga6
_dbus_data_slot_list_clear
(
structDBusDataSlotList.html
DBusDataSlotList
*list)
Frees all data slots contained in the list, calling application-provided free functions if they exist.
#ga6
void
group__DBusDataSlot.html#ga7
_dbus_data_slot_list_free
(
structDBusDataSlotList.html
DBusDataSlotList
*list)
Frees the data slot list and all data slots contained in it, calling application-provided free functions if they exist.
#ga7
Detailed Description
Storing data by ID.
Types and functions related to storing data by an allocated ID. This is used for
group__DBusConnection.html#ga58
dbus_connection_set_data()
,
group__DBusServer.html#ga15
dbus_server_set_data()
, etc.
Function Documentation
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_data_slot_allocator_alloc
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*
allocator
,
DBusMutex *
mutex
,
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_id_p
)
Allocates an integer ID to be used for storing data in a
structDBusDataSlotList.html
DBusDataSlotList
.
If the value at *slot_id_p is not -1, this function just increments the refcount for the existing slot ID. If the value is -1, a new slot ID is allocated and stored at *slot_id_p.
Parameters:
allocator
the allocator
mutex
the lock for this allocator
slot_id_p
address to fill with the slot ID
Returns:
group__DBusMacros.html#ga2
TRUE
on success
Definition at line
dbus-dataslot_8c-source.html#l00067
67
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-threads_8c-source.html#l00089
_dbus_mutex_lock()
,
dbus-threads_8c-source.html#l00103
_dbus_mutex_unlock()
,
dbus-dataslot_8h-source.html#l00057
DBusDataSlotAllocator::allocated_slots
,
dbus-memory_8c-source.html#l00539
dbus_realloc()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-dataslot_8h-source.html#l00060
DBusDataSlotAllocator::lock
,
dbus-dataslot_8h-source.html#l00058
DBusDataSlotAllocator::n_allocated_slots
,
dbus-dataslot_8h-source.html#l00059
DBusDataSlotAllocator::n_used_slots
,
group__DBusMacros.html#ga4
NULL
,
dbus-dataslot_8h-source.html#l00049
DBusAllocatedSlot::refcount
, and
dbus-dataslot_8h-source.html#l00048
DBusAllocatedSlot::slot_id
.
Referenced by
dbus-connection_8c-source.html#l04456
dbus_connection_allocate_data_slot()
,
dbus-message_8c-source.html#l03589
dbus_message_allocate_data_slot()
,
dbus-pending-call_8c-source.html#l00331
dbus_pending_call_allocate_data_slot()
, and
dbus-server_8c-source.html#l01060
dbus_server_allocate_data_slot()
.
void _dbus_data_slot_allocator_free
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*
allocator
,
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_id_p
)
Deallocates an ID previously allocated with
group__DBusDataSlot.html#ga1
_dbus_data_slot_allocator_alloc()
.
Existing data stored on existing DBusDataList objects with this ID will be freed when the data list is finalized, but may not be retrieved (and may only be replaced if someone else reallocates the slot). The slot value is reset to -1 if this is the last unref.
Parameters:
allocator
the allocator
slot_id_p
address where we store the slot
Definition at line
dbus-dataslot_8c-source.html#l00161
161
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-threads_8c-source.html#l00089
_dbus_mutex_lock()
,
dbus-threads_8c-source.html#l00103
_dbus_mutex_unlock()
,
dbus-dataslot_8h-source.html#l00057
DBusDataSlotAllocator::allocated_slots
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-dataslot_8h-source.html#l00060
DBusDataSlotAllocator::lock
,
dbus-dataslot_8h-source.html#l00058
DBusDataSlotAllocator::n_allocated_slots
,
dbus-dataslot_8h-source.html#l00059
DBusDataSlotAllocator::n_used_slots
,
group__DBusMacros.html#ga4
NULL
,
dbus-dataslot_8h-source.html#l00049
DBusAllocatedSlot::refcount
, and
dbus-dataslot_8h-source.html#l00048
DBusAllocatedSlot::slot_id
.
Referenced by
dbus-connection_8c-source.html#l04475
dbus_connection_free_data_slot()
,
dbus-message_8c-source.html#l03608
dbus_message_free_data_slot()
,
dbus-pending-call_8c-source.html#l00350
dbus_pending_call_free_data_slot()
, and
dbus-server_8c-source.html#l01079
dbus_server_free_data_slot()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_data_slot_allocator_init
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*
allocator
)
Initializes a data slot allocator object, used to assign integer IDs for data slots.
Parameters:
allocator
the allocator to initialize
Definition at line
dbus-dataslot_8c-source.html#l00044
44
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-dataslot_8h-source.html#l00057
DBusDataSlotAllocator::allocated_slots
,
dbus-dataslot_8h-source.html#l00060
DBusDataSlotAllocator::lock
,
dbus-dataslot_8h-source.html#l00058
DBusDataSlotAllocator::n_allocated_slots
,
dbus-dataslot_8h-source.html#l00059
DBusDataSlotAllocator::n_used_slots
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
void _dbus_data_slot_list_clear
(
structDBusDataSlotList.html
DBusDataSlotList
*
list
)
Frees all data slots contained in the list, calling application-provided free functions if they exist.
Parameters:
list
the list to clear
Definition at line
dbus-dataslot_8c-source.html#l00325
325
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-dataslot_8h-source.html#l00038
data
,
dbus-dataslot_8h-source.html#l00039
free_data_func
,
group__DBusMacros.html#ga4
NULL
, and
dbus-dataslot_8h-source.html#l00069
DBusDataSlotList::slots
.
Referenced by
dbus-dataslot_8c-source.html#l00348
_dbus_data_slot_list_free()
.
void _dbus_data_slot_list_free
(
structDBusDataSlotList.html
DBusDataSlotList
*
list
)
Frees the data slot list and all data slots contained in it, calling application-provided free functions if they exist.
Parameters:
list
the list to free
Definition at line
dbus-dataslot_8c-source.html#l00348
348
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-dataslot_8c-source.html#l00325
_dbus_data_slot_list_clear()
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-dataslot_8h-source.html#l00070
DBusDataSlotList::n_slots
,
group__DBusMacros.html#ga4
NULL
, and
dbus-dataslot_8h-source.html#l00069
DBusDataSlotList::slots
.
Referenced by
dbus-server_8c-source.html#l00195
_dbus_server_finalize_base()
, and
dbus-pending-call_8c-source.html#l00170
dbus_pending_call_unref()
.
void* _dbus_data_slot_list_get
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*
allocator
,
structDBusDataSlotList.html
DBusDataSlotList
*
list
,
int
slot
)
Retrieves data previously set with _dbus_data_slot_list_set_data().
The slot must still be allocated (must not have been freed).
Parameters:
allocator
the allocator slot was allocated from
list
the data slot list
slot
the slot to get data from
Returns:
the data, or
group__DBusMacros.html#ga4
NULL
if not found
Definition at line
dbus-dataslot_8c-source.html#l00295
295
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-threads_8c-source.html#l00089
_dbus_mutex_lock()
,
dbus-threads_8c-source.html#l00103
_dbus_mutex_unlock()
,
dbus-dataslot_8h-source.html#l00057
DBusDataSlotAllocator::allocated_slots
,
dbus-dataslot_8h-source.html#l00038
data
,
group__DBusMacros.html#ga3
FALSE
,
dbus-dataslot_8h-source.html#l00060
DBusDataSlotAllocator::lock
,
dbus-dataslot_8h-source.html#l00070
DBusDataSlotList::n_slots
,
group__DBusMacros.html#ga4
NULL
,
dbus-dataslot_8h-source.html#l00048
DBusAllocatedSlot::slot_id
, and
dbus-dataslot_8h-source.html#l00069
DBusDataSlotList::slots
.
Referenced by
dbus-connection_8c-source.html#l04536
dbus_connection_get_data()
,
dbus-message_8c-source.html#l03665
dbus_message_get_data()
,
dbus-pending-call_8c-source.html#l00406
dbus_pending_call_get_data()
, and
dbus-server_8c-source.html#l01140
dbus_server_get_data()
.
void _dbus_data_slot_list_init
(
structDBusDataSlotList.html
DBusDataSlotList
*
list
)
Initializes a slot list.
Parameters:
list
the list to initialize.
Definition at line
dbus-dataslot_8c-source.html#l00209
209
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-dataslot_8h-source.html#l00070
DBusDataSlotList::n_slots
,
group__DBusMacros.html#ga4
NULL
, and
dbus-dataslot_8h-source.html#l00069
DBusDataSlotList::slots
.
Referenced by
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
,
dbus-pending-call_8c-source.html#l00052
_dbus_pending_call_new()
, and
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_data_slot_list_set
(
structDBusDataSlotAllocator.html
DBusDataSlotAllocator
*
allocator
,
structDBusDataSlotList.html
DBusDataSlotList
*
list
,
int
slot
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func
,
group__DBusMemory.html#ga8
DBusFreeFunction
*
old_free_func
,
void **
old_data
)
Stores a pointer in the data slot list, along with an optional function to be used for freeing the data when the data is set again, or when the slot list is finalized.
The slot number must have been allocated with
group__DBusDataSlot.html#ga1
_dbus_data_slot_allocator_alloc()
for the same allocator passed in here. The same allocator has to be used with the slot list every time.
Parameters:
allocator
the allocator to use
list
the data slot list
slot
the slot number
data
the data to store
free_data_func
finalizer function for the data
old_free_func
free function for any previously-existing data
old_data
previously-existing data, should be freed with old_free_func
Returns:
group__DBusMacros.html#ga2
TRUE
if there was enough memory to store the data
Definition at line
dbus-dataslot_8c-source.html#l00233
233
of file
dbus-dataslot_8c-source.html
dbus-dataslot.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-threads_8c-source.html#l00089
_dbus_mutex_lock()
,
dbus-threads_8c-source.html#l00103
_dbus_mutex_unlock()
,
dbus-dataslot_8h-source.html#l00057
DBusDataSlotAllocator::allocated_slots
,
dbus-dataslot_8h-source.html#l00038
data
,
dbus-memory_8c-source.html#l00539
dbus_realloc()
,
group__DBusMacros.html#ga3
FALSE
,
dbus-dataslot_8h-source.html#l00039
free_data_func
,
dbus-dataslot_8h-source.html#l00060
DBusDataSlotAllocator::lock
,
dbus-dataslot_8h-source.html#l00070
DBusDataSlotList::n_slots
,
group__DBusMacros.html#ga4
NULL
,
dbus-dataslot_8h-source.html#l00048
DBusAllocatedSlot::slot_id
,
dbus-dataslot_8h-source.html#l00069
DBusDataSlotList::slots
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-connection_8c-source.html#l04496
dbus_connection_set_data()
,
dbus-message_8c-source.html#l03629
dbus_message_set_data()
,
dbus-pending-call_8c-source.html#l00371
dbus_pending_call_set_data()
, and
dbus-server_8c-source.html#l01100
dbus_server_set_data()
.
Generated on Tue Sep 13 01:28:08 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
