mav_listNew(3)

NAME
mav_listNew - List management functions.

LEVEL
Maverik Level 1

SYNTAX
MAV_list *mav_listNew(void);

MAV_list *mav_listOrderedNew(void);

void mav_listDelete(MAV_list *l);

void mav_listEmpty(MAV_list *l);

void mav_listItemAdd(MAV_list *l, void *d);

void mav_listItemRmv(MAV_list *l, void *d);

void mav_listPointerReset(MAV_list *l);

void mav_listPointerPush(MAV_list *l);

void mav_listPointerPop(MAV_list *l);

int mav_listItemNext(MAV_list *l, void **d);

int mav_listSize(MAV_list *l);

int mav_listItemContains(MAV_list *l, void *d);

DESCRIPTION
creates a new list, and returns a handle to the list. Lists created using this function do not guarantee to preserve elements in the order in which they were inserted.

Each list created using mav_listNew or mav_listOrderedNew has its own private "list pointer", and a stack on which to save it, which can be used to conveniently step through the list (see mav_listItemNext and related functions). deletes all the nodes in list l. It does not, however, delete any data referenced by nodes in the list. After calling this function, l is undefined. deletes all the nodes from list l. It does not, however, delete any data referenced by nodes in the list. After calling this function, l refers to an empty list, which can be used again. adds a new item list l. The created by mav_listOrderedNew), the new item is appended to the list; If l is a non-ordered list (as created by mav_listNew), the new item may be placed anywhere in the list. searches list l for an item containing data pointer d, and removes the item from the list. sets the list pointer of list l to point to the beginning of the list. This function pushes the list pointer for list l onto its stack. The value of the list pointer is unchanged. pops the list pointer for list l from its stack. returns, in d, the date of the list item currently pointed to by the list pointer of list l. The return value of the function is MAV_TRUE if the data was successfully returned, otherwise MAV_FALSE. The pointer is then moved onto the next item. returns the number of items in list l. searches list l for an item containing data d. The function returns MAV_TRUE if the the item is located, otherwise MAV_FALSE.