/**
* Key for the entry.
*/
- GNUNET_HashCode key;
+ struct GNUNET_HashCode key;
/**
* Value of the entry.
*/
static unsigned int
idx_of (const struct GNUNET_CONTAINER_MultiHashMap *m,
- const GNUNET_HashCode * key)
+ const struct GNUNET_HashCode * key)
{
GNUNET_assert (m != NULL);
return (*(unsigned int *) key) % m->map_length;
*/
void *
GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap
- *map, const GNUNET_HashCode * key)
+ *map, const struct GNUNET_HashCode * key)
{
struct MapEntry *e;
e = map->map[idx_of (map, key)];
while (e != NULL)
{
- if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+ if (0 == memcmp (key, &e->key, sizeof (struct GNUNET_HashCode)))
return e->value;
e = e->next;
}
unsigned int i;
struct MapEntry *e;
struct MapEntry *n;
- GNUNET_HashCode kc;
+ struct GNUNET_HashCode kc;
count = 0;
GNUNET_assert (map != NULL);
*/
int
GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map,
- const GNUNET_HashCode * key, void *value)
+ const struct GNUNET_HashCode * key, void *value)
{
struct MapEntry *e;
struct MapEntry *p;
e = map->map[i];
while (e != NULL)
{
- if ((0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) &&
+ if ((0 == memcmp (key, &e->key, sizeof (struct GNUNET_HashCode))) &&
(value == e->value))
{
if (p == NULL)
*/
int
GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap
- *map, const GNUNET_HashCode * key)
+ *map, const struct GNUNET_HashCode * key)
{
struct MapEntry *e;
struct MapEntry *p;
e = map->map[i];
while (e != NULL)
{
- if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+ if (0 == memcmp (key, &e->key, sizeof (struct GNUNET_HashCode)))
{
if (p == NULL)
map->map[i] = e->next;
int
GNUNET_CONTAINER_multihashmap_contains (const struct
GNUNET_CONTAINER_MultiHashMap *map,
- const GNUNET_HashCode * key)
+ const struct GNUNET_HashCode * key)
{
struct MapEntry *e;
e = map->map[idx_of (map, key)];
while (e != NULL)
{
- if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+ if (0 == memcmp (key, &e->key, sizeof (struct GNUNET_HashCode)))
return GNUNET_YES;
e = e->next;
}
int
GNUNET_CONTAINER_multihashmap_contains_value (const struct
GNUNET_CONTAINER_MultiHashMap
- *map, const GNUNET_HashCode * key,
+ *map, const struct GNUNET_HashCode * key,
const void *value)
{
struct MapEntry *e;
e = map->map[idx_of (map, key)];
while (e != NULL)
{
- if ((0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) &&
+ if ((0 == memcmp (key, &e->key, sizeof (struct GNUNET_HashCode))) &&
(e->value == value))
return GNUNET_YES;
e = e->next;
*/
int
GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map,
- const GNUNET_HashCode * key, void *value,
+ const struct GNUNET_HashCode * key, void *value,
enum GNUNET_CONTAINER_MultiHashMapOption opt)
{
struct MapEntry *e;
e = map->map[i];
while (e != NULL)
{
- if (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+ if (0 == memcmp (key, &e->key, sizeof (struct GNUNET_HashCode)))
{
if (opt == GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)
return GNUNET_SYSERR;
int
GNUNET_CONTAINER_multihashmap_get_multiple (const struct
GNUNET_CONTAINER_MultiHashMap *map,
- const GNUNET_HashCode * key,
+ const struct GNUNET_HashCode * key,
GNUNET_CONTAINER_HashMapIterator it,
void *it_cls)
{
while (NULL != (e = n))
{
n = e->next;
- if (0 != memcmp (key, &e->key, sizeof (GNUNET_HashCode)))
+ if (0 != memcmp (key, &e->key, sizeof (struct GNUNET_HashCode)))
continue;
if ((it != NULL) && (GNUNET_OK != it (it_cls, key, e->value)))
return GNUNET_SYSERR;