cr_hash.h revision bf51ba1739a9eb4abd3bbf2fbeda16c90cdd2c19
/* Copyright (c) 2001, Stanford University
* All rights reserved.
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#ifndef CR_HASH_H
#define CR_HASH_H
#include "chromium.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct CRHashIdPool CRHashIdPool;
typedef struct CRHashTable CRHashTable;
typedef void (*CRHashtableCallback)(void *data);
/* Callback function used for walking through table entries */
/* to ensure hash table pool id consistency, there is no crHashTableFreeKeys/UnregisterKey,
* one should call crHashtableDelete to free unneeded keys,
* which will also ensure there is no entry with the specified key left in the table */
DECLEXPORT(void) crHashtableDelete( CRHashTable *h, unsigned long key, CRHashtableCallback deleteCallback );
DECLEXPORT(void) crHashtableDeleteBlock( CRHashTable *h, unsigned long key, GLsizei range, CRHashtableCallback deleteFunc );
DECLEXPORT(void) crHashtableReplace( CRHashTable *h, unsigned long key, void *data, CRHashtableCallback deleteFunc);
DECLEXPORT(void) crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
/* walk the hashtable w/o holding the table lock */
DECLEXPORT(void) crHashtableWalkUnlocked( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
/*Returns GL_TRUE if given hashtable hold the data, pKey is updated with key value for data in this case*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* CR_HASH_H */