List management routines
[GridLAB-D Core]


Detailed Description

Manage lists of objects in the rank indexes.


Classes

struct  s_list
struct  s_listitem

Functions

LISTITEMlist_append (LIST *list, void *data)
 Append an item to a list.
LISTlist_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 82 of file list.c.

References s_list::first, s_list::last, s_listitem::next, and s_list::size.

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 50 of file list.c.

References s_list::first, s_list::last, and s_list::size.

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 66 of file list.c.

References s_list::first, s_listitem::next, and s_list::size.


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