Linked List Find Functions
Functions that find specified data in a linked list. More...Functions | |
| EAPI void * | evas_list_find (const Evas_List *list, const void *data) |
| Find a member of a list and return the member. | |
| EAPI Evas_List * | evas_list_find_list (const Evas_List *list, const void *data) |
| Find a member of a list and return the list node containing that member. | |
| EAPI void * | evas_list_nth (const Evas_List *list, int n) |
| Get the nth member's data pointer in a list. | |
| EAPI Evas_List * | evas_list_nth_list (const Evas_List *list, int n) |
| Get the nth member's list node in a list. | |
Detailed Description
Functions that find specified data in a linked list.
Function Documentation
| EAPI void* evas_list_find | ( | const Evas_List * | list, | |
| const void * | data | |||
| ) |
Find a member of a list and return the member.
- Parameters:
-
list The list handle to search for datadata The data pointer to find in the list list
- Returns:
- The found member data pointer
list from beginning to end for the first member whose data pointer is data. If it is found, data will be returned, otherwise NULL will be returned.Example:
extern Evas_List *list; extern void *my_data; if (evas_list_find(list, my_data) == my_data) { printf("Found member %p\n", my_data); }
References _Evas_List::data, and _Evas_List::next.
Referenced by evas_event_feed_mouse_in(), evas_event_feed_mouse_move(), evas_event_feed_mouse_up(), and evas_object_layer_set().
Find a member of a list and return the list node containing that member.
- Parameters:
-
list The list handle to search for datadata The data pointer to find in the list list
- Returns:
- The found members list node
list from beginning to end for the first member whose data pointer is data. If it is found, the list node containing the specified member will be returned, otherwise NULL will be returned.Example:
extern Evas_List *list; extern void *my_data; Evas_List *found_node; found_node = evas_list_find_list(list, my_data); if (found_node) { printf("Found member %p\n", found_node->data); }
References _Evas_List::data, and _Evas_List::next.
| EAPI void* evas_list_nth | ( | const Evas_List * | list, | |
| int | n | |||
| ) |
Get the nth member's data pointer in a list.
- Parameters:
-
list The list to get member number nfromn The number of the element (0 being the first)
- Returns:
- The data pointer stored in the specified element
n, in the list list. The first element in the array is element number 0. If the element number n does not exist, NULL will be returned.Example:
extern Evas_List *list; extern int number; void *data; data = evas_list_nth(list, number); if (data) printf("Element number %i has data %p\n", number, data);
References _Evas_List::data, and evas_list_nth_list().
Get the nth member's list node in a list.
- Parameters:
-
list The list to get member number nfromn The number of the element (0 being the first)
- Returns:
- The list node stored in the numbered element
n, in the list list. The first element in the array is element number 0. If the element number n does not exist, NULL will be returned.Example:
extern Evas_List *list; extern int number; Evas_List *nth_list; nth_list = evas_list_nth_list(list, number); if (nth_list) printf("Element number %i has data %p\n", number, nth_list->data);
References _Evas_List::accounting, _Evas_List::next, and _Evas_List::prev.
Referenced by evas_list_nth().