VirtualBox

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

最後變更 在這個檔案從45027是 45027,由 vboxsync 提交於 12 年 前

crOpenGL: shader/program state fixes; glDrawXxx-based blitting fixes, etc.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 3.2 KB
 
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);
23/* Callback function used for walking through table entries */
24typedef void (*CRHashtableWalkCallback)(unsigned long key, void *data1, void *data2);
25
26DECLEXPORT(CRHashIdPool *) crAllocHashIdPool( void );
27DECLEXPORT(CRHashIdPool *) crAllocHashIdPoolEx( GLuint min, GLuint max );
28DECLEXPORT(void) crFreeHashIdPool( CRHashIdPool *pool );
29DECLEXPORT(GLboolean) crHashIdPoolIsIdFree( const CRHashIdPool *pool, GLuint id );
30DECLEXPORT(GLuint) crHashIdPoolAllocBlock( CRHashIdPool *pool, GLuint count );
31DECLEXPORT(void) crHashIdPoolFreeBlock( CRHashIdPool *pool, GLuint first, GLuint count );
32/* @return GL_TRUE if the id is allocated, and GL_FALSE if the id was already allocated */
33DECLEXPORT(GLboolean) crHashIdPoolAllocId( CRHashIdPool *pool, GLuint id );
34
35DECLEXPORT(CRHashTable *) crAllocHashtable( void );
36DECLEXPORT(CRHashTable *) crAllocHashtableEx( GLuint min, GLuint max );
37DECLEXPORT(void) crFreeHashtable( CRHashTable *hash, CRHashtableCallback deleteCallback );
38DECLEXPORT(void) crHashtableAdd( CRHashTable *h, unsigned long key, void *data );
39/* to ensure hash table pool id consistency, there is no crHashTableFreeKeys/UnregisterKey,
40 * one should call crHashtableDelete to free unneeded keys,
41 * which will also ensure there is no entry with the specified key left in the table */
42DECLEXPORT(GLuint) crHashtableAllocKeys( CRHashTable *h, GLsizei range );
43/* @return GL_TRUE if the id is allocated, and GL_FALSE if the id was already allocated */
44DECLEXPORT(GLboolean) crHashtableAllocRegisterKey( CRHashTable *h, GLuint key);
45DECLEXPORT(void) crHashtableDelete( CRHashTable *h, unsigned long key, CRHashtableCallback deleteCallback );
46DECLEXPORT(void) crHashtableDeleteBlock( CRHashTable *h, unsigned long key, GLsizei range, CRHashtableCallback deleteFunc );
47DECLEXPORT(void *) crHashtableSearch( const CRHashTable *h, unsigned long key );
48DECLEXPORT(void) crHashtableReplace( CRHashTable *h, unsigned long key, void *data, CRHashtableCallback deleteFunc);
49DECLEXPORT(unsigned int) crHashtableNumElements( const CRHashTable *h) ;
50DECLEXPORT(GLboolean) crHashtableIsKeyUsed( const CRHashTable *h, GLuint id );
51DECLEXPORT(void) crHashtableWalk( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
52/* walk the hashtable w/o holding the table lock */
53DECLEXPORT(void) crHashtableWalkUnlocked( CRHashTable *hash, CRHashtableWalkCallback walkFunc , void *data);
54/*Returns GL_TRUE if given hashtable hold the data, pKey is updated with key value for data in this case*/
55DECLEXPORT(GLboolean) crHashtableGetDataKey(CRHashTable *pHash, void *pData, unsigned long *pKey);
56DECLEXPORT(void) crHashtableLock(CRHashTable *h);
57DECLEXPORT(void) crHashtableUnlock(CRHashTable *h);
58
59#ifdef __cplusplus
60} /* extern "C" */
61#endif
62
63#endif /* CR_HASH_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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