version 1.12, 2000/06/10 01:32:23 |
version 1.13, 2000/06/10 01:41:05 |
|
|
|
|
typedef struct Lst *Lst; |
typedef struct Lst *Lst; |
typedef struct LstNode *LstNode; |
typedef struct LstNode *LstNode; |
typedef int (*FindProc) __P((ClientData, ClientData)); |
typedef int (*FindProc) __P((void *, void *)); |
typedef void (*SimpleProc) __P((ClientData)); |
typedef void (*SimpleProc) __P((void *)); |
typedef void (*ForEachProc) __P((ClientData, ClientData)); |
typedef void (*ForEachProc) __P((void *, void *)); |
typedef ClientData (*DuplicateProc) __P((ClientData)); |
typedef void * (*DuplicateProc) __P((void *)); |
|
|
/* |
/* |
* NOFREE can be used as the freeProc to Lst_Destroy when the elements are |
* NOFREE can be used as the freeProc to Lst_Destroy when the elements are |
|
|
* Functions to modify a list |
* Functions to modify a list |
*/ |
*/ |
/* Insert an element before another */ |
/* Insert an element before another */ |
void Lst_Insert __P((Lst, LstNode, ClientData)); |
void Lst_Insert __P((Lst, LstNode, void *)); |
/* Insert an element after another */ |
/* Insert an element after another */ |
void Lst_Append __P((Lst, LstNode, ClientData)); |
void Lst_Append __P((Lst, LstNode, void *)); |
/* Place an element at the front of a lst. */ |
/* Place an element at the front of a lst. */ |
void Lst_AtFront __P((Lst, ClientData)); |
void Lst_AtFront __P((Lst, void *)); |
/* Place an element at the end of a lst. */ |
/* Place an element at the end of a lst. */ |
void Lst_AtEnd __P((Lst, ClientData)); |
void Lst_AtEnd __P((Lst, void *)); |
/* Remove an element */ |
/* Remove an element */ |
void Lst_Remove __P((Lst, LstNode)); |
void Lst_Remove __P((Lst, LstNode)); |
/* Replace a node with a new value */ |
/* Replace a node with a new value */ |
void Lst_Replace __P((LstNode, ClientData)); |
void Lst_Replace __P((LstNode, void *)); |
/* Concatenate two lists */ |
/* Concatenate two lists */ |
void Lst_Concat __P((Lst, Lst, int)); |
void Lst_Concat __P((Lst, Lst, int)); |
|
|
|
|
/* Return successor to given element */ |
/* Return successor to given element */ |
LstNode Lst_Succ __P((LstNode)); |
LstNode Lst_Succ __P((LstNode)); |
/* Get datum from LstNode */ |
/* Get datum from LstNode */ |
ClientData Lst_Datum __P((LstNode)); |
void * Lst_Datum __P((LstNode)); |
|
|
/* |
/* |
* Functions for entire lists |
* Functions for entire lists |
|
|
#define Lst_Find(l, cProc, d) Lst_FindFrom(Lst_First(l), cProc, d) |
#define Lst_Find(l, cProc, d) Lst_FindFrom(Lst_First(l), cProc, d) |
|
|
/* Find an element starting from somewhere */ |
/* Find an element starting from somewhere */ |
LstNode Lst_FindFrom __P((LstNode, FindProc, ClientData)); |
LstNode Lst_FindFrom __P((LstNode, FindProc, void *)); |
|
|
/* Apply a function to all elements of a lst */ |
/* Apply a function to all elements of a lst */ |
#define Lst_ForEach(l, proc, d) Lst_ForEachFrom(Lst_First(l), proc, d) |
#define Lst_ForEach(l, proc, d) Lst_ForEachFrom(Lst_First(l), proc, d) |
/* Apply a function to all elements of a lst starting from a certain point. */ |
/* Apply a function to all elements of a lst starting from a certain point. */ |
void Lst_ForEachFrom __P((LstNode, ForEachProc, ClientData)); |
void Lst_ForEachFrom __P((LstNode, ForEachProc, void *)); |
void Lst_Every __P((Lst, SimpleProc)); |
void Lst_Every __P((Lst, SimpleProc)); |
|
|
|
|
|
|
* See if the given datum is on the list. Returns the LstNode containing |
* See if the given datum is on the list. Returns the LstNode containing |
* the datum |
* the datum |
*/ |
*/ |
LstNode Lst_Member __P((Lst, ClientData)); |
LstNode Lst_Member __P((Lst, void *)); |
|
|
/* |
/* |
* these functions are for dealing with a list as a table, of sorts. |
* these functions are for dealing with a list as a table, of sorts. |
|
|
* for using the list as a queue |
* for using the list as a queue |
*/ |
*/ |
/* Place an element at tail of queue */ |
/* Place an element at tail of queue */ |
void Lst_EnQueue __P((Lst, ClientData)); |
void Lst_EnQueue __P((Lst, void *)); |
/* Remove an element from head of queue */ |
/* Remove an element from head of queue */ |
ClientData Lst_DeQueue __P((Lst)); |
void * Lst_DeQueue __P((Lst)); |
|
|
#endif /* _LST_H_ */ |
#endif /* _LST_H_ */ |