|
libdom
|
#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <dom/core/string.h>#include <dom/core/node.h>#include "comparators.h"#include "list.h"#include "domtsasserts.h"Functions | |
| struct list_elt * | list_new_elt (void *data) |
| struct list * | list_new (TYPE type) |
| void | list_destroy (struct list *list) |
| void | list_add (struct list *list, void *data) |
| bool | list_remove (struct list *list, void *data) |
| struct list * | list_clone (struct list *list) |
| bool | list_contains (struct list *list, void *data, comparator comparator) |
| bool | list_contains_all (struct list *superList, struct list *subList, comparator comparator) |
| void list_add | ( | struct list * | list, |
| void * | data | ||
| ) |
Add data to the tail of the list.
| bool list_contains | ( | struct list * | list, |
| void * | data, | ||
| comparator | comparator | ||
| ) |
Tests if data is equal to any element in the list.
| bool list_contains_all | ( | struct list * | superList, |
| struct list * | subList, | ||
| comparator | comparator | ||
| ) |
Tests if superlist contains all elements in sublist. Order is not important.
| void list_destroy | ( | struct list * | list | ) |
| struct list_elt * list_new_elt | ( | void * | data | ) |
Private helper function. Create a new list_elt and initialise it.
| bool list_remove | ( | struct list * | list, |
| void * | data | ||
| ) |
Remove element containing data from list. The list element is freed, but the caller must free the data itself if necessary.
Returns true if data was found in the list.