Download

Support

Linked List General Functions

Miscellaneous functions that work on linked lists. More...

Functions

EAPI void * evas_list_data (const Evas_List *list)
 Get the list node data member.
EAPI int evas_list_count (const Evas_List *list)
 Get the count of the number of items in a list.
EAPI int evas_list_alloc_error (void)
 Return the memory allocation failure flag after any operation needin allocation.

Detailed Description

Miscellaneous functions that work on linked lists.


Function Documentation

EAPI int evas_list_alloc_error ( void   ) 

Return the memory allocation failure flag after any operation needin allocation.

Returns:
The state of the allocation flag
This function returns the state of the memory allocation flag. This flag is set if memory allocations during evas_list_append(), evas_list_prepend(), evas_list_append_relative(), or evas_list_prepend_relative() fail. If they do fail, 1 will be returned, otherwise 0 will be returned. The flag will remain in its current state until the next call that requires allocation is called, and is then reset.

Example:

 Evas_List *list = NULL;
 extern void *my_data;

 list = evas_list_append(list, my_data);
 if (evas_list_alloc_error())
   {
     fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
     exit(-1);
   }

EAPI int evas_list_count ( const Evas_List list  ) 

Get the count of the number of items in a list.

Parameters:
list The list whose count to return
Returns:
The number of members in the list list
This function returns how many members in the specified list: list. If the list is empty (NULL), 0 is returned.

NB: This is an order-1 operation and takes the same tiem regardless of the length of the list.

Example:

 extern Evas_List *list;

 printf("The list has %i members\n", evas_list_count(list));

References _Evas_List::accounting.

EAPI void* evas_list_data ( const Evas_List list  ) 

Get the list node data member.

Parameters:
list The list node to get the data member of
Returns:
The data member from the list node list
This function returns the data member of the specified list node list. It is equivalent to list->data.

Example:

 extern Evas_List *list;
 Evas_List *l;

 printf("The list:\n");
 for (l = list; l; l = evas_list_next(l))
   {
     printf("%p\n", evas_list_data(l));
   }

References _Evas_List::data.


Copyright © Enlightenment.org

Evas Documentation Generated: Thu Sep 25 12:23:33 2008