libamxc
1.10.3
C Generic Data Containers
|
Data Structures | |
struct | _amxc_array_it |
The array iterator structure. More... | |
Typedefs | |
typedef struct _amxc_array_it | amxc_array_it_t |
The array iterator structure. More... | |
typedef int(* | amxc_array_it_cmp_t) (amxc_array_it_t *it1, amxc_array_it_t *it2) |
Type definition of an array iterator compare callback function. More... | |
Functions | |
amxc_array_it_t * | amxc_array_it_get_next (const amxc_array_it_t *const reference) |
Gets the next used item in the array, starting from the provided array iterator. More... | |
amxc_array_it_t * | amxc_array_it_get_next_free (const amxc_array_it_t *const reference) |
Gets the next free item in the array, starting from the provided array iterator. More... | |
amxc_array_it_t * | amxc_array_it_get_previous (const amxc_array_it_t *const reference) |
Gets the previous used item in the array, starting from the provided array iterator. More... | |
amxc_array_it_t * | amxc_array_it_get_previous_free (const amxc_array_it_t *const reference) |
Gets the previous free item in the array, starting from the provided array iterator. More... | |
unsigned int | amxc_array_it_index (const amxc_array_it_t *const it) |
Gets the index of the iterator in the array. More... | |
AMXC_INLINE void * | amxc_array_it_get_data (const amxc_array_it_t *const it) |
Gets the data pointer of array iterator. More... | |
int | amxc_array_it_set_data (amxc_array_it_t *const it, void *data) |
Sets the data pointer of an array iterator. More... | |
void * | amxc_array_it_take_data (amxc_array_it_t *const it) |
Gets and removes a data pointer from the iterator. More... | |
int | amxc_array_it_swap (amxc_array_it_t *const it1, amxc_array_it_t *const it2) |
Swaps the content of the two array iterators. More... | |
typedef int(* amxc_array_it_cmp_t) (amxc_array_it_t *it1, amxc_array_it_t *it2) |
Type definition of an array iterator compare callback function.
When sorting an array, the items in the array (iterators) must be compared. When calling amxc_array_sort a compare function must be provided using this signature.
it1 | the first array iterator |
it2 | the second array iterator |
Definition at line 213 of file amxc_array.h.
typedef struct _amxc_array_it amxc_array_it_t |
The array iterator structure.
AMXC_INLINE void* amxc_array_it_get_data | ( | const amxc_array_it_t *const | it | ) |
Gets the data pointer of array iterator.
it | pointer to the item iterator |
Definition at line 729 of file amxc_array.h.
amxc_array_it_t* amxc_array_it_get_next | ( | const amxc_array_it_t *const | reference | ) |
Gets the next used item in the array, starting from the provided array iterator.
This function iterates forwards over all items starting from the reference iterator and searches the next used item.
reference | array iterator used as starting point. |
Definition at line 66 of file amxc_array_it.c.
amxc_array_it_t* amxc_array_it_get_next_free | ( | const amxc_array_it_t *const | reference | ) |
Gets the next free item in the array, starting from the provided array iterator.
This function iterates forwards over all items starting from the reference iterator and searches the next free item.
reference | array iterator used as starting point. |
Definition at line 87 of file amxc_array_it.c.
amxc_array_it_t* amxc_array_it_get_previous | ( | const amxc_array_it_t *const | reference | ) |
Gets the previous used item in the array, starting from the provided array iterator.
This function iterates backwards over all items starting from the reference iterator and searches the previous used item.
reference | array iterator used as starting point. |
Definition at line 108 of file amxc_array_it.c.
amxc_array_it_t* amxc_array_it_get_previous_free | ( | const amxc_array_it_t *const | reference | ) |
Gets the previous free item in the array, starting from the provided array iterator.
This function iterates backwards over all items starting from the reference iterator and searches the previous free item.
reference | array iterator used as starting point. |
Definition at line 128 of file amxc_array_it.c.
unsigned int amxc_array_it_index | ( | const amxc_array_it_t *const | it | ) |
Gets the index of the iterator in the array.
it | pointer to the array iterator. |
Definition at line 148 of file amxc_array_it.c.
int amxc_array_it_set_data | ( | amxc_array_it_t *const | it, |
void * | data | ||
) |
Sets the data pointer of an array iterator.
it | pointer to the item iterator |
data | pointer to the data |
Definition at line 158 of file amxc_array_it.c.
int amxc_array_it_swap | ( | amxc_array_it_t *const | it1, |
amxc_array_it_t *const | it2 | ||
) |
Swaps the content of the two array iterators.
The array iterators do not have to belong to the same array.
it1 | pointer to the item iterator 1 |
it2 | pointer to the item iterator 2 |
Definition at line 218 of file amxc_array_it.c.
void* amxc_array_it_take_data | ( | amxc_array_it_t *const | it | ) |
Gets and removes a data pointer from the iterator.
This functions resets the data pointer of the iterator back to NULL.
it | pointer to the item iterator |
Definition at line 183 of file amxc_array_it.c.