VirtualBox

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

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

crOpenGL: registered keys save/restore

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

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