55 #if !defined(__AMXC_ASTACK_H__)
56 #define __AMXC_ASTACK_H__
Ambiorix array API header file.
amxc_array_it_t * amxc_array_get_last(const amxc_array_t *const array)
Gets the item iterator of the last used item in the array.
size_t amxc_array_size(const amxc_array_t *const array)
Calculates the number of used items in the array.
void * amxc_array_take_last_data(amxc_array_t *const array)
Takes the data pointer from the last used item in the array.
int amxc_array_init(amxc_array_t *const array, const size_t items)
Initializes an array.
bool amxc_array_is_empty(const amxc_array_t *const array)
Checks that the array is empty.
int8_t amxc_array_new(amxc_array_t **array, const size_t items)
Allocates an array.
void amxc_array_clean(amxc_array_t *const array, amxc_array_it_delete_t func)
Removes all items from the array.
void(* amxc_array_it_delete_t)(amxc_array_it_t *it)
Definition of the array item delete callback function.
amxc_array_it_t * amxc_array_append_data(amxc_array_t *const array, void *data)
Adds an item after the last used item in the array.
void amxc_array_delete(amxc_array_t **array, const amxc_array_it_delete_t func)
Frees the previously allocated array.
AMXC_INLINE void amxc_astack_clean(amxc_astack_t *const astack, amxc_astack_it_delete_t func)
Removes all items from the array stack.
AMXC_INLINE bool amxc_astack_is_empty(const amxc_astack_t *const astack)
Checks that the array stack is empty.
AMXC_INLINE int amxc_astack_init(amxc_astack_t *const astack)
Initializes an array stack.
AMXC_INLINE void * amxc_astack_peek(amxc_astack_t *const astack)
Peek the top of the stack, without removing.
AMXC_INLINE void amxc_astack_delete(amxc_astack_t **astack, amxc_astack_it_delete_t func)
Frees the previously allocated array stack.
AMXC_INLINE size_t amxc_astack_size(const amxc_astack_t *const astack)
Calculate the number of items on the stack, expressed in number of items.
AMXC_INLINE int amxc_astack_new(amxc_astack_t **astack)
Allocates an array stack.
amxc_array_t amxc_astack_t
The array stack structure.
amxc_array_it_delete_t amxc_astack_it_delete_t
Definition of the item delete function.
amxc_array_it_t amxc_astack_it_t
The array stack iterator structure.
AMXC_INLINE void * amxc_astack_pop(amxc_astack_t *const astack)
Removes the last added data from the stack.
AMXC_INLINE amxc_astack_it_t * amxc_astack_push(amxc_astack_t *const astack, void *data)
Adds an item to the array stack.
The array iterator structure.