Changeset 11709
- Timestamp:
- Feb 8, 2007, 11:44:00 AM (19 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psHash.c
r11668 r11709 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-02-0 6 21:36:09$14 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-02-08 21:44:00 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 137 137 The new hash table. 138 138 *****************************************************************************/ 139 psHash* psHashAlloc(long nalloc) // initial number of buckets 139 psHash* p_psHashAlloc(const char *file, 140 unsigned int lineno, 141 const char *func, 142 long nalloc) // initial number of buckets 140 143 { 141 144 if (nalloc < 0) … … 148 151 149 152 // Create the new hash table. 150 psHash* table = p sAlloc(sizeof(psHash));153 psHash* table = p_psAlloc(file, lineno, func, sizeof(psHash)); 151 154 152 155 psMemSetDeallocator(table, (psFreeFunc) hashFree); … … 167 170 return table; 168 171 } 172 169 173 170 174 bool psMemCheckHash(psPtr ptr) -
trunk/psLib/src/types/psHash.h
r11248 r11709 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2007-0 1-23 22:47:23$13 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2007-02-08 21:44:00 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 34 34 psHashBucket; 35 35 36 36 37 //typedef struct HashTable psHash; ///< Opaque type for a hash table 37 38 … … 45 46 psHash; 46 47 48 47 49 /** Checks the type of a particular pointer. 48 50 * 49 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 51 * Uses the appropriate deallocation function in psMemBlock to check the ptr 52 * datatype. 50 53 * 51 54 * @return bool: True if the pointer matches a psHash structure, false otherwise. … … 53 56 bool psMemCheckHash( 54 57 psPtr ptr ///< the pointer whose type to check 55 ) 56 ; 58 ); 59 57 60 58 61 /// Allocate hash buckets in table. 62 #ifdef DOXYGEN 59 63 psHash* psHashAlloc( 60 64 long nalloc ///< The number of buckets to allocate. 61 65 ); 66 #else // ifdef DOXYGEN 67 psHash* p_psHashAlloc( 68 const char *file, ///< File of caller 69 unsigned int lineno, ///< Line number of caller 70 const char *func, ///< Function name of caller 71 long nalloc ///< The number of buckets to allocate. 72 ); 73 #define psHashAlloc(nalloc) \ 74 p_psHashAlloc(__FILE__, __LINE__, __func__, nalloc) 75 #endif // ifdef DOXYGEN 76 77 62 78 63 79 /// Insert entry into table. … … 68 84 ); 69 85 86 70 87 /// Lookup key in table. 71 88 psPtr psHashLookup( … … 73 90 const char *key ///< The key to lookup. 74 91 ); 92 75 93 76 94 /// Remove key from table. … … 80 98 ); 81 99 100 82 101 /// List all keys in table. 83 102 psList* psHashKeyList( 84 103 const psHash* hash ///< The table to list keys from.. 85 104 ); 105 86 106 87 107 /** Create a psArray from a psHash contents. … … 93 113 ); 94 114 115 95 116 /// @} End of DataContainer Functions 96 117 #endif // #ifndef PS_HASH_H
Note:
See TracChangeset
for help on using the changeset viewer.
