Changeset 24 for branches/FREEBSD/src/kmk/lst.h
- Timestamp:
- Nov 26, 2002, 10:24:54 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/FREEBSD/src/kmk/lst.h
r10 r24 1 1 /* 2 * Copyright (c) 1988, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 2 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. 4 3 * Copyright (c) 1988, 1989 by Adam de Boor 5 4 * Copyright (c) 1989 by Berkeley Softworks … … 37 36 * SUCH DAMAGE. 38 37 * 39 * @(#)lst.h 8.2 (Berkeley) 4/28/9540 * $FreeBSD: src/usr.bin/make/lst.h,v 1. 15 2002/09/17 21:29:06 jmallettExp $38 * from: @(#)lst.h 8.1 (Berkeley) 6/6/93 39 * $FreeBSD: src/usr.bin/make/lst.h,v 1.9 1999/08/28 01:03:32 peter Exp $ 41 40 */ 42 41 … … 46 45 */ 47 46 #ifndef _LST_H_ 48 #define 47 #define _LST_H_ 49 48 50 49 #include <sys/param.h> 50 #ifdef __STDC__ 51 51 #include <stdlib.h> 52 #endif 52 53 #include "sprite.h" 53 54 … … 59 60 typedef struct LstNode *LstNode; 60 61 62 #define NILLST ((Lst) NIL) 63 #define NILLNODE ((LstNode) NIL) 64 61 65 /* 62 66 * NOFREE can be used as the freeProc to Lst_Destroy when the elements are … … 64 68 * NOCOPY performs similarly when given as the copyProc to Lst_Duplicate. 65 69 */ 66 #define NOFREE ((void (*)(void *)) 0)67 #define NOCOPY ((void * (*)(void *)) 0)70 #define NOFREE ((void (*) __P((ClientData))) 0) 71 #define NOCOPY ((ClientData (*) __P((ClientData))) 0) 68 72 69 #define 70 #define 73 #define LST_CONCNEW 0 /* create new LstNode's when using Lst_Concat */ 74 #define LST_CONCLINK 1 /* relink LstNode's when using Lst_Concat */ 71 75 72 76 /* … … 74 78 */ 75 79 /* Create a new list */ 76 Lst Lst_Init (Boolean);80 Lst Lst_Init __P((Boolean)); 77 81 /* Duplicate an existing list */ 78 Lst Lst_Duplicate (Lst, void * (*)(void *));82 Lst Lst_Duplicate __P((Lst, ClientData (*)(ClientData))); 79 83 /* Destroy an old one */ 80 void Lst_Destroy (Lst, void (*)(void *));84 void Lst_Destroy __P((Lst, void (*)(ClientData))); 81 85 /* True if list is empty */ 82 Boolean Lst_IsEmpty (Lst);86 Boolean Lst_IsEmpty __P((Lst)); 83 87 84 88 /* … … 86 90 */ 87 91 /* Insert an element before another */ 88 ReturnStatus Lst_Insert (Lst, LstNode, void *);92 ReturnStatus Lst_Insert __P((Lst, LstNode, ClientData)); 89 93 /* Insert an element after another */ 90 ReturnStatus Lst_Append (Lst, LstNode, void *);94 ReturnStatus Lst_Append __P((Lst, LstNode, ClientData)); 91 95 /* Place an element at the front of a lst. */ 92 ReturnStatus Lst_AtFront (Lst, void *);96 ReturnStatus Lst_AtFront __P((Lst, ClientData)); 93 97 /* Place an element at the end of a lst. */ 94 ReturnStatus Lst_AtEnd (Lst, void *);98 ReturnStatus Lst_AtEnd __P((Lst, ClientData)); 95 99 /* Remove an element */ 96 ReturnStatus Lst_Remove (Lst, LstNode);100 ReturnStatus Lst_Remove __P((Lst, LstNode)); 97 101 /* Replace a node with a new value */ 98 ReturnStatus Lst_Replace (LstNode, void *);102 ReturnStatus Lst_Replace __P((LstNode, ClientData)); 99 103 /* Concatenate two lists */ 100 ReturnStatus Lst_Concat (Lst, Lst, int);104 ReturnStatus Lst_Concat __P((Lst, Lst, int)); 101 105 102 106 /* … … 104 108 */ 105 109 /* Return first element in list */ 106 LstNode Lst_First (Lst);110 LstNode Lst_First __P((Lst)); 107 111 /* Return last element in list */ 108 LstNode Lst_Last (Lst);112 LstNode Lst_Last __P((Lst)); 109 113 /* Return successor to given element */ 110 LstNode Lst_Succ (LstNode);114 LstNode Lst_Succ __P((LstNode)); 111 115 /* Get datum from LstNode */ 112 void * Lst_Datum(LstNode);116 ClientData Lst_Datum __P((LstNode)); 113 117 114 118 /* … … 116 120 */ 117 121 /* Find an element in a list */ 118 LstNode Lst_Find(Lst, void *, int (*)(void *, void *)); 122 LstNode Lst_Find __P((Lst, ClientData, 123 int (*)(ClientData, ClientData))); 119 124 /* Find an element starting from somewhere */ 120 LstNode Lst_FindFrom(Lst, LstNode, void *, int (*cProc)(void *, void *)); 125 LstNode Lst_FindFrom __P((Lst, LstNode, ClientData, 126 int (*cProc)(ClientData, ClientData))); 121 127 /* 122 128 * See if the given datum is on the list. Returns the LstNode containing 123 129 * the datum 124 130 */ 125 LstNode Lst_Member (Lst, void *);131 LstNode Lst_Member __P((Lst, ClientData)); 126 132 /* Apply a function to all elements of a lst */ 127 void Lst_ForEach(Lst, int (*)(void *, void *), void *); 133 void Lst_ForEach __P((Lst, int (*)(ClientData, ClientData), 134 ClientData)); 128 135 /* 129 136 * Apply a function to all elements of a lst starting from a certain point. … … 131 138 * beginning of the list again. 132 139 */ 133 void Lst_ForEachFrom(Lst, LstNode, int (*)(void *, void *), void *); 140 void Lst_ForEachFrom __P((Lst, LstNode, 141 int (*)(ClientData, ClientData), 142 ClientData)); 134 143 /* 135 144 * these functions are for dealing with a list as a table, of sorts. … … 138 147 */ 139 148 /* Open the list */ 140 ReturnStatus Lst_Open (Lst);149 ReturnStatus Lst_Open __P((Lst)); 141 150 /* Next element please */ 142 LstNode Lst_Next (Lst);151 LstNode Lst_Next __P((Lst)); 143 152 /* Done yet? */ 144 Boolean Lst_IsAtEnd (Lst);153 Boolean Lst_IsAtEnd __P((Lst)); 145 154 /* Finish table access */ 146 void Lst_Close (Lst);155 void Lst_Close __P((Lst)); 147 156 148 157 /* … … 150 159 */ 151 160 /* Place an element at tail of queue */ 152 ReturnStatus Lst_EnQueue (Lst, void *);161 ReturnStatus Lst_EnQueue __P((Lst, ClientData)); 153 162 /* Remove an element from head of queue */ 154 void * Lst_DeQueue(Lst);163 ClientData Lst_DeQueue __P((Lst)); 155 164 156 165 #endif /* _LST_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.