IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2004, 4:10:27 PM (22 years ago)
Author:
Paul Price
Message:

Updating from SDRS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/pslib/include/psHash.h

    r359 r1581  
    77 */
    88
    9 /** DO WE NEED TO DEFINE HashTable? */
    10 typedef struct HashTable psHash;        ///< Opaque type for a hash table
     9/** A hash table */
     10typedef struct {
     11    int nbucket;                        ///< number of buckets
     12    psHashBucket **buckets;             ///< the buckets themselves
     13} psHash;
     14
     15/** The hash buckets, which compose the hash */
     16typedef struct psHashBucket {
     17    char *key;                          ///< key for this item of data
     18    void *data;                         ///< the data itself
     19    struct psHashBucket *next;          ///< list of other possible keys
     20} psHashBucket;
    1121
    1222/** Functions **************************************************************/
     
    1525 */
    1626
    17 /// Allocate hash buckets in table.
     27/** Allocate hash buckets in table. */
    1828psHash *psHashAlloc(void);
    1929
    20 /// Free hash buckets from table.
    21 void psHashFree(psHash *table,          ///< hash table to be freed
    22                 void (*itemFree)(void *item) ///< how to free hashed data; or NULL
     30/** Add entry to table. */
     31bool psHashAdd(psHash *table,           ///< table to insert in
     32               const char *key,         ///< key to use
     33               void *data               ///< data to insert
    2334    );
    2435
    25 /// Insert entry into table.
    26 void *psHashInsert(psHash *table,       ///< table to insert in
    27                    const char *key,     ///< key to use
    28                    void *data,          ///< data to insert
    29                    void (*itemFree)(void *item) ///< how to free hashed data; or NULL
    30     );
    31 
    32 /// Lookup key in table.
     36/** Lookup key in table. */
    3337void *psHashLookup(psHash *table,       ///< table to lookup key in
    3438                   const char *key      ///< key to lookup
    3539    );
    3640
    37 /// Remove key from table.
    38 void *psHashRemove(psHash *table,       ///< table to lookup key in
    39                    const char *key      ///< key to lookup
     41/** Remove key from table. */
     42bool psHashRemove(psHash *table,        ///< table to lookup key in
     43                  const char *key       ///< key to lookup
    4044    );
     45
     46/** Get list of keys */
     47psList *psHashKeyList(psHash *table     ///< table for which to get keys
     48    );
     49
    4150
    4251/* \} */ // End of DataGroup Functions
Note: See TracChangeset for help on using the changeset viewer.