X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=doc%2Fhtml%2Flinkhash_8h.html;h=772ea22bf2c11619d21abd98aa63d753f15641bd;hb=bc5c17d2ffbbbafa4acc7390f3a0a960b3efb29c;hp=eaad46372ae37ac878cd779b25996372b6263e55;hpb=b757b5a02c4779620a65e68d23cff27fb20a7757;p=platform%2Fupstream%2Fjson-c.git diff --git a/doc/html/linkhash_8h.html b/doc/html/linkhash_8h.html index eaad463..772ea22 100644 --- a/doc/html/linkhash_8h.html +++ b/doc/html/linkhash_8h.html @@ -3,7 +3,6 @@
-Typedefs | |
struct lh_entry * | lh_table_lookup_entry_w_hash (struct lh_table *t, const void *k, const unsigned long h) |
const void * | lh_table_lookup (struct lh_table *t, const void *k) |
json_bool | lh_table_lookup_ex (struct lh_table *t, const void *k, void **v) |
json_bool | lh_table_lookup_ex (struct lh_table *t, const void *k, void **v) |
int | lh_table_delete_entry (struct lh_table *t, struct lh_entry *e) |
int | lh_table_length (struct lh_table *t) |
void | lh_abort (const char *msg,...) |
int | lh_table_resize (struct lh_table *t, int new_size) |
static struct lh_entry * | lh_table_head (const lh_table *t) |
static unsigned long | lh_get_hash (const struct lh_table *t, const void *k) |
static void * | lh_entry_k (const struct lh_entry *e) |
static int | lh_entry_k_is_constant (const struct lh_entry *e) |
static void * | lh_entry_v (const struct lh_entry *e) |
static void | lh_entry_set_val (struct lh_entry *e, void *newval) |
static struct lh_entry * | lh_entry_next (const struct lh_entry *e) |
static struct lh_entry * | lh_entry_prev (const struct lh_entry *e) |
Internal methods for working with json_type_object objects. Although this is exposed by the json_object_get_object() function and within the json_object_iter type, it is not recommended for direct use.
#define _LH_INLINE inline | -
#define _LH_UNCONST | -( | -- | a | ) | -((void *)(uintptr_t)(const void *)(a)) | -
#define LH_EMPTY (void*)-1 | +#define LH_EMPTY (void *)-1 |
#define lh_entry_k | -( | -- | entry | ) | -_LH_UNCONST((entry)->k) | -
Return a non-const version of lh_entry.k.
-lh_entry.k is const to indicate and help ensure that linkhash itself doesn't modify it, but callers are allowed to do what they want with it. See also lh_entry.k_is_constant
- -#define lh_entry_v | -( | -- | entry | ) | -_LH_UNCONST((entry)->v) | -
Return a non-const version of lh_entry.v.
-v is const to indicate and help ensure that linkhash itself doesn't modify it, but callers are allowed to do what they want with it.
- -#define LH_FREED (void*)-2 | +#define LH_FREED (void *)-2 |
This function sets the hash function to be used for strings. Must be one of the JSON_C_STR_HASH_* values.
This function sets the hash function to be used for strings. Must be one of the JSON_C_STR_HASH_* values.
+
+
|
+ +inlinestatic | +
Return a non-const version of lh_entry.k.
+lh_entry.k is const to indicate and help ensure that linkhash itself doesn't modify it, but callers are allowed to do what they want with it.
+References lh_entry::k.
+ +
+
|
+ +inlinestatic | +
Returns 1 if the key for the given entry is constant, and thus does not need to be freed when the lh_entry is freed.
+References lh_entry::k_is_constant.
+ +
+
|
+ +staticread | +
Return the next element, or NULL if there is no next element.
+References lh_entry::next.
+ +
+
|
+ +staticread | +
Return the previous element, or NULL if there is no previous element.
+References lh_entry::prev.
+ +
+
|
+ +inlinestatic | +
Change the value for an entry. The caller is responsible for freeing the previous value.
+ +References lh_entry::v.
|
+ +inlinestatic | +
Return a non-const version of lh_entry.v.
+v is const to indicate and help ensure that linkhash itself doesn't modify it, but callers are allowed to do what they want with it.
+ +References lh_entry::v.
+ +
+
|
+ +inlinestatic | +
Prints a message to stdout
, then exits the program with an exit code of 1
.
Calculate the hash of a key for a given table.
+This is an extension to support functions that need to calculate the hash several times and allows them to do it just once and then pass in the hash to all utility functions. Depending on use case, this can be a considerable performance improvement.
msg | Message format string, like for printf . |
... | Format args. |
t | the table (used to obtain hash function) |
k | a pointer to the key to lookup |
References lh_table::hash_fn.
|
+ +read | +
Convenience function to create a new linkhash table with char keys.
|
+ +read | +
Convenience function to create a new linkhash table with ptr keys.
Delete a record from the table.
-If a callback free function is provided then it is called for the for the item being deleted.
If a callback free function is provided then it is called for the for the item being deleted.
+t | the table to delete from. |
k | a pointer to the key to delete. |
Delete a record from the table.
-If a callback free function is provided then it is called for the for the item being deleted.
If a callback free function is provided then it is called for the for the item being deleted.
+Insert a record into the table using a precalculated key hash.
-The hash h, which should be calculated with lh_get_hash() on k, is provided by the caller, to allow for optimization when multiple operations with the same key are known to be needed.
+The hash h, which should be calculated with lh_get_hash() on k, is provided by the caller, to allow for optimization when multiple operations with the same key are known to be needed.
t | the table to insert into. |
k | a pointer to the key to insert. |
v | a pointer to the value to insert. |
h | hash value of the key to insert |
opts | if set to JSON_C_OBJECT_KEY_IS_CONSTANT, sets lh_entry.k_is_constant so t's free function knows to avoid freeing the key. |
opts | if set to JSON_C_OBJECT_ADD_CONSTANT_KEY, sets lh_entry.k_is_constant so t's free function knows to avoid freeing the key. |
const void* lh_table_lookup | -( | -struct lh_table * | -t, | -
- | - | const void * | -k | -
- | ) | -- |
Lookup a record into the table.
-t | the table to lookup |
k | a pointer to the key to lookup |
Return the number of entries in the table.
|
+ +read | +
Lookup a record in the table.
|
+ +read | +
Lookup a record in the table using a precalculated key hash.
-The hash h, which should be calculated with lh_get_hash() on k, is provided by the caller, to allow for optimization when multiple operations with the same key are known to be needed.
+The hash h, which should be calculated with lh_get_hash() on k, is provided by the caller, to allow for optimization when multiple operations with the same key are known to be needed.
t | the table to lookup |
json_bool lh_table_lookup_ex | +json_bool lh_table_lookup_ex | ( | struct lh_table * | t, | @@ -897,6 +1055,9 @@ Functions
|
+ +read | +
Create a new linkhash table.