/* * Definition of a C++ interface to a plain C generic list, derived from * ./list++.h, q.v. Note well -- this list differs significantly from * ./list.h, which is used for run-time list values in the interpreter. This * "plain C" list is the ANSI C parallel to the C++ list defined in ./list++.h. * The two list types could be merged, but for historical reason they are not * at this point. So be it for now. * * List elements have the following opaque structure, as documented further in * list++.h: * * PlainCListElem Data; * List Next; * List Prev; * */ #ifndef plainclistIncluded #define plainclistIncluded typedef char *PlainCListElem; typedef struct PlainCAuxListElemStruct { char *Data; struct Sym *AuxData; } *PlainCAuxListElem; typedef struct PlainCListItemStruct { PlainCListElem Data; struct PlainCListItemStruct *Next; struct PlainCListItemStruct *Prev; } *PlainCListItem; typedef struct PlainCListStruct { PlainCListItem First; PlainCListItem Last; int Size; PlainCListItem EnumState; } *PlainCList; /* * Visible functions. */ extern "C" PlainCList NewCList(); extern "C" void PutCList(PlainCList l, PlainCListElem e); extern "C" PlainCListElem PullCList(PlainCList l); extern "C" void PushCList(PlainCList l, PlainCListElem e); extern "C" PlainCListElem PopCList(PlainCList l); extern "C" PlainCListElem GetNthCList(PlainCList l, int n); extern "C" PlainCListElem DelNthCList(PlainCList l, int n); extern "C" int CListLen(PlainCList l); extern "C" PlainCListElem EnumCList(PlainCList l); extern "C" void ResetCListEnum(PlainCList l); extern "C" void PrintCList(PlainCList l); #endif