An hashlist is a dual structure where data are both stored in a two-way list, preserving ordering, and indexed in a hash table.
This structure can quickly determine whether it contains some piece of data, as well as quickly remove data. It can be iterated over, in the order of the items or in reverse order.
|
Data Structures |
| struct | hash_list |
| struct | hash_list_item |
| struct | hash_list_iter |
Defines |
| #define | equiv(p, q) (!(p) == !(q)) |
| #define | hash_list_regression(hl) |
Enumerations |
| enum | hash_list_magic_t { HASH_LIST_MAGIC = 0x338954fdU
} |
| enum | hash_list_iter_magic_t { HASH_LIST_ITER_MAGIC = 0x438954efU
} |
Functions |
| void | hash_list_iter_check (const hash_list_iter_t *const iter) |
| void | hash_list_check (const hash_list_t *const hl) |
| hash_list_t * | hash_list_new (GHashFunc hash_func, GEqualFunc eq_func) |
| | Create a new hash list.
|
| void | hash_list_free (hash_list_t **hl_ptr) |
| | Dispose of the data structure, but not of the items it holds.
|
| void | hash_list_insert_item (hash_list_t *hl, struct hash_list_item *item) |
| void | hash_list_append (hash_list_t *hl, gconstpointer key) |
| | Append `key' to the list.
|
| void | hash_list_prepend (hash_list_t *hl, gconstpointer key) |
| | Prepend `key' to the list.
|
| void | hash_list_insert_sorted (hash_list_t *hl, gconstpointer key, GCompareFunc func) |
| | Insert `key' into the list.
|
| gpointer | hash_list_remove_item (hash_list_t *hl, struct hash_list_item *item) |
| gpointer | hash_list_remove (hash_list_t *hl, gconstpointer key) |
| | Remove `data' from the list.
|
| gpointer | hash_list_shift (hash_list_t *hl) |
| gpointer | hash_list_tail (const hash_list_t *hl) |
| gpointer | hash_list_head (const hash_list_t *hl) |
| void | hash_list_moveto_head (hash_list_t *hl, gconstpointer key) |
| | Move entry to the head of the list.
|
| void | hash_list_moveto_tail (hash_list_t *hl, gconstpointer key) |
| | Move entry to the tail of the list.
|
| guint | hash_list_length (const hash_list_t *hl) |
| hash_list_iter_t * | hash_list_iterator (hash_list_t *hl) |
| | Get an iterator on the list, positionned before first item.
|
| hash_list_iter_t * | hash_list_iterator_tail (hash_list_t *hl) |
| | Get an iterator on the list, positionned after last item.
|
| gpointer | hash_list_iter_next (hash_list_iter_t *iter) |
| | Get the next data item from the iterator, or NULL if none.
|
| gboolean | hash_list_iter_has_next (const hash_list_iter_t *iter) |
| | Checks whether there is a next item to be iterated over.
|
| gpointer | hash_list_iter_previous (hash_list_iter_t *iter) |
| | Get the previous data item from the iterator, or NULL if none.
|
| gboolean | hash_list_has_iter_previous (const hash_list_iter_t *iter) |
| | Checks whether there is a previous item in the iterator.
|
| void | hash_list_iter_release (hash_list_iter_t **iter_ptr) |
| | Release the iterator once we're done with it.
|
| gboolean | hash_list_contains (hash_list_t *hl, gconstpointer key, gconstpointer *orig_key_ptr) |
| | Check whether hashlist contains the `data'.
|
| gpointer | hash_list_next (hash_list_t *hl, gconstpointer key) |
| | Get the next item after a given key.
|
| void | hash_list_foreach (const hash_list_t *hl, GFunc func, gpointer user_data) |
| | Apply `func' to all the items in the structure.
|