aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/lst.h
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2004-12-07 13:49:13 +0000
committerHartmut Brandt <harti@FreeBSD.org>2004-12-07 13:49:13 +0000
commitbf1ead06083208b33eb36ed779e5ece8bcb681b9 (patch)
tree56920a7ef5b24bec1022ce1711332864a400679e /usr.bin/make/lst.h
parentb82f920f8e385ddce2851c04b3dd314183b13612 (diff)
downloadsrc-bf1ead06083208b33eb36ed779e5ece8bcb681b9.tar.gz
src-bf1ead06083208b33eb36ed779e5ece8bcb681b9.zip
Typedefs of pointers to structs are evil. Make Lst and LstNode typedef of
the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files
Notes
Notes: svn path=/head/; revision=138512
Diffstat (limited to 'usr.bin/make/lst.h')
-rw-r--r--usr.bin/make/lst.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h
index b3ac17662215..a8bc102a55ab 100644
--- a/usr.bin/make/lst.h
+++ b/usr.bin/make/lst.h
@@ -62,7 +62,7 @@ struct LstNode {
int flags:8; /* Node status flags */
void *datum; /* datum associated with this element */
};
-typedef struct LstNode *LstNode;
+typedef struct LstNode LstNode;
/*
* Flags required for synchronization
@@ -77,19 +77,19 @@ typedef enum {
* The list itself
*/
struct Lst {
- LstNode firstPtr; /* first node in list */
- LstNode lastPtr; /* last node in list */
+ LstNode *firstPtr; /* first node in list */
+ LstNode *lastPtr; /* last node in list */
/*
* fields for sequential access
*/
LstWhere atEnd; /* Where in the list the last access was */
Boolean isOpen; /* true if list has been Lst_Open'ed */
- LstNode curPtr; /* current node, if open. NULL if
+ LstNode *curPtr; /* current node, if open. NULL if
* *just* opened */
- LstNode prevPtr; /* Previous node, if open. Used by
+ LstNode *prevPtr; /* Previous node, if open. Used by
* Lst_Remove */
};
-typedef struct Lst *Lst;
+typedef struct Lst Lst;
typedef int CompareProc(void *, void *);
typedef int DoProc(void *, void *);
@@ -111,30 +111,30 @@ typedef void FreeProc(void *);
* Creation/destruction functions
*/
/* Create a new list */
-Lst Lst_Init(void);
+Lst *Lst_Init(void);
/* Duplicate an existing list */
-Lst Lst_Duplicate(Lst, DuplicateProc *);
+Lst *Lst_Duplicate(Lst *, DuplicateProc *);
/* Destroy an old one */
-void Lst_Destroy(Lst, FreeProc *);
+void Lst_Destroy(Lst *, FreeProc *);
/*
* Functions to modify a list
*/
/* Insert an element before another */
-ReturnStatus Lst_Insert(Lst, LstNode, void *);
+ReturnStatus Lst_Insert(Lst *, LstNode *, void *);
/* Insert an element after another */
-ReturnStatus Lst_Append(Lst, LstNode, void *);
+ReturnStatus Lst_Append(Lst *, LstNode *, void *);
/* Place an element at the front of a lst. */
#define Lst_AtFront(LST, D) (Lst_Insert((LST), Lst_First(LST), (D)))
/* Place an element at the end of a lst. */
#define Lst_AtEnd(LST, D) (Lst_Append((LST), Lst_Last(LST), (D)))
/* Remove an element */
-ReturnStatus Lst_Remove(Lst, LstNode);
+ReturnStatus Lst_Remove(Lst *, LstNode *);
/* Replace a node with a new value */
#define Lst_Replace(NODE, D) (((NODE) == NULL) ? FAILURE : \
(((NODE)->datum = (D)), SUCCESS))
/* Concatenate two lists */
-ReturnStatus Lst_Concat(Lst, Lst, int);
+ReturnStatus Lst_Concat(Lst *, Lst *, int);
/*
* Node-specific functions
@@ -156,14 +156,14 @@ ReturnStatus Lst_Concat(Lst, Lst, int);
/* Find an element in a list */
#define Lst_Find(LST, D, FN) (Lst_FindFrom((LST), Lst_First(LST), (D), (FN)))
/* Find an element starting from somewhere */
-LstNode Lst_FindFrom(Lst, LstNode, void *, CompareProc *);
+LstNode *Lst_FindFrom(Lst *, LstNode *, void *, CompareProc *);
/*
* See if the given datum is on the list. Returns the LstNode containing
* the datum
*/
-LstNode Lst_Member(Lst, void *);
+LstNode *Lst_Member(Lst *, void *);
/* Apply a function to all elements of a lst */
-void Lst_ForEach(Lst, DoProc *, void *);
+void Lst_ForEach(Lst *, DoProc *, void *);
#define Lst_ForEach(LST, FN, D) (Lst_ForEachFrom((LST), Lst_First(LST), \
(FN), (D)))
/*
@@ -171,20 +171,20 @@ void Lst_ForEach(Lst, DoProc *, void *);
* If the list is circular, the application will wrap around to the
* beginning of the list again.
*/
-void Lst_ForEachFrom(Lst, LstNode, DoProc *, void *);
+void Lst_ForEachFrom(Lst *, LstNode *, DoProc *, 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
* between Lst_Open() and Lst_Close().
*/
/* Open the list */
-ReturnStatus Lst_Open(Lst);
+ReturnStatus Lst_Open(Lst *);
/* Next element please */
-LstNode Lst_Next(Lst);
+LstNode *Lst_Next(Lst *);
/* Done yet? */
-Boolean Lst_IsAtEnd(Lst);
+Boolean Lst_IsAtEnd(Lst *);
/* Finish table access */
-void Lst_Close(Lst);
+void Lst_Close(Lst *);
/*
* for using the list as a queue
@@ -194,7 +194,7 @@ void Lst_Close(Lst);
? Lst_Append((LST), Lst_Last(LST), (D)) \
: FAILURE)
/* Remove an element from head of queue */
-void * Lst_DeQueue(Lst);
+void *Lst_DeQueue(Lst *);
/*
* LstValid (L) --