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 
793  int do_not_copy_keys);
794 
795 
803 void
806 
807 
819 void *
821  const struct GNUNET_CONTAINER_MultiHashMap *map,
822  const struct GNUNET_HashCode *key);
823 
824 
837 int
839  const struct GNUNET_HashCode *key,
840  const void *value);
841 
851 int
854  const struct GNUNET_HashCode *key);
855 
856 
865 unsigned int
867 
868 
879 int
881  const struct GNUNET_CONTAINER_MultiHashMap *map,
882  const struct GNUNET_HashCode *key);
883 
884 
896 int
898  const struct GNUNET_CONTAINER_MultiHashMap *map,
899  const struct GNUNET_HashCode *key,
900  const void *value);
901 
902 
916 int
919  const struct GNUNET_HashCode *key,
920  void *value,
922 
930 unsigned int
932  const struct GNUNET_CONTAINER_MultiHashMap *map);
933 
934 
945 int
949  void *it_cls);
950 
951 
967  const struct GNUNET_CONTAINER_MultiHashMap *map);
968 
969 
985 int
988  struct GNUNET_HashCode *key,
989  const void **value);
990 
991 
998 void
1001 
1002 
1014 int
1017  const struct GNUNET_HashCode *key,
1019  void *it_cls);
1020 
1021 
1033 unsigned int
1035  const struct GNUNET_CONTAINER_MultiHashMap *map,
1037  void *it_cls);
1038 
1039 
1040 /* ***************** Version of Multihashmap for peer identities ****************** */
1041 
1054  void *cls,
1055  const struct GNUNET_PeerIdentity *key,
1056  void *value);
1057 
1058 
1063 
1064 
1082 GNUNET_CONTAINER_multipeermap_create (unsigned int len, int do_not_copy_keys);
1083 
1084 
1092 void
1095 
1096 
1108 void *
1110  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1111  const struct GNUNET_PeerIdentity *key);
1112 
1113 
1126 int
1128  const struct GNUNET_PeerIdentity *key,
1129  const void *value);
1130 
1140 int
1143  const struct GNUNET_PeerIdentity *key);
1144 
1145 
1156 int
1158  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1159  const struct GNUNET_PeerIdentity *key);
1160 
1161 
1173 int
1175  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1176  const struct GNUNET_PeerIdentity *key,
1177  const void *value);
1178 
1179 
1193 int
1196  const struct GNUNET_PeerIdentity *key,
1197  void *value,
1199 
1200 
1208 unsigned int
1210  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1211 
1212 
1223 int
1227  void *it_cls);
1228 
1229 
1246  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1247 
1248 
1264 int
1267  struct GNUNET_PeerIdentity *key,
1268  const void **value);
1269 
1270 
1277 void
1280 
1281 
1293 int
1296  const struct GNUNET_PeerIdentity *key,
1298  void *it_cls);
1299 
1300 
1312 unsigned int
1314  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1316  void *it_cls);
1317 
1318 
1319 /* ***************** Version of Multihashmap for short hashes ****************** */
1320 
1333  void *cls,
1334  const struct GNUNET_ShortHashCode *key,
1335  void *value);
1336 
1337 
1342 
1343 
1361 GNUNET_CONTAINER_multishortmap_create (unsigned int len, int do_not_copy_keys);
1362 
1363 
1371 void
1374 
1375 
1387 void *
1389  const struct GNUNET_CONTAINER_MultiShortmap *map,
1390  const struct GNUNET_ShortHashCode *key);
1391 
1392 
1405 int
1408  const struct GNUNET_ShortHashCode *key,
1409  const void *value);
1410 
1420 int
1423  const struct GNUNET_ShortHashCode *key);
1424 
1425 
1436 int
1438  const struct GNUNET_CONTAINER_MultiShortmap *map,
1439  const struct GNUNET_ShortHashCode *key);
1440 
1441 
1453 int
1455  const struct GNUNET_CONTAINER_MultiShortmap *map,
1456  const struct GNUNET_ShortHashCode *key,
1457  const void *value);
1458 
1459 
1473 int
1476  const struct GNUNET_ShortHashCode *key,
1477  void *value,
1479 
1480 
1488 unsigned int
1490  const struct GNUNET_CONTAINER_MultiShortmap *map);
1491 
1492 
1503 int
1507  void *it_cls);
1508 
1509 
1511 
1512 
1528  const struct GNUNET_CONTAINER_MultiShortmap *map);
1529 
1530 
1546 int
1549  struct GNUNET_ShortHashCode *key,
1550  const void **value);
1551 
1552 
1559 void
1562 
1563 
1575 int
1578  const struct GNUNET_ShortHashCode *key,
1580  void *it_cls);
1581 
1582 
1594 unsigned int
1596  const struct GNUNET_CONTAINER_MultiShortmap *map,
1598  void *it_cls);
1599 
1600 
1601 /* ***************** Version of Multihashmap for UUIDs ****************** */
1602 
1603 
1616  void *cls,
1617  const struct GNUNET_Uuid *key,
1618  void *value);
1619 
1620 
1625 
1626 
1644 GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys);
1645 
1646 
1654 void
1657 
1658 
1670 void *
1672  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1673  const struct GNUNET_Uuid *key);
1674 
1675 
1688 int
1690  const struct GNUNET_Uuid *key,
1691  const void *value);
1692 
1702 int
1705  const struct GNUNET_Uuid *key);
1706 
1707 
1718 int
1720  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1721  const struct GNUNET_Uuid *key);
1722 
1723 
1735 int
1737  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1738  const struct GNUNET_Uuid *key,
1739  const void *value);
1740 
1741 
1755 int
1758  const struct GNUNET_Uuid *key,
1759  void *value,
1761 
1762 
1770 unsigned int
1772  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1773 
1774 
1785 int
1789  void *it_cls);
1790 
1791 
1793 
1794 
1810  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1811 
1812 
1828 int
1831  struct GNUNET_Uuid *key,
1832  const void **value);
1833 
1834 
1841 void
1844 
1845 
1857 int
1860  const struct GNUNET_Uuid *key,
1862  void *it_cls);
1863 
1864 
1876 unsigned int
1878  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1880  void *it_cls);
1881 
1882 
1883 /* Version of multihashmap with 32 bit keys */
1884 
1890 
1891 
1898 
1899 
1912  uint32_t key,
1913  void *value);
1914 
1915 
1925 
1926 
1934 void
1937 
1938 
1946 unsigned int
1948  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
1949 
1950 
1962 void *
1964  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
1965  uint32_t key);
1966 
1967 
1978 int
1982  void *it_cls);
1983 
1984 
1997 int
2000  uint32_t key,
2001  const void *value);
2002 
2003 
2013 int
2016  uint32_t key);
2017 
2018 
2029 int
2031  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2032  uint32_t key);
2033 
2034 
2046 int
2048  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2049  uint32_t key,
2050  const void *value);
2051 
2052 
2066 int
2069  uint32_t key,
2070  void *value,
2072 
2073 
2085 int
2088  uint32_t key,
2090  void *it_cls);
2091 
2092 
2107  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
2108 
2109 
2124 int
2127  uint32_t *key,
2128  const void **value);
2129 
2130 
2136 void
2139 
2140 
2141 /* ******************** doubly-linked list *************** */
2142 /* To avoid mistakes: head->prev == tail->next == NULL */
2143 
2153 #define GNUNET_CONTAINER_DLL_insert(head, tail, element) \
2154  do \
2155  { \
2156  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2157  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2158  (element)->next = (head); \
2159  (element)->prev = NULL; \
2160  if ((tail) == NULL) \
2161  (tail) = element; \
2162  else \
2163  (head)->prev = element; \
2164  (head) = (element); \
2165  } while (0)
2166 
2167 
2177 #define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \
2178  do \
2179  { \
2180  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2181  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2182  (element)->prev = (tail); \
2183  (element)->next = NULL; \
2184  if ((head) == NULL) \
2185  (head) = element; \
2186  else \
2187  (tail)->next = element; \
2188  (tail) = (element); \
2189  } while (0)
2190 
2191 
2202 #define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \
2203  do \
2204  { \
2205  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2206  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2207  (element)->prev = (other); \
2208  if (NULL == other) \
2209  { \
2210  (element)->next = (head); \
2211  (head) = (element); \
2212  } \
2213  else \
2214  { \
2215  (element)->next = (other)->next; \
2216  (other)->next = (element); \
2217  } \
2218  if (NULL == (element)->next) \
2219  (tail) = (element); \
2220  else \
2221  (element)->next->prev = (element); \
2222  } while (0)
2223 
2224 
2235 #define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \
2236  do \
2237  { \
2238  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2239  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2240  (element)->next = (other); \
2241  if (NULL == other) \
2242  { \
2243  (element)->prev = (tail); \
2244  (tail) = (element); \
2245  } \
2246  else \
2247  { \
2248  (element)->prev = (other)->prev; \
2249  (other)->prev = (element); \
2250  } \
2251  if (NULL == (element)->prev) \
2252  (head) = (element); \
2253  else \
2254  (element)->prev->next = (element); \
2255  } while (0)
2256 
2257 
2272 #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \
2273  do \
2274  { \
2275  GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \
2276  GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \
2277  if ((element)->prev == NULL) \
2278  (head) = (element)->next; \
2279  else \
2280  (element)->prev->next = (element)->next; \
2281  if ((element)->next == NULL) \
2282  (tail) = (element)->prev; \
2283  else \
2284  (element)->next->prev = (element)->prev; \
2285  (element)->next = NULL; \
2286  (element)->prev = NULL; \
2287  } while (0)
2288 
2289 
2290 /* ************ Multi-DLL interface, allows DLL elements to be
2291  in multiple lists at the same time *********************** */
2292 
2303 #define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \
2304  do \
2305  { \
2306  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2307  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2308  (element)->next_ ## mdll = (head); \
2309  (element)->prev_ ## mdll = NULL; \
2310  if ((tail) == NULL) \
2311  (tail) = element; \
2312  else \
2313  (head)->prev_ ## mdll = element; \
2314  (head) = (element); \
2315  } while (0)
2316 
2317 
2328 #define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \
2329  do \
2330  { \
2331  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2332  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2333  (element)->prev_ ## mdll = (tail); \
2334  (element)->next_ ## mdll = NULL; \
2335  if ((head) == NULL) \
2336  (head) = element; \
2337  else \
2338  (tail)->next_ ## mdll = element; \
2339  (tail) = (element); \
2340  } while (0)
2341 
2342 
2354 #define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \
2355  do \
2356  { \
2357  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2358  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2359  (element)->prev_ ## mdll = (other); \
2360  if (NULL == other) \
2361  { \
2362  (element)->next_ ## mdll = (head); \
2363  (head) = (element); \
2364  } \
2365  else \
2366  { \
2367  (element)->next_ ## mdll = (other)->next_ ## mdll; \
2368  (other)->next_ ## mdll = (element); \
2369  } \
2370  if (NULL == (element)->next_ ## mdll) \
2371  (tail) = (element); \
2372  else \
2373  (element)->next_ ## mdll->prev_ ## mdll = (element); \
2374  } while (0)
2375 
2376 
2388 #define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \
2389  do \
2390  { \
2391  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2392  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2393  (element)->next_ ## mdll = (other); \
2394  if (NULL == other) \
2395  { \
2396  (element)->prev = (tail); \
2397  (tail) = (element); \
2398  } \
2399  else \
2400  { \
2401  (element)->prev_ ## mdll = (other)->prev_ ## mdll; \
2402  (other)->prev_ ## mdll = (element); \
2403  } \
2404  if (NULL == (element)->prev_ ## mdll) \
2405  (head) = (element); \
2406  else \
2407  (element)->prev_ ## mdll->next_ ## mdll = (element); \
2408  } while (0)
2409 
2410 
2422 #define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \
2423  do \
2424  { \
2425  GNUNET_assert (((element)->prev_ ## mdll != NULL) || ((head) == (element))); \
2426  GNUNET_assert (((element)->next_ ## mdll != NULL) || ((tail) == (element))); \
2427  if ((element)->prev_ ## mdll == NULL) \
2428  (head) = (element)->next_ ## mdll; \
2429  else \
2430  (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \
2431  if ((element)->next_ ## mdll == NULL) \
2432  (tail) = (element)->prev_ ## mdll; \
2433  else \
2434  (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \
2435  (element)->next_ ## mdll = NULL; \
2436  (element)->prev_ ## mdll = NULL; \
2437  } while (0)
2438 
2439 
2453 #define GNUNET_CONTAINER_DLL_insert_sorted(TYPE, \
2454  comparator, \
2455  comparator_cls, \
2456  head, \
2457  tail, \
2458  element) \
2459  do \
2460  { \
2461  if ((NULL == head) || (0 < comparator (comparator_cls, element, head))) \
2462  { \
2463  /* insert at head, element < head */ \
2464  GNUNET_CONTAINER_DLL_insert (head, tail, element); \
2465  } \
2466  else \
2467  { \
2468  TYPE *pos; \
2469  \
2470  for (pos = head; NULL != pos; pos = pos->next) \
2471  if (0 < comparator (comparator_cls, element, pos)) \
2472  break; /* element < pos */ \
2473  if (NULL == pos) /* => element > tail */ \
2474  { \
2475  GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \
2476  } \
2477  else /* prev < element < pos */ \
2478  { \
2479  GNUNET_CONTAINER_DLL_insert_after (head, tail, pos->prev, element); \
2480  } \
2481  } \
2482  } while (0)
2483 
2484 
2485 /* ******************** Heap *************** */
2486 
2487 
2493 
2494 
2500 {
2506 
2512 };
2513 
2514 
2519 struct GNUNET_CONTAINER_Heap;
2520 
2521 
2527 
2528 
2536 struct GNUNET_CONTAINER_Heap *
2538 
2539 
2547 void
2549 
2550 
2558 void *
2560 
2561 
2571 int
2573  void **element,
2575 
2576 
2584 unsigned int
2586 
2587 
2597  const struct GNUNET_CONTAINER_HeapNode *node);
2598 
2599 
2612  void *cls,
2613  struct GNUNET_CONTAINER_HeapNode *node,
2614  void *element,
2616 
2617 
2626 void
2629  void *iterator_cls);
2630 
2643 void *
2645 
2646 
2658  void *element,
2660 
2661 
2669 void *
2671 
2672 
2680 void *
2682 
2683 
2691 void
2694 
2695 
2696 #if 0 /* keep Emacsens' auto-indent happy */
2697 {
2698 #endif
2699 #ifdef __cplusplus
2700 }
2701 #endif
2702 
2703 
2704 /* ifndef GNUNET_CONTAINER_LIB_H */
2705 #endif
2706 /* 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 associated with a filter in memory, flush to drive if needed (do not free the space on...
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.