Changeset 291
- Timestamp:
- Mar 23, 2004, 4:48:25 PM (22 years ago)
- Location:
- trunk/archive/pslib/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psDlist.h
r257 r291 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_PREV65 63 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 64 //!< PS_DLIST_PREV 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_PREV69 ;68 int which //!< index of item, or PS_DLIST_NEXT, or PS_DLIST_PREV 69 ); 70 70 71 71 /**** convenience functions to use psDlistGet as an iterator ******/ … … 74 74 void psDlistSetIterator(psDlist *list, //!< list to retrieve element from 75 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 76 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 77 //!< PS_DLIST_PREV 78 ); 78 79 79 80 /** Get next element */ 80 81 void *psDlistGetNext(psDlist *list, //!< list to retrieve element from 81 int which) //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 82 ; //!< PS_DLIST_PREV 82 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 83 //!< PS_DLIST_PREV 84 ); 83 85 84 86 /** Get previous element */ 85 87 void *psDlistGetPrev(psDlist *list, //!< list to retrieve element from 86 int which) //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 87 ; //!< PS_DLIST_PREV 88 int which //!< index of item, or PS_DLIST_UNKNOWN, or PS_DLIST_NEXT, or 89 //!< PS_DLIST_PREV 90 ); 88 91 89 92 /** Convert doubly-linked list to an array */ 90 psVoidPtrArray *psDlistToArray(psDlist *dlist )//!< List to convert91 ;93 psVoidPtrArray *psDlistToArray(psDlist *dlist //!< List to convert 94 ); 92 95 93 96 /** Convert array to a doubly-linked list */ 94 psDlist *psArrayToDlist(psVoidPtrArray *arr )//!< Array to convert95 ;97 psDlist *psArrayToDlist(psVoidPtrArray *arr //!< Array to convert 98 ); 96 99 97 100 /* \} */ // End of DataGroup Functions -
trunk/archive/pslib/include/psHash.h
r257 r291 16 16 17 17 /// Allocate hash buckets in table. 18 psHash *psHashAlloc(int nbucket )///< initial number of buckets19 ;18 psHash *psHashAlloc(int nbucket ///< initial number of buckets 19 ); 20 20 21 21 /// Free hash buckets from table. 22 22 void psHashFree(psHash *table, ///< hash table to be freed 23 void (*itemFree)(void *item) )///< how to free hashed data; or NULL24 ;23 void (*itemFree)(void *item) ///< how to free hashed data; or NULL 24 ); 25 25 26 26 /// Insert entry into table. … … 28 28 const char *key, ///< key to use 29 29 void *data, ///< data to insert 30 void (*itemFree)(void *item) )///< how to free hashed data; or NULL31 ;30 void (*itemFree)(void *item) ///< how to free hashed data; or NULL 31 ); 32 32 33 33 /// Lookup key in table. 34 34 void *psHashLookup(psHash *table, ///< table to lookup key in 35 const char *key )///< key to lookup36 ;35 const char *key ///< key to lookup 36 ); 37 37 38 38 /// Remove key from table. 39 39 void *psHashRemove(psHash *table, ///< table to lookup key in 40 const char *key )///< key to lookup41 ;40 const char *key ///< key to lookup 41 ); 42 42 43 43 /* \} */ // End of DataGroup Functions -
trunk/archive/pslib/include/psMisc.h
r266 r291 15 15 void psAbort(const char *name, ///< Category of code that caused the abort 16 16 const char *fmt, ///< Format 17 ... )///< Extra arguments to use format18 ;17 ... ///< Extra arguments to use format 18 ); 19 19 20 20 /// Prints an error message and doesn't abort 21 21 void psError(const char *name, ///< Category of code that caused the abort 22 22 const char *fmt, ///< Format 23 ... )///< Extra arguments to use format24 ;23 ... ///< Extra arguments to use format 24 ); 25 25 26 26 /// Allocates and returns a copy of a string 27 char *psStringCopy(const char *str )///< string to copy28 ;27 char *psStringCopy(const char *str ///< string to copy 28 ); 29 29 30 30 /// Allocates nChar and returns a copy of the string or segment 31 char *psStringNCopy(const char *str, int nChar) ///< string to copy 32 ; 31 char *psStringNCopy(const char *str, ///< string to copy 32 int nChar //!< Number of characters (including \0 ) 33 ); 33 34 34 35 /* \} */ // End of SystemGroup Functions
Note:
See TracChangeset
for help on using the changeset viewer.
