Changeset 257 for trunk/archive/pslib/include/psDlist.h
- Timestamp:
- Mar 18, 2004, 9:37:58 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psDlist.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psDlist.h
r247 r257 31 31 }; 32 32 33 /*****************************************************************************/ 33 /** Functions **************************************************************/ 34 /** \addtogroup DataGroup General Data Container Utilities 35 * \{ 36 */ 37 34 38 /** Constructor */ 35 psDlist *psDlistAlloc(void *data //!< initial data item; may be NULL36 );39 psDlist *psDlistAlloc(void *data) //!< initial data item; may be NULL 40 ; 37 41 38 42 /** Destructor */ 39 43 void psDlistFree(psDlist *list, //!< list to destroy 40 void (*elemFree)(void *) //!< destructor for data on list41 );44 void (*elemFree)(void *)) //!< destructor for data on list 45 ; 42 46 43 /* 44 * List maintainence functions 45 */ 47 /**** List maintainence functions ****/ 46 48 47 49 /** Add to list */ 48 50 psDlist *psDlistAdd(psDlist *list, //!< list to add to (may be NULL) 49 51 void *data, //!< data item to add 50 int where //!< index, PS_DLIST_HEAD, or PS_DLIST_TAIL51 );52 int where) //!< index, PS_DLIST_HEAD, or PS_DLIST_TAIL 53 ; 52 54 53 55 /** Append to a list */ 54 56 psDlist *psDlistAppend(psDlist *list, //!< list to append to (may be NULL) 55 void *data //!< data item to add56 );57 void *data) //!< data item to add 58 ; 57 59 58 60 /** Remove from a list */ 59 61 void *psDlistRemove(psDlist *list, //!< list to remove element from 60 62 void *data, //!< data item to remove 61 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 62 //!< PS_DLIST_PREV 63 ); 63 int which) //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 64 ; //!< PS_DLIST_PREV 64 65 65 66 /** Retrieve from a list */ 66 67 void *psDlistGet(const psDlist *list, //!< list to retrieve element from 67 int which //!< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV68 );68 int which) //!< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV 69 ; 69 70 70 /* 71 * convenience functions to use psDlistGet as an iterator 72 */ 71 /**** convenience functions to use psDlistGet as an iterator ******/ 73 72 74 73 /** Set the iterator */ 75 74 void psDlistSetIterator(psDlist *list, //!< list to retrieve element from 76 75 int where, //!< index, PS_DLIST_HEAD, or PS_DLIST_TAIL 77 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 78 //!< PS_DLIST_PREV 79 ); 76 int which) //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 77 ; //!< PS_DLIST_PREV 80 78 81 79 /** Get next element */ 82 80 void *psDlistGetNext(psDlist *list, //!< list to retrieve element from 83 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 84 //!< PS_DLIST_PREV 85 ); 81 int which) //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 82 ; //!< PS_DLIST_PREV 86 83 87 84 /** Get previous element */ 88 85 void *psDlistGetPrev(psDlist *list, //!< list to retrieve element from 89 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 90 //!< PS_DLIST_PREV 91 ); 92 86 int which) //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 87 ; //!< PS_DLIST_PREV 93 88 94 89 /** Convert doubly-linked list to an array */ 95 psVoidPtrArray *psDlistToArray(psDlist *dlist //!< List to convert96 );90 psVoidPtrArray *psDlistToArray(psDlist *dlist) //!< List to convert 91 ; 97 92 98 93 /** Convert array to a doubly-linked list */ 99 psDlist *psArrayToDlist(psVoidPtrArray *arr //!< Array to convert100 );94 psDlist *psArrayToDlist(psVoidPtrArray *arr) //!< Array to convert 95 ; 101 96 97 /* \} */ // End of DataGroup Functions 102 98 103 99 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
