.TH List 3
.UC 4
.SH NAME
list \- procedures for managing lisp style lists in libmagicutils.a

.SH SYNOPSIS
.nf
.B #include "magic.h"
.B #include "list.h"
.PP
.B "LIST_ADD(item,list)"
.PP
.B "LIST_FIRST(list)"
.PP
.B "LIST_TAIL(list)"
.PP
.B "bool ListContainsP(element, list)"
.B "ClientData element;"
.B "List *list;"
.PP
.B "Void ListDealloc(list)"
.B "List *list;"
.PP
.B "Void ListDeallocC(list)"
.B "List *list;"
.PP
.B "int ListLength(list)"
.B "List *list;"
.PP
.B "ClientData ListPop(listPP)"
.B "List **listPP;"
.PP
.B "List *ListReverse(list)"
.B "List *list"
.PP
.SH DESCRIPTION
These macros and procedures permit the implementation of linked lists 
of arbitrary things.  The lists are lisp like, i.e., list pointers 
are in separate structures rather than in the strucs being linked.  Macros
are distinguished from procedues by names that are all upper-case.
.PP
.I LIST_ADD(i,l)
adds an item to the front of a list.
.PP
.I LIST_COPY(l,lnew)
creates a copy of a list
.PP
.I LIST_FIRST
references the first item on the list.
.PP
.I LIST_TAIL(l)
references the sublist consisting of all but the first item of the list.
.PP
.I ListContainsP
returns \fBTRUE\fR in the specified item is contained in the list.
.PP
.I int ListLength
returns the length of the list.
.PP
.I Void ListDealloc
reclaims a list (but not its contents).
.PP
.I Void ListDeallocC
reclaims a list /fIand/fR its contents.
.PP
.I ListPop
deletes the first item from the list, and returns it (the item).
.PP
.I List *ListReverse
creates and returns a reversed copy of a list.
.SH SEE ALSO
magicutils\|(3)