Functions | |
EAPI Evas_List * | evas_list_reverse (Evas_List *list) |
Reverse all the elements in the list. | |
EAPI Evas_List * | evas_list_sort (Evas_List *list, int size, int(*func)(void *, void *)) |
Sort a list according to the ordering func will return. |
Reverse all the elements in the list.
list | The list to reverse |
list
, and reverses the order of all elements in the list, so the last member is now first, and so on.Example:
extern Evas_List *list; list = evas_list_reverse(list);
Sort a list according to the ordering func will return.
list | The list handle to sort | |
size | The length of the list to sort | |
func | A function pointer that can handle comparing the list data nodes |
In the event of a memory allocation failure, It might segv.
Example:
int sort_cb(void *d1, void *d2) { const char *txt = NULL; const char *txt2 = NULL; if(!d1) return(1); if(!d2) return(-1); return(strcmp((const char*)d1, (const char*)d2)); } extern Evas_List *list; list = evas_list_sort(list, evas_list_count(list), sort_cb); if (evas_list_alloc_error()) { fprintf(stderr, "ERROR: Memory is low. List Sorting failed.\n"); exit(-1); }