Changeset 376
- Timestamp:
- Apr 1, 2004, 12:20:40 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psDlist.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psDlist.h
r344 r376 37 37 38 38 /** Constructor */ 39 psDlist *psDlistAlloc(void *data ///< initial data item; may be NULL40 );39 psDlist *psDlistAlloc(void *data) ///< initial data item; may be NULL 40 ; 41 41 42 42 /** Destructor */ 43 43 void psDlistFree(psDlist *list, ///< list to destroy 44 void (*elemFree)(void *) ///< destructor for data on list45 );44 void (*elemFree)(void *)) ///< destructor for data on list 45 ; 46 46 47 47 /**** List maintainence functions ****/ … … 50 50 psDlist *psDlistAdd(psDlist *list, ///< list to add to (may be NULL) 51 51 void *data, ///< data item to add 52 int where ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL53 );52 int where) ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL 53 ; 54 54 55 55 /** Append to a list */ 56 56 psDlist *psDlistAppend(psDlist *list, ///< list to append to (may be NULL) 57 void *data ///< data item to add58 );57 void *data) ///< data item to add 58 ; 59 59 60 60 /** Remove from a list */ 61 61 void *psDlistRemove(psDlist *list, ///< list to remove element from 62 62 void *data, ///< data item to remove 63 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or64 ///< PS_DLIST_PREV 65 ); 63 int which) ///< index of item, or PS_DLIST_UNKNOWN, PS_DLIST_NEXT, PS_DLIST_PREV 64 ; 65 66 66 /** Retrieve from a list */ 67 67 void *psDlistGet(const psDlist *list, ///< list to retrieve element from 68 int which ///< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV 69 ); 70 71 /**** convenience functions to use psDlistGet as an iterator ******/ 68 void *data, ///< data item to retrieve 69 int which) ///< index of item, or PS_DLIST_NEXT, PS_DLIST_PREV, PS_DLIST_UNKNOWN 70 ; 72 71 73 72 /** Set the iterator */ 74 73 void psDlistSetIterator(psDlist *list, ///< list to retrieve element from 75 int where, ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL 76 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 77 ///< PS_DLIST_PREV 78 ); 74 int where) ///< index, PS_DLIST_HEAD, or PS_DLIST_TAIL 75 ; 79 76 80 /** Get next element */ 81 void *psDlistGetNext(psDlist *list, ///< list to retrieve element from 82 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 83 ///< PS_DLIST_PREV 84 ); 77 /** Get next element relative to iter */ 78 void *psDlistGetNext(psDlist *list) ///< list to retrieve element from 79 ; 85 80 86 /** Get previous element */ 87 void *psDlistGetPrev(psDlist *list, ///< list to retrieve element from 88 int which ///< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 89 ///< PS_DLIST_PREV 90 ); 81 /** Get prev element relative to iter */ 82 void *psDlistGetPrev(psDlist *list) ///< list to retrieve element from 83 ; 91 84 92 85 /** Convert doubly-linked list to an array */ 93 psVoidPtrArray *psDlistToArray(psDlist *dlist ///< List to convert94 );86 psVoidPtrArray *psDlistToArray(psDlist *dlist) ///< List to convert 87 ; 95 88 96 89 /** Convert array to a doubly-linked list */ 97 psDlist *psArrayToDlist(psVoidPtrArray *arr ///< Array to convert98 );90 psDlist *psArrayToDlist(psVoidPtrArray *arr) ///< Array to convert 91 ; 99 92 100 93 /* \} */ // End of DataGroup Functions
Note:
See TracChangeset
for help on using the changeset viewer.
