Tizen Native API
Reordering Eina_List elements

If you don't know how to create lists see Adding elements to Eina_List.

We start out with code that should be familiar by now:

You can move elements around in a list using eina_list_move() or using eina_list_promote_list() and eina_list_demote_list() which move a list node to the head and end of the list respectevely:

Removing elements from a list can be done with ease:

To replace an element in the list it is not necessary to remove it and then add with the new value, it is possible to just change the value of a node:

We will now take a peek to see if the list still has the right number of elements:

Now that the list is in alphabetical order let's create a copy of it in reverse order and print every element to see if worked as expected:

Note:
Always remember to free your iterators when done using them.

And as always release memory and shutdown eina before ending:

The full source code can be found on the examples folder on the eina_list_03.c file.