=============================================================LIBRARY FUNCTIONS (see Dr.Dobb's Journal, July 1993 for full info)

LLCB *ll_open(LLCB *pList, unsigned usAtomSize, unsigned usAtomCnt); Initializes a linked-list control structure. Must be the first call performed for a linked-list control. usAtom size indicates the size of the atom data, and usAtomCnt indicates the number of atoms to create per block. This call does not allocate any memory; it only initializes the linked-list control structure with the value supplied.

LLST *ll_mklist(LLCB *pListCntl, LLST *pList); Creates a linked list as part of the linked-list control addressed by pListCntl.

void *ll_alloc(LLST *pList); Allocates a new atom in pList. Returns a pointer to atom data area if successful, or NULL if no atoms are available and none can be generated by creating new blocks.

void ll_rmlist(LLST *pList); Closes pList and releases all resources currently allocates by Plist.

void ll_close(LLCB *pListCntl); Closes the linked-list control. Any resources owned by any linked lists associated with the control are released to the system pool.

void *ll_first(LLST *pList); Returns the first atom in pList, or NULL if pList is empty.

void *ll_last(LLST *pList); Returns the last atom in pList, or NULL if pList is empty.

void *ll_next(void *pAtom); Returns the next atom relative to pAtom or NULL if pAtom is the last atom in the list.

void *ll_prev(void *pAtom); Returns the previous atom relative to pAtom, or NULL if pAtom is first on the list.

void ll_swap(LLST *pList, void *pSrcAtom, void *pTrgAtom); Effectively swaps the places of pSrcAtom and pTrgAtom in pList. Both atoms are assumed to be members of pList, and are not checked. This can cause significant problems if atoms from two different lists are swapped.

void ll_mvbefore(LLST *pList, void *pSrcAtom, void *pTrgAtom); Moves pSrcAtom before pTrgAtom in pList. Both atoms are assumed to be members of pList and are not checked.

void ll_mvafter(LLST *pList , void *pSrcAtom, void *pTrgAtom); Moves pSrcAtom after pTrgAtom in pList. Both atoms are assumed to be members of pList and are not checked.