torcs - 1.2.2

src/libs/tgf/hash.cpp File Reference


Detailed Description

This is the hash computation API.

Author:
Eric Espie
Version:
Id
hash.cpp,v 1.3 2003/08/18 06:44:53 torcs Exp

#include <tgf.h>

Include dependency graph for hash.cpp:

Include dependency graph

Compounds

struct  HashElem
struct  HashHeader

Defines

#define HASH_BYTE(x, y)   (((y) + ((x) << 4) + ((x) >> 4)) * 11)
#define DEFAULT_SIZE   32

Typedefs

typedef HashElem tHashElem
typedef HashHeader tHashHeader

Functions

 GF_TAILQ_HEAD (HashHead, tHashElem)
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.


Define Documentation

#define DEFAULT_SIZE   32
 

#define HASH_BYTE x,
y   )     (((y) + ((x) << 4) + ((x) >> 4)) * 11)
 


Typedef Documentation

typedef struct HashElem tHashElem
 

typedef struct HashHeader tHashHeader
 


Function Documentation

GF_TAILQ_HEAD HashHead  ,
tHashElem 
 


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