eina_inarray_02.c
//Compile with:
//gcc -g eina_inarray_02.c -o eina_inarray_02 `pkg-config --cflags --libs eina`
#include <Eina.h>
int
main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
const char* strings[] = {
"helo", "hera", "starbuck", "kat", "boomer",
"hotdog", "longshot", "jammer", "crashdown", "hardball",
"duck", "racetrack", "apolo", "husker", "freaker",
"skulls", "bulldog", "flat top", "hammerhead", "gonzo"
};
char **str, **str2;
Eina_Inarray *iarr;
int i;
iarr = eina_inarray_new(sizeof(char *), 0);
for (i = 0; i < 20; i++){
str = (char **)(&strings[i]);
eina_inarray_push(iarr, str);
}
printf("Inline array of strings:\n");
printf("string: %s(pointer: %p)\n", *str2, str2);
}
Eina Utility library.
EINA_API void eina_inarray_free(Eina_Inarray *array)
Frees an array and its members.
Definition: eina_inarray.c:355
EINA_API int eina_inarray_push(Eina_Inarray *array, const void *data)
Copies the data as the last member of the array.
Definition: eina_inarray.c:411
#define EINA_INARRAY_FOREACH(array, itr)
Walks through an array linearly from head to tail.
Definition: eina_inarray.h:724
EINA_API Eina_Inarray * eina_inarray_new(unsigned int member_size, unsigned int step)
Creates a new inline array.
Definition: eina_inarray.c:342
EINA_API int eina_shutdown(void)
Shuts down the Eina library.
Definition: eina_main.c:379
EINA_API int eina_init(void)
Initializes the Eina library.
Definition: eina_main.c:291
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339
Inline array structure.
Definition: eina_inarray.h:225