Changeset 1426 for trunk/psLib/src/collections/psList.h
- Timestamp:
- Aug 9, 2004, 12:44:25 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psList.h (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psList.h
r1407 r1426 10 10 * @ingroup LinkedList 11 11 * 12 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 7 00:06:06$12 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 22:44:25 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 */ 34 34 enum { 35 PS_LIST_HEAD = 0, // /< at head36 PS_LIST_TAIL = -1, // /< at tail37 PS_LIST_PREVIOUS = -2, // /< previous element38 PS_LIST_CURRENT = -3, // /< current element39 PS_LIST_NEXT = -4, // /< next element40 PS_LIST_UNKNOWN = -5 // /< unknown position (should be last in enum list)35 PS_LIST_HEAD = 0, ///< at head 36 PS_LIST_TAIL = -1, ///< at tail 37 PS_LIST_PREVIOUS = -2, ///< previous element 38 PS_LIST_CURRENT = -3, ///< current element 39 PS_LIST_NEXT = -4, ///< next element 40 PS_LIST_UNKNOWN = -5 ///< unknown position (should be last in enum list) 41 41 }; 42 42 … … 44 44 typedef struct psListElem 45 45 { 46 struct psListElem *prev; // /< previous link in list47 struct psListElem *next; // /< next link in list48 void *data; // /< real data item46 struct psListElem *prev; ///< previous link in list 47 struct psListElem *next; ///< next link in list 48 void *data; ///< real data item 49 49 } 50 50 psListElem; … … 57 57 typedef struct 58 58 { 59 unsigned int size; // /< number of elements on list60 psListElem *head; // /< first element on list (may be NULL)61 psListElem *tail; // /< last element on list (may be NULL)62 psListElem *iter; // /< iteration cursor63 unsigned int iterIndex; // /< the numeric position of the iteration cursor in the list64 pthread_mutex_t lock; // /< mutex to lock a node during changes59 unsigned int size; ///< number of elements on list 60 psListElem *head; ///< first element on list (may be NULL) 61 psListElem *tail; ///< last element on list (may be NULL) 62 psListElem *iter; ///< iteration cursor 63 unsigned int iterIndex; ///< the numeric position of the iteration cursor in the list 64 pthread_mutex_t lock; ///< mutex to lock a node during changes 65 65 } 66 66 psList; … … 71 71 */ 72 72 psList *psListAlloc(void *data 73 // /< initial data item; may be NULL if no an empty psList is desired73 ///< initial data item; may be NULL if no an empty psList is desired 74 74 ) 75 75 ; … … 80 80 * NULL, the return value will also be NULL. 81 81 */ 82 bool psListAdd(psList * restrict list, // /< list to add to (if NULL, nothing is done)83 void *data, // /< data item to add. If NULL, list is not modified.84 int where // /< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location.82 bool psListAdd(psList * restrict list, ///< list to add to (if NULL, nothing is done) 83 void *data, ///< data item to add. If NULL, list is not modified. 84 int where ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location. 85 85 ); 86 86 … … 90 90 */ 91 91 bool psListRemove(psList * restrict list, 92 // /< list to remove element from92 ///< list to remove element from 93 93 void *data, 94 // /< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored.94 ///< if which is PS_LIST_UNKNOWN, data item to find and remove, otherwise this is ignored. 95 95 int which 96 // /< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location.96 ///< index of item, or PS_LIST_UNKNOWN, PS_LIST_NEXT, PS_LIST_PREV, or numbered location. 97 97 ); 98 98 … … 104 104 * NULL is returned. 105 105 */ 106 void *psListGet(psList * restrict list, // /< list to retrieve element from107 int which // /< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN106 void *psListGet(psList * restrict list, ///< list to retrieve element from 107 int which ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN 108 108 ); 109 109 … … 112 112 * 113 113 */ 114 void psListSetIterator(psList * restrict list, // /< list to retrieve element from115 int where // /< index number, PS_LIST_HEAD, or PS_LIST_TAIL114 void psListSetIterator(psList * restrict list, ///< list to retrieve element from 115 int where ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL 116 116 ); 117 117 … … 123 123 * parameter was NULL. 124 124 */ 125 void *psListGetNext(psList * restrict list // /< list to retrieve element from125 void *psListGetNext(psList * restrict list ///< list to retrieve element from 126 126 ); 127 127 … … 133 133 * iterator is not valid or list parameter was NULL. 134 134 */ 135 void *psListGetCurrent(psList * restrict list // /< list to retrieve element from135 void *psListGetCurrent(psList * restrict list ///< list to retrieve element from 136 136 ); 137 137 … … 143 143 * parameter was NULL. 144 144 */ 145 void *psListGetPrevious(psList * restrict list // /< list to retrieve element from145 void *psListGetPrevious(psList * restrict list ///< list to retrieve element from 146 146 ); 147 147 … … 151 151 * or NULL if the given dlist parameter is NULL. 152 152 */ 153 psArray *psListToArray(psList * dlist // /< List to convert153 psArray *psListToArray(psList * dlist ///< List to convert 154 154 ); 155 155 … … 159 159 * or NULL is the given arr parameter is NULL. 160 160 */ 161 psList *psArrayToList(psArray * arr // /< vector to convert161 psList *psArrayToList(psArray * arr ///< vector to convert 162 162 ); 163 163
Note:
See TracChangeset
for help on using the changeset viewer.
