libFirm
|
Data Structures | |
struct | plist_t |
The plist data type. More... | |
struct | plist_element_t |
An element in the pointer list. More... | |
Macros | |
#define | plist_count(list) ((list)->element_count) |
Returns the number of elements in a pointer list. More... | |
#define | plist_first(list) ((list)->first_element) |
Returns the first element of a pointer list. More... | |
#define | plist_last(list) ((list)->last_element) |
Returns the last element of a pointer list. More... | |
#define | plist_element_has_next(element) ((element)->next != NULL) |
Checks whether a pointer list element has a successor or not. More... | |
#define | plist_element_has_prev(element) ((element)->prev != NULL) |
Checks whether a pointer list element has a predecessor or not. More... | |
#define | plist_element_get_next(element) ((element)->next) |
Gets the successor of the passed list element. More... | |
#define | plist_element_get_prev(element) ((element)->prev) |
Gets the predecessor of the passed list element. More... | |
#define | plist_element_get_value(element) ((element)->data) |
Gets the value stored in the passed list element. More... | |
#define | foreach_plist(list, el) for (plist_element_t *el = plist_first(list); el; el = plist_element_get_next(el)) |
Convenience macro to iterate over a plist. More... | |
Functions | |
plist_t * | plist_new (void) |
Creates a new pointer list and initializes it. More... | |
plist_t * | plist_obstack_new (struct obstack *obst) |
Creates a new pointer list and initializes it. More... | |
void | plist_free (plist_t *list) |
Frees the passed pointer list. More... | |
void | plist_insert_back (plist_t *list, void *value) |
Inserts an element at the back of a pointer list. More... | |
void | plist_insert_front (plist_t *list, void *value) |
Inserts an element at the front of a pointer list. More... | |
void | plist_insert_before (plist_t *list, plist_element_t *element, void *value) |
Inserts an element into a pointer list before the specified element, which must be non null. More... | |
void | plist_insert_after (plist_t *list, plist_element_t *element, void *value) |
Inserts an element into a pointer list after the specified element, which must be non null. More... | |
int | plist_has_value (plist_t *list, void *value) |
Checks if list has an element with the given data pointer. More... | |
plist_element_t * | plist_find_value (plist_t *list, void *value) |
Tries to find list element associated to the given data pointer. More... | |
void | plist_erase (plist_t *list, plist_element_t *element) |
Erases the specified element from the pointer list. More... | |
void | plist_clear (plist_t *list) |
Erases all elements from the specified pointer list. More... | |
struct plist |
struct plist_element |
#define foreach_plist | ( | list, | |
el | |||
) | for (plist_element_t *el = plist_first(list); el; el = plist_element_get_next(el)) |
#define plist_count | ( | list | ) | ((list)->element_count) |
#define plist_element_get_next | ( | element | ) | ((element)->next) |
#define plist_element_get_prev | ( | element | ) | ((element)->prev) |
#define plist_element_get_value | ( | element | ) | ((element)->data) |
#define plist_element_has_next | ( | element | ) | ((element)->next != NULL) |
#define plist_element_has_prev | ( | element | ) | ((element)->prev != NULL) |
#define plist_first | ( | list | ) | ((list)->first_element) |
#define plist_last | ( | list | ) | ((list)->last_element) |
void plist_clear | ( | plist_t * | list | ) |
Erases all elements from the specified pointer list.
list | the pointer list that should be cleared. |
void plist_erase | ( | plist_t * | list, |
plist_element_t * | element | ||
) |
Erases the specified element from the pointer list.
list | the pointer list from which the element should be erased. |
element | the list element to erase. This element must be a part of list . |
plist_element_t* plist_find_value | ( | plist_t * | list, |
void * | value | ||
) |
Tries to find list element associated to the given data pointer.
list | the list to check |
value | the data pointer to look for |
void plist_free | ( | plist_t * | list | ) |
Frees the passed pointer list.
After a call to this function all references to the list and any of its elements are invalid.
int plist_has_value | ( | plist_t * | list, |
void * | value | ||
) |
Checks if list has an element with the given data pointer.
list | the list to check |
value | the data pointer to look for |
void plist_insert_after | ( | plist_t * | list, |
plist_element_t * | element, | ||
void * | value | ||
) |
Inserts an element into a pointer list after the specified element, which must be non null.
list | the pointer list to insert the new element into. |
element | the list element after which the new element should be inserted. This element must be a part of list . |
value | the element value to insert. |
void plist_insert_back | ( | plist_t * | list, |
void * | value | ||
) |
Inserts an element at the back of a pointer list.
list | the pointer list to append the new element to. |
value | the element value to append. |
void plist_insert_before | ( | plist_t * | list, |
plist_element_t * | element, | ||
void * | value | ||
) |
Inserts an element into a pointer list before the specified element, which must be non null.
list | the pointer list to insert the new element into. |
element | the list element before which the new element should be inserted. This element must be a part of list . |
value | the element value to insert. |
void plist_insert_front | ( | plist_t * | list, |
void * | value | ||
) |
Inserts an element at the front of a pointer list.
list | the pointer list to prepend the new element to. |
value | the element value to prepend. |
plist_t* plist_new | ( | void | ) |
Creates a new pointer list and initializes it.
plist_t* plist_obstack_new | ( | struct obstack * | obst | ) |
Creates a new pointer list and initializes it.
Uses the given obstack instead of creating one.
obst | The obstack to use |