Changeset 1440 for trunk/psLib/src/collections/psList.h
- Timestamp:
- Aug 9, 2004, 1:34:58 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psList.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psList.h
r1426 r1440 10 10 * @ingroup LinkedList 11 11 * 12 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-09 2 2:44:25$12 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-09 23:34:57 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 typedef struct psListElem 45 45 { 46 struct psListElem *prev; ///< previous link in list47 struct psListElem *next; ///< next link in list46 struct psListElem* prev; ///< previous link in list 47 struct psListElem* next; ///< next link in list 48 48 void *data; ///< real data item 49 49 } … … 58 58 { 59 59 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 cursor60 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 63 unsigned int iterIndex; ///< the numeric position of the iteration cursor in the list 64 64 pthread_mutex_t lock; ///< mutex to lock a node during changes … … 68 68 /** Creates a psList linked list object. 69 69 * 70 * @return psList* A new psList object.70 * @return psList* A new psList object. 71 71 */ 72 psList *psListAlloc(void *data72 psList* psListAlloc(void *data 73 73 ///< initial data item; may be NULL if no an empty psList is desired 74 74 ) … … 77 77 /** Adds an element to a psList at position given. 78 78 * 79 * @return psList* The psList with added data item. If list parameter is79 * @return psList* The psList with added data item. If list parameter is 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)82 bool psListAdd(psList* restrict list, ///< list to add to (if NULL, nothing is done) 83 83 void *data, ///< data item to add. If NULL, list is not modified. 84 84 int where ///< index, PS_LIST_HEAD, PS_LIST_TAIL, or numbered location. … … 89 89 * @return bool TRUE if element is successfully removed, otherwise FALSE. 90 90 */ 91 bool psListRemove(psList * restrict list,91 bool psListRemove(psList* restrict list, 92 92 ///< list to remove element from 93 93 void *data, … … 104 104 * NULL is returned. 105 105 */ 106 void *psListGet(psList * restrict list, ///< list to retrieve element from106 void *psListGet(psList* restrict list, ///< list to retrieve element from 107 107 int which ///< index number, or PS_LIST_NEXT, PS_LIST_PREV, PS_LIST_UNKNOWN 108 108 ); … … 112 112 * 113 113 */ 114 void psListSetIterator(psList * restrict list, ///< list to retrieve element from114 void psListSetIterator(psList* restrict list, ///< list to retrieve element from 115 115 int where ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL 116 116 ); … … 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 148 148 /** Convert a linked list to an array 149 149 * 150 * @return psArray* A new psArray populated with elements from the list,150 * @return psArray* A new psArray populated with elements from the list, 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 156 156 /** Convert array to a doubly-linked list 157 157 * 158 * @return psList* A new psList populated with elements formt the psArray,158 * @return psList* A new psList populated with elements formt the psArray, 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 164 psList *psListSort(psList* list, psComparePtrFcn compare);164 psList* psListSort(psList* list, psComparePtrFcn compare); 165 165 166 166 /// @} End of DataGroup Functions
Note:
See TracChangeset
for help on using the changeset viewer.
