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
Hash table
[
group__DBusInternals.html
D-BUS internal implementation details
]
structDBusHashTable.html
DBusHashTable
data structure.
#_details
More...
Typedefs
typedef int(*
group__DBusHashTable.html#ga0
KeyCompareFunc
)(const void *key_a, const void *key_b)
Key comparison function.
typedef
structDBusHashIter.html
DBusHashIter
group__DBusHashTable.html#ga29
DBusHashIter
Public opaque hash table iterator object.
typedef
structDBusHashTable.html
DBusHashTable
group__DBusHashTable.html#ga30
DBusHashTable
Public opaque hash table object.
Enumerations
enum
group__DBusHashTable.html#ga31
DBusHashType
{
dbus-hash_8h.html#ga31a3
DBUS_HASH_STRING
,
dbus-hash_8h.html#ga31a4
DBUS_HASH_TWO_STRINGS
,
dbus-hash_8h.html#ga31a5
DBUS_HASH_INT
,
dbus-hash_8h.html#ga31a6
DBUS_HASH_POINTER
,
dbus-hash_8h.html#ga31a7
DBUS_HASH_ULONG
}
Indicates the type of a key in the hash table.
Functions
structDBusHashTable.html
DBusHashTable
*
group__DBusHashTable.html#ga1
_dbus_hash_table_new
(
group__DBusHashTable.html#ga31
DBusHashType
type,
group__DBusMemory.html#ga8
DBusFreeFunction
key_free_function,
group__DBusMemory.html#ga8
DBusFreeFunction
value_free_function)
Constructs a new hash table.
#ga1
structDBusHashTable.html
DBusHashTable
*
group__DBusHashTable.html#ga2
_dbus_hash_table_ref
(
structDBusHashTable.html
DBusHashTable
*table)
Increments the reference count for a hash table.
#ga2
void
group__DBusHashTable.html#ga3
_dbus_hash_table_unref
(
structDBusHashTable.html
DBusHashTable
*table)
Decrements the reference count for a hash table, freeing the hash table if the count reaches zero.
#ga3
void
group__DBusHashTable.html#ga4
_dbus_hash_iter_init
(
structDBusHashTable.html
DBusHashTable
*table,
structDBusHashIter.html
DBusHashIter
*iter)
Initializes a hash table iterator.
#ga4
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga5
_dbus_hash_iter_next
(
structDBusHashIter.html
DBusHashIter
*iter)
Move the hash iterator forward one step, to the next hash entry.
#ga5
void
group__DBusHashTable.html#ga6
_dbus_hash_iter_remove_entry
(
structDBusHashIter.html
DBusHashIter
*iter)
Removes the current entry from the hash table.
#ga6
void *
group__DBusHashTable.html#ga7
_dbus_hash_iter_get_value
(
structDBusHashIter.html
DBusHashIter
*iter)
Gets the value of the current entry.
#ga7
void
group__DBusHashTable.html#ga8
_dbus_hash_iter_set_value
(
structDBusHashIter.html
DBusHashIter
*iter, void *value)
Sets the value of the current entry.
#ga8
int
group__DBusHashTable.html#ga9
_dbus_hash_iter_get_int_key
(
structDBusHashIter.html
DBusHashIter
*iter)
Gets the key for the current entry.
#ga9
unsigned long
group__DBusHashTable.html#ga10
_dbus_hash_iter_get_ulong_key
(
structDBusHashIter.html
DBusHashIter
*iter)
Gets the key for the current entry.
#ga10
const char *
group__DBusHashTable.html#ga11
_dbus_hash_iter_get_string_key
(
structDBusHashIter.html
DBusHashIter
*iter)
Gets the key for the current entry.
#ga11
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga12
_dbus_hash_iter_lookup
(
structDBusHashTable.html
DBusHashTable
*table, void *key,
group__DBusTypes.html#ga2
dbus_bool_t
create_if_not_found,
structDBusHashIter.html
DBusHashIter
*iter)
A low-level but efficient interface for manipulating the hash table.
#ga12
void *
group__DBusHashTable.html#ga16
_dbus_hash_table_lookup_string
(
structDBusHashTable.html
DBusHashTable
*table, const char *key)
Looks up the value for a given string in a hash table of type DBUS_HASH_STRING.
#ga16
void *
group__DBusHashTable.html#ga17
_dbus_hash_table_lookup_int
(
structDBusHashTable.html
DBusHashTable
*table, int key)
Looks up the value for a given integer in a hash table of type DBUS_HASH_INT.
#ga17
void *
group__DBusHashTable.html#ga18
_dbus_hash_table_lookup_ulong
(
structDBusHashTable.html
DBusHashTable
*table, unsigned long key)
Looks up the value for a given integer in a hash table of type DBUS_HASH_ULONG.
#ga18
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga19
_dbus_hash_table_remove_string
(
structDBusHashTable.html
DBusHashTable
*table, const char *key)
Removes the hash entry for the given key.
#ga19
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga20
_dbus_hash_table_remove_int
(
structDBusHashTable.html
DBusHashTable
*table, int key)
Removes the hash entry for the given key.
#ga20
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga21
_dbus_hash_table_remove_ulong
(
structDBusHashTable.html
DBusHashTable
*table, unsigned long key)
Removes the hash entry for the given key.
#ga21
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga22
_dbus_hash_table_insert_string
(
structDBusHashTable.html
DBusHashTable
*table, char *key, void *value)
Creates a hash entry with the given key and value.
#ga22
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga23
_dbus_hash_table_insert_int
(
structDBusHashTable.html
DBusHashTable
*table, int key, void *value)
Creates a hash entry with the given key and value.
#ga23
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusHashTable.html#ga24
_dbus_hash_table_insert_ulong
(
structDBusHashTable.html
DBusHashTable
*table, unsigned long key, void *value)
Creates a hash entry with the given key and value.
#ga24
DBusPreallocatedHash *
group__DBusHashTable.html#ga25
_dbus_hash_table_preallocate_entry
(
structDBusHashTable.html
DBusHashTable
*table)
Preallocate an opaque data blob that allows us to insert into the hash table at a later time without allocating any memory.
#ga25
void
group__DBusHashTable.html#ga26
_dbus_hash_table_free_preallocated_entry
(
structDBusHashTable.html
DBusHashTable
*table, DBusPreallocatedHash *preallocated)
Frees an opaque DBusPreallocatedHash that was *not* used in order to insert into the hash table.
#ga26
void
group__DBusHashTable.html#ga27
_dbus_hash_table_insert_string_preallocated
(
structDBusHashTable.html
DBusHashTable
*table, DBusPreallocatedHash *preallocated, char *key, void *value)
Inserts a string-keyed entry into the hash table, using a preallocated data block from
group__DBusHashTable.html#ga25
_dbus_hash_table_preallocate_entry()
.
#ga27
int
group__DBusHashTable.html#ga28
_dbus_hash_table_get_n_entries
(
structDBusHashTable.html
DBusHashTable
*table)
Gets the number of hash entries in a hash table.
#ga28
Detailed Description
structDBusHashTable.html
DBusHashTable
data structure.
Types and functions related to
structDBusHashTable.html
DBusHashTable
.
Function Documentation
int _dbus_hash_iter_get_int_key
(
structDBusHashIter.html
DBusHashIter
*
iter
)
Gets the key for the current entry.
Only works for hash tables of type DBUS_HASH_INT.
Parameters:
iter
the hash table iterator.
Definition at line
dbus-hash_8c-source.html#l00656
656
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00147
_DBUS_POINTER_TO_INT
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
dbus-hash_8c-source.html#l00148
DBusHashEntry::key
,
group__DBusMacros.html#ga4
NULL
, and
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
.
const char* _dbus_hash_iter_get_string_key
(
structDBusHashIter.html
DBusHashIter
*
iter
)
Gets the key for the current entry.
Only works for hash tables of type DBUS_HASH_STRING
Parameters:
iter
the hash table iterator.
Definition at line
dbus-hash_8c-source.html#l00693
693
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
dbus-hash_8c-source.html#l00148
DBusHashEntry::key
,
group__DBusMacros.html#ga4
NULL
, and
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
.
unsigned long _dbus_hash_iter_get_ulong_key
(
structDBusHashIter.html
DBusHashIter
*
iter
)
Gets the key for the current entry.
Only works for hash tables of type DBUS_HASH_ULONG.
Parameters:
iter
the hash table iterator.
Definition at line
dbus-hash_8c-source.html#l00675
675
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
dbus-hash_8c-source.html#l00148
DBusHashEntry::key
,
group__DBusMacros.html#ga4
NULL
, and
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
.
void* _dbus_hash_iter_get_value
(
structDBusHashIter.html
DBusHashIter
*
iter
)
Gets the value of the current entry.
Parameters:
iter
the hash table iterator.
Definition at line
dbus-hash_8c-source.html#l00610
610
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
group__DBusMacros.html#ga4
NULL
,
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
void _dbus_hash_iter_init
(
structDBusHashTable.html
DBusHashTable
*
table
,
structDBusHashIter.html
DBusHashIter
*
iter
)
Initializes a hash table iterator.
To iterate over all entries in a hash table, use the following code (the printf assumes a hash from strings to strings obviously):
structDBusHashIter.html
DBusHashIter
iter;
group__DBusHashTable.html#ga4
_dbus_hash_iter_init
(table, &iter);
while
(
group__DBusHashTable.html#ga5
_dbus_hash_iter_next
(&iter))
{
printf (
"The first key is %s and value is %s\n"
,
group__DBusHashTable.html#ga11
_dbus_hash_iter_get_string_key
(&iter),
group__DBusHashTable.html#ga7
_dbus_hash_iter_get_value
(&iter));
}
The iterator is initialized pointing "one before" the first hash entry. The first call to
group__DBusHashTable.html#ga5
_dbus_hash_iter_next()
moves it onto the first valid entry or returns
group__DBusMacros.html#ga3
FALSE
if the hash table is empty. Subsequent calls move to the next valid entry or return
group__DBusMacros.html#ga3
FALSE
if there are no more entries.
Note that it is guaranteed to be safe to remove a hash entry during iteration, but it is not safe to add a hash entry.
Parameters:
table
the hash table to iterate over.
iter
the iterator to initialize.
Definition at line
dbus-hash_8c-source.html#l00514
514
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00214
DBusRealHashIter::bucket
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
dbus-hash_8c-source.html#l00181
n_entries
,
dbus-hash_8c-source.html#l00221
DBusRealHashIter::n_entries_on_init
,
dbus-hash_8c-source.html#l00220
DBusRealHashIter::next_bucket
,
dbus-hash_8c-source.html#l00219
DBusRealHashIter::next_entry
,
group__DBusMacros.html#ga4
NULL
, and
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_iter_lookup
(
structDBusHashTable.html
DBusHashTable
*
table
,
void *
key
,
group__DBusTypes.html#ga2
dbus_bool_t
create_if_not_found
,
structDBusHashIter.html
DBusHashIter
*
iter
)
A low-level but efficient interface for manipulating the hash table.
It's efficient because you can get, set, and optionally create the hash entry while only running the hash function one time.
Note that while calling
group__DBusHashTable.html#ga5
_dbus_hash_iter_next()
on the iterator filled in by this function may work, it's completely undefined which entries are after this iter and which are before it. So it would be silly to iterate using this iterator.
If the hash entry is created, its value will be initialized to all bits zero.
group__DBusMacros.html#ga3
FALSE
may be returned due to memory allocation failure, or because create_if_not_found was
group__DBusMacros.html#ga3
FALSE
and the entry did not exist.
If create_if_not_found is
group__DBusMacros.html#ga2
TRUE
and the entry is created, the hash table takes ownership of the key that's passed in.
For a hash table of type DBUS_HASH_INT, cast the int key to the key parameter using
group__DBusInternalsUtils.html#ga133
_DBUS_INT_TO_POINTER()
.
Parameters:
table
the hash table.
key
the hash key.
create_if_not_found
if
group__DBusMacros.html#ga2
TRUE
, create the entry if it didn't exist.
iter
the iterator to initialize.
Returns:
group__DBusMacros.html#ga2
TRUE
if the hash entry now exists (and the iterator is thus valid).
Definition at line
dbus-hash_8c-source.html#l00757
757
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00214
DBusRealHashIter::bucket
,
dbus-hash_8c-source.html#l00170
buckets
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
group__DBusMacros.html#ga3
FALSE
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00181
n_entries
,
dbus-hash_8c-source.html#l00221
DBusRealHashIter::n_entries_on_init
,
dbus-hash_8c-source.html#l00144
DBusHashEntry::next
,
dbus-hash_8c-source.html#l00220
DBusRealHashIter::next_bucket
,
dbus-hash_8c-source.html#l00219
DBusRealHashIter::next_entry
,
group__DBusMacros.html#ga4
NULL
,
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_iter_next
(
structDBusHashIter.html
DBusHashIter
*
iter
)
Move the hash iterator forward one step, to the next hash entry.
The documentation for
group__DBusHashTable.html#ga4
_dbus_hash_iter_init()
explains in more detail.
Parameters:
iter
the iterator to move forward.
Returns:
group__DBusMacros.html#ga3
FALSE
if there are no more entries to move to.
Definition at line
dbus-hash_8c-source.html#l00540
540
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00214
DBusRealHashIter::bucket
,
dbus-hash_8c-source.html#l00170
buckets
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
group__DBusMacros.html#ga3
FALSE
,
dbus-hash_8c-source.html#l00178
n_buckets
,
dbus-hash_8c-source.html#l00181
n_entries
,
dbus-hash_8c-source.html#l00221
DBusRealHashIter::n_entries_on_init
,
dbus-hash_8c-source.html#l00144
DBusHashEntry::next
,
dbus-hash_8c-source.html#l00220
DBusRealHashIter::next_bucket
,
dbus-hash_8c-source.html#l00219
DBusRealHashIter::next_entry
,
group__DBusMacros.html#ga4
NULL
,
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
, and
group__DBusMacros.html#ga2
TRUE
.
void _dbus_hash_iter_remove_entry
(
structDBusHashIter.html
DBusHashIter
*
iter
)
Removes the current entry from the hash table.
If a key_free_function or value_free_function was provided to
group__DBusHashTable.html#ga1
_dbus_hash_table_new()
, frees the key and/or value for this entry.
Parameters:
iter
the hash table iterator.
Definition at line
dbus-hash_8c-source.html#l00589
589
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00214
DBusRealHashIter::bucket
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
group__DBusMacros.html#ga4
NULL
, and
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
.
void _dbus_hash_iter_set_value
(
structDBusHashIter.html
DBusHashIter
*
iter
,
void *
value
)
Sets the value of the current entry.
If the hash table has a value_free_function it will be used to free the previous value. The hash table will own the passed-in value (it will not be copied).
Parameters:
iter
the hash table iterator.
value
the new value.
Definition at line
dbus-hash_8c-source.html#l00633
633
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00218
DBusRealHashIter::entry
,
dbus-hash_8c-source.html#l00203
free_value_function
,
group__DBusMacros.html#ga4
NULL
,
dbus-hash_8c-source.html#l00213
DBusRealHashIter::table
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
void _dbus_hash_table_free_preallocated_entry
(
structDBusHashTable.html
DBusHashTable
*
table
,
DBusPreallocatedHash *
preallocated
)
Frees an opaque DBusPreallocatedHash that was *not* used in order to insert into the hash table.
Parameters:
table
the hash table
preallocated
the preallocated data
Definition at line
dbus-hash_8c-source.html#l01627
1627
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-mempool_8c-source.html#l00336
_dbus_mem_pool_dealloc()
, and
dbus-hash_8c-source.html#l00205
entry_pool
.
int _dbus_hash_table_get_n_entries
(
structDBusHashTable.html
DBusHashTable
*
table
)
Gets the number of hash entries in a hash table.
Parameters:
table
the hash table.
Returns:
the number of entries in the table.
Definition at line
dbus-hash_8c-source.html#l01685
1685
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-hash_8c-source.html#l00181
n_entries
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_table_insert_int
(
structDBusHashTable.html
DBusHashTable
*
table
,
int
key
,
void *
value
)
Creates a hash entry with the given key and value.
The key and value are not copied; they are stored in the hash table by reference. If an entry with the given key already exists, the previous key and value are overwritten (and freed if the hash table has a key_free_function and/or value_free_function).
Returns
group__DBusMacros.html#ga3
FALSE
if memory for the new hash entry can't be allocated.
Parameters:
table
the hash table.
key
the hash entry key.
value
the hash entry value.
Definition at line
dbus-hash_8c-source.html#l01492
1492
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00148
_DBUS_INT_TO_POINTER
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00202
free_key_function
,
dbus-hash_8c-source.html#l00203
free_value_function
,
dbus-hash_8c-source.html#l00148
DBusHashEntry::key
,
dbus-hash_8c-source.html#l00197
key_type
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_table_insert_string
(
structDBusHashTable.html
DBusHashTable
*
table
,
char *
key
,
void *
value
)
Creates a hash entry with the given key and value.
The key and value are not copied; they are stored in the hash table by reference. If an entry with the given key already exists, the previous key and value are overwritten (and freed if the hash table has a key_free_function and/or value_free_function).
Returns
group__DBusMacros.html#ga3
FALSE
if memory for the new hash entry can't be allocated.
Parameters:
table
the hash table.
key
the hash entry key.
value
the hash entry value.
Definition at line
dbus-hash_8c-source.html#l01415
1415
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l01654
_dbus_hash_table_insert_string_preallocated()
,
dbus-hash_8c-source.html#l01610
_dbus_hash_table_preallocate_entry()
,
dbus-hash_8c-source.html#l00197
key_type
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-userdb_8c-source.html#l00102
_dbus_user_database_lookup()
, and
dbus-userdb-util_8c-source.html#l00189
_dbus_user_database_lookup_group()
.
void _dbus_hash_table_insert_string_preallocated
(
structDBusHashTable.html
DBusHashTable
*
table
,
DBusPreallocatedHash *
preallocated
,
char *
key
,
void *
value
)
Inserts a string-keyed entry into the hash table, using a preallocated data block from
group__DBusHashTable.html#ga25
_dbus_hash_table_preallocate_entry()
.
This function cannot fail due to lack of memory. The DBusPreallocatedHash object is consumed and should not be reused or freed. Otherwise this function works just like
group__DBusHashTable.html#ga22
_dbus_hash_table_insert_string()
.
Parameters:
table
the hash table
preallocated
the preallocated data
key
the hash key
value
the value
Definition at line
dbus-hash_8c-source.html#l01654
1654
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00202
free_key_function
,
dbus-hash_8c-source.html#l00203
free_value_function
,
dbus-hash_8c-source.html#l00148
DBusHashEntry::key
,
dbus-hash_8c-source.html#l00197
key_type
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
Referenced by
dbus-hash_8c-source.html#l01415
_dbus_hash_table_insert_string()
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_table_insert_ulong
(
structDBusHashTable.html
DBusHashTable
*
table
,
unsigned long
key
,
void *
value
)
Creates a hash entry with the given key and value.
The key and value are not copied; they are stored in the hash table by reference. If an entry with the given key already exists, the previous key and value are overwritten (and freed if the hash table has a key_free_function and/or value_free_function).
Returns
group__DBusMacros.html#ga3
FALSE
if memory for the new hash entry can't be allocated.
Parameters:
table
the hash table.
key
the hash entry key.
value
the hash entry value.
Definition at line
dbus-hash_8c-source.html#l01577
1577
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00202
free_key_function
,
dbus-hash_8c-source.html#l00203
free_value_function
,
dbus-hash_8c-source.html#l00148
DBusHashEntry::key
,
dbus-hash_8c-source.html#l00197
key_type
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
Referenced by
dbus-userdb_8c-source.html#l00102
_dbus_user_database_lookup()
, and
dbus-userdb-util_8c-source.html#l00189
_dbus_user_database_lookup_group()
.
void* _dbus_hash_table_lookup_int
(
structDBusHashTable.html
DBusHashTable
*
table
,
int
key
)
Looks up the value for a given integer in a hash table of type DBUS_HASH_INT.
Returns NULL if the value is not present. (A not-present entry is indistinguishable from an entry with a value of NULL.)
Parameters:
table
the hash table.
key
the integer to look up.
Returns:
the value of the hash entry.
Definition at line
dbus-hash_8c-source.html#l01186
1186
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00148
_DBUS_INT_TO_POINTER
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00197
key_type
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
Referenced by
dbus-connection_8c-source.html#l00358
_dbus_connection_queue_received_message_link()
, and
dbus-connection_8c-source.html#l03435
dbus_connection_dispatch()
.
void* _dbus_hash_table_lookup_string
(
structDBusHashTable.html
DBusHashTable
*
table
,
const char *
key
)
Looks up the value for a given string in a hash table of type DBUS_HASH_STRING.
Returns NULL if the value is not present. (A not-present entry is indistinguishable from an entry with a value of NULL.)
Parameters:
table
the hash table.
key
the string to look up.
Returns:
the value of the hash entry.
Definition at line
dbus-hash_8c-source.html#l01134
1134
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
group__DBusMacros.html#ga3
FALSE
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00197
key_type
,
group__DBusMacros.html#ga4
NULL
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
Referenced by
dbus-userdb_8c-source.html#l00102
_dbus_user_database_lookup()
, and
dbus-userdb-util_8c-source.html#l00189
_dbus_user_database_lookup_group()
.
void* _dbus_hash_table_lookup_ulong
(
structDBusHashTable.html
DBusHashTable
*
table
,
unsigned long
key
)
Looks up the value for a given integer in a hash table of type DBUS_HASH_ULONG.
Returns NULL if the value is not present. (A not-present entry is indistinguishable from an entry with a value of NULL.)
Parameters:
table
the hash table.
key
the integer to look up.
Returns:
the value of the hash entry.
Definition at line
dbus-hash_8c-source.html#l01239
1239
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00197
key_type
, and
dbus-hash_8c-source.html#l00149
DBusHashEntry::value
.
Referenced by
dbus-userdb_8c-source.html#l00102
_dbus_user_database_lookup()
, and
dbus-userdb-util_8c-source.html#l00189
_dbus_user_database_lookup_group()
.
structDBusHashTable.html
DBusHashTable
* _dbus_hash_table_new
(
group__DBusHashTable.html#ga31
DBusHashType
type
,
group__DBusMemory.html#ga8
DBusFreeFunction
key_free_function
,
group__DBusMemory.html#ga8
DBusFreeFunction
value_free_function
)
Constructs a new hash table.
Should be freed with
group__DBusHashTable.html#ga3
_dbus_hash_table_unref()
. If memory cannot be allocated for the hash table, returns
group__DBusMacros.html#ga4
NULL
.
Parameters:
type
the type of hash key to use.
key_free_function
function to free hash keys.
value_free_function
function to free hash values.
Returns:
a new
structDBusHashTable.html
DBusHashTable
or
group__DBusMacros.html#ga4
NULL
if no memory.
Definition at line
dbus-hash_8c-source.html#l00292
292
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00112
_dbus_assert_not_reached
,
dbus-mempool_8c-source.html#l00136
_dbus_mem_pool_new()
,
dbus-internals_8h-source.html#l00145
_DBUS_N_ELEMENTS
,
dbus-hash_8c-source.html#l00170
buckets
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-memory_8h-source.html#l00042
dbus_new0
,
dbus-hash_8c-source.html#l00129
DBUS_SMALL_HASH_TABLE
,
dbus-hash_8c-source.html#l00190
down_shift
,
dbus-hash_8c-source.html#l00205
entry_pool
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00202
free_key_function
,
dbus-hash_8c-source.html#l00203
free_value_function
,
dbus-hash_8c-source.html#l00184
hi_rebuild_size
,
dbus-hash_8c-source.html#l00197
key_type
,
dbus-hash_8c-source.html#l00187
lo_rebuild_size
,
dbus-hash_8c-source.html#l00194
mask
,
dbus-hash_8c-source.html#l00178
n_buckets
,
dbus-hash_8c-source.html#l00181
n_entries
,
group__DBusMacros.html#ga4
NULL
,
dbus-hash_8c-source.html#l00103
REBUILD_MULTIPLIER
,
dbus-hash_8c-source.html#l00168
refcount
,
dbus-hash_8c-source.html#l00175
static_buckets
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
, and
dbus-userdb_8c-source.html#l00440
_dbus_user_database_new()
.
DBusPreallocatedHash* _dbus_hash_table_preallocate_entry
(
structDBusHashTable.html
DBusHashTable
*
table
)
Preallocate an opaque data blob that allows us to insert into the hash table at a later time without allocating any memory.
Parameters:
table
the hash table
Returns:
the preallocated data, or
group__DBusMacros.html#ga4
NULL
if no memory
Definition at line
dbus-hash_8c-source.html#l01610
1610
of file
dbus-hash_8c-source.html
dbus-hash.c
.
Referenced by
dbus-hash_8c-source.html#l01415
_dbus_hash_table_insert_string()
.
structDBusHashTable.html
DBusHashTable
* _dbus_hash_table_ref
(
structDBusHashTable.html
DBusHashTable
*
table
)
Increments the reference count for a hash table.
Parameters:
table
the hash table to add a reference to.
Returns:
the hash table.
Definition at line
dbus-hash_8c-source.html#l00360
360
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-hash_8c-source.html#l00168
refcount
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_table_remove_int
(
structDBusHashTable.html
DBusHashTable
*
table
,
int
key
)
Removes the hash entry for the given key.
If no hash entry for the key exists, does nothing.
Parameters:
table
the hash table.
key
the hash key.
Returns:
group__DBusMacros.html#ga2
TRUE
if the entry existed
Definition at line
dbus-hash_8c-source.html#l01321
1321
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-internals_8h-source.html#l00148
_DBUS_INT_TO_POINTER
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00197
key_type
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_table_remove_string
(
structDBusHashTable.html
DBusHashTable
*
table
,
const char *
key
)
Removes the hash entry for the given key.
If no hash entry for the key exists, does nothing.
Parameters:
table
the hash table.
key
the hash key.
Returns:
group__DBusMacros.html#ga2
TRUE
if the entry existed
Definition at line
dbus-hash_8c-source.html#l01263
1263
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00197
key_type
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
_dbus_hash_table_remove_ulong
(
structDBusHashTable.html
DBusHashTable
*
table
,
unsigned long
key
)
Removes the hash entry for the given key.
If no hash entry for the key exists, does nothing.
Parameters:
table
the hash table.
key
the hash key.
Returns:
group__DBusMacros.html#ga2
TRUE
if the entry existed
Definition at line
dbus-hash_8c-source.html#l01380
1380
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-hash_8c-source.html#l00200
find_function
,
dbus-hash_8c-source.html#l00197
key_type
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-userdb_8c-source.html#l00102
_dbus_user_database_lookup()
, and
dbus-userdb-util_8c-source.html#l00189
_dbus_user_database_lookup_group()
.
void _dbus_hash_table_unref
(
structDBusHashTable.html
DBusHashTable
*
table
)
Decrements the reference count for a hash table, freeing the hash table if the count reaches zero.
Parameters:
table
the hash table to remove a reference from.
Definition at line
dbus-hash_8c-source.html#l00374
374
of file
dbus-hash_8c-source.html
dbus-hash.c
.
References
dbus-mempool_8c-source.html#l00183
_dbus_mem_pool_free()
,
dbus-hash_8c-source.html#l00170
buckets
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-hash_8c-source.html#l00205
entry_pool
,
dbus-hash_8c-source.html#l00144
DBusHashEntry::next
,
group__DBusMacros.html#ga4
NULL
,
dbus-hash_8c-source.html#l00168
refcount
, and
dbus-hash_8c-source.html#l00175
static_buckets
.
Referenced by
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
, and
dbus-userdb_8c-source.html#l00501
_dbus_user_database_unref()
.
Generated on Tue Sep 13 00:15:28 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
