39 #ifndef LIST_H_0707122009
40 #define LIST_H_0707122009
311 extern SCEW_API scew_list*
scew_list_find (scew_list *list,
void *data);
scew_bool(* scew_cmp_hook)(void const *, void const *)
SCEW lists comparison hooks are used by scew_list_find_custom.
Definition: list.h:81
void(* scew_list_hook)(scew_list *, void *)
SCEW lists hooks (functions) are used by scew_list_foreach.
Definition: list.h:70
SCEW_API scew_list * scew_list_next(scew_list *list)
Obtains the next item of the given list item.
SCEW_API scew_list * scew_list_find(scew_list *list, void *data)
Finds the first list item that contains data.
SCEW shared library support.
struct scew_list scew_list
This is the type delcaration for SCEW lists.
Definition: list.h:55
SCEW_API scew_list * scew_list_find_custom(scew_list *list, void const *data, scew_cmp_hook hook)
Finds the first list item that matches the given predicate, hook.
SCEW_API void scew_list_foreach(scew_list *list, scew_list_hook hook, void *user_data)
Traverses all list items and executes the given hook for each item found.
unsigned char scew_bool
This should be defined using stdbool.h when C99 is available.
Definition: bool.h:35
SCEW_API scew_list * scew_list_last(scew_list *list)
Finds the last item of the given list.
SCEW_API scew_list * scew_list_append(scew_list *list, void *data)
Creates a new list item with the given data and appends it to list.
SCEW_API scew_list * scew_list_first(scew_list *list)
Finds the first item of the given list.
SCEW_API void * scew_list_data(scew_list *list)
Returns the data pointer of the given list item.
SCEW_API scew_list * scew_list_index(scew_list *list, unsigned int index)
Gets the list item at the given index.
SCEW_API void scew_list_free(scew_list *list)
Frees all the items from the given list.
SCEW_API unsigned int scew_list_size(scew_list *list)
Returns the number of items in the given list.
SCEW_API scew_list * scew_list_prepend(scew_list *list, void *data)
Creates a new list item with the given data and prepends it to list.
SCEW_API scew_list * scew_list_delete(scew_list *list, void *data)
Deletes the first item pointing to data from the given list.
SCEW boolean type declaration.
SCEW_API scew_list * scew_list_delete_item(scew_list *list, scew_list *item)
Deletes the given list item from list.
SCEW_API scew_list * scew_list_previous(scew_list *list)
Obtains the previous item of the given list item.
SCEW_API scew_list * scew_list_create(void *data)
Creates a new list item with the given data.