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