Functions



list_append

int list_append (
    List *theList,
    void* theItem
);

Parameters

NameDescription
*theListpointer to the list to add the item to
*theItempointer to void, the item to append.
Result: true on success

list_destroy

Abstract: Removes all items from a list.
void list_destroy (
    List *theList
);

Will traverse all nodes in a list, first free()ing the item, and then removing the node.


list_getID

void *list_getID (
    List *theList,
    long id
);

Parameters

NameDescription
theListpointer to list to search
idnumber of items to traverse into the list (from start)
Result: pointer to item

list_getItem

Abstract: Get an item from the list
void *list_getItem (
    List *theList,
    void* item,
    int (*compare
)(void*,void*));

Parameters

NameDescription
theListpointer to list to search
itemitem to look for (void*)
comparepointer to function to compare item to each node's item. They can be different types, but the compare function must be able to track this itself.
Result: pointer to item

list_new

int list_new (
    List *theList
);

Parameters

NameDescription
*theListpointer to list to be 'newed'
Result: integer, true on success

list_traverse

void* list_traverse (
    List *theList,
    ListNode** current
);

Parameters

NameDescription
theListlist to traverse
currentStatus variable (initially should be NULL)
Result: next item in list

(Last Updated 4/21/2003)