52 #ifndef MERCURY_LIST_H
53 #define MERCURY_LIST_H
55 #include "mercury_util_config.h"
95 #define HG_LIST_NULL ((void *) 0)
177 HG_UTIL_EXPORT hg_list_value_t
198 HG_UTIL_EXPORT hg_list_value_t
207 HG_UTIL_EXPORT
unsigned int
219 HG_UTIL_EXPORT hg_list_value_t *
242 HG_UTIL_EXPORT
unsigned int
244 hg_list_value_t data);
268 hg_list_value_t data);
297 HG_UTIL_EXPORT hg_list_value_t
void * hg_list_value_t
A value stored in a list.
HG_UTIL_EXPORT int hg_list_remove_entry(hg_list_entry_t **list, hg_list_entry_t *entry)
Remove an entry from a list.
HG_UTIL_EXPORT hg_list_value_t hg_list_data(hg_list_entry_t *listentry)
Retrieve the value at a list entry.
int(* hg_list_compare_func_t)(hg_list_value_t value1, hg_list_value_t value2)
Callback function used to compare values in a list when sorting.
HG_UTIL_EXPORT hg_list_value_t hg_list_iter_next(hg_list_iter_t *iterator)
Using a list iterator, retrieve the next value from the list.
hg_list_entry_t ** prev_next
Definition of a hg_list_iter_t.
HG_UTIL_EXPORT hg_list_entry_t * hg_list_prev(hg_list_entry_t *listentry)
Retrieve the previous entry in a list.
HG_UTIL_EXPORT unsigned int hg_list_remove_data(hg_list_entry_t **list, hg_list_equal_func_t callback, hg_list_value_t data)
Remove all occurrences of a particular value from a list.
HG_UTIL_EXPORT void hg_list_free(hg_list_entry_t *list)
Free an entire list.
HG_UTIL_EXPORT int hg_list_iter_has_more(hg_list_iter_t *iterator)
Determine if there are more values in the list to iterate over.
HG_UTIL_EXPORT unsigned int hg_list_length(hg_list_entry_t *list)
Find the length of a list.
HG_UTIL_EXPORT void hg_list_iterate(hg_list_entry_t **list, hg_list_iter_t *iter)
Initialize a hg_list_iter_t structure to iterate over a list.
HG_UTIL_EXPORT hg_list_entry_t * hg_list_nth_entry(hg_list_entry_t *list, unsigned int n)
Retrieve the entry at a specified index in a list.
HG_UTIL_EXPORT hg_list_value_t * hg_list_to_array(hg_list_entry_t *list)
Create a C array containing the contents of a list.
HG_UTIL_EXPORT void hg_list_sort(hg_list_entry_t **list, hg_list_compare_func_t compare_func)
Sort a list.
HG_UTIL_EXPORT hg_list_entry_t * hg_list_find_data(hg_list_entry_t *list, hg_list_equal_func_t callback, hg_list_value_t data)
Find the entry for a particular value in a list.
int(* hg_list_equal_func_t)(hg_list_value_t value1, hg_list_value_t value2)
Callback function used to determine of two values in a list are equal.
HG_UTIL_EXPORT void hg_list_iter_remove(hg_list_iter_t *iterator)
Delete the current entry in the list (the value last returned from list_iter_next) ...
hg_list_entry_t * current
struct hg_list_entry hg_list_entry_t
Represents an entry in a doubly-linked list.
HG_UTIL_EXPORT hg_list_entry_t * hg_list_next(hg_list_entry_t *listentry)
Retrieve the next entry in a list.
HG_UTIL_EXPORT hg_list_entry_t * hg_list_append(hg_list_entry_t **list, hg_list_value_t data)
Append a value to the end of a list.
HG_UTIL_EXPORT hg_list_value_t hg_list_nth_data(hg_list_entry_t *list, unsigned int n)
Retrieve the value at a specified index in the list.
HG_UTIL_EXPORT hg_list_entry_t * hg_list_prepend(hg_list_entry_t **list, hg_list_value_t data)
Prepend a value to the start of a list.