Linked List Find Functions

Functions that find specified data in a linked list. More...

Functions

EAPI void * evas_list_find (Evas_List *list, const void *data)
 Find a member of a list and return the member.
EAPI Evas_Listevas_list_find_list (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 (Evas_List *list, int n)
 Get the nth member's data pointer in a list.
EAPI Evas_Listevas_list_nth_list (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 ( Evas_List list,
const void *  data 
)

Find a member of a list and return the member.

Parameters:
list The list handle to search for data
data The data pointer to find in the list list
Returns:
The found member data pointer
A call to this function will search the list 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);
   }

EAPI Evas_List* evas_list_find_list ( Evas_List list,
const void *  data 
)

Find a member of a list and return the list node containing that member.

Parameters:
list The list handle to search for data
data The data pointer to find in the list list
Returns:
The found members list node
A call to this function will search the list 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);
   }

EAPI void* evas_list_nth ( Evas_List list,
int  n 
)

Get the nth member's data pointer in a list.

Parameters:
list The list to get member number n from
n The number of the element (0 being the first)
Returns:
The data pointer stored in the specified element
This function returns the data pointer of element number 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);

EAPI Evas_List* evas_list_nth_list ( Evas_List list,
int  n 
)

Get the nth member's list node in a list.

Parameters:
list The list to get member number n from
n The number of the element (0 being the first)
Returns:
The list node stored in the numbered element
This function returns the list node of element number 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);