summaryrefslogtreecommitdiff
path: root/devel/bmake/files/lst.h
diff options
context:
space:
mode:
Diffstat (limited to 'devel/bmake/files/lst.h')
-rw-r--r--devel/bmake/files/lst.h47
1 files changed, 18 insertions, 29 deletions
diff --git a/devel/bmake/files/lst.h b/devel/bmake/files/lst.h
index b3efa00e602..d5817473f86 100644
--- a/devel/bmake/files/lst.h
+++ b/devel/bmake/files/lst.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lst.h,v 1.3 2009/09/18 21:27:25 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,19 +92,8 @@
typedef struct List *Lst;
typedef struct ListNode *LstNode;
-typedef ClientData DuplicateProc(ClientData);
-typedef void FreeProc(ClientData);
-
-#define NILLST ((Lst)NIL)
-#define NILLNODE ((LstNode)NIL)
-
-/*
- * NOFREE can be used as the freeProc to Lst_Destroy when the elements are
- * not to be freed.
- * NOCOPY performs similarly when given as the copyProc to Lst_Duplicate.
- */
-#define NOFREE ((FreeProc *)NULL)
-#define NOCOPY ((DuplicateProc *)NULL)
+typedef void *DuplicateProc(void *);
+typedef void FreeProc(void *);
#define LST_CONCNEW 0 /* create new LstNode's when using Lst_Concat */
#define LST_CONCLINK 1 /* relink LstNode's when using Lst_Concat */
@@ -125,17 +114,17 @@ Boolean Lst_IsEmpty(Lst);
* Functions to modify a list
*/
/* Insert an element before another */
-ReturnStatus Lst_InsertBefore(Lst, LstNode, ClientData);
+ReturnStatus Lst_InsertBefore(Lst, LstNode, void *);
/* Insert an element after another */
-ReturnStatus Lst_InsertAfter(Lst, LstNode, ClientData);
+ReturnStatus Lst_InsertAfter(Lst, LstNode, void *);
/* Place an element at the front of a lst. */
-ReturnStatus Lst_AtFront(Lst, ClientData);
+ReturnStatus Lst_AtFront(Lst, void *);
/* Place an element at the end of a lst. */
-ReturnStatus Lst_AtEnd(Lst, ClientData);
+ReturnStatus Lst_AtEnd(Lst, void *);
/* Remove an element */
ReturnStatus Lst_Remove(Lst, LstNode);
/* Replace a node with a new value */
-ReturnStatus Lst_Replace(LstNode, ClientData);
+ReturnStatus Lst_Replace(LstNode, void *);
/* Concatenate two lists */
ReturnStatus Lst_Concat(Lst, Lst, int);
@@ -151,30 +140,30 @@ LstNode Lst_Succ(LstNode);
/* Return predecessor to given element */
LstNode Lst_Prev(LstNode);
/* Get datum from LstNode */
-ClientData Lst_Datum(LstNode);
+void *Lst_Datum(LstNode);
/*
* Functions for entire lists
*/
/* Find an element in a list */
-LstNode Lst_Find(Lst, ClientData, int (*)(ClientData, ClientData));
+LstNode Lst_Find(Lst, const void *, int (*)(const void *, const void *));
/* Find an element starting from somewhere */
-LstNode Lst_FindFrom(Lst, LstNode, ClientData,
- int (*cProc)(ClientData, ClientData));
+LstNode Lst_FindFrom(Lst, LstNode, const void *,
+ int (*cProc)(const void *, const void *));
/*
* See if the given datum is on the list. Returns the LstNode containing
* the datum
*/
-LstNode Lst_Member(Lst, ClientData);
+LstNode Lst_Member(Lst, void *);
/* Apply a function to all elements of a lst */
-int Lst_ForEach(Lst, int (*)(ClientData, ClientData), ClientData);
+int Lst_ForEach(Lst, int (*)(void *, void *), void *);
/*
* Apply a function to all elements of a lst starting from a certain point.
* If the list is circular, the application will wrap around to the
* beginning of the list again.
*/
-int Lst_ForEachFrom(Lst, LstNode, int (*)(ClientData, ClientData),
- ClientData);
+int Lst_ForEachFrom(Lst, LstNode, int (*)(void *, void *),
+ void *);
/*
* these functions are for dealing with a list as a table, of sorts.
* An idea of the "current element" is kept and used by all the functions
@@ -193,8 +182,8 @@ void Lst_Close(Lst);
* for using the list as a queue
*/
/* Place an element at tail of queue */
-ReturnStatus Lst_EnQueue(Lst, ClientData);
+ReturnStatus Lst_EnQueue(Lst, void *);
/* Remove an element from head of queue */
-ClientData Lst_DeQueue(Lst);
+void *Lst_DeQueue(Lst);
#endif /* _LST_H_ */