return node;
}
-struct util_hash_iter util_hash_insert(struct util_hash *hash,
- unsigned key, void *data)
+drm_private struct util_hash_iter
+util_hash_insert(struct util_hash *hash, unsigned key, void *data)
{
util_data_might_grow(hash->data.d);
}
}
-struct util_hash * util_hash_create(void)
+drm_private struct util_hash *util_hash_create(void)
{
struct util_hash *hash = malloc(sizeof(struct util_hash));
if (!hash)
return hash;
}
-void util_hash_delete(struct util_hash *hash)
+drm_private void util_hash_delete(struct util_hash *hash)
{
struct util_node *e_for_x = (struct util_node *)(hash->data.d);
struct util_node **bucket = (struct util_node **)(hash->data.d->buckets);
free(hash);
}
-struct util_hash_iter util_hash_find(struct util_hash *hash,
- unsigned key)
+drm_private struct util_hash_iter
+util_hash_find(struct util_hash *hash, unsigned key)
{
struct util_node **nextNode = util_hash_find_node(hash, key);
struct util_hash_iter iter = {hash, *nextNode};
return iter;
}
-unsigned util_hash_iter_key(struct util_hash_iter iter)
+drm_private unsigned util_hash_iter_key(struct util_hash_iter iter)
{
if (!iter.node || iter.hash->data.e == iter.node)
return 0;
return iter.node->key;
}
-void * util_hash_iter_data(struct util_hash_iter iter)
+drm_private void *util_hash_iter_data(struct util_hash_iter iter)
{
if (!iter.node || iter.hash->data.e == iter.node)
return 0;
return a.e;
}
-struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter)
+drm_private struct util_hash_iter
+util_hash_iter_next(struct util_hash_iter iter)
{
struct util_hash_iter next = {iter.hash, util_hash_data_next(iter.node)};
return next;
}
-int util_hash_iter_is_null(struct util_hash_iter iter)
+drm_private int util_hash_iter_is_null(struct util_hash_iter iter)
{
if (!iter.node || iter.node == iter.hash->data.e)
return 1;
return 0;
}
-void * util_hash_take(struct util_hash *hash,
- unsigned akey)
+drm_private void *util_hash_take(struct util_hash *hash, unsigned akey)
{
struct util_node **node = util_hash_find_node(hash, akey);
if (*node != hash->data.e) {
return 0;
}
-struct util_hash_iter util_hash_first_node(struct util_hash *hash)
+drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash)
{
struct util_hash_iter iter = {hash, util_data_first_node(hash->data.d)};
return iter;
}
-struct util_hash_iter util_hash_erase(struct util_hash *hash, struct util_hash_iter iter)
+drm_private struct util_hash_iter
+util_hash_erase(struct util_hash *hash, struct util_hash_iter iter)
{
struct util_hash_iter ret = iter;
struct util_node *node = iter.node;
#ifndef UTIL_HASH_H
#define UTIL_HASH_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdbool.h>
+#include "libdrm_macros.h"
+
struct util_hash;
struct util_node;
};
-struct util_hash *util_hash_create(void);
-void util_hash_delete(struct util_hash *hash);
+drm_private struct util_hash *util_hash_create(void);
+drm_private void util_hash_delete(struct util_hash *hash);
/**
* in the collision list.
* Function returns iterator pointing to the inserted item in the hash.
*/
-struct util_hash_iter util_hash_insert(struct util_hash *hash, unsigned key,
- void *data);
+drm_private struct util_hash_iter
+util_hash_insert(struct util_hash *hash, unsigned key, void *data);
/**
* Removes the item pointed to by the current iterator from the hash.
* Function returns iterator pointing to the item after the removed one in
* the hash.
*/
-struct util_hash_iter util_hash_erase(struct util_hash *hash,
- struct util_hash_iter iter);
+drm_private struct util_hash_iter
+util_hash_erase(struct util_hash *hash, struct util_hash_iter iter);
-void *util_hash_take(struct util_hash *hash, unsigned key);
+drm_private void *util_hash_take(struct util_hash *hash, unsigned key);
-struct util_hash_iter util_hash_first_node(struct util_hash *hash);
+drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash);
/**
* Return an iterator pointing to the first entry in the collision list.
*/
-struct util_hash_iter util_hash_find(struct util_hash *hash, unsigned key);
+drm_private struct util_hash_iter
+util_hash_find(struct util_hash *hash, unsigned key);
-int util_hash_iter_is_null(struct util_hash_iter iter);
-unsigned util_hash_iter_key(struct util_hash_iter iter);
-void *util_hash_iter_data(struct util_hash_iter iter);
+drm_private int util_hash_iter_is_null(struct util_hash_iter iter);
+drm_private unsigned util_hash_iter_key(struct util_hash_iter iter);
+drm_private void *util_hash_iter_data(struct util_hash_iter iter);
-struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter);
+drm_private struct util_hash_iter
+util_hash_iter_next(struct util_hash_iter iter);
#endif