2 ** libCxClient - Citadel/UX Extensible Client API
3 ** Copyright (c) 2000, Flaming Sword Productions
4 ** Copyright (c) 2001, The Citadel/UX Consortium
9 ** Last Revision: 2000-10-15
10 ** Description: Brian's Linked-list Manager
13 ** Based loosely upon the ideas expressed in Jesse Sweetland's
24 ** CxLiInsert(): Insert a new string into the linked-list.
27 ** (CXLIST)li: The list we're inserting into.
28 ** (char *)s: The string (or data) we are inserting into @li.
33 CXLIST CxLlInsert(CXLIST li, char *s) {
37 DPF((DFA,"List @0x%08x",li));
38 DPF((DFA,"Inserting \"%s\"",s));
40 for(loop = 0; loop < 5; loop++ ) {
41 DPF((DFA,"malloc safety loop, iteration %d",loop));
42 if((new = (CXLIST) CxMalloc( sizeof( CXLIST ) ))) break;
47 new->data = (char *) CxMalloc( strlen( s ) +1 );
53 while( p->next ) p = p->next;
64 ** CxLlRemove(): Remove the n'th item from the linked-list. [SKEL]
67 ** (CXLIST)li: The list we are altering.
68 ** (int)d: The item number to remove.
73 CXLIST CxLlRemove(CXLIST li, unsigned int d) {
78 ** CxLlFlush(): Flush all of a list's memory. (Erases the entire
82 ** (CXLIST)li: The list to be nuked.
87 CXLIST CxLlFlush(CXLIST li) {
90 DPF((DFA,"Clearing list @0x%08x",li));
100 ** This function should _ALWAYS_ eliminate the list...
101 ** Therefore it's not necessary to return @li.