GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
* If there is a hash collision, we create a linked list.
*/
struct SmallMapEntry *next;
* If there is a hash collision, we create a linked list.
*/
struct SmallMapEntry *next;
- * GNUNET_NO if the map entries are of type 'struct BigMapEntry',
- * GNUNET_YES if the map entries are of type 'struct SmallMapEntry'.
+ * #GNUNET_NO if the map entries are of type 'struct BigMapEntry',
+ * #GNUNET_YES if the map entries are of type 'struct SmallMapEntry'.
- * @param do_not_copy_keys GNUNET_NO is always safe and should be used by default;
- * GNUNET_YES means that on 'put', the 'key' does not have
- * to be copied as the destination of the pointer is
+ * @param do_not_copy_keys #GNUNET_NO is always safe and should be used by default;
+ * #GNUNET_YES means that on 'put', the 'key' does not have
+ * to be copied as the destination of the pointer is
- * the hashmap. This can significantly reduce memory
- * consumption, but of course is also a recipie for
+ * the hashmap. This can significantly reduce memory
+ * consumption, but of course is also a recipie for
* heap corruption if the assumption is not true. Only
* use this if (1) memory use is important in this case and
* (2) you have triple-checked that the invariant holds
* heap corruption if the assumption is not true. Only
* use this if (1) memory use is important in this case and
* (2) you have triple-checked that the invariant holds
old_map[i].bme = bme->next;
idx = idx_of (map, &bme->key);
bme->next = new_map[idx].bme;
old_map[i].bme = bme->next;
idx = idx_of (map, &bme->key);
bme->next = new_map[idx].bme;
- * @return GNUNET_OK on success,
- * GNUNET_NO if a value was replaced (with REPLACE)
- * GNUNET_SYSERR if UNIQUE_ONLY was the option and the
+ * @return #GNUNET_OK on success,
+ * #GNUNET_NO if a value was replaced (with REPLACE)
+ * #GNUNET_SYSERR if UNIQUE_ONLY was the option and the
if (0 == memcmp (key, sme->key, sizeof (struct GNUNET_HashCode)))
{
if (opt == GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)
if (0 == memcmp (key, sme->key, sizeof (struct GNUNET_HashCode)))
{
if (opt == GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)
if (0 == memcmp (key, &bme->key, sizeof (struct GNUNET_HashCode)))
{
if (opt == GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)
if (0 == memcmp (key, &bme->key, sizeof (struct GNUNET_HashCode)))
{
if (opt == GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)
* @param it function to call on each entry
* @param it_cls extra argument to it
* @return the number of key value pairs processed,
* @param it function to call on each entry
* @param it_cls extra argument to it
* @return the number of key value pairs processed,
me = map->map[idx_of (map, key)];
if (map->use_small_entries)
{
me = map->map[idx_of (map, key)];
if (map->use_small_entries)
{
* Create an iterator for a multihashmap.
* The iterator can be used to retrieve all the elements in the multihashmap
* one by one, without having to handle all elements at once (in contrast to
* Create an iterator for a multihashmap.
* The iterator can be used to retrieve all the elements in the multihashmap
* one by one, without having to handle all elements at once (in contrast to
* used anymore if elements have been removed from 'map' after the creation of
* the iterator, or 'map' has been destroyed. Adding elements to 'map' may
* result in skipped or repeated elements.
* used anymore if elements have been removed from 'map' after the creation of
* the iterator, or 'map' has been destroyed. Adding elements to 'map' may
* result in skipped or repeated elements.
* @param iter the iterator to get the next element from
* @param key pointer to store the key in, can be NULL
* @param value pointer to store the value in, can be NULL
* @param iter the iterator to get the next element from
* @param key pointer to store the key in, can be NULL
* @param value pointer to store the value in, can be NULL
- * @return GNUNET_YES we returned an element,
- * GNUNET_NO if we are out of elements
+ * @return #GNUNET_YES we returned an element,
+ * #GNUNET_NO if we are out of elements
GNUNET_assert (iter->modification_counter == iter->map->modification_counter);
/* look for the next entry, skipping empty buckets */
GNUNET_assert (iter->modification_counter == iter->map->modification_counter);
/* look for the next entry, skipping empty buckets */