Adding elements to Eina_List example
//Compile with:
//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina`
#include <stdio.h>
#include <Eina.h>
int
main(int argc, char **argv)
{
(void)argc;
(void)argv;
Eina_List *list = NULL;
void *list_data;
list = eina_list_append(list, "tigh");
list = eina_list_append(list, "adar");
list = eina_list_append(list, "baltar");
list = eina_list_append(list, "roslin");
EINA_LIST_FOREACH(list, l, list_data)
printf("%s\n", (char*)list_data);
printf("\n");
l = eina_list_nth_list(list, 1);
list = eina_list_append_relative_list(list, "cain", l);
list = eina_list_append_relative(list, "zarek", "cain");
list = eina_list_prepend(list, "adama");
list = eina_list_prepend_relative(list, "gaeta", "cain");
list = eina_list_prepend_relative_list(list, "lampkin", l);
EINA_LIST_FOREACH(list, l, list_data)
printf("%s\n", (char*)list_data);
return 0;
}
Eina Utility library.
EINA_API Eina_List * eina_list_append_relative(Eina_List *list, const void *data, const void *relative)
Inserts the given data into the given linked list after the specified data.
Definition: eina_list.c:649
EINA_API Eina_List * eina_list_prepend(Eina_List *list, const void *data)
Prepends the given data to the given linked list.
Definition: eina_list.c:618
EINA_API Eina_List * eina_list_nth_list(const Eina_List *list, unsigned int n)
Gets the nth member's list node in a list.
Definition: eina_list.c:1006
EINA_API Eina_List * eina_list_append(Eina_List *list, const void *data)
Appends the given data to the given linked list.
Definition: eina_list.c:584
EINA_API Eina_List * eina_list_prepend_relative(Eina_List *list, const void *data, const void *relative)
Prepends a data pointer to a linked list before the specified member.
Definition: eina_list.c:704
EINA_API Eina_List * eina_list_free(Eina_List *list)
Frees an entire list and all the nodes, ignoring the data contained.
Definition: eina_list.c:823
EINA_API Eina_List * eina_list_append_relative_list(Eina_List *list, const void *data, Eina_List *relative)
Appends a list node to a linked list after the specified member.
Definition: eina_list.c:670
EINA_API Eina_List * eina_list_prepend_relative_list(Eina_List *list, const void *data, Eina_List *relative)
Prepends a list node to a linked list before the specified member.
Definition: eina_list.c:724
#define EINA_LIST_FOREACH(list, l, _data)
Definition for the macro to iterate over a list.
Definition: eina_list.h:1415
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
Type for a generic double linked list.
Definition: eina_list.h:318