GNUnet  0.11.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 
133 {
138 
144 
149 
155 };
156 
157 
175 typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
176  const char *plugin_name,
178  enum EXTRACTOR_MetaFormat format,
179  const char *data_mime_type,
180  const char *data,
181  size_t data_len);
182 
183 #endif
184 
185 #ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
186 /* hack for LE < 0.6.3 */
187 #define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
188 #endif
189 
190 #ifdef __cplusplus
191 extern "C" {
192 #if 0 /* keep Emacsens' auto-indent happy */
193 }
194 #endif
195 #endif
196 
197 
198 /* ******************* bloomfilter ***************** */
199 
205 
206 
216 typedef int (*GNUNET_CONTAINER_HashCodeIterator) (void *cls,
217  struct GNUNET_HashCode *next);
218 
219 
234  size_t size,
235  unsigned int k);
236 
237 
254  size_t size,
255  unsigned int k);
256 
257 
267 int
269  const struct GNUNET_CONTAINER_BloomFilter *bf,
270  char *data,
271  size_t size);
272 
273 
282 int
284  const struct GNUNET_CONTAINER_BloomFilter *bf,
285  const struct GNUNET_HashCode *e);
286 
287 
295 void
297  const struct GNUNET_HashCode *e);
298 
299 
307 void
309  const struct GNUNET_HashCode *e);
310 
311 
321  const struct GNUNET_CONTAINER_BloomFilter *bf);
322 
323 
332 void
334 
335 
342 size_t
344  const struct GNUNET_CONTAINER_BloomFilter *bf);
345 
346 
354 size_t
356  const struct GNUNET_CONTAINER_BloomFilter *bf);
357 
358 
365 void
367 
368 
381 int
383  const char *data,
384  size_t size);
385 
386 
397 int
399  struct GNUNET_CONTAINER_BloomFilter *bf,
400  const struct GNUNET_CONTAINER_BloomFilter *to_or);
401 
402 
415 void
418  void *iterator_cls,
419  size_t size,
420  unsigned int k);
421 
422 
423 /* ****************** metadata ******************* */
424 
430 
431 
440 
441 
451  const struct GNUNET_CONTAINER_MetaData *md);
452 
453 
460 void
462 
463 
475 int
477  const struct GNUNET_CONTAINER_MetaData *md1,
478  const struct GNUNET_CONTAINER_MetaData *md2);
479 
480 
499 int
501  const char *plugin_name,
503  enum EXTRACTOR_MetaFormat format,
504  const char *data_mime_type,
505  const char *data,
506  size_t data_size);
507 
508 
517 void
519  const struct GNUNET_CONTAINER_MetaData *in);
520 
521 
533 int
536  const char *data,
537  size_t data_size);
538 
539 
546 void
548 
549 
557 void
559  struct GNUNET_CONTAINER_MetaData *md);
560 
561 
572 int
575  void *iter_cls);
576 
577 
589 char *
591  const struct GNUNET_CONTAINER_MetaData *md,
592  enum EXTRACTOR_MetaType type);
593 
594 
607 char *
609  const struct GNUNET_CONTAINER_MetaData *md,
610  ...);
611 
622 size_t
624  const struct GNUNET_CONTAINER_MetaData *md,
625  unsigned char **thumb);
626 
627 
633 {
639 
646 
652 };
653 
654 
670 ssize_t
672  const struct GNUNET_CONTAINER_MetaData *md,
673  char **target,
674  size_t max,
676 
677 
685 ssize_t
687  const struct GNUNET_CONTAINER_MetaData *md);
688 
689 
700 GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size);
701 
702 
703 /* ******************************* HashMap **************************** */
704 
710 
717 
723 {
731 
737 
744 
755 };
756 
757 
770  void *cls,
771  const struct GNUNET_HashCode *key,
772  void *value);
773 
774 
792 GNUNET_CONTAINER_multihashmap_create (unsigned int len, int do_not_copy_keys);
793 
794 
802 void
805 
806 
818 void *
820  const struct GNUNET_CONTAINER_MultiHashMap *map,
821  const struct GNUNET_HashCode *key);
822 
823 
836 int
838  const struct GNUNET_HashCode *key,
839  const void *value);
840 
850 int
853  const struct GNUNET_HashCode *key);
854 
855 
864 unsigned int
866 
867 
878 int
880  const struct GNUNET_CONTAINER_MultiHashMap *map,
881  const struct GNUNET_HashCode *key);
882 
883 
895 int
897  const struct GNUNET_CONTAINER_MultiHashMap *map,
898  const struct GNUNET_HashCode *key,
899  const void *value);
900 
901 
915 int
918  const struct GNUNET_HashCode *key,
919  void *value,
921 
929 unsigned int
931  const struct GNUNET_CONTAINER_MultiHashMap *map);
932 
933 
944 int
948  void *it_cls);
949 
950 
966  const struct GNUNET_CONTAINER_MultiHashMap *map);
967 
968 
984 int
987  struct GNUNET_HashCode *key,
988  const void **value);
989 
990 
997 void
1000 
1001 
1013 int
1016  const struct GNUNET_HashCode *key,
1018  void *it_cls);
1019 
1020 
1032 unsigned int
1034  const struct GNUNET_CONTAINER_MultiHashMap *map,
1036  void *it_cls);
1037 
1038 
1039 /* ***************** Version of Multihashmap for peer identities ****************** */
1040 
1053  void *cls,
1054  const struct GNUNET_PeerIdentity *key,
1055  void *value);
1056 
1057 
1062 
1063 
1081 GNUNET_CONTAINER_multipeermap_create (unsigned int len, int do_not_copy_keys);
1082 
1083 
1091 void
1094 
1095 
1107 void *
1109  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1110  const struct GNUNET_PeerIdentity *key);
1111 
1112 
1125 int
1127  const struct GNUNET_PeerIdentity *key,
1128  const void *value);
1129 
1139 int
1142  const struct GNUNET_PeerIdentity *key);
1143 
1144 
1155 int
1157  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1158  const struct GNUNET_PeerIdentity *key);
1159 
1160 
1172 int
1174  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1175  const struct GNUNET_PeerIdentity *key,
1176  const void *value);
1177 
1178 
1192 int
1195  const struct GNUNET_PeerIdentity *key,
1196  void *value,
1198 
1199 
1207 unsigned int
1209  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1210 
1211 
1222 int
1226  void *it_cls);
1227 
1228 
1245  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1246 
1247 
1263 int
1266  struct GNUNET_PeerIdentity *key,
1267  const void **value);
1268 
1269 
1276 void
1279 
1280 
1292 int
1295  const struct GNUNET_PeerIdentity *key,
1297  void *it_cls);
1298 
1299 
1311 unsigned int
1313  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1315  void *it_cls);
1316 
1317 
1318 /* ***************** Version of Multihashmap for short hashes ****************** */
1319 
1332  void *cls,
1333  const struct GNUNET_ShortHashCode *key,
1334  void *value);
1335 
1336 
1341 
1342 
1360 GNUNET_CONTAINER_multishortmap_create (unsigned int len, int do_not_copy_keys);
1361 
1362 
1370 void
1373 
1374 
1386 void *
1388  const struct GNUNET_CONTAINER_MultiShortmap *map,
1389  const struct GNUNET_ShortHashCode *key);
1390 
1391 
1404 int
1407  const struct GNUNET_ShortHashCode *key,
1408  const void *value);
1409 
1419 int
1422  const struct GNUNET_ShortHashCode *key);
1423 
1424 
1435 int
1437  const struct GNUNET_CONTAINER_MultiShortmap *map,
1438  const struct GNUNET_ShortHashCode *key);
1439 
1440 
1452 int
1454  const struct GNUNET_CONTAINER_MultiShortmap *map,
1455  const struct GNUNET_ShortHashCode *key,
1456  const void *value);
1457 
1458 
1472 int
1475  const struct GNUNET_ShortHashCode *key,
1476  void *value,
1478 
1479 
1487 unsigned int
1489  const struct GNUNET_CONTAINER_MultiShortmap *map);
1490 
1491 
1502 int
1506  void *it_cls);
1507 
1508 
1510 
1511 
1527  const struct GNUNET_CONTAINER_MultiShortmap *map);
1528 
1529 
1545 int
1548  struct GNUNET_ShortHashCode *key,
1549  const void **value);
1550 
1551 
1558 void
1561 
1562 
1574 int
1577  const struct GNUNET_ShortHashCode *key,
1579  void *it_cls);
1580 
1581 
1593 unsigned int
1595  const struct GNUNET_CONTAINER_MultiShortmap *map,
1597  void *it_cls);
1598 
1599 
1600 /* ***************** Version of Multihashmap for UUIDs ****************** */
1601 
1602 
1615  void *cls,
1616  const struct GNUNET_Uuid *key,
1617  void *value);
1618 
1619 
1624 
1625 
1643 GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys);
1644 
1645 
1653 void
1656 
1657 
1669 void *
1671  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1672  const struct GNUNET_Uuid *key);
1673 
1674 
1687 int
1689  const struct GNUNET_Uuid *key,
1690  const void *value);
1691 
1701 int
1704  const struct GNUNET_Uuid *key);
1705 
1706 
1717 int
1719  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1720  const struct GNUNET_Uuid *key);
1721 
1722 
1734 int
1736  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1737  const struct GNUNET_Uuid *key,
1738  const void *value);
1739 
1740 
1754 int
1757  const struct GNUNET_Uuid *key,
1758  void *value,
1760 
1761 
1769 unsigned int
1771  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1772 
1773 
1784 int
1788  void *it_cls);
1789 
1790 
1792 
1793 
1809  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1810 
1811 
1827 int
1830  struct GNUNET_Uuid *key,
1831  const void **value);
1832 
1833 
1840 void
1843 
1844 
1856 int
1859  const struct GNUNET_Uuid *key,
1861  void *it_cls);
1862 
1863 
1875 unsigned int
1877  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1879  void *it_cls);
1880 
1881 
1882 /* Version of multihashmap with 32 bit keys */
1883 
1889 
1890 
1897 
1898 
1911  uint32_t key,
1912  void *value);
1913 
1914 
1924 
1925 
1933 void
1936 
1937 
1945 unsigned int
1947  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
1948 
1949 
1961 void *
1963  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
1964  uint32_t key);
1965 
1966 
1977 int
1981  void *it_cls);
1982 
1983 
1996 int
1999  uint32_t key,
2000  const void *value);
2001 
2002 
2012 int
2015  uint32_t key);
2016 
2017 
2028 int
2030  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2031  uint32_t key);
2032 
2033 
2045 int
2047  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2048  uint32_t key,
2049  const void *value);
2050 
2051 
2065 int
2068  uint32_t key,
2069  void *value,
2071 
2072 
2084 int
2087  uint32_t key,
2089  void *it_cls);
2090 
2091 
2106  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
2107 
2108 
2123 int
2126  uint32_t *key,
2127  const void **value);
2128 
2129 
2135 void
2138 
2139 
2140 /* ******************** doubly-linked list *************** */
2141 /* To avoid mistakes: head->prev == tail->next == NULL */
2142 
2152 #define GNUNET_CONTAINER_DLL_insert(head, tail, element) \
2153  do \
2154  { \
2155  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2156  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2157  (element)->next = (head); \
2158  (element)->prev = NULL; \
2159  if ((tail) == NULL) \
2160  (tail) = element; \
2161  else \
2162  (head)->prev = element; \
2163  (head) = (element); \
2164  } while (0)
2165 
2166 
2176 #define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \
2177  do \
2178  { \
2179  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2180  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2181  (element)->prev = (tail); \
2182  (element)->next = NULL; \
2183  if ((head) == NULL) \
2184  (head) = element; \
2185  else \
2186  (tail)->next = element; \
2187  (tail) = (element); \
2188  } while (0)
2189 
2190 
2201 #define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \
2202  do \
2203  { \
2204  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2205  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2206  (element)->prev = (other); \
2207  if (NULL == other) \
2208  { \
2209  (element)->next = (head); \
2210  (head) = (element); \
2211  } \
2212  else \
2213  { \
2214  (element)->next = (other)->next; \
2215  (other)->next = (element); \
2216  } \
2217  if (NULL == (element)->next) \
2218  (tail) = (element); \
2219  else \
2220  (element)->next->prev = (element); \
2221  } while (0)
2222 
2223 
2234 #define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \
2235  do \
2236  { \
2237  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2238  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2239  (element)->next = (other); \
2240  if (NULL == other) \
2241  { \
2242  (element)->prev = (tail); \
2243  (tail) = (element); \
2244  } \
2245  else \
2246  { \
2247  (element)->prev = (other)->prev; \
2248  (other)->prev = (element); \
2249  } \
2250  if (NULL == (element)->prev) \
2251  (head) = (element); \
2252  else \
2253  (element)->prev->next = (element); \
2254  } while (0)
2255 
2256 
2271 #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \
2272  do \
2273  { \
2274  GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \
2275  GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \
2276  if ((element)->prev == NULL) \
2277  (head) = (element)->next; \
2278  else \
2279  (element)->prev->next = (element)->next; \
2280  if ((element)->next == NULL) \
2281  (tail) = (element)->prev; \
2282  else \
2283  (element)->next->prev = (element)->prev; \
2284  (element)->next = NULL; \
2285  (element)->prev = NULL; \
2286  } while (0)
2287 
2288 
2289 /* ************ Multi-DLL interface, allows DLL elements to be
2290  in multiple lists at the same time *********************** */
2291 
2302 #define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \
2303  do \
2304  { \
2305  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2306  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2307  (element)->next_ ## mdll = (head); \
2308  (element)->prev_ ## mdll = NULL; \
2309  if ((tail) == NULL) \
2310  (tail) = element; \
2311  else \
2312  (head)->prev_ ## mdll = element; \
2313  (head) = (element); \
2314  } while (0)
2315 
2316 
2327 #define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \
2328  do \
2329  { \
2330  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2331  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2332  (element)->prev_ ## mdll = (tail); \
2333  (element)->next_ ## mdll = NULL; \
2334  if ((head) == NULL) \
2335  (head) = element; \
2336  else \
2337  (tail)->next_ ## mdll = element; \
2338  (tail) = (element); \
2339  } while (0)
2340 
2341 
2353 #define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \
2354  do \
2355  { \
2356  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2357  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2358  (element)->prev_ ## mdll = (other); \
2359  if (NULL == other) \
2360  { \
2361  (element)->next_ ## mdll = (head); \
2362  (head) = (element); \
2363  } \
2364  else \
2365  { \
2366  (element)->next_ ## mdll = (other)->next_ ## mdll; \
2367  (other)->next_ ## mdll = (element); \
2368  } \
2369  if (NULL == (element)->next_ ## mdll) \
2370  (tail) = (element); \
2371  else \
2372  (element)->next_ ## mdll->prev_ ## mdll = (element); \
2373  } while (0)
2374 
2375 
2387 #define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \
2388  do \
2389  { \
2390  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2391  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2392  (element)->next_ ## mdll = (other); \
2393  if (NULL == other) \
2394  { \
2395  (element)->prev = (tail); \
2396  (tail) = (element); \
2397  } \
2398  else \
2399  { \
2400  (element)->prev_ ## mdll = (other)->prev_ ## mdll; \
2401  (other)->prev_ ## mdll = (element); \
2402  } \
2403  if (NULL == (element)->prev_ ## mdll) \
2404  (head) = (element); \
2405  else \
2406  (element)->prev_ ## mdll->next_ ## mdll = (element); \
2407  } while (0)
2408 
2409 
2421 #define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \
2422  do \
2423  { \
2424  GNUNET_assert (((element)->prev_ ## mdll != NULL) || ((head) == (element))); \
2425  GNUNET_assert (((element)->next_ ## mdll != NULL) || ((tail) == (element))); \
2426  if ((element)->prev_ ## mdll == NULL) \
2427  (head) = (element)->next_ ## mdll; \
2428  else \
2429  (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \
2430  if ((element)->next_ ## mdll == NULL) \
2431  (tail) = (element)->prev_ ## mdll; \
2432  else \
2433  (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \
2434  (element)->next_ ## mdll = NULL; \
2435  (element)->prev_ ## mdll = NULL; \
2436  } while (0)
2437 
2438 
2452 #define GNUNET_CONTAINER_DLL_insert_sorted(TYPE, \
2453  comparator, \
2454  comparator_cls, \
2455  head, \
2456  tail, \
2457  element) \
2458  do \
2459  { \
2460  if ((NULL == head) || (0 < comparator (comparator_cls, element, head))) \
2461  { \
2462  /* insert at head, element < head */ \
2463  GNUNET_CONTAINER_DLL_insert (head, tail, element); \
2464  } \
2465  else \
2466  { \
2467  TYPE *pos; \
2468  \
2469  for (pos = head; NULL != pos; pos = pos->next) \
2470  if (0 < comparator (comparator_cls, element, pos)) \
2471  break; /* element < pos */ \
2472  if (NULL == pos) /* => element > tail */ \
2473  { \
2474  GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \
2475  } \
2476  else /* prev < element < pos */ \
2477  { \
2478  GNUNET_CONTAINER_DLL_insert_after (head, tail, pos->prev, element); \
2479  } \
2480  } \
2481  } while (0)
2482 
2483 
2484 /* ******************** Heap *************** */
2485 
2486 
2492 
2493 
2499 {
2505 
2511 };
2512 
2513 
2518 struct GNUNET_CONTAINER_Heap;
2519 
2520 
2526 
2527 
2535 struct GNUNET_CONTAINER_Heap *
2537 
2538 
2546 void
2548 
2549 
2557 void *
2559 
2560 
2570 int
2572  void **element,
2574 
2575 
2583 unsigned int
2585 
2586 
2596  const struct GNUNET_CONTAINER_HeapNode *node);
2597 
2598 
2611  void *cls,
2612  struct GNUNET_CONTAINER_HeapNode *node,
2613  void *element,
2615 
2616 
2625 void
2628  void *iterator_cls);
2629 
2642 void *
2644 
2645 
2657  void *element,
2659 
2660 
2668 void *
2670 
2671 
2679 void *
2681 
2682 
2690 void
2693 
2694 
2695 #if 0 /* keep Emacsens' auto-indent happy */
2696 {
2697 #endif
2698 #ifdef __cplusplus
2699 }
2700 #endif
2701 
2702 
2703 /* ifndef GNUNET_CONTAINER_LIB_H */
2704 #endif
2705 /* 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.
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
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).
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.
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...
static char * plugin_name
Name of our plugin.
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.