/********* * * WARNING: Any structural changes made here need to be reflected in list.h, * and vice versa. This file was once a sym link to list.h, but it's now a * copy so it will check in with cvs normally. * */ /* * Definition of a generic list. The visible list functions are: * * List NewList() * PutList(List l, ListElem e) * ListElem PullList(List l) * PushList(List l, ListElem e) * ListElem PopList(List l) * ListElem GetNthList(List l, int n) * ListElem DelNthList(List l, int n) * int ListLen(List l) * ListElem EnumList(List l) * ResetListEnum(l) * PrintList(list l) * * * List elements have the following opaque structure: * * ListElem Data; * List Next; * List Prev; * */ #ifndef listIncluded #define listIncluded #include "std-macros.h" typedef char *ListElem; typedef struct AuxListElemStruct { char *Data; struct Sym *AuxData; } *AuxListElem; typedef struct ListItemStruct { ListElem Data; struct ListItemStruct *Next; struct ListItemStruct *Prev; } *ListItem; typedef struct ListStruct { ListItem First; ListItem Last; int Size; ListItem EnumState; } *List; /* * Visible functions. */ List NewList(); void DelList(/* List l */); void DelListNodesOnly(/* List l */); void PutList(/* List l, ListElem e */); ListElem PullList(/* List l */); void PushList(/* List l, ListElem e */); ListElem PopList(/* List l */); ListElem GetNthList(/* List l, int n */); ListElem DelNthList(/* List l, int n */); bool InList(/* List l, ListElem e */); int ListLen(/* List l */); ListElem EnumList(/* List l */); void ResetListEnum(/* l */); void PrintList(/* list l */); AuxListElem NewAuxListElem(/* char *name, struct Sym *sym */); #endif