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_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 |
| RCSID ("$Id:hashlist.c, v 1.14 2005/06/29 14:24:26 daichik Exp $") |
hash_list_t * | hash_list_new (void) |
| Create a new hash list.
|
void | hash_list_free (hash_list_t *hl) |
| Dispose of the data structure, but not of the items it holds.
|
gboolean | hash_list_rt (gpointer uu_key, gpointer uu_value, gpointer uu_udata) |
| Hash table removal iterator -- always returns TRUE.
|
void | hash_list_clear (hash_list_t *hl) |
| Clear the structure.
|
void | hash_list_append (hash_list_t *hl, gpointer data) |
| Append `data' to the list.
|
void | hash_list_prepend (hash_list_t *hl, gpointer data) |
| Prepend `data' to the list.
|
void | hash_list_remove (hash_list_t *hl, gpointer data) |
| Remove `data' from the list.
|
gpointer | hash_list_last (const hash_list_t *hl) |
gpointer | hash_list_first (const hash_list_t *hl) |
gint | 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_last (hash_list_t *hl) |
| Get an iterator on the list, positionned after last item.
|
gpointer | hash_list_next (hash_list_iter_t *i) |
| Get the next data item from the iterator, or NULL if none.
|
gboolean | hash_list_has_next (const hash_list_iter_t *i) |
| Checks whether there is a next item to be iterated over.
|
gpointer | hash_list_previous (hash_list_iter_t *i) |
| Get the previous data item from the iterator, or NULL if none.
|
gboolean | hash_list_has_previous (const hash_list_iter_t *i) |
| Checks whether there is a previous item in the iterator.
|
gpointer | hash_list_follower (hash_list_iter_t *i) |
| Move to next item in the direction of the iterator.
|
gboolean | hash_list_has_follower (const hash_list_iter_t *i) |
| Checks whether there is a following item in the iterator, in the direction chosen at creation time.
|
void | hash_list_release (hash_list_iter_t *i) |
| Release the iterator once we're done with it.
|
gboolean | hash_list_contains (hash_list_t *hl, gpointer data) |
| Check whether hashlist contains the `data'.
|
void | hash_list_foreach (const hash_list_t *hl, GFunc func, gpointer user_data) |
| Apply `func' to all the items in the structure.
|