1#ifndef __PX_LINK_LIST_H__
2#define __PX_LINK_LIST_H__
69typedef struct px_link_list_item_s
71 struct px_link_list_item_s *
next;
72 struct px_link_list_item_s *
prev;
78 struct px_link_list_item_s *
first;
79 struct px_link_list_item_s *
last;
94 size_t max_nr_of_items);
struct px_link_list_item_s * next
Pointer to next item in the list.
size_t item_count
Number of items in the list.
size_t items_max
Maximum number of items allowed in list; 0 means no limit.
struct px_link_list_item_s * first
Pointer to first item in the list.
struct px_link_list_item_s * last
Pointer to last item in the list.
struct px_link_list_item_s * prev
Pointer to previous item in the list.
bool px_link_list_is_empty(px_link_list_t *list)
See if the list is empty.
px_link_list_item_t * px_link_list_get_item_next(px_link_list_t *list, px_link_list_item_t *item)
Get a pointer to the next item in the list (after the specified item).
size_t px_link_list_get_item_count(px_link_list_t *list)
Get the number of items in the list.
px_link_list_item_t * px_link_list_remove_item_last(px_link_list_t *list)
Remove last item from the list.
bool px_link_list_insert_item_end(px_link_list_t *list, px_link_list_item_t *item)
Add item to the end of the list.
px_link_list_item_t * px_link_list_get_item_last(px_link_list_t *list)
Get a pointer to the last item in the list.
px_link_list_item_t * px_link_list_get_item_first(px_link_list_t *list)
Get a pointer to the first item in the list.
px_link_list_item_t * px_link_list_remove_item_first(px_link_list_t *list)
Remove first item from the list.
px_link_list_item_t * px_link_list_get_item_prev(px_link_list_t *list, px_link_list_item_t *item)
Get a pointer to the previous item in the list (before the specified item).
bool px_link_list_has_item(px_link_list_t *list, px_link_list_item_t *item)
See if item is in the list.
void px_link_list_init(px_link_list_t *list, size_t max_nr_of_items)
Initialises a linked list structure.
void px_link_list_remove_item(px_link_list_t *list, px_link_list_item_t *item)
Remove item from the list.
bool px_link_list_insert_item_after(px_link_list_t *list, px_link_list_item_t *item, px_link_list_item_t *item_pos)
Insert item after specified item.
bool px_link_list_is_full(px_link_list_t *list)
See if the list is full.
void px_link_list_item_init(px_link_list_t *list, px_link_list_item_t *item)
Initialises a list item.
bool px_link_list_insert_item_start(px_link_list_t *list, px_link_list_item_t *item)
Insert item to the start of the list.
bool px_link_list_insert_item_before(px_link_list_t *list, px_link_list_item_t *item, px_link_list_item_t *item_pos)
Insert item before specified item.
Link structure that must be at the head of each item in the list.