31 #define GEN_ARRAY_SIZE_INCREMENT (50)
51 for (i=0; i<size; i++) a->
array[i] = (
void*) NULL;
62 a->
array = (
void**) realloc(a->
array, nsize*
sizeof(
void*));
64 for (i=a->
size; i<nsize; i++)
65 a->
array[i] = (
void*) NULL;
80 for (i=0; i<a->
size; i++)
101 a->
array[i] = (
void *)NULL;
154 return strcmp(* (
char **) a1, * (
char **) a2);
201 bool first_iteration =
true;
205 if (! first_iteration)
208 first_iteration =
false;
void const char const char const int
void gen_array_sort_with_cmp(gen_array_t a, int(*cmp)(const void *, const void *))
size_t gen_array_nitems(const gen_array_t a)
void gen_array_full_free(gen_array_t a)
size_t gen_array_size(const gen_array_t a)
gen_array_t gen_array_make(size_t size)
declarations...
string string_array_join(gen_array_t array, string separator)
Join a string array with a string separator.
void ** gen_array_pointer(const gen_array_t a)
Observers...
void gen_array_addto(gen_array_t a, size_t i, void *what)
void gen_array_dupaddto(gen_array_t a, size_t i, void *what)
list list_from_gen_array(gen_array_t a)
void gen_array_sort(gen_array_t a)
gen_array_t gen_array_from_list(list ls)
void gen_array_remove(gen_array_t a, size_t i)
void * gen_array_item(const gen_array_t a, size_t i)
static void gen_array_resize(gen_array_t a, int min)
void gen_array_append(gen_array_t a, void *what)
static int gen_array_cmp(const void *a1, const void *a2)
Sort: assumes that the items are the first ones.
#define GEN_ARRAY_SIZE_INCREMENT
void gen_array_free(gen_array_t a)
void gen_array_dupappend(gen_array_t a, void *what)
#define NIL
The empty list (nil in Lisp)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
void gen_free_area(void **p, int size)
free an area.
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
#define GEN_ARRAY_FOREACH(type, s, array)
struct _gen_array_chunk_t * gen_array_t
#define message_assert(msg, ex)
string concatenate(const char *,...)
Return the concatenation of the given strings.
The structure used to build lists in NewGen.