Dec 242017
 
ANSI C Source code for Garyl Hester's linked-list tool kit and library.

Full Description of File


Garyl Hester's linked-list tool kit. C source
code from Dr.Dobb's Journal, July 1993.


File GHLNKLST.ZIP from The Programmer’s Corner in
Category C Source Code
ANSI C Source code for Garyl Hester’s linked-list tool kit and library.
File Name File Size Zip Size Zip Type
FILE_ID.DIZ 88 86 deflated
LL.H 4936 1401 deflated
LL.MAK 1114 441 deflated
LLBASE.C 7072 2062 deflated
LLINS.C 2035 592 deflated
LLPRIM.C 2696 899 deflated
LLSORT.C 1275 501 deflated
LLSWAP.C 1766 543 deflated
LLTEST.C 4004 1262 deflated
MAKEFILE 693 326 deflated
MAKEFILE.TCC 888 404 deflated
README 2890 1049 deflated

Download File GHLNKLST.ZIP Here

Contents of the README file


Garyl Hester's linked-list tool kit. C source
code from Dr.Dobb's Journal, July 1993.
Garyl Hester's linked-list tool kit.
C source code from Dr.Dobb's Journal, July 1993.

Garly Hester can be reached at Compuserve 76507,1503
or through:
Dr.Dobb's Journal
411 Borel Ave.
San Mateo, CA 94402

1-415-358-9500

=============================================================
There are three makefiles included here:

1. Makefile ............ Unix makefile
2. makefile.tcc ........ Borland Turbo C makefile
3. ll.mak .............. Microsoft C makefile

Choose your poison ...

=============================================================
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_free(LLST *pList, void *pAtom);
Returns and atom to the free list.

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.




 December 24, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)