VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_hash.h@ 69474

Last change on this file since 69474 was 69474, checked in by vboxsync, 7 years ago

*: scm updates - header files should have 'svn:keywords=Id Revision' too (doesn't mean they have to use them).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 3.8 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_HASH_H
8#define CR_HASH_H
9
10#include "chromium.h"
11
12#include <iprt/cdefs.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18typedef struct CRHashIdPool CRHashIdPool;
19typedef struct CRHashTable CRHashTable;
20
21/* Callback function used for freeing/deleting table entries */
22typedef void (*CRHashtableCallback)(void *data);
23typedef void (*CRHashtableCallbackEx)(void *data1, void *data2);
24/* Callback function used for walking through table entries */
25typedef void (*CRHashtableWalkCallback)(unsigned long key, void *data1, void *data2);
26/* Callback function used for walking through allocated keys */
27typedef void (*CRHashIdWalkKeys)(unsigned long firstKey, unsigned long count, void *data);
28
29DECLEXPORT(CRHashIdPool *) crAllocHashIdPool( void );
30DECLEXPORT(CRHashIdPool *) crAllocHashIdPoolEx( GLuint min, GLuint max );
31DECLEXPORT(void) crFreeHashIdPool( CRHashIdPool *pool );
32DECLEXPORT(GLboolean) crHashIdPoolIsIdFree( const CRHashIdPool *pool, GLuint id );
33DECLEXPORT(GLuint) crHashIdPoolAllocBlock( CRHashIdPool *pool, GLuint count );
34DECLEXPORT(void) crHashIdPoolFreeBlock( CRHashIdPool *pool, GLuint first, GLuint count );
35/* @return GL_TRUE if the id is allocated, and GL_FALSE if the id was already allocated */
36DECLEXPORT(GLboolean) crHashIdPoolAllocId( CRHashIdPool *pool, GLuint id );
37DECLEXPORT(void) crHashIdWalkKeys( CRHashIdPool *pool, CRHashIdWalkKeys walkFunc , void *data);
38
39DECLEXPORT(CRHashTable *) crAllocHashtable( void );
40DECLEXPORT(CRHashTable *) crAllocHashtableEx( GLuint min, GLuint max );
41DECLEXPORT(void) crFreeHashtable( CRHashTable *hash, CRHashtableCallback deleteCallback );
42DECLEXPORT(void) crFreeHashtableEx( CRHashTable *hash, CRHashtableCallbackEx deleteCallback, void *pData );
43DECLEXPORT(void) crHashtableAdd( CRHashTable *h, unsigned long key, void *data );
44/* to ensure hash table pool id consistency, there is no crHashTableFreeKeys/UnregisterKey,
45 * one should call crHashtableDelete to free unneeded keys,
46 * which will also ensure there is no entry with the specified key left in the table */
47DECLEXPORT(GLuint) crHashtableAllocKeys( CRHashTable *h, GLsizei range );
48/* @return GL_TRUE if the id is allocated, and GL_FALSE if the id was already allocated */
49DECLEXPORT(GLboolean) crHashtableAllocRegisterKey( CRHashTable *h, GLuint key);
50DECLEXPORT(void) crHashtableDelete( CRHashTable *h, unsigned long key, CRHashtableCallback deleteCallback );
51DECLEXPORT(void) crHashtableDeleteEx( CRHashTable *h, unsigned long key, CRHashtableCallbackEx deleteCallback, void *pData );
52DECLEXPORT(void) crHashtableDeleteBlock( CRHashTable *h, unsigned long key, GLsizei range, CRHashtableCallback deleteFunc );
53DECLEXPORT(void *) crHashtableSearch( const CRHashTable *h, unsigned long key );
54DECLEXPORT(void) crHashtableReplace( CRHashTable *h, unsigned long key, void *data, CRHashtableCallback deleteFunc);
55DECLEXPORT(unsigned int) crHashtableNumElements( const CRHashTable *h) ;
56DECLEXPORT(GLboolean) crHashtableIsKeyUsed( const CRHashTable *h, GLuint id );
57DECLEXPORT(void) crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
58/* walk the hashtable w/o holding the table lock */
59DECLEXPORT(void) crHashtableWalkUnlocked( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
60/*Returns GL_TRUE if given hashtable hold the data, pKey is updated with key value for data in this case*/
61DECLEXPORT(GLboolean) crHashtableGetDataKey(CRHashTable *pHash, void *pData, unsigned long *pKey);
62DECLEXPORT(void) crHashtableLock(CRHashTable *h);
63DECLEXPORT(void) crHashtableUnlock(CRHashTable *h);
64DECLEXPORT(void) crHashtableWalkKeys(CRHashTable *hash, CRHashIdWalkKeys walkFunc , void *data);
65
66#ifdef __cplusplus
67} /* extern "C" */
68#endif
69
70#endif /* CR_HASH_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette