List management routines


Detailed Description

Manage lists of objects in the rank indexes.


Functions

LISTITEM * list_append (LIST *list, void *data)
 Append an item to a list.
LIST * list_create (void)
 Create a new list.
void list_destroy (LIST *list)
 Destroy a list.
void list_shuffle (LIST *list)
 Shuffle a list.


Function Documentation

LISTITEM * list_append ( LIST *  list,
void *  data 
)

Append an item to a list.

Returns:
a pointer to the LISTITEM created and appended, NULL on error, errno
  • ENOMEM memory allocation failed
Parameters:
list  a pointer to the LIST structure to which the item it to be appended
data  a pointer to the data which the new LISTITEM will contain

Definition at line 83 of file list.c.

Referenced by index_insert().

LIST * list_create ( void   ) 

Create a new list.

Returns:
a pointer to the new LIST structure, NULL on error, errno
  • ENOMEM memory allocation failed

Definition at line 51 of file list.c.

Referenced by index_insert().

void list_destroy ( LIST *  list  ) 

Destroy a list.

Parameters:
list  a pointer to the LIST structure to destroy

Definition at line 67 of file list.c.


GridLAB-DTM Version 2.0
An open-source project initiated by the US Department of Energy