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 
126 };
127 
136 
142 
147 
153 };
154 
155 
173 typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
174  const char *plugin_name,
176  enum EXTRACTOR_MetaFormat format,
177  const char *data_mime_type,
178  const char *data,
179  size_t data_len);
180 
181 #endif
182 
183 #ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
184 /* hack for LE < 0.6.3 */
185 #define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
186 #endif
187 
188 #ifdef __cplusplus
189 extern "C" {
190 #if 0 /* keep Emacsens' auto-indent happy */
191 }
192 #endif
193 #endif
194 
195 
196 /* ******************* bloomfilter ***************** */
197 
203 
204 
214 typedef int (*GNUNET_CONTAINER_HashCodeIterator) (void *cls,
215  struct GNUNET_HashCode *next);
216 
217 
232  size_t size,
233  unsigned int k);
234 
235 
252  size_t size,
253  unsigned int k);
254 
255 
265 int
267  const struct GNUNET_CONTAINER_BloomFilter *bf,
268  char *data,
269  size_t size);
270 
271 
280 int
282  const struct GNUNET_CONTAINER_BloomFilter *bf,
283  const struct GNUNET_HashCode *e);
284 
285 
293 void
295  const struct GNUNET_HashCode *e);
296 
297 
305 void
307  const struct GNUNET_HashCode *e);
308 
309 
319  const struct GNUNET_CONTAINER_BloomFilter *bf);
320 
321 
330 void
332 
333 
340 size_t
342  const struct GNUNET_CONTAINER_BloomFilter *bf);
343 
344 
352 size_t
354  const struct GNUNET_CONTAINER_BloomFilter *bf);
355 
356 
363 void
365 
366 
379 int
381  const char *data,
382  size_t size);
383 
384 
395 int
397  struct GNUNET_CONTAINER_BloomFilter *bf,
398  const struct GNUNET_CONTAINER_BloomFilter *to_or);
399 
400 
413 void
416  void *iterator_cls,
417  size_t size,
418  unsigned int k);
419 
420 
421 /* ****************** metadata ******************* */
422 
428 
429 
438 
439 
449  const struct GNUNET_CONTAINER_MetaData *md);
450 
451 
458 void
460 
461 
473 int
475  const struct GNUNET_CONTAINER_MetaData *md1,
476  const struct GNUNET_CONTAINER_MetaData *md2);
477 
478 
497 int
499  const char *plugin_name,
501  enum EXTRACTOR_MetaFormat format,
502  const char *data_mime_type,
503  const char *data,
504  size_t data_size);
505 
506 
515 void
517  const struct GNUNET_CONTAINER_MetaData *in);
518 
519 
531 int
534  const char *data,
535  size_t data_size);
536 
537 
544 void
546 
547 
555 void
557  struct GNUNET_CONTAINER_MetaData *md);
558 
559 
570 int
573  void *iter_cls);
574 
575 
587 char *
589  const struct GNUNET_CONTAINER_MetaData *md,
590  enum EXTRACTOR_MetaType type);
591 
592 
605 char *
607  const struct GNUNET_CONTAINER_MetaData *md,
608  ...);
609 
620 size_t
622  const struct GNUNET_CONTAINER_MetaData *md,
623  unsigned char **thumb);
624 
625 
636 
643 
649 };
650 
651 
667 ssize_t
669  const struct GNUNET_CONTAINER_MetaData *md,
670  char **target,
671  size_t max,
673 
674 
682 ssize_t
684  const struct GNUNET_CONTAINER_MetaData *md);
685 
686 
697 GNUNET_CONTAINER_meta_data_deserialize(const char *input, size_t size);
698 
699 
700 /* ******************************* HashMap **************************** */
701 
707 
714 
727 
733 
740 
751 };
752 
753 
766  void *cls,
767  const struct GNUNET_HashCode *key,
768  void *value);
769 
770 
788 GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys);
789 
790 
798 void
801 
802 
814 void *
816  const struct GNUNET_CONTAINER_MultiHashMap *map,
817  const struct GNUNET_HashCode *key);
818 
819 
832 int
834  const struct GNUNET_HashCode *key,
835  const void *value);
836 
846 int
849  const struct GNUNET_HashCode *key);
850 
851 
860 unsigned int
862 
863 
874 int
876  const struct GNUNET_CONTAINER_MultiHashMap *map,
877  const struct GNUNET_HashCode *key);
878 
879 
891 int
893  const struct GNUNET_CONTAINER_MultiHashMap *map,
894  const struct GNUNET_HashCode *key,
895  const void *value);
896 
897 
911 int
914  const struct GNUNET_HashCode *key,
915  void *value,
917 
925 unsigned int
927  const struct GNUNET_CONTAINER_MultiHashMap *map);
928 
929 
940 int
944  void *it_cls);
945 
946 
962  const struct GNUNET_CONTAINER_MultiHashMap *map);
963 
964 
980 int
983  struct GNUNET_HashCode *key,
984  const void **value);
985 
986 
993 void
996 
997 
1009 int
1012  const struct GNUNET_HashCode *key,
1014  void *it_cls);
1015 
1016 
1028 unsigned int
1030  const struct GNUNET_CONTAINER_MultiHashMap *map,
1032  void *it_cls);
1033 
1034 
1035 /* ***************** Version of Multihashmap for peer identities ****************** */
1036 
1049  void *cls,
1050  const struct GNUNET_PeerIdentity *key,
1051  void *value);
1052 
1053 
1058 
1059 
1077 GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys);
1078 
1079 
1087 void
1090 
1091 
1103 void *
1105  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1106  const struct GNUNET_PeerIdentity *key);
1107 
1108 
1121 int
1123  const struct GNUNET_PeerIdentity *key,
1124  const void *value);
1125 
1135 int
1138  const struct GNUNET_PeerIdentity *key);
1139 
1140 
1151 int
1153  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1154  const struct GNUNET_PeerIdentity *key);
1155 
1156 
1168 int
1170  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1171  const struct GNUNET_PeerIdentity *key,
1172  const void *value);
1173 
1174 
1188 int
1191  const struct GNUNET_PeerIdentity *key,
1192  void *value,
1194 
1195 
1203 unsigned int
1205  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1206 
1207 
1218 int
1222  void *it_cls);
1223 
1224 
1241  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1242 
1243 
1259 int
1262  struct GNUNET_PeerIdentity *key,
1263  const void **value);
1264 
1265 
1272 void
1275 
1276 
1288 int
1291  const struct GNUNET_PeerIdentity *key,
1293  void *it_cls);
1294 
1295 
1307 unsigned int
1309  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1311  void *it_cls);
1312 
1313 
1314 /* ***************** Version of Multihashmap for short hashes ****************** */
1315 
1328  void *cls,
1329  const struct GNUNET_ShortHashCode *key,
1330  void *value);
1331 
1332 
1337 
1338 
1356 GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys);
1357 
1358 
1366 void
1369 
1370 
1382 void *
1384  const struct GNUNET_CONTAINER_MultiShortmap *map,
1385  const struct GNUNET_ShortHashCode *key);
1386 
1387 
1400 int
1403  const struct GNUNET_ShortHashCode *key,
1404  const void *value);
1405 
1415 int
1418  const struct GNUNET_ShortHashCode *key);
1419 
1420 
1431 int
1433  const struct GNUNET_CONTAINER_MultiShortmap *map,
1434  const struct GNUNET_ShortHashCode *key);
1435 
1436 
1448 int
1450  const struct GNUNET_CONTAINER_MultiShortmap *map,
1451  const struct GNUNET_ShortHashCode *key,
1452  const void *value);
1453 
1454 
1468 int
1471  const struct GNUNET_ShortHashCode *key,
1472  void *value,
1474 
1475 
1483 unsigned int
1485  const struct GNUNET_CONTAINER_MultiShortmap *map);
1486 
1487 
1498 int
1502  void *it_cls);
1503 
1504 
1506 
1507 
1523  const struct GNUNET_CONTAINER_MultiShortmap *map);
1524 
1525 
1541 int
1544  struct GNUNET_ShortHashCode *key,
1545  const void **value);
1546 
1547 
1554 void
1557 
1558 
1570 int
1573  const struct GNUNET_ShortHashCode *key,
1575  void *it_cls);
1576 
1577 
1589 unsigned int
1591  const struct GNUNET_CONTAINER_MultiShortmap *map,
1593  void *it_cls);
1594 
1595 
1596 /* ***************** Version of Multihashmap for UUIDs ****************** */
1597 
1598 
1611  void *cls,
1612  const struct GNUNET_Uuid *key,
1613  void *value);
1614 
1615 
1620 
1621 
1639 GNUNET_CONTAINER_multiuuidmap_create(unsigned int len, int do_not_copy_keys);
1640 
1641 
1649 void
1652 
1653 
1665 void *
1667  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1668  const struct GNUNET_Uuid *key);
1669 
1670 
1683 int
1685  const struct GNUNET_Uuid *key,
1686  const void *value);
1687 
1697 int
1700  const struct GNUNET_Uuid *key);
1701 
1702 
1713 int
1715  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1716  const struct GNUNET_Uuid *key);
1717 
1718 
1730 int
1732  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1733  const struct GNUNET_Uuid *key,
1734  const void *value);
1735 
1736 
1750 int
1753  const struct GNUNET_Uuid *key,
1754  void *value,
1756 
1757 
1765 unsigned int
1767  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1768 
1769 
1780 int
1784  void *it_cls);
1785 
1786 
1788 
1789 
1805  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1806 
1807 
1823 int
1826  struct GNUNET_Uuid *key,
1827  const void **value);
1828 
1829 
1836 void
1839 
1840 
1852 int
1855  const struct GNUNET_Uuid *key,
1857  void *it_cls);
1858 
1859 
1871 unsigned int
1873  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1875  void *it_cls);
1876 
1877 
1878 /* Version of multihashmap with 32 bit keys */
1879 
1885 
1886 
1893 
1894 
1907  uint32_t key,
1908  void *value);
1909 
1910 
1920 
1921 
1929 void
1932 
1933 
1941 unsigned int
1943  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
1944 
1945 
1957 void *
1959  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
1960  uint32_t key);
1961 
1962 
1973 int
1977  void *it_cls);
1978 
1979 
1992 int
1995  uint32_t key,
1996  const void *value);
1997 
1998 
2008 int
2011  uint32_t key);
2012 
2013 
2024 int
2026  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2027  uint32_t key);
2028 
2029 
2041 int
2043  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2044  uint32_t key,
2045  const void *value);
2046 
2047 
2061 int
2064  uint32_t key,
2065  void *value,
2067 
2068 
2080 int
2083  uint32_t key,
2085  void *it_cls);
2086 
2087 
2102  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
2103 
2104 
2119 int
2122  uint32_t *key,
2123  const void **value);
2124 
2125 
2131 void
2134 
2135 
2136 /* ******************** doubly-linked list *************** */
2137 /* To avoid mistakes: head->prev == tail->next == NULL */
2138 
2148 #define GNUNET_CONTAINER_DLL_insert(head, tail, element) \
2149  do \
2150  { \
2151  GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \
2152  GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \
2153  (element)->next = (head); \
2154  (element)->prev = NULL; \
2155  if ((tail) == NULL) \
2156  (tail) = element; \
2157  else \
2158  (head) ->prev = element; \
2159  (head) = (element); \
2160  } while (0)
2161 
2162 
2172 #define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \
2173  do \
2174  { \
2175  GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \
2176  GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \
2177  (element)->prev = (tail); \
2178  (element)->next = NULL; \
2179  if ((head) == NULL) \
2180  (head) = element; \
2181  else \
2182  (tail) ->next = element; \
2183  (tail) = (element); \
2184  } while (0)
2185 
2186 
2197 #define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \
2198  do \
2199  { \
2200  GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \
2201  GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \
2202  (element)->prev = (other); \
2203  if (NULL == other) \
2204  { \
2205  (element)->next = (head); \
2206  (head) = (element); \
2207  } \
2208  else \
2209  { \
2210  (element)->next = (other)->next; \
2211  (other)->next = (element); \
2212  } \
2213  if (NULL == (element)->next) \
2214  (tail) = (element); \
2215  else \
2216  (element) ->next->prev = (element); \
2217  } while (0)
2218 
2219 
2230 #define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \
2231  do \
2232  { \
2233  GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \
2234  GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \
2235  (element)->next = (other); \
2236  if (NULL == other) \
2237  { \
2238  (element)->prev = (tail); \
2239  (tail) = (element); \
2240  } \
2241  else \
2242  { \
2243  (element)->prev = (other)->prev; \
2244  (other)->prev = (element); \
2245  } \
2246  if (NULL == (element)->prev) \
2247  (head) = (element); \
2248  else \
2249  (element) ->prev->next = (element); \
2250  } while (0)
2251 
2252 
2267 #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \
2268  do \
2269  { \
2270  GNUNET_assert(((element)->prev != NULL) || ((head) == (element))); \
2271  GNUNET_assert(((element)->next != NULL) || ((tail) == (element))); \
2272  if ((element)->prev == NULL) \
2273  (head) = (element)->next; \
2274  else \
2275  (element) ->prev->next = (element)->next; \
2276  if ((element)->next == NULL) \
2277  (tail) = (element)->prev; \
2278  else \
2279  (element) ->next->prev = (element)->prev; \
2280  (element)->next = NULL; \
2281  (element)->prev = NULL; \
2282  } while (0)
2283 
2284 
2285 /* ************ Multi-DLL interface, allows DLL elements to be
2286  in multiple lists at the same time *********************** */
2287 
2298 #define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \
2299  do \
2300  { \
2301  GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2302  GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2303  (element)->next_ ## mdll = (head); \
2304  (element)->prev_ ## mdll = NULL; \
2305  if ((tail) == NULL) \
2306  (tail) = element; \
2307  else \
2308  (head) ->prev_ ## mdll = element; \
2309  (head) = (element); \
2310  } while (0)
2311 
2312 
2323 #define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \
2324  do \
2325  { \
2326  GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2327  GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2328  (element)->prev_ ## mdll = (tail); \
2329  (element)->next_ ## mdll = NULL; \
2330  if ((head) == NULL) \
2331  (head) = element; \
2332  else \
2333  (tail) ->next_ ## mdll = element; \
2334  (tail) = (element); \
2335  } while (0)
2336 
2337 
2349 #define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \
2350  do \
2351  { \
2352  GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2353  GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2354  (element)->prev_ ## mdll = (other); \
2355  if (NULL == other) \
2356  { \
2357  (element)->next_ ## mdll = (head); \
2358  (head) = (element); \
2359  } \
2360  else \
2361  { \
2362  (element)->next_ ## mdll = (other)->next_ ## mdll; \
2363  (other)->next_ ## mdll = (element); \
2364  } \
2365  if (NULL == (element)->next_ ## mdll) \
2366  (tail) = (element); \
2367  else \
2368  (element) ->next_ ## mdll->prev_ ## mdll = (element); \
2369  } while (0)
2370 
2371 
2383 #define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \
2384  do \
2385  { \
2386  GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2387  GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2388  (element)->next_ ## mdll = (other); \
2389  if (NULL == other) \
2390  { \
2391  (element)->prev = (tail); \
2392  (tail) = (element); \
2393  } \
2394  else \
2395  { \
2396  (element)->prev_ ## mdll = (other)->prev_ ## mdll; \
2397  (other)->prev_ ## mdll = (element); \
2398  } \
2399  if (NULL == (element)->prev_ ## mdll) \
2400  (head) = (element); \
2401  else \
2402  (element) ->prev_ ## mdll->next_ ## mdll = (element); \
2403  } while (0)
2404 
2405 
2417 #define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \
2418  do \
2419  { \
2420  GNUNET_assert(((element)->prev_ ## mdll != NULL) || ((head) == (element))); \
2421  GNUNET_assert(((element)->next_ ## mdll != NULL) || ((tail) == (element))); \
2422  if ((element)->prev_ ## mdll == NULL) \
2423  (head) = (element)->next_ ## mdll; \
2424  else \
2425  (element) ->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \
2426  if ((element)->next_ ## mdll == NULL) \
2427  (tail) = (element)->prev_ ## mdll; \
2428  else \
2429  (element) ->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \
2430  (element)->next_ ## mdll = NULL; \
2431  (element)->prev_ ## mdll = NULL; \
2432  } while (0)
2433 
2434 
2448 #define GNUNET_CONTAINER_DLL_insert_sorted(TYPE, \
2449  comparator, \
2450  comparator_cls, \
2451  head, \
2452  tail, \
2453  element) \
2454  do \
2455  { \
2456  if ((NULL == head) || (0 < comparator(comparator_cls, element, head))) \
2457  { \
2458  /* insert at head, element < head */ \
2459  GNUNET_CONTAINER_DLL_insert(head, tail, element); \
2460  } \
2461  else \
2462  { \
2463  TYPE *pos; \
2464  \
2465  for (pos = head; NULL != pos; pos = pos->next) \
2466  if (0 < comparator(comparator_cls, element, pos)) \
2467  break; /* element < pos */ \
2468  if (NULL == pos) /* => element > tail */ \
2469  { \
2470  GNUNET_CONTAINER_DLL_insert_tail(head, tail, element); \
2471  } \
2472  else /* prev < element < pos */ \
2473  { \
2474  GNUNET_CONTAINER_DLL_insert_after(head, tail, pos->prev, element); \
2475  } \
2476  } \
2477  } while (0)
2478 
2479 
2480 /* ******************** Heap *************** */
2481 
2482 
2488 
2489 
2500 
2506 };
2507 
2508 
2513 struct GNUNET_CONTAINER_Heap;
2514 
2515 
2521 
2522 
2530 struct GNUNET_CONTAINER_Heap *
2532 
2533 
2541 void
2543 
2544 
2552 void *
2554 
2555 
2565 int
2567  void **element,
2569 
2570 
2578 unsigned int
2580 
2581 
2591  const struct GNUNET_CONTAINER_HeapNode *node);
2592 
2593 
2606  void *cls,
2607  struct GNUNET_CONTAINER_HeapNode *node,
2608  void *element,
2610 
2611 
2620 void
2623  void *iterator_cls);
2624 
2637 void *
2639 
2640 
2652  void *element,
2654 
2655 
2663 void *
2665 
2666 
2674 void *
2676 
2677 
2685 void
2688 
2689 
2690 #if 0 /* keep Emacsens' auto-indent happy */
2691 {
2692 #endif
2693 #ifdef __cplusplus
2694 }
2695 #endif
2696 
2697 
2698 /* ifndef GNUNET_CONTAINER_LIB_H */
2699 #endif
2700 /* 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:66
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.