amdgpu/util_hash_table: hide private symbols from global namespace

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
main
Emil Velikov 2015-08-07 16:44:33 +01:00
parent 5f0f6387a6
commit f4d14f147c
2 changed files with 26 additions and 16 deletions

View File

@ -69,7 +69,8 @@ util_hash_table_item(struct util_hash_iter iter)
return (struct util_hash_table_item *)util_hash_iter_data(iter);
}
struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key),
drm_private struct util_hash_table *
util_hash_table_create(unsigned (*hash)(void *key),
int (*compare)(void *key1, void *key2))
{
struct util_hash_table *ht;
@ -126,7 +127,8 @@ util_hash_table_find_item(struct util_hash_table *ht,
return NULL;
}
void util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
drm_private void
util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
{
unsigned key_hash;
struct util_hash_table_item *item;
@ -159,7 +161,7 @@ void util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
}
}
void *util_hash_table_get(struct util_hash_table *ht, void *key)
drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key)
{
unsigned key_hash;
struct util_hash_table_item *item;
@ -177,7 +179,7 @@ void *util_hash_table_get(struct util_hash_table *ht, void *key)
return item->value;
}
void util_hash_table_remove(struct util_hash_table *ht, void *key)
drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key)
{
unsigned key_hash;
struct util_hash_iter iter;
@ -200,7 +202,7 @@ void util_hash_table_remove(struct util_hash_table *ht, void *key)
util_hash_erase(ht->head, iter);
}
void util_hash_table_clear(struct util_hash_table *ht)
drm_private void util_hash_table_clear(struct util_hash_table *ht)
{
struct util_hash_iter iter;
struct util_hash_table_item *item;
@ -217,7 +219,7 @@ void util_hash_table_clear(struct util_hash_table *ht)
}
}
void util_hash_table_foreach(struct util_hash_table *ht,
drm_private void util_hash_table_foreach(struct util_hash_table *ht,
void (*callback)(void *key, void *value, void *data),
void *data)
{
@ -236,7 +238,7 @@ void util_hash_table_foreach(struct util_hash_table *ht,
}
}
void util_hash_table_destroy(struct util_hash_table *ht)
drm_private void util_hash_table_destroy(struct util_hash_table *ht)
{
struct util_hash_iter iter;
struct util_hash_table_item *item;

View File

@ -34,6 +34,12 @@
#ifndef U_HASH_TABLE_H_
#define U_HASH_TABLE_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "libdrm_macros.h"
/**
* Generic purpose hash table.
*/
@ -45,21 +51,23 @@ struct util_hash_table;
* @param hash hash function
* @param compare should return 0 for two equal keys.
*/
struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key),
drm_private struct util_hash_table *
util_hash_table_create(unsigned (*hash)(void *key),
int (*compare)(void *key1, void *key2));
void util_hash_table_set(struct util_hash_table *ht, void *key, void *value);
drm_private void
util_hash_table_set(struct util_hash_table *ht, void *key, void *value);
void *util_hash_table_get(struct util_hash_table *ht, void *key);
drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key);
void util_hash_table_remove(struct util_hash_table *ht, void *key);
drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key);
void util_hash_table_clear(struct util_hash_table *ht);
drm_private void util_hash_table_clear(struct util_hash_table *ht);
void util_hash_table_foreach(struct util_hash_table *ht,
drm_private void util_hash_table_foreach(struct util_hash_table *ht,
void (*callback)(void *key, void *value, void *data),
void *data);
void util_hash_table_destroy(struct util_hash_table *ht);
drm_private void util_hash_table_destroy(struct util_hash_table *ht);
#endif /* U_HASH_TABLE_H_ */