73 pos = (reference -
array->buffer);
75 while(pos < array->items && !
array->buffer[pos].data) {
79 if(pos < array->items) {
94 pos = (reference -
array->buffer);
96 while(pos < array->items &&
array->buffer[pos].data != NULL) {
100 if(pos < array->items) {
115 pos = (reference -
array->buffer);
116 while(pos > 0 && !
array->buffer[pos - 1].data) {
135 pos = (reference -
array->buffer);
136 while(pos > 0 &&
array->buffer[pos - 1].data != NULL) {
140 if((pos > 0) && !
array->buffer[pos - 1].data) {
152 index =
it -
it->array->buffer;
160 unsigned int index = 0;
169 if((index < array->first_used) ||
170 ((
array->first_used == 0) && (
array->buffer[0].data == NULL))) {
171 array->first_used = index;
173 if(index >
array->last_used) {
174 array->last_used = index;
185 unsigned int index = 0;
197 if(index ==
array->first_used) {
200 array->first_used = 0;
205 if(index ==
array->last_used) {
208 array->last_used = 0;
Ambiorix array API header file.
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.
int amxc_array_it_set_data(amxc_array_it_t *const it, void *data)
Sets the data pointer of an array iterator.
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.
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.
void * amxc_array_it_take_data(amxc_array_it_t *it)
Gets and removes a data pointer from the iterator.
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.
unsigned int amxc_array_it_index(const amxc_array_it_t *const it)
Gets the index of the iterator in the array.
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 iterator structure.
static unsigned int array[2006]
static amxc_htable_it_t it[2000]
static amxc_llist_it_t it2
static amxc_llist_it_t it1