diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-08-16 19:08:53 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-08-16 19:08:53 -0700 |
commit | 6c03c576cc49bbb008de66d374f4302ff0fe0390 (patch) | |
tree | 7ddeb3ee88532d9aef8728b9aa256edf7c125247 /src/mesa/program/hash_table.h | |
parent | 15a3b42e135a3a2cb463ec3cff80a55dd8528051 (diff) | |
parent | a433cd286c60eb9d4c2114f042709eda0f3de676 (diff) | |
download | external_mesa3d-6c03c576cc49bbb008de66d374f4302ff0fe0390.zip external_mesa3d-6c03c576cc49bbb008de66d374f4302ff0fe0390.tar.gz external_mesa3d-6c03c576cc49bbb008de66d374f4302ff0fe0390.tar.bz2 |
Merge branch 'glsl2'
Conflicts:
src/mesa/program/prog_optimize.c
Diffstat (limited to 'src/mesa/program/hash_table.h')
-rw-r--r-- | src/mesa/program/hash_table.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/mesa/program/hash_table.h b/src/mesa/program/hash_table.h index e750906..f1c4fdc 100644 --- a/src/mesa/program/hash_table.h +++ b/src/mesa/program/hash_table.h @@ -36,6 +36,10 @@ struct hash_table; typedef unsigned (*hash_func_t)(const void *key); typedef int (*hash_compare_func_t)(const void *key1, const void *key2); +#ifdef __cplusplus +extern "C" { +#endif + /** * Hash table constructor * @@ -88,6 +92,10 @@ extern void *hash_table_find(struct hash_table *ht, const void *key); extern void hash_table_insert(struct hash_table *ht, void *data, const void *key); +/** + * Remove a specific element from a hash table. + */ +extern void hash_table_remove(struct hash_table *ht, const void *key); /** * Compute hash value of a string @@ -112,4 +120,31 @@ extern unsigned hash_table_string_hash(const void *key); */ #define hash_table_string_compare ((hash_compare_func_t) strcmp) + +/** + * Compute hash value of a pointer + * + * \param key Pointer to be used as a hash key + * + * \note + * The memory pointed to by \c key is \b never accessed. The value of \c key + * itself is used as the hash key + * + * \sa hash_table_pointer_compare + */ +unsigned +hash_table_pointer_hash(const void *key); + + +/** + * Compare two pointers used as keys + * + * \sa hash_table_pointer_hash + */ +int +hash_table_pointer_compare(const void *key1, const void *key2); + +#ifdef __cplusplus +} +#endif #endif /* HASH_TABLE_H */ |