Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

HashTable


Files

file  psHash.h
 Contains support for basic hashing functions.

Data Structures

struct  psHashBucket
 A bucket that holds an item of data. More...
struct  psHash
 The hash-table itself. More...

Typedefs

typedef psHashBucket psHashBucket
 A bucket that holds an item of data.

Functions

bool psMemCheckHash (psPtr ptr)
 Checks the type of a particular pointer.
psHash * psHashAlloc (long nalloc)
 Allocate hash buckets in table.
bool psHashAdd (psHash *hash, const char *key, psPtr data)
 Insert entry into table.
psPtr psHashLookup (const psHash *hash, const char *key)
 Lookup key in table.
bool psHashRemove (psHash *hash, const char *key)
 Remove key from table.
psList * psHashKeyList (const psHash *hash)
 List all keys in table.
psArray * psHashToArray (const psHash *hash)
 Create a psArray from a psHash contents.


Typedef Documentation

typedef struct psHashBucket psHashBucket
 

A bucket that holds an item of data.


Function Documentation

bool psHashAdd (  psHash *  hash,
const char *  key,
psPtr  data
) 
 

Insert entry into table.

Parameters:
hash  The table to insert in.
key  The key to use.
data  The data to insert.

psHash* psHashAlloc (  long  nalloc  ) 
 

Allocate hash buckets in table.

Parameters:
nalloc  The number of buckets to allocate.

psList* psHashKeyList (  const psHash *  hash  ) 
 

List all keys in table.

Parameters:
hash  The table to list keys from..

psPtr psHashLookup (  const psHash *  hash,
const char *  key
) 
 

Lookup key in table.

Parameters:
hash  The table to lookup key in.
key  The key to lookup.

bool psHashRemove (  psHash *  hash,
const char *  key
) 
 

Remove key from table.

Parameters:
hash  The table to lookup key in.
key  The key to lookup.

psArray* psHashToArray (  const psHash *  hash  ) 
 

Create a psArray from a psHash contents.

Returns:
psArray* A new psArray with duplicate contents of the input psHash
Parameters:
hash  The table to convert to psArray.

bool psMemCheckHash (  psPtr  ptr  ) 
 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psHash structure, false otherwise.
Parameters:
ptr  the pointer whose type to check


Generated on Tue Dec 6 17:18:44 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2