torcs - 1.2.2

Hash tables Management


Detailed Description

This is the hash computation API.


Files

file  hash.cpp
 This is the hash computation API.


Functions

void * GfHashCreate (int type)
 Create a new hash table.

int GfHashAddStr (void *hash, char *key, void *data)
 Add an element with a string key to a hash table.

void * GfHashRemStr (void *hash, char *key)
 Remove an element with a string key from a hash table.

void * GfHashGetStr (void *hash, char *key)
 Get the user data associated with a string key.

void GfHashAddBuf (void *hash, char *key, size_t sz, void *data)
 Add an element with a memory buffer key to a hash table.

void * GfHashRemBuf (void *hash, char *key, size_t sz)
 Remove an element with a memory buffer key from a hash table.

void * GfHashGetBuf (void *hash, char *key, size_t sz)
 Get the user data associated with a memory buffer key.

void GfHashRelease (void *hash, tfHashFree hashFree)
 Release a hash table.

void * GfHashGetFirst (void *hash)
 Get the first user data of a hash table.

void * GfHashGetNext (void *hash)
 Get the next user data of a hash table.


Function Documentation

void GfHashAddBuf void *  hash,
char *  key,
size_t  sz,
void *  data
 

Add an element with a memory buffer key to a hash table.

Parameters:
hash Current hash table handle.
key key buffer to hash.
sz size of the buffer.
data user data.
Returns:
none

int GfHashAddStr void *  hash,
char *  key,
void *  data
 

Add an element with a string key to a hash table.

Parameters:
hash Current hash table handle.
key key string to hash.
data user data.
Returns:
0 OK, 1 NOK.

void* GfHashCreate int  type  ) 
 

Create a new hash table.

Parameters:
type Type of key used (GF_HASH_TYPE_STR or GF_HASH_TYPE_BUF)
Returns:
handle on new hash table
0 if Error

void* GfHashGetBuf void *  hash,
char *  key,
size_t  sz
 

Get the user data associated with a memory buffer key.

Parameters:
hash Current hash table handle.
key key buffer to hash.
sz size of the buffer.
Returns:
User data.

void* GfHashGetFirst void *  hash  ) 
 

Get the first user data of a hash table.

This is used for table scan.

Parameters:
hash Current hash table handle.
Returns:
User data.
See also:
GfHashGetNext

Here is the call graph for this function:

void* GfHashGetNext void *  hash  ) 
 

Get the next user data of a hash table.

This is used for table scan.

Parameters:
hash Current hash table handle.
Returns:
User data.
See also:
GfHashGetFirst

void* GfHashGetStr void *  hash,
char *  key
 

Get the user data associated with a string key.

Parameters:
hash Current hash table handle.
key key string to hash.
Returns:
User data.

void GfHashRelease void *  hash,
tfHashFree  hashFree
 

Release a hash table.

Parameters:
hash Current hash table handle.
hashFree pointer on user function used to free the user data (NULL if not used).
Returns:
none

void* GfHashRemBuf void *  hash,
char *  key,
size_t  sz
 

Remove an element with a memory buffer key from a hash table.

Parameters:
hash Current hash table handle.
key key buffer to hash.
sz size of the buffer.
Returns:
User data.

void* GfHashRemStr void *  hash,
char *  key
 

Remove an element with a string key from a hash table.

Parameters:
hash Current hash table handle.
key key string to hash.
Returns:
User data.


Generated at Thu Feb 26 21:54:23 2004 for torcs by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-1999
TORCS © Eric Espié 1999, 2002.