libFirm 1.20
|
Simple, non circular, double linked pointer list. Created because the properties of the standard circular list were not very well suited for the interference graph implementation. This list uses an obstack and a free-list to efficiently manage its elements. More...
Go to the source code of this file.
Data Structures | |
struct | plist_t |
The plist data type. More... | |
struct | plist_element_t |
An element in the pointer list. More... | |
Defines | |
#define | plist_count(list) ((list)->element_count) |
Returns the number of elements in a pointer list. | |
#define | plist_first(list) ((list)->first_element) |
Returns the first element of a pointer list. | |
#define | plist_last(list) ((list)->last_element) |
Returns the last element of a pointer list. | |
#define | plist_element_has_next(element) ((element)->next != NULL) |
Checks whether a pointer list element has a successor or not. | |
#define | plist_element_has_prev(element) ((element)->prev != NULL) |
Checks whether a pointer list element has a predecessor or not. | |
#define | plist_element_get_next(element) ((element)->next) |
Gets the successor of the passed list element. | |
#define | plist_element_get_prev(element) ((element)->prev) |
Gets the predecessor of the passed list element. | |
#define | plist_element_get_value(element) ((element)->data) |
Gets the value stored in the passed list element. | |
#define | foreach_plist(list, el) for (el = plist_first(list); el; el = plist_element_get_next(el)) |
Convenience macro to iterate over a plist. | |
Functions | |
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. | |
void | plist_free (plist_t *list) |
Frees the passed pointer list. | |
void | plist_insert_back (plist_t *list, void *value) |
Inserts an element at the back of a pointer list. | |
void | plist_insert_front (plist_t *list, void *value) |
Inserts an element at the front of a pointer list. | |
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. | |
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. | |
int | plist_has_value (plist_t *list, void *value) |
Checks if list has an element with the given data pointer. | |
plist_element_t * | plist_find_value (plist_t *list, void *value) |
Tries to find list element associated to the given data pointer. | |
void | plist_erase (plist_t *list, plist_element_t *element) |
Erases the specified element from the pointer list. | |
void | plist_clear (plist_t *list) |
Erases all elements from the specified pointer list. |
Simple, non circular, double linked pointer list. Created because the properties of the standard circular list were not very well suited for the interference graph implementation. This list uses an obstack and a free-list to efficiently manage its elements.
Definition in file plist.h.
#define foreach_plist | ( | list, | |
el | |||
) | for (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 |