hash.h revision 6dc85575000127630489b407c50a4b3ea87c9acb
16dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell/** 26dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell * \file hash.h 36dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell * Generic hash table. 46dc85575000127630489b407c50a4b3ea87c9acbKeith Whitwell */ 5afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 6afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg/* 7afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * Mesa 3-D graphics library 8c84e84a7342f4a10a69c0ab96f649f54586afb9dBrian Paul * Version: 4.1 922144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * 10c84e84a7342f4a10a69c0ab96f649f54586afb9dBrian Paul * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. 1122144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * 12afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * Permission is hereby granted, free of charge, to any person obtaining a 13afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * copy of this software and associated documentation files (the "Software"), 14afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * to deal in the Software without restriction, including without limitation 15afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * and/or sell copies of the Software, and to permit persons to whom the 17afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * Software is furnished to do so, subject to the following conditions: 1822144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * 19afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * The above copyright notice and this permission notice shall be included 20afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * in all copies or substantial portions of the Software. 2122144ab7552f0799bcfca506bf4ffa7f70a06649Gareth Hughes * 22afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 23afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 25afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 27afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg */ 29afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 30afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 31afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg#ifndef HASH_H 32afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg#define HASH_H 33afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 34afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 35fbd8f212c3866ec98c1d8c9d3db3ddb7e7c479a5Brian Paul#include "glheader.h" 36afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 37afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 38c84e84a7342f4a10a69c0ab96f649f54586afb9dBrian Paul/** 39c84e84a7342f4a10a69c0ab96f649f54586afb9dBrian Paul * Opaque hash table type. 40c84e84a7342f4a10a69c0ab96f649f54586afb9dBrian Paul */ 41afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtgstruct HashTable; 42afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 43afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 44afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 45bb79790662f56eb71aafd3f020cd86ad810f56b2Brian Paulextern struct _mesa_HashTable *_mesa_NewHashTable(void); 46afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 47bb79790662f56eb71aafd3f020cd86ad810f56b2Brian Paulextern void _mesa_DeleteHashTable(struct _mesa_HashTable *table); 48afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 49bb79790662f56eb71aafd3f020cd86ad810f56b2Brian Paulextern void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key); 50afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 51bb79790662f56eb71aafd3f020cd86ad810f56b2Brian Paulextern void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data); 52afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 53bb79790662f56eb71aafd3f020cd86ad810f56b2Brian Paulextern void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key); 54afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 559b8094a663f08b50f01e3bcce8d22e4415b253e4Brian Paulextern GLuint _mesa_HashFirstEntry(struct _mesa_HashTable *table); 56afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 57bb79790662f56eb71aafd3f020cd86ad810f56b2Brian Paulextern void _mesa_HashPrint(const struct _mesa_HashTable *table); 58afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 599b8094a663f08b50f01e3bcce8d22e4415b253e4Brian Paulextern GLuint _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys); 60afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 61afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg 62afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1cjtg#endif 63