GNUnet  0.10.x
gnunet_container_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2001-2015 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19 */
20 
47 #ifndef GNUNET_CONTAINER_LIB_H
48 #define GNUNET_CONTAINER_LIB_H
49 
50 /* add error and config prototypes */
51 #include "gnunet_crypto_lib.h"
52 
53 
69 int
70 GNUNET_try_compression (const char *data,
71  size_t old_size,
72  char **result,
73  size_t *new_size);
74 
75 
86 char *
87 GNUNET_decompress (const char *input, size_t input_size, size_t output_size);
88 
89 
90 #if HAVE_EXTRACTOR_H
91 
92 #include <extractor.h>
93 
94 #else
95 
96 /* definitions from extractor.h we need for the build */
97 
103 {
127 
128 };
129 
134 {
139 
145 
150 
156 };
157 
158 
176 typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
177  const char *plugin_name,
179  enum EXTRACTOR_MetaFormat format,
180  const char *data_mime_type,
181  const char *data,
182  size_t data_len);
183 
184 #endif
185 
186 #ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
187 /* hack for LE < 0.6.3 */
188 #define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
189 #endif
190 
191 #ifdef __cplusplus
192 extern "C" {
193 #if 0 /* keep Emacsens' auto-indent happy */
194 }
195 #endif
196 #endif
197 
198 
199 /* ******************* bloomfilter ***************** */
200 
206 
207 
217 typedef int (*GNUNET_CONTAINER_HashCodeIterator) (void *cls,
218  struct GNUNET_HashCode *next);
219 
220 
235  size_t size,
236  unsigned int k);
237 
238 
255  size_t size,
256  unsigned int k);
257 
258 
268 int
270  const struct GNUNET_CONTAINER_BloomFilter *bf,
271  char *data,
272  size_t size);
273 
274 
283 int
285  const struct GNUNET_CONTAINER_BloomFilter *bf,
286  const struct GNUNET_HashCode *e);
287 
288 
296 void
298  const struct GNUNET_HashCode *e);
299 
300 
308 void
310  const struct GNUNET_HashCode *e);
311 
312 
322  const struct GNUNET_CONTAINER_BloomFilter *bf);
323 
324 
333 void
335 
336 
343 size_t
345  const struct GNUNET_CONTAINER_BloomFilter *bf);
346 
347 
355 size_t
357  const struct GNUNET_CONTAINER_BloomFilter *bf);
358 
359 
366 void
368 
369 
382 int
384  const char *data,
385  size_t size);
386 
387 
398 int
400  struct GNUNET_CONTAINER_BloomFilter *bf,
401  const struct GNUNET_CONTAINER_BloomFilter *to_or);
402 
403 
416 void
419  void *iterator_cls,
420  size_t size,
421  unsigned int k);
422 
423 
424 /* ****************** metadata ******************* */
425 
431 
432 
441 
442 
452  const struct GNUNET_CONTAINER_MetaData *md);
453 
454 
461 void
463 
464 
476 int
478  const struct GNUNET_CONTAINER_MetaData *md1,
479  const struct GNUNET_CONTAINER_MetaData *md2);
480 
481 
500 int
502  const char *plugin_name,
504  enum EXTRACTOR_MetaFormat format,
505  const char *data_mime_type,
506  const char *data,
507  size_t data_size);
508 
509 
518 void
520  const struct GNUNET_CONTAINER_MetaData *in);
521 
522 
534 int
537  const char *data,
538  size_t data_size);
539 
540 
547 void
549 
550 
558 void
560  struct GNUNET_CONTAINER_MetaData *md);
561 
562 
573 int
576  void *iter_cls);
577 
578 
590 char *
592  const struct GNUNET_CONTAINER_MetaData *md,
593  enum EXTRACTOR_MetaType type);
594 
595 
608 char *
610  const struct GNUNET_CONTAINER_MetaData *md,
611  ...);
612 
623 size_t
625  const struct GNUNET_CONTAINER_MetaData *md,
626  unsigned char **thumb);
627 
628 
634 {
640 
647 
653 };
654 
655 
671 ssize_t
673  const struct GNUNET_CONTAINER_MetaData *md,
674  char **target,
675  size_t max,
677 
678 
686 ssize_t
688  const struct GNUNET_CONTAINER_MetaData *md);
689 
690 
701 GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size);
702 
703 
704 /* ******************************* HashMap **************************** */
705 
711 
718 
724 {
725 
733 
739 
746 
757 };
758 
759 
772  void *cls,
773  const struct GNUNET_HashCode *key,
774  void *value);
775 
776 
794 GNUNET_CONTAINER_multihashmap_create (unsigned int len, int do_not_copy_keys);
795 
796 
804 void
807 
808 
820 void *
822  const struct GNUNET_CONTAINER_MultiHashMap *map,
823  const struct GNUNET_HashCode *key);
824 
825 
838 int
840  const struct GNUNET_HashCode *key,
841  const void *value);
842 
852 int
855  const struct GNUNET_HashCode *key);
856 
857 
866 unsigned int
868 
869 
880 int
882  const struct GNUNET_CONTAINER_MultiHashMap *map,
883  const struct GNUNET_HashCode *key);
884 
885 
897 int
899  const struct GNUNET_CONTAINER_MultiHashMap *map,
900  const struct GNUNET_HashCode *key,
901  const void *value);
902 
903 
917 int
920  const struct GNUNET_HashCode *key,
921  void *value,
923 
931 unsigned int
933  const struct GNUNET_CONTAINER_MultiHashMap *map);
934 
935 
946 int
950  void *it_cls);
951 
952 
968  const struct GNUNET_CONTAINER_MultiHashMap *map);
969 
970 
986 int
989  struct GNUNET_HashCode *key,
990  const void **value);
991 
992 
999 void
1002 
1003 
1015 int
1018  const struct GNUNET_HashCode *key,
1020  void *it_cls);
1021 
1022 
1034 unsigned int
1036  const struct GNUNET_CONTAINER_MultiHashMap *map,
1038  void *it_cls);
1039 
1040 
1041 /* ***************** Version of Multihashmap for peer identities ****************** */
1042 
1055  void *cls,
1056  const struct GNUNET_PeerIdentity *key,
1057  void *value);
1058 
1059 
1064 
1065 
1083 GNUNET_CONTAINER_multipeermap_create (unsigned int len, int do_not_copy_keys);
1084 
1085 
1093 void
1096 
1097 
1109 void *
1111  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1112  const struct GNUNET_PeerIdentity *key);
1113 
1114 
1127 int
1129  const struct GNUNET_PeerIdentity *key,
1130  const void *value);
1131 
1141 int
1144  const struct GNUNET_PeerIdentity *key);
1145 
1146 
1157 int
1159  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1160  const struct GNUNET_PeerIdentity *key);
1161 
1162 
1174 int
1176  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1177  const struct GNUNET_PeerIdentity *key,
1178  const void *value);
1179 
1180 
1194 int
1197  const struct GNUNET_PeerIdentity *key,
1198  void *value,
1200 
1201 
1209 unsigned int
1211  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1212 
1213 
1224 int
1228  void *it_cls);
1229 
1230 
1247  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1248 
1249 
1265 int
1268  struct GNUNET_PeerIdentity *key,
1269  const void **value);
1270 
1271 
1278 void
1281 
1282 
1294 int
1297  const struct GNUNET_PeerIdentity *key,
1299  void *it_cls);
1300 
1301 
1313 unsigned int
1315  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1317  void *it_cls);
1318 
1319 
1320 /* ***************** Version of Multihashmap for short hashes ****************** */
1321 
1334  void *cls,
1335  const struct GNUNET_ShortHashCode *key,
1336  void *value);
1337 
1338 
1343 
1344 
1362 GNUNET_CONTAINER_multishortmap_create (unsigned int len, int do_not_copy_keys);
1363 
1364 
1372 void
1375 
1376 
1388 void *
1390  const struct GNUNET_CONTAINER_MultiShortmap *map,
1391  const struct GNUNET_ShortHashCode *key);
1392 
1393 
1406 int
1409  const struct GNUNET_ShortHashCode *key,
1410  const void *value);
1411 
1421 int
1424  const struct GNUNET_ShortHashCode *key);
1425 
1426 
1437 int
1439  const struct GNUNET_CONTAINER_MultiShortmap *map,
1440  const struct GNUNET_ShortHashCode *key);
1441 
1442 
1454 int
1456  const struct GNUNET_CONTAINER_MultiShortmap *map,
1457  const struct GNUNET_ShortHashCode *key,
1458  const void *value);
1459 
1460 
1474 int
1477  const struct GNUNET_ShortHashCode *key,
1478  void *value,
1480 
1481 
1489 unsigned int
1491  const struct GNUNET_CONTAINER_MultiShortmap *map);
1492 
1493 
1504 int
1508  void *it_cls);
1509 
1510 
1512 
1513 
1529  const struct GNUNET_CONTAINER_MultiShortmap *map);
1530 
1531 
1547 int
1550  struct GNUNET_ShortHashCode *key,
1551  const void **value);
1552 
1553 
1560 void
1563 
1564 
1576 int
1579  const struct GNUNET_ShortHashCode *key,
1581  void *it_cls);
1582 
1583 
1595 unsigned int
1597  const struct GNUNET_CONTAINER_MultiShortmap *map,
1599  void *it_cls);
1600 
1601 
1602 /* ***************** Version of Multihashmap for UUIDs ****************** */
1603 
1604 
1617  void *cls,
1618  const struct GNUNET_Uuid *key,
1619  void *value);
1620 
1621 
1626 
1627 
1645 GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys);
1646 
1647 
1655 void
1658 
1659 
1671 void *
1673  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1674  const struct GNUNET_Uuid *key);
1675 
1676 
1689 int
1691  const struct GNUNET_Uuid *key,
1692  const void *value);
1693 
1703 int
1706  const struct GNUNET_Uuid *key);
1707 
1708 
1719 int
1721  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1722  const struct GNUNET_Uuid *key);
1723 
1724 
1736 int
1738  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1739  const struct GNUNET_Uuid *key,
1740  const void *value);
1741 
1742 
1756 int
1759  const struct GNUNET_Uuid *key,
1760  void *value,
1762 
1763 
1771 unsigned int
1773  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1774 
1775 
1786 int
1790  void *it_cls);
1791 
1792 
1794 
1795 
1811  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1812 
1813 
1829 int
1832  struct GNUNET_Uuid *key,
1833  const void **value);
1834 
1835 
1842 void
1845 
1846 
1858 int
1861  const struct GNUNET_Uuid *key,
1863  void *it_cls);
1864 
1865 
1877 unsigned int
1879  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1881  void *it_cls);
1882 
1883 
1884 /* Version of multihashmap with 32 bit keys */
1885 
1891 
1892 
1899 
1900 
1913  uint32_t key,
1914  void *value);
1915 
1916 
1926 
1927 
1935 void
1938 
1939 
1947 unsigned int
1949  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
1950 
1951 
1963 void *
1965  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
1966  uint32_t key);
1967 
1968 
1979 int
1983  void *it_cls);
1984 
1985 
1998 int
2001  uint32_t key,
2002  const void *value);
2003 
2004 
2014 int
2017  uint32_t key);
2018 
2019 
2030 int
2032  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2033  uint32_t key);
2034 
2035 
2047 int
2049  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2050  uint32_t key,
2051  const void *value);
2052 
2053 
2067 int
2070  uint32_t key,
2071  void *value,
2073 
2074 
2086 int
2089  uint32_t key,
2091  void *it_cls);
2092 
2093 
2108  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
2109 
2110 
2125 int
2128  uint32_t *key,
2129  const void **value);
2130 
2131 
2137 void
2140 
2141 
2142 /* ******************** doubly-linked list *************** */
2143 /* To avoid mistakes: head->prev == tail->next == NULL */
2144 
2154 #define GNUNET_CONTAINER_DLL_insert(head, tail, element) \
2155  do \
2156  { \
2157  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2158  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2159  (element)->next = (head); \
2160  (element)->prev = NULL; \
2161  if ((tail) == NULL) \
2162  (tail) = element; \
2163  else \
2164  (head)->prev = element; \
2165  (head) = (element); \
2166  } while (0)
2167 
2168 
2178 #define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \
2179  do \
2180  { \
2181  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2182  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2183  (element)->prev = (tail); \
2184  (element)->next = NULL; \
2185  if ((head) == NULL) \
2186  (head) = element; \
2187  else \
2188  (tail)->next = element; \
2189  (tail) = (element); \
2190  } while (0)
2191 
2192 
2203 #define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \
2204  do \
2205  { \
2206  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2207  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2208  (element)->prev = (other); \
2209  if (NULL == other) \
2210  { \
2211  (element)->next = (head); \
2212  (head) = (element); \
2213  } \
2214  else \
2215  { \
2216  (element)->next = (other)->next; \
2217  (other)->next = (element); \
2218  } \
2219  if (NULL == (element)->next) \
2220  (tail) = (element); \
2221  else \
2222  (element)->next->prev = (element); \
2223  } while (0)
2224 
2225 
2236 #define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \
2237  do \
2238  { \
2239  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2240  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2241  (element)->next = (other); \
2242  if (NULL == other) \
2243  { \
2244  (element)->prev = (tail); \
2245  (tail) = (element); \
2246  } \
2247  else \
2248  { \
2249  (element)->prev = (other)->prev; \
2250  (other)->prev = (element); \
2251  } \
2252  if (NULL == (element)->prev) \
2253  (head) = (element); \
2254  else \
2255  (element)->prev->next = (element); \
2256  } while (0)
2257 
2258 
2273 #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \
2274  do \
2275  { \
2276  GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \
2277  GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \
2278  if ((element)->prev == NULL) \
2279  (head) = (element)->next; \
2280  else \
2281  (element)->prev->next = (element)->next; \
2282  if ((element)->next == NULL) \
2283  (tail) = (element)->prev; \
2284  else \
2285  (element)->next->prev = (element)->prev; \
2286  (element)->next = NULL; \
2287  (element)->prev = NULL; \
2288  } while (0)
2289 
2290 
2291 /* ************ Multi-DLL interface, allows DLL elements to be
2292  in multiple lists at the same time *********************** */
2293 
2304 #define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \
2305  do \
2306  { \
2307  GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \
2308  GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \
2309  (element)->next_##mdll = (head); \
2310  (element)->prev_##mdll = NULL; \
2311  if ((tail) == NULL) \
2312  (tail) = element; \
2313  else \
2314  (head)->prev_##mdll = element; \
2315  (head) = (element); \
2316  } while (0)
2317 
2318 
2329 #define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \
2330  do \
2331  { \
2332  GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \
2333  GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \
2334  (element)->prev_##mdll = (tail); \
2335  (element)->next_##mdll = NULL; \
2336  if ((head) == NULL) \
2337  (head) = element; \
2338  else \
2339  (tail)->next_##mdll = element; \
2340  (tail) = (element); \
2341  } while (0)
2342 
2343 
2355 #define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \
2356  do \
2357  { \
2358  GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \
2359  GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \
2360  (element)->prev_##mdll = (other); \
2361  if (NULL == other) \
2362  { \
2363  (element)->next_##mdll = (head); \
2364  (head) = (element); \
2365  } \
2366  else \
2367  { \
2368  (element)->next_##mdll = (other)->next_##mdll; \
2369  (other)->next_##mdll = (element); \
2370  } \
2371  if (NULL == (element)->next_##mdll) \
2372  (tail) = (element); \
2373  else \
2374  (element)->next_##mdll->prev_##mdll = (element); \
2375  } while (0)
2376 
2377 
2389 #define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \
2390  do \
2391  { \
2392  GNUNET_assert (((element)->prev_##mdll == NULL) && ((head) != (element))); \
2393  GNUNET_assert (((element)->next_##mdll == NULL) && ((tail) != (element))); \
2394  (element)->next_##mdll = (other); \
2395  if (NULL == other) \
2396  { \
2397  (element)->prev = (tail); \
2398  (tail) = (element); \
2399  } \
2400  else \
2401  { \
2402  (element)->prev_##mdll = (other)->prev_##mdll; \
2403  (other)->prev_##mdll = (element); \
2404  } \
2405  if (NULL == (element)->prev_##mdll) \
2406  (head) = (element); \
2407  else \
2408  (element)->prev_##mdll->next_##mdll = (element); \
2409  } while (0)
2410 
2411 
2423 #define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \
2424  do \
2425  { \
2426  GNUNET_assert (((element)->prev_##mdll != NULL) || ((head) == (element))); \
2427  GNUNET_assert (((element)->next_##mdll != NULL) || ((tail) == (element))); \
2428  if ((element)->prev_##mdll == NULL) \
2429  (head) = (element)->next_##mdll; \
2430  else \
2431  (element)->prev_##mdll->next_##mdll = (element)->next_##mdll; \
2432  if ((element)->next_##mdll == NULL) \
2433  (tail) = (element)->prev_##mdll; \
2434  else \
2435  (element)->next_##mdll->prev_##mdll = (element)->prev_##mdll; \
2436  (element)->next_##mdll = NULL; \
2437  (element)->prev_##mdll = NULL; \
2438  } while (0)
2439 
2440 
2454 #define GNUNET_CONTAINER_DLL_insert_sorted(TYPE, \
2455  comparator, \
2456  comparator_cls, \
2457  head, \
2458  tail, \
2459  element) \
2460  do \
2461  { \
2462  if ((NULL == head) || (0 < comparator (comparator_cls, element, head))) \
2463  { \
2464  /* insert at head, element < head */ \
2465  GNUNET_CONTAINER_DLL_insert (head, tail, element); \
2466  } \
2467  else \
2468  { \
2469  TYPE *pos; \
2470  \
2471  for (pos = head; NULL != pos; pos = pos->next) \
2472  if (0 < comparator (comparator_cls, element, pos)) \
2473  break; /* element < pos */ \
2474  if (NULL == pos) /* => element > tail */ \
2475  { \
2476  GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \
2477  } \
2478  else /* prev < element < pos */ \
2479  { \
2480  GNUNET_CONTAINER_DLL_insert_after (head, tail, pos->prev, element); \
2481  } \
2482  } \
2483  } while (0)
2484 
2485 
2486 /* ******************** Heap *************** */
2487 
2488 
2494 
2495 
2501 {
2507 
2513 };
2514 
2515 
2520 struct GNUNET_CONTAINER_Heap;
2521 
2522 
2528 
2529 
2537 struct GNUNET_CONTAINER_Heap *
2539 
2540 
2548 void
2550 
2551 
2559 void *
2561 
2562 
2572 int
2574  void **element,
2576 
2577 
2585 unsigned int
2587 
2588 
2598  const struct GNUNET_CONTAINER_HeapNode *node);
2599 
2600 
2613  void *cls,
2614  struct GNUNET_CONTAINER_HeapNode *node,
2615  void *element,
2617 
2618 
2627 void
2630  void *iterator_cls);
2631 
2644 void *
2646 
2647 
2659  void *element,
2661 
2662 
2670 void *
2672 
2673 
2681 void *
2683 
2684 
2692 void
2695 
2696 
2697 #if 0 /* keep Emacsens' auto-indent happy */
2698 {
2699 #endif
2700 #ifdef __cplusplus
2701 }
2702 #endif
2703 
2704 
2705 /* ifndef GNUNET_CONTAINER_LIB_H */
2706 #endif
2707 /* end of gnunet_container_lib.h */
static int iterator(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterator over hash map entries.
ssize_t GNUNET_CONTAINER_meta_data_get_serialized_size(const struct GNUNET_CONTAINER_MetaData *md)
Get the size of the full meta-data in serialized form.
int(* GNUNET_CONTAINER_MulitHashMapIteratorCallback)(void *cls, const struct GNUNET_HashCode *key, void *value)
Iterator over hash map entries.
void GNUNET_CONTAINER_multiuuidmap_iterator_destroy(struct GNUNET_CONTAINER_MultiUuidmapIterator *iter)
Destroy a multiuuidmap iterator.
void GNUNET_CONTAINER_multihashmap_iterator_destroy(struct GNUNET_CONTAINER_MultiHashMapIterator *iter)
Destroy a multihashmap iterator.
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_init(const char *data, size_t size, unsigned int k)
Create a Bloom filter from raw bits.
void GNUNET_CONTAINER_heap_update_cost(struct GNUNET_CONTAINER_HeapNode *node, GNUNET_CONTAINER_HeapCostType new_cost)
Updates the cost of any node in the tree.
int GNUNET_CONTAINER_multihashmap_iterator_next(struct GNUNET_CONTAINER_MultiHashMapIterator *iter, struct GNUNET_HashCode *key, const void **value)
Retrieve the next element from the hash map at the iterator&#39;s position.
EXTRACTOR_MetaFormat
Format in which the extracted meta data is presented.
void GNUNET_CONTAINER_meta_data_clear(struct GNUNET_CONTAINER_MetaData *md)
Remove all items in the container.
GNUNET_CONTAINER_MultiHashMapOption
Options for storing values in the HashMap.
ssize_t GNUNET_CONTAINER_meta_data_serialize(const struct GNUNET_CONTAINER_MetaData *md, char **target, size_t max, enum GNUNET_CONTAINER_MetaDataSerializationOptions opt)
Serialize meta-data to target.
void GNUNET_CONTAINER_bloomfilter_add(struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
Add an element to the filter.
unsigned int GNUNET_CONTAINER_multihashmap_size(const struct GNUNET_CONTAINER_MultiHashMap *map)
Get the number of key-value pairs in the map.
int GNUNET_CONTAINER_multiuuidmap_iterate(struct GNUNET_CONTAINER_MultiUuidmap *map, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
If a value with the given key exists, replace it.
unsigned int GNUNET_CONTAINER_multishortmap_size(const struct GNUNET_CONTAINER_MultiShortmap *map)
Get the number of key-value pairs in the map.
struct GNUNET_CONTAINER_HeapNode * GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap, void *element, GNUNET_CONTAINER_HeapCostType cost)
Inserts a new element into the heap.
If not enough space is available, it is acceptable to only serialize some of the metadata.
int GNUNET_CONTAINER_multipeermap_remove_all(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Remove all entries for the given key from the map.
Some kind of binary format, see given Mime type.
struct GNUNET_CONTAINER_MultiHashMapIterator * GNUNET_CONTAINER_multihashmap_iterator_create(const struct GNUNET_CONTAINER_MultiHashMap *map)
Create an iterator for a multihashmap.
void GNUNET_CONTAINER_meta_data_add_publication_date(struct GNUNET_CONTAINER_MetaData *md)
Add the current time as the publication date to the meta-data.
int GNUNET_CONTAINER_multihashmap32_iterate(struct GNUNET_CONTAINER_MultiHashMap32 *map, GNUNET_CONTAINER_MulitHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map.
int GNUNET_CONTAINER_multiuuidmap_remove_all(struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key)
Remove all entries for the given key from the map.
unsigned int GNUNET_CONTAINER_multipeermap_get_random(const struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Call it on a random value from the map, or not at all if the map is empty.
GNUNET_CONTAINER_MetaDataSerializationOptions
Options for metadata serialization.
struct GNUNET_CONTAINER_MultiHashMap32Iterator * GNUNET_CONTAINER_multihashmap32_iterator_create(const struct GNUNET_CONTAINER_MultiHashMap32 *map)
Create an iterator for a 32-bit multihashmap.
unsigned int GNUNET_CONTAINER_multishortmap_get_random(const struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Call it on a random value from the map, or not at all if the map is empty.
size_t GNUNET_CONTAINER_meta_data_get_thumbnail(const struct GNUNET_CONTAINER_MetaData *md, unsigned char **thumb)
Get a thumbnail from the meta-data (if present).
int GNUNET_CONTAINER_multiuuidmap_put(struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void GNUNET_CONTAINER_multiuuidmap_destroy(struct GNUNET_CONTAINER_MultiUuidmap *map)
Destroy a hash map.
int GNUNET_CONTAINER_multihashmap32_iterator_next(struct GNUNET_CONTAINER_MultiHashMap32Iterator *iter, uint32_t *key, const void **value)
Retrieve the next element from the hash map at the iterator&#39;s position.
GNUNET_CONTAINER_HeapCostType cost
Cost for this element.
int GNUNET_CONTAINER_multishortmap_get_multiple(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map that match a particular key.
int GNUNET_CONTAINER_multishortmap_remove(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Remove the given key-value pair from the map.
void GNUNET_CONTAINER_multipeermap_iterator_destroy(struct GNUNET_CONTAINER_MultiPeerMapIterator *iter)
Destroy a multipeermap iterator.
int(* GNUNET_CONTAINER_PeerMapIterator)(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterator over hash map entries.
size_t GNUNET_CONTAINER_bloomfilter_get_size(const struct GNUNET_CONTAINER_BloomFilter *bf)
Get size of the bloom filter.
struct GNUNET_CONTAINER_MetaData * GNUNET_CONTAINER_meta_data_deserialize(const char *input, size_t size)
Deserialize meta-data.
static struct Experiment * e
void GNUNET_CONTAINER_multishortmap_iterator_destroy(struct GNUNET_CONTAINER_MultiShortmapIterator *iter)
Destroy a multishortmap iterator.
int GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
0-terminated, UTF-8 encoded string.
int GNUNET_CONTAINER_multipeermap_iterator_next(struct GNUNET_CONTAINER_MultiPeerMapIterator *iter, struct GNUNET_PeerIdentity *key, const void **value)
Retrieve the next element from the hash map at the iterator&#39;s position.
int GNUNET_CONTAINER_heap_peek2(const struct GNUNET_CONTAINER_Heap *heap, void **element, GNUNET_CONTAINER_HeapCostType *cost)
Get element and cost stored at the root of heap.
size_t GNUNET_CONTAINER_bloomfilter_get_element_addresses(const struct GNUNET_CONTAINER_BloomFilter *bf)
Get the number of the addresses set per element in the bloom filter.
int GNUNET_CONTAINER_multihashmap_remove_all(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Remove all entries for the given key from the map.
int GNUNET_CONTAINER_multihashmap32_get_multiple(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, GNUNET_CONTAINER_MulitHashMapIterator32Callback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
char * GNUNET_CONTAINER_meta_data_get_by_type(const struct GNUNET_CONTAINER_MetaData *md, enum EXTRACTOR_MetaType type)
Get the first MD entry of the given type.
int GNUNET_CONTAINER_multihashmap_contains(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Check if the map contains any value under the given key (including values that are NULL)...
int GNUNET_CONTAINER_multiuuidmap_remove(struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, const void *value)
Remove the given key-value pair from the map.
Internal representation of the hash map.
int(* GNUNET_CONTAINER_ShortmapIterator)(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
Iterator over hash map entries.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
EXTRACTOR_MetaType
Enumeration defining various sources of keywords.
int GNUNET_CONTAINER_multihashmap32_put(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
Internal representation of the hash map.
int GNUNET_CONTAINER_multihashmap32_remove_all(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key)
Remove all entries for the given key from the map.
int GNUNET_CONTAINER_bloomfilter_or2(struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_CONTAINER_BloomFilter *to_or)
"or" the entries of the given raw data array with the data of the given Bloom filter.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
GNUNET_CONTAINER_HeapOrder
Heap type, either max or min.
A 256-bit hashcode.
static struct GNUNET_CONTAINER_MultiPeerMap * map
Handle to the map used to store old latency values for peers.
char * GNUNET_CONTAINER_meta_data_get_first_by_types(const struct GNUNET_CONTAINER_MetaData *md,...)
Get the first matching MD entry of the given types.
void * GNUNET_CONTAINER_multihashmap_get(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Given a key find a value in the map matching the key.
cryptographic primitives for GNUnet
Meta data to associate with a file, directory or namespace.
int(* EXTRACTOR_MetaDataProcessor)(void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format, const char *data_mime_type, const char *data, size_t data_len)
Type of a function that libextractor calls for each meta data item found.
int GNUNET_CONTAINER_multiuuidmap_get_multiple(struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
void * element
Our element.
int GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
, &#39; bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_...
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
static char * value
Value of the record to add/remove.
void GNUNET_CONTAINER_bloomfilter_remove(struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
Remove an element from the filter.
void GNUNET_CONTAINER_meta_data_merge(struct GNUNET_CONTAINER_MetaData *md, const struct GNUNET_CONTAINER_MetaData *in)
Extend metadata.
int GNUNET_CONTAINER_bloomfilter_test(const struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
Test if an element is in the filter.
int GNUNET_CONTAINER_multihashmap32_contains(const struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key)
Check if the map contains any value under the given key (including values that are NULL)...
unsigned int GNUNET_CONTAINER_multihashmap_clear(struct GNUNET_CONTAINER_MultiHashMap *map)
Remove all entries from the map.
void * GNUNET_CONTAINER_multihashmap32_get(const struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key)
Given a key find a value in the map matching the key.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
int(* GNUNET_CONTAINER_HeapIterator)(void *cls, struct GNUNET_CONTAINER_HeapNode *node, void *element, GNUNET_CONTAINER_HeapCostType cost)
Iterator for heap.
struct GNUNET_CONTAINER_MetaData * GNUNET_CONTAINER_meta_data_create(void)
Create a fresh meta data container.
unsigned int GNUNET_CONTAINER_multihashmap_get_random(const struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Call it on a random value from the map, or not at all if the map is empty.
unsigned int GNUNET_CONTAINER_multiuuidmap_get_random(const struct GNUNET_CONTAINER_MultiUuidmap *map, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls)
Call it on a random value from the map, or not at all if the map is empty.
void * GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap)
Get element stored at the root of heap.
unsigned int GNUNET_CONTAINER_multihashmap32_size(const struct GNUNET_CONTAINER_MultiHashMap32 *map)
Get the number of key-value pairs in the map.
static char * filename
int GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
Speed is of the essence, do not allow compression.
void GNUNET_CONTAINER_meta_data_destroy(struct GNUNET_CONTAINER_MetaData *md)
Free meta data.
int GNUNET_CONTAINER_multishortmap_put(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_load(const char *filename, size_t size, unsigned int k)
Load a Bloom filter from a file.
static int result
Global testing status.
Handle to a node in a heap.
A UUID, a 128 bit random value.
struct GNUNET_CONTAINER_MultiShortmapIterator * GNUNET_CONTAINER_multishortmap_iterator_create(const struct GNUNET_CONTAINER_MultiShortmap *map)
Create an iterator for a multihashmap.
struct GNUNET_CONTAINER_MultiUuidmap * GNUNET_CONTAINER_multiuuidmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
static char * plugin_name
Solver plugin name as string.
Internal representation of the hash map.
Internal representation of the hash map.
struct GNUNET_CONTAINER_MultiShortmap * GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
Heap with the minimum cost at the root.
int GNUNET_CONTAINER_multishortmap_remove_all(struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Remove all entries for the given key from the map.
void GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap)
Destroys the heap.
A 512-bit hashcode.
void * GNUNET_CONTAINER_heap_walk_get_next(struct GNUNET_CONTAINER_Heap *heap)
Perform a random walk of the tree.
int GNUNET_CONTAINER_meta_data_insert(struct GNUNET_CONTAINER_MetaData *md, const char *plugin_name, enum EXTRACTOR_MetaType type, enum EXTRACTOR_MetaFormat format, const char *data_mime_type, const char *data, size_t data_size)
Extend metadata.
unsigned int GNUNET_CONTAINER_multiuuidmap_size(const struct GNUNET_CONTAINER_MultiUuidmap *map)
Get the number of key-value pairs in the map.
struct GNUNET_CONTAINER_MultiHashMap32 * GNUNET_CONTAINER_multihashmap32_create(unsigned int len)
Create a 32-bit key multi hash map.
void GNUNET_CONTAINER_multihashmap32_destroy(struct GNUNET_CONTAINER_MultiHashMap32 *map)
Destroy a 32-bit key hash map.
int GNUNET_CONTAINER_meta_data_delete(struct GNUNET_CONTAINER_MetaData *md, enum EXTRACTOR_MetaType type, const char *data, size_t data_size)
Remove an item.
Node in the heap.
unsigned int GNUNET_CONTAINER_heap_get_size(const struct GNUNET_CONTAINER_Heap *heap)
Get the current size of the heap.
enum GNUNET_CONTAINER_HeapOrder order
How is the heap sorted?
void GNUNET_CONTAINER_bloomfilter_clear(struct GNUNET_CONTAINER_BloomFilter *bf)
Reset a Bloom filter to empty.
There must only be one value per key; storing a value should fail if a value under the same key alrea...
struct GNUNET_HashCode key
The key used in the DHT.
int GNUNET_CONTAINER_multiuuidmap_contains(const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key)
Check if the map contains any value under the given key (including values that are NULL)...
Internal representation of the hash map.
static unsigned int size
Size of the "table".
Definition: peer.c:67
uint64_t GNUNET_CONTAINER_HeapCostType
Cost by which elements in a heap can be ordered.
int GNUNET_CONTAINER_multihashmap_contains_value(const struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Check if the map contains the given value under the given key.
int GNUNET_CONTAINER_bloomfilter_or(struct GNUNET_CONTAINER_BloomFilter *bf, const char *data, size_t size)
"or" the entries of the given raw data array with the data of the given Bloom filter.
#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
struct GNUNET_CONTAINER_MultiUuidmapIterator * GNUNET_CONTAINER_multiuuidmap_iterator_create(const struct GNUNET_CONTAINER_MultiUuidmap *map)
Create an iterator for a multihashmap.
int GNUNET_CONTAINER_bloomfilter_get_raw_data(const struct GNUNET_CONTAINER_BloomFilter *bf, char *data, size_t size)
Copy the raw data of this Bloom filter into the given data array.
int GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_Heap * GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order)
Create a new heap.
int(* GNUNET_CONTAINER_MultiUuidmapIteratorCallback)(void *cls, const struct GNUNET_Uuid *key, void *value)
Iterator over uuid map entries.
int GNUNET_CONTAINER_meta_data_test_equal(const struct GNUNET_CONTAINER_MetaData *md1, const struct GNUNET_CONTAINER_MetaData *md2)
Test if two MDs are equal.
Allow multiple values with the same key.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
struct GNUNET_CONTAINER_Heap * heap
Heap this node belongs to.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
The identity of the host (wraps the signing key of the peer).
int GNUNET_CONTAINER_multipeermap_contains_value(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Check if the map contains the given value under the given key.
int GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
void GNUNET_CONTAINER_multihashmap32_iterator_destroy(struct GNUNET_CONTAINER_MultiHashMapIterator *iter)
Destroy a 32-bit multihashmap iterator.
int GNUNET_CONTAINER_multiuuidmap_contains_value(const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key, const void *value)
Check if the map contains the given value under the given key.
int GNUNET_CONTAINER_multiuuidmap_iterator_next(struct GNUNET_CONTAINER_MultiUuidmapIterator *iter, struct GNUNET_Uuid *key, const void **value)
Retrieve the next element from the hash map at the iterator&#39;s position.
void * GNUNET_CONTAINER_multishortmap_get(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Given a key find a value in the map matching the key.
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
int GNUNET_CONTAINER_meta_data_iterate(const struct GNUNET_CONTAINER_MetaData *md, EXTRACTOR_MetaDataProcessor iter, void *iter_cls)
Iterate over MD entries.
struct GNUNET_CONTAINER_MultiPeerMapIterator * GNUNET_CONTAINER_multipeermap_iterator_create(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Create an iterator for a multihashmap.
Heap with the maximum cost at the root.
void * GNUNET_CONTAINER_heap_remove_root(struct GNUNET_CONTAINER_Heap *heap)
Remove root of the heap.
int GNUNET_try_compression(const char *data, size_t old_size, char **result, size_t *new_size)
Try to compress the given block of data using libz.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_copy(const struct GNUNET_CONTAINER_BloomFilter *bf)
Create a copy of a bloomfilter.
int(* GNUNET_CONTAINER_HashCodeIterator)(void *cls, struct GNUNET_HashCode *next)
Iterator over struct GNUNET_HashCode.
unsigned int GNUNET_CONTAINER_multipeermap_size(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Get the number of key-value pairs in the map.
void GNUNET_CONTAINER_heap_iterate(const struct GNUNET_CONTAINER_Heap *heap, GNUNET_CONTAINER_HeapIterator iterator, void *iterator_cls)
Iterate over all entries in the heap.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
uint32_t data
The data value.
int GNUNET_CONTAINER_multihashmap32_contains_value(const struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Check if the map contains the given value under the given key.
void * GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node)
Removes a node from the heap.
int(* GNUNET_CONTAINER_MulitHashMapIterator32Callback)(void *cls, uint32_t key, void *value)
Iterator over hash map entries.
static size_t data_size
Number of bytes in data.
int GNUNET_CONTAINER_multipeermap_contains(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Check if the map contains any value under the given key (including values that are NULL)...
int GNUNET_CONTAINER_multishortmap_contains(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key)
Check if the map contains any value under the given key (including values that are NULL)...
void GNUNET_CONTAINER_bloomfilter_resize(struct GNUNET_CONTAINER_BloomFilter *bf, GNUNET_CONTAINER_HashCodeIterator iterator, void *iterator_cls, size_t size, unsigned int k)
Resize a bloom filter.
char * GNUNET_decompress(const char *input, size_t input_size, size_t output_size)
Decompress input, return the decompressed data as output.
void GNUNET_CONTAINER_bloomfilter_free(struct GNUNET_CONTAINER_BloomFilter *bf)
Free the space associcated with a filter in memory, flush to drive if needed (do not free the space o...
int GNUNET_CONTAINER_multipeermap_get_multiple(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map that match a particular key.
GNUNET_CONTAINER_HeapCostType GNUNET_CONTAINER_heap_node_get_cost(const struct GNUNET_CONTAINER_HeapNode *node)
Get the current cost of the node.
int GNUNET_CONTAINER_multishortmap_contains_value(const struct GNUNET_CONTAINER_MultiShortmap *map, const struct GNUNET_ShortHashCode *key, const void *value)
Check if the map contains the given value under the given key.
int GNUNET_CONTAINER_multishortmap_iterator_next(struct GNUNET_CONTAINER_MultiShortmapIterator *iter, struct GNUNET_ShortHashCode *key, const void **value)
Retrieve the next element from the hash map at the iterator&#39;s position.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
void * GNUNET_CONTAINER_multiuuidmap_get(const struct GNUNET_CONTAINER_MultiUuidmap *map, const struct GNUNET_Uuid *key)
Given a key find a value in the map matching the key.
struct GNUNET_CONTAINER_MetaData * GNUNET_CONTAINER_meta_data_duplicate(const struct GNUNET_CONTAINER_MetaData *md)
Duplicate a MetaData token.