55 #if !defined(__AMXC_LSTACK_H__)
56 #define __AMXC_LSTACK_H__
Ambiorix linked list API header file.
int amxc_llist_it_init(amxc_llist_it_t *const it)
Initializes a linked list iterator.
void amxc_llist_delete(amxc_llist_t **llist, amxc_llist_it_delete_t func)
Frees the previously allocated linked list.
AMXC_INLINE amxc_llist_it_t * amxc_llist_take_last(amxc_llist_t *const llist)
Removes the last item from the linked list.
size_t amxc_llist_size(const amxc_llist_t *const llist)
Calculates the size of the linked list.
int amxc_llist_new(amxc_llist_t **llist)
Allocates a linked list.
int amxc_llist_append(amxc_llist_t *const llist, amxc_llist_it_t *const it)
Adds an item to the end of the linked list.
int amxc_llist_init(amxc_llist_t *const llist)
Initializes a linked list.
bool amxc_llist_is_empty(const amxc_llist_t *const llist)
Checks that the linked list is empty.
void amxc_llist_clean(amxc_llist_t *const llist, amxc_llist_it_delete_t func)
Removes all items from the linked list.
void(* amxc_llist_it_delete_t)(amxc_llist_it_t *it)
Definition of the linked list item delete function.
AMXC_INLINE amxc_llist_it_t * amxc_llist_get_last(const amxc_llist_t *const llist)
Gets the last item of the linked list.
AMXC_INLINE void amxc_lstack_clean(amxc_lstack_t *const lstack, amxc_lstack_it_delete_t func)
Removes all items from the linked stack.
AMXC_INLINE int amxc_lstack_init(amxc_lstack_t *const lstack)
Initializes a linked stack.
AMXC_INLINE int amxc_lstack_push(amxc_lstack_t *const lstack, amxc_lstack_it_t *const it)
Adds an item to the linked stack.
AMXC_INLINE amxc_lstack_it_t * amxc_lstack_pop(amxc_lstack_t *const lstack)
Removes the last added item from the stack.
AMXC_INLINE size_t amxc_lstack_size(const amxc_lstack_t *const lstack)
Calculates the size of the stack, expressed in number of items.
AMXC_INLINE amxc_lstack_it_t * amxc_lstack_peek(amxc_lstack_t *const lstack)
Peeks the top of the stack, without removing.
amxc_llist_it_t amxc_lstack_it_t
The linked stack iterator structure.
AMXC_INLINE int amxc_lstack_new(amxc_lstack_t **lstack)
Allocates a linked stack.
AMXC_INLINE int amxc_lstack_it_init(amxc_lstack_it_t *const it)
Initializes a linked stack iterator.
amxc_llist_it_delete_t amxc_lstack_it_delete_t
Definition of the item delete function.
AMXC_INLINE bool amxc_lstack_is_empty(const amxc_lstack_t *const lstack)
Checks if the linked stack is empty.
amxc_llist_t amxc_lstack_t
The linked stack structure.
AMXC_INLINE void amxc_lstack_delete(amxc_lstack_t **lstack, amxc_lstack_it_delete_t func)
Frees the previously allocated linked stack.
The linked list iterator structure.
The linked list structure.
static amxc_htable_it_t it[2000]