GNUnet  0.17.6
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 
51 #ifndef GNUNET_CONTAINER_LIB_H
52 #define GNUNET_CONTAINER_LIB_H
53 
54 /* add error and config prototypes */
55 #include "gnunet_crypto_lib.h"
56 
57 
73 int
74 GNUNET_try_compression (const char *data,
75  size_t old_size,
76  char **result,
77  size_t *new_size);
78 
79 
90 char *
91 GNUNET_decompress (const char *input, size_t input_size, size_t output_size);
92 
93 
94 #if HAVE_EXTRACTOR_H
95 
96 #include <extractor.h>
97 
98 #else
99 
100 /* definitions from extractor.h we need for the build */
101 
107 {
131 };
132 
137 {
142 
148 
153 
159 };
160 
161 
179 typedef int (*EXTRACTOR_MetaDataProcessor) (void *cls,
180  const char *plugin_name,
182  enum EXTRACTOR_MetaFormat format,
183  const char *data_mime_type,
184  const char *data,
185  size_t data_len);
186 
187 #endif
188 
189 #ifndef EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
190 /* hack for LE < 0.6.3 */
191 #define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME 180
192 #endif
193 
194 #ifdef __cplusplus
195 extern "C" {
196 #if 0 /* keep Emacsens' auto-indent happy */
197 }
198 #endif
199 #endif
200 
201 
202 /* ******************* bloomfilter ***************** */
203 
209 
210 
221  struct GNUNET_HashCode *next);
222 
223 
238  size_t size,
239  unsigned int k);
240 
241 
258  size_t size,
259  unsigned int k);
260 
261 
271 int
273  const struct GNUNET_CONTAINER_BloomFilter *bf,
274  char *data,
275  size_t size);
276 
277 
286 bool
288  const struct GNUNET_CONTAINER_BloomFilter *bf,
289  const struct GNUNET_HashCode *e);
290 
291 
299 void
301  const struct GNUNET_HashCode *e);
302 
303 
311 void
313  const struct GNUNET_HashCode *e);
314 
315 
325  const struct GNUNET_CONTAINER_BloomFilter *bf);
326 
327 
336 void
338 
339 
346 size_t
348  const struct GNUNET_CONTAINER_BloomFilter *bf);
349 
350 
358 size_t
360  const struct GNUNET_CONTAINER_BloomFilter *bf);
361 
362 
369 void
371 
372 
385 int
387  const char *data,
388  size_t size);
389 
390 
401 int
403  struct GNUNET_CONTAINER_BloomFilter *bf,
404  const struct GNUNET_CONTAINER_BloomFilter *to_or);
405 
406 
419 void
422  void *iterator_cls,
423  size_t size,
424  unsigned int k);
425 
426 
427 /* ****************** metadata ******************* */
428 
434 
435 
444 
445 
455  const struct GNUNET_CONTAINER_MetaData *md);
456 
457 
464 void
466 
467 
479 int
481  const struct GNUNET_CONTAINER_MetaData *md1,
482  const struct GNUNET_CONTAINER_MetaData *md2);
483 
484 
503 int
505  const char *plugin_name,
507  enum EXTRACTOR_MetaFormat format,
508  const char *data_mime_type,
509  const char *data,
510  size_t data_size);
511 
512 
521 void
523  const struct GNUNET_CONTAINER_MetaData *in);
524 
525 
537 int
540  const char *data,
541  size_t data_size);
542 
543 
550 void
552 
553 
561 void
563  struct GNUNET_CONTAINER_MetaData *md);
564 
565 
576 int
579  void *iter_cls);
580 
581 
593 char *
595  const struct GNUNET_CONTAINER_MetaData *md,
596  enum EXTRACTOR_MetaType type);
597 
598 
611 char *
613  const struct GNUNET_CONTAINER_MetaData *md,
614  ...);
615 
626 size_t
628  const struct GNUNET_CONTAINER_MetaData *md,
629  unsigned char **thumb);
630 
631 
637 {
643 
650 
656 };
657 
658 
674 ssize_t
676  const struct GNUNET_CONTAINER_MetaData *md,
677  char **target,
678  size_t max,
680 
681 
689 ssize_t
691  const struct GNUNET_CONTAINER_MetaData *md);
692 
693 
704 GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size);
705 
706 
707 /* ******************************* HashMap **************************** */
708 
714 
721 
727 {
735 
741 
748 
759 };
760 
761 
773 typedef enum GNUNET_GenericReturnValue
775  void *cls,
776  const struct GNUNET_HashCode *key,
777  void *value);
778 
779 
798  int do_not_copy_keys);
799 
800 
808 void
811 
812 
824 void *
826  const struct GNUNET_CONTAINER_MultiHashMap *map,
827  const struct GNUNET_HashCode *key);
828 
829 
844  const struct GNUNET_HashCode *key,
845  const void *value);
846 
856 int
859  const struct GNUNET_HashCode *key);
860 
861 
870 unsigned int
872 
873 
886  const struct GNUNET_CONTAINER_MultiHashMap *map,
887  const struct GNUNET_HashCode *key);
888 
889 
903  const struct GNUNET_CONTAINER_MultiHashMap *map,
904  const struct GNUNET_HashCode *key,
905  const void *value);
906 
907 
924  const struct GNUNET_HashCode *key,
925  void *value,
927 
935 unsigned int
937  const struct GNUNET_CONTAINER_MultiHashMap *map);
938 
939 
950 int
954  void *it_cls);
955 
956 
972  const struct GNUNET_CONTAINER_MultiHashMap *map);
973 
974 
993  struct GNUNET_HashCode *key,
994  const void **value);
995 
996 
1003 void
1006 
1007 
1019 int
1022  const struct GNUNET_HashCode *key,
1024  void *it_cls);
1025 
1026 
1038 unsigned int
1040  const struct GNUNET_CONTAINER_MultiHashMap *map,
1042  void *it_cls);
1043 
1044 
1045 /* ***************** Version of Multihashmap for peer identities ****************** */
1046 
1058 typedef enum GNUNET_GenericReturnValue
1060  void *cls,
1061  const struct GNUNET_PeerIdentity *key,
1062  void *value);
1063 
1064 
1069 
1070 
1088 GNUNET_CONTAINER_multipeermap_create (unsigned int len, int do_not_copy_keys);
1089 
1090 
1098 void
1101 
1102 
1114 void *
1116  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1117  const struct GNUNET_PeerIdentity *key);
1118 
1119 
1134  const struct GNUNET_PeerIdentity *key,
1135  const void *value);
1136 
1146 int
1149  const struct GNUNET_PeerIdentity *key);
1150 
1151 
1164  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1165  const struct GNUNET_PeerIdentity *key);
1166 
1167 
1181  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1182  const struct GNUNET_PeerIdentity *key,
1183  const void *value);
1184 
1185 
1199 int
1202  const struct GNUNET_PeerIdentity *key,
1203  void *value,
1205 
1206 
1214 unsigned int
1216  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1217 
1218 
1229 int
1233  void *it_cls);
1234 
1235 
1252  const struct GNUNET_CONTAINER_MultiPeerMap *map);
1253 
1254 
1276  struct GNUNET_PeerIdentity *key,
1277  const void **value);
1278 
1279 
1286 void
1289 
1290 
1302 int
1305  const struct GNUNET_PeerIdentity *key,
1307  void *it_cls);
1308 
1309 
1321 unsigned int
1323  const struct GNUNET_CONTAINER_MultiPeerMap *map,
1325  void *it_cls);
1326 
1327 
1328 /* ***************** Version of Multihashmap for short hashes ****************** */
1329 
1341 typedef enum GNUNET_GenericReturnValue
1343  void *cls,
1344  const struct GNUNET_ShortHashCode *key,
1345  void *value);
1346 
1347 
1352 
1353 
1371 GNUNET_CONTAINER_multishortmap_create (unsigned int len, int do_not_copy_keys);
1372 
1373 
1381 void
1384 
1385 
1397 void *
1399  const struct GNUNET_CONTAINER_MultiShortmap *map,
1400  const struct GNUNET_ShortHashCode *key);
1401 
1402 
1415 int
1418  const struct GNUNET_ShortHashCode *key,
1419  const void *value);
1420 
1430 int
1433  const struct GNUNET_ShortHashCode *key);
1434 
1435 
1446 int
1448  const struct GNUNET_CONTAINER_MultiShortmap *map,
1449  const struct GNUNET_ShortHashCode *key);
1450 
1451 
1463 int
1465  const struct GNUNET_CONTAINER_MultiShortmap *map,
1466  const struct GNUNET_ShortHashCode *key,
1467  const void *value);
1468 
1469 
1486  const struct GNUNET_ShortHashCode *key,
1487  void *value,
1489 
1490 
1498 unsigned int
1500  const struct GNUNET_CONTAINER_MultiShortmap *map);
1501 
1502 
1513 int
1517  void *it_cls);
1518 
1519 
1521 
1522 
1538  const struct GNUNET_CONTAINER_MultiShortmap *map);
1539 
1540 
1559  struct GNUNET_ShortHashCode *key,
1560  const void **value);
1561 
1562 
1569 void
1572 
1573 
1585 int
1588  const struct GNUNET_ShortHashCode *key,
1590  void *it_cls);
1591 
1592 
1604 unsigned int
1606  const struct GNUNET_CONTAINER_MultiShortmap *map,
1608  void *it_cls);
1609 
1610 
1611 /* ***************** Version of Multihashmap for UUIDs ****************** */
1612 
1613 
1625 typedef enum GNUNET_GenericReturnValue
1627  void *cls,
1628  const struct GNUNET_Uuid *key,
1629  void *value);
1630 
1631 
1636 
1637 
1655 GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys);
1656 
1657 
1665 void
1668 
1669 
1681 void *
1683  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1684  const struct GNUNET_Uuid *key);
1685 
1686 
1701  const struct GNUNET_Uuid *key,
1702  const void *value);
1703 
1713 int
1716  const struct GNUNET_Uuid *key);
1717 
1718 
1731  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1732  const struct GNUNET_Uuid *key);
1733 
1734 
1748  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1749  const struct GNUNET_Uuid *key,
1750  const void *value);
1751 
1752 
1769  const struct GNUNET_Uuid *key,
1770  void *value,
1772 
1773 
1781 unsigned int
1783  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1784 
1785 
1796 int
1800  void *it_cls);
1801 
1802 
1804 
1805 
1821  const struct GNUNET_CONTAINER_MultiUuidmap *map);
1822 
1823 
1842  struct GNUNET_Uuid *key,
1843  const void **value);
1844 
1845 
1852 void
1855 
1856 
1868 int
1871  const struct GNUNET_Uuid *key,
1873  void *it_cls);
1874 
1875 
1887 unsigned int
1889  const struct GNUNET_CONTAINER_MultiUuidmap *map,
1891  void *it_cls);
1892 
1893 
1894 /* Version of multihashmap with 32 bit keys */
1895 
1901 
1902 
1909 
1910 
1922 typedef enum GNUNET_GenericReturnValue
1924  void *cls,
1925  uint32_t key,
1926  void *value);
1927 
1928 
1938 
1939 
1947 void
1950 
1951 
1959 unsigned int
1961  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
1962 
1963 
1975 void *
1977  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
1978  uint32_t key);
1979 
1980 
1991 int
1995  void *it_cls);
1996 
1997 
2013  uint32_t key,
2014  const void *value);
2015 
2016 
2026 int
2029  uint32_t key);
2030 
2031 
2044  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2045  uint32_t key);
2046 
2047 
2061  const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2062  uint32_t key,
2063  const void *value);
2064 
2065 
2082  uint32_t key,
2083  void *value,
2085 
2086 
2098 int
2101  uint32_t key,
2103  void *it_cls);
2104 
2105 
2120  const struct GNUNET_CONTAINER_MultiHashMap32 *map);
2121 
2122 
2140  uint32_t *key,
2141  const void **value);
2142 
2143 
2149 void
2152 
2153 
2154 /* ******************** doubly-linked list *************** */
2155 /* To avoid mistakes: head->prev == tail->next == NULL */
2156 
2166 #define GNUNET_CONTAINER_DLL_insert(head, tail, element) \
2167  do \
2168  { \
2169  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2170  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2171  (element)->next = (head); \
2172  (element)->prev = NULL; \
2173  if ((tail) == NULL) \
2174  (tail) = element; \
2175  else \
2176  (head)->prev = element; \
2177  (head) = (element); \
2178  } while (0)
2179 
2180 
2190 #define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \
2191  do \
2192  { \
2193  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2194  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2195  (element)->prev = (tail); \
2196  (element)->next = NULL; \
2197  if ((head) == NULL) \
2198  (head) = element; \
2199  else \
2200  (tail)->next = element; \
2201  (tail) = (element); \
2202  } while (0)
2203 
2204 
2215 #define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \
2216  do \
2217  { \
2218  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2219  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2220  (element)->prev = (other); \
2221  if (NULL == other) \
2222  { \
2223  (element)->next = (head); \
2224  (head) = (element); \
2225  } \
2226  else \
2227  { \
2228  (element)->next = (other)->next; \
2229  (other)->next = (element); \
2230  } \
2231  if (NULL == (element)->next) \
2232  (tail) = (element); \
2233  else \
2234  (element)->next->prev = (element); \
2235  } while (0)
2236 
2237 
2248 #define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \
2249  do \
2250  { \
2251  GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2252  GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2253  (element)->next = (other); \
2254  if (NULL == other) \
2255  { \
2256  (element)->prev = (tail); \
2257  (tail) = (element); \
2258  } \
2259  else \
2260  { \
2261  (element)->prev = (other)->prev; \
2262  (other)->prev = (element); \
2263  } \
2264  if (NULL == (element)->prev) \
2265  (head) = (element); \
2266  else \
2267  (element)->prev->next = (element); \
2268  } while (0)
2269 
2270 
2285 #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \
2286  do \
2287  { \
2288  GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \
2289  GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \
2290  if ((element)->prev == NULL) \
2291  (head) = (element)->next; \
2292  else \
2293  (element)->prev->next = (element)->next; \
2294  if ((element)->next == NULL) \
2295  (tail) = (element)->prev; \
2296  else \
2297  (element)->next->prev = (element)->prev; \
2298  (element)->next = NULL; \
2299  (element)->prev = NULL; \
2300  } while (0)
2301 
2302 
2303 /* ************ Multi-DLL interface, allows DLL elements to be
2304  in multiple lists at the same time *********************** */
2305 
2316 #define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \
2317  do \
2318  { \
2319  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2320  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2321  (element)->next_ ## mdll = (head); \
2322  (element)->prev_ ## mdll = NULL; \
2323  if ((tail) == NULL) \
2324  (tail) = element; \
2325  else \
2326  (head)->prev_ ## mdll = element; \
2327  (head) = (element); \
2328  } while (0)
2329 
2330 
2341 #define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \
2342  do \
2343  { \
2344  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2345  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2346  (element)->prev_ ## mdll = (tail); \
2347  (element)->next_ ## mdll = NULL; \
2348  if ((head) == NULL) \
2349  (head) = element; \
2350  else \
2351  (tail)->next_ ## mdll = element; \
2352  (tail) = (element); \
2353  } while (0)
2354 
2355 
2367 #define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \
2368  do \
2369  { \
2370  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2371  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2372  (element)->prev_ ## mdll = (other); \
2373  if (NULL == other) \
2374  { \
2375  (element)->next_ ## mdll = (head); \
2376  (head) = (element); \
2377  } \
2378  else \
2379  { \
2380  (element)->next_ ## mdll = (other)->next_ ## mdll; \
2381  (other)->next_ ## mdll = (element); \
2382  } \
2383  if (NULL == (element)->next_ ## mdll) \
2384  (tail) = (element); \
2385  else \
2386  (element)->next_ ## mdll->prev_ ## mdll = (element); \
2387  } while (0)
2388 
2389 
2401 #define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \
2402  do \
2403  { \
2404  GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2405  GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2406  (element)->next_ ## mdll = (other); \
2407  if (NULL == other) \
2408  { \
2409  (element)->prev = (tail); \
2410  (tail) = (element); \
2411  } \
2412  else \
2413  { \
2414  (element)->prev_ ## mdll = (other)->prev_ ## mdll; \
2415  (other)->prev_ ## mdll = (element); \
2416  } \
2417  if (NULL == (element)->prev_ ## mdll) \
2418  (head) = (element); \
2419  else \
2420  (element)->prev_ ## mdll->next_ ## mdll = (element); \
2421  } while (0)
2422 
2423 
2435 #define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \
2436  do \
2437  { \
2438  GNUNET_assert (((element)->prev_ ## mdll != NULL) || ((head) == (element))); \
2439  GNUNET_assert (((element)->next_ ## mdll != NULL) || ((tail) == (element))); \
2440  if ((element)->prev_ ## mdll == NULL) \
2441  (head) = (element)->next_ ## mdll; \
2442  else \
2443  (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \
2444  if ((element)->next_ ## mdll == NULL) \
2445  (tail) = (element)->prev_ ## mdll; \
2446  else \
2447  (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \
2448  (element)->next_ ## mdll = NULL; \
2449  (element)->prev_ ## mdll = NULL; \
2450  } while (0)
2451 
2452 
2466 #define GNUNET_CONTAINER_DLL_insert_sorted(TYPE, \
2467  comparator, \
2468  comparator_cls, \
2469  head, \
2470  tail, \
2471  element) \
2472  do \
2473  { \
2474  if ((NULL == head) || (0 < comparator (comparator_cls, element, head))) \
2475  { \
2476  /* insert at head, element < head */ \
2477  GNUNET_CONTAINER_DLL_insert (head, tail, element); \
2478  } \
2479  else \
2480  { \
2481  TYPE *pos; \
2482  \
2483  for (pos = head; NULL != pos; pos = pos->next) \
2484  if (0 < comparator (comparator_cls, element, pos)) \
2485  break; /* element < pos */ \
2486  if (NULL == pos) /* => element > tail */ \
2487  { \
2488  GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \
2489  } \
2490  else /* prev < element < pos */ \
2491  { \
2492  GNUNET_CONTAINER_DLL_insert_after (head, tail, pos->prev, element); \
2493  } \
2494  } \
2495  } while (0)
2496 
2497 
2498 /* ******************** Heap *************** */
2499 
2500 
2506 
2507 
2513 {
2519 
2525 };
2526 
2527 
2532 struct GNUNET_CONTAINER_Heap;
2533 
2534 
2540 
2541 
2549 struct GNUNET_CONTAINER_Heap *
2551 
2552 
2560 void
2562 
2563 
2571 void *
2573 
2574 
2586  void **element,
2588 
2589 
2597 unsigned int
2599 
2600 
2610  const struct GNUNET_CONTAINER_HeapNode *node);
2611 
2612 
2624 typedef enum GNUNET_GenericReturnValue
2626  void *cls,
2627  struct GNUNET_CONTAINER_HeapNode *node,
2628  void *element,
2630 
2631 
2640 void
2643  void *iterator_cls);
2644 
2657 void *
2659 
2660 
2672  void *element,
2674 
2675 
2683 void *
2685 
2686 
2694 void *
2696 
2697 
2705 void
2708 
2709 
2710 #if 0 /* keep Emacsens' auto-indent happy */
2711 {
2712 #endif
2713 #ifdef __cplusplus
2714 }
2715 #endif
2716 
2717 
2718 /* ifndef GNUNET_CONTAINER_LIB_H */
2719 #endif
2720  /* end of group addition */
2722 
2723 /* end of gnunet_container_lib.h */
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
static struct Experiment * e
static struct GNUNET_CONTAINER_MultiPeerMap * map
Handle to the map used to store old latency values for peers.
struct GNUNET_HashCode key
The key used in the DHT.
static char * filename
uint32_t data
The data value.
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
static char * value
Value of the record to add/remove.
static int result
Global testing status.
static char * plugin_name
Name of our plugin.
cryptographic primitives for GNUnet
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.
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_load(const char *filename, size_t size, unsigned int k)
Load a Bloom filter from a file.
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.
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.
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_bloomfilter_add(struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
Add an element to the filter.
bool GNUNET_CONTAINER_bloomfilter_test(const struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
Test if an element is in the filter.
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_copy(const struct GNUNET_CONTAINER_BloomFilter *bf)
Create a copy of a bloomfilter.
void GNUNET_CONTAINER_bloomfilter_clear(struct GNUNET_CONTAINER_BloomFilter *bf)
Reset a Bloom filter to empty.
struct GNUNET_CONTAINER_BloomFilter * GNUNET_CONTAINER_bloomfilter_init(const char *data, size_t size, unsigned int k)
Create a Bloom filter from raw bits.
int(* GNUNET_CONTAINER_HashCodeIterator)(void *cls, struct GNUNET_HashCode *next)
Iterator over struct GNUNET_HashCode.
size_t GNUNET_CONTAINER_bloomfilter_get_size(const struct GNUNET_CONTAINER_BloomFilter *bf)
Get size of the bloom filter.
void GNUNET_CONTAINER_bloomfilter_remove(struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *e)
Remove an element from the filter.
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...
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.
enum GNUNET_GenericReturnValue 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.
unsigned int GNUNET_CONTAINER_multiuuidmap_size(const struct GNUNET_CONTAINER_MultiUuidmap *map)
Get the number of key-value pairs in the map.
enum GNUNET_GenericReturnValue 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_multihashmap_remove_all(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key)
Remove all entries for the given key from the map.
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.
int GNUNET_CONTAINER_multiuuidmap_iterate(struct GNUNET_CONTAINER_MultiUuidmap *map, GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_ShortmapIterator)(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
Iterator over hash map entries.
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.
enum GNUNET_GenericReturnValue 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.
enum GNUNET_GenericReturnValue 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).
struct GNUNET_CONTAINER_MultiUuidmapIterator * GNUNET_CONTAINER_multiuuidmap_iterator_create(const struct GNUNET_CONTAINER_MultiUuidmap *map)
Create an iterator for a multihashmap.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_PeerMapIterator)(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterator over hash map entries.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
enum GNUNET_GenericReturnValue 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.
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.
enum GNUNET_GenericReturnValue 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's position.
enum GNUNET_GenericReturnValue 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).
void GNUNET_CONTAINER_multishortmap_iterator_destroy(struct GNUNET_CONTAINER_MultiShortmapIterator *iter)
Destroy a multishortmap iterator.
enum GNUNET_GenericReturnValue 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's position.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap32_remove(struct GNUNET_CONTAINER_MultiHashMap32 *map, uint32_t key, const void *value)
Remove the given key-value pair from the map.
enum GNUNET_GenericReturnValue 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.
enum GNUNET_GenericReturnValue 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_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
unsigned int GNUNET_CONTAINER_multihashmap32_size(const struct GNUNET_CONTAINER_MultiHashMap32 *map)
Get the number of key-value pairs in the map.
enum GNUNET_GenericReturnValue 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.
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.
enum GNUNET_GenericReturnValue 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.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
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_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MulitHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
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).
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).
struct GNUNET_CONTAINER_MultiShortmapIterator * GNUNET_CONTAINER_multishortmap_iterator_create(const struct GNUNET_CONTAINER_MultiShortmap *map)
Create an iterator for a multihashmap.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
enum GNUNET_GenericReturnValue 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's position.
int GNUNET_CONTAINER_multishortmap_iterate(struct GNUNET_CONTAINER_MultiShortmap *map, GNUNET_CONTAINER_ShortmapIterator it, void *it_cls)
Iterate over all entries in the map.
struct GNUNET_CONTAINER_MultiHashMapIterator * GNUNET_CONTAINER_multihashmap_iterator_create(const struct GNUNET_CONTAINER_MultiHashMap *map)
Create an iterator for a multihashmap.
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.
void GNUNET_CONTAINER_multipeermap_iterator_destroy(struct GNUNET_CONTAINER_MultiPeerMapIterator *iter)
Destroy a multipeermap iterator.
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.
enum GNUNET_GenericReturnValue 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.
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.
void GNUNET_CONTAINER_multiuuidmap_destroy(struct GNUNET_CONTAINER_MultiUuidmap *map)
Destroy a hash map.
GNUNET_CONTAINER_MultiHashMapOption
Options for storing values in the HashMap.
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).
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_MultiHashMap32 * GNUNET_CONTAINER_multihashmap32_create(unsigned int len)
Create a 32-bit key multi hash map.
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 GNUNET_CONTAINER_multishortmap_destroy(struct GNUNET_CONTAINER_MultiShortmap *map)
Destroy a hash map.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_MulitHashMapIteratorCallback)(void *cls, const struct GNUNET_HashCode *key, void *value)
Iterator over hash map entries.
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.
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_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.
enum GNUNET_GenericReturnValue 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).
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.
unsigned int GNUNET_CONTAINER_multihashmap_clear(struct GNUNET_CONTAINER_MultiHashMap *map)
Remove all entries from the map.
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_multihashmap_iterator_destroy(struct GNUNET_CONTAINER_MultiHashMapIterator *iter)
Destroy a multihashmap iterator.
void GNUNET_CONTAINER_multihashmap32_destroy(struct GNUNET_CONTAINER_MultiHashMap32 *map)
Destroy a 32-bit key hash map.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_MultiUuidmapIteratorCallback)(void *cls, const struct GNUNET_Uuid *key, void *value)
Iterator over uuid map entries.
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.
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_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.
unsigned int GNUNET_CONTAINER_multishortmap_size(const struct GNUNET_CONTAINER_MultiShortmap *map)
Get the number of key-value pairs in the map.
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.
struct GNUNET_CONTAINER_MultiPeerMapIterator * GNUNET_CONTAINER_multipeermap_iterator_create(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Create an iterator for a multihashmap.
static int iterator(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterator over hash map entries.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_MulitHashMapIterator32Callback)(void *cls, uint32_t key, void *value)
Iterator over hash map entries.
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_multiuuidmap_iterator_destroy(struct GNUNET_CONTAINER_MultiUuidmapIterator *iter)
Destroy a multiuuidmap iterator.
enum GNUNET_GenericReturnValue 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.
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.
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.
enum GNUNET_GenericReturnValue 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's position.
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).
enum GNUNET_GenericReturnValue 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.
enum GNUNET_GenericReturnValue 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.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST
, ' bother checking if a value already exists (faster than GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE...
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE
If a value with the given key exists, replace it.
void * GNUNET_CONTAINER_heap_remove_root(struct GNUNET_CONTAINER_Heap *heap)
Remove root of the heap.
GNUNET_CONTAINER_HeapOrder
Heap type, either max or min.
void * GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node)
Removes a node from the heap.
GNUNET_CONTAINER_HeapCostType GNUNET_CONTAINER_heap_node_get_cost(const struct GNUNET_CONTAINER_HeapNode *node)
Get the current cost of the node.
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.
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.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_HeapIterator)(void *cls, struct GNUNET_CONTAINER_HeapNode *node, void *element, GNUNET_CONTAINER_HeapCostType cost)
Iterator for heap.
void * GNUNET_CONTAINER_heap_walk_get_next(struct GNUNET_CONTAINER_Heap *heap)
Perform a random walk of the tree.
void * GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap)
Get element stored at the root of heap.
unsigned int GNUNET_CONTAINER_heap_get_size(const struct GNUNET_CONTAINER_Heap *heap)
Get the current size of the heap.
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.
uint64_t GNUNET_CONTAINER_HeapCostType
Cost by which elements in a heap can be ordered.
struct GNUNET_CONTAINER_Heap * GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order)
Create a new heap.
void GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap)
Destroys the heap.
@ GNUNET_CONTAINER_HEAP_ORDER_MIN
Heap with the minimum cost at the root.
@ GNUNET_CONTAINER_HEAP_ORDER_MAX
Heap with the maximum cost at the root.
#define EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME
char * GNUNET_decompress(const char *input, size_t input_size, size_t output_size)
Decompress input, return the decompressed data as output.
enum GNUNET_GenericReturnValue 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.
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.
enum GNUNET_GenericReturnValue 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's position.
void GNUNET_CONTAINER_multihashmap32_iterator_destroy(struct GNUNET_CONTAINER_MultiHashMapIterator *iter)
Destroy a 32-bit multihashmap iterator.
struct GNUNET_CONTAINER_MultiHashMap32Iterator * GNUNET_CONTAINER_multihashmap32_iterator_create(const struct GNUNET_CONTAINER_MultiHashMap32 *map)
Create an iterator for a 32-bit multihashmap.
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.
EXTRACTOR_MetaFormat
Format in which the extracted meta data is presented.
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.
GNUNET_GenericReturnValue
Named constants for return values.
Definition: gnunet_common.h:96
EXTRACTOR_MetaType
Enumeration defining various sources of keywords.
@ EXTRACTOR_METAFORMAT_BINARY
Some kind of binary format, see given Mime type.
@ EXTRACTOR_METAFORMAT_C_STRING
0-terminated string.
@ EXTRACTOR_METAFORMAT_UTF8
0-terminated, UTF-8 encoded string.
@ EXTRACTOR_METAFORMAT_UNKNOWN
Format is unknown.
@ EXTRACTOR_METATYPE_PUBLICATION_DATE
@ EXTRACTOR_METATYPE_URI
@ EXTRACTOR_METATYPE_JOURNAL_NAME
@ EXTRACTOR_METATYPE_BOOK_TITLE
@ EXTRACTOR_METATYPE_THUMBNAIL
@ EXTRACTOR_METATYPE_UNKNOWN
@ EXTRACTOR_METATYPE_AUTHOR_NAME
@ EXTRACTOR_METATYPE_COMMENT
@ EXTRACTOR_METATYPE_TITLE
@ EXTRACTOR_METATYPE_ARTIST
@ EXTRACTOR_METATYPE_ISRC
@ EXTRACTOR_METATYPE_KEYWORDS
@ EXTRACTOR_METATYPE_FILENAME
@ EXTRACTOR_METATYPE_MIMETYPE
@ EXTRACTOR_METATYPE_ALBUM
@ EXTRACTOR_METATYPE_ORIGINAL_TITLE
@ EXTRACTOR_METATYPE_PACKAGE_NAME
@ EXTRACTOR_METATYPE_SUBJECT
@ EXTRACTOR_METATYPE_RESERVED
@ EXTRACTOR_METATYPE_URL
@ EXTRACTOR_METATYPE_GNUNET_FULL_DATA
@ EXTRACTOR_METATYPE_DESCRIPTION
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.
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.
int GNUNET_CONTAINER_meta_data_iterate(const struct GNUNET_CONTAINER_MetaData *md, EXTRACTOR_MetaDataProcessor iter, void *iter_cls)
Iterate over MD entries.
void GNUNET_CONTAINER_meta_data_merge(struct GNUNET_CONTAINER_MetaData *md, const struct GNUNET_CONTAINER_MetaData *in)
Extend metadata.
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).
GNUNET_CONTAINER_MetaDataSerializationOptions
Options for metadata serialization.
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.
struct GNUNET_CONTAINER_MetaData * GNUNET_CONTAINER_meta_data_deserialize(const char *input, size_t size)
Deserialize meta-data.
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.
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.
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.
struct GNUNET_CONTAINER_MetaData * GNUNET_CONTAINER_meta_data_create(void)
Create a fresh meta data container.
void GNUNET_CONTAINER_meta_data_destroy(struct GNUNET_CONTAINER_MetaData *md)
Free meta data.
struct GNUNET_CONTAINER_MetaData * GNUNET_CONTAINER_meta_data_duplicate(const struct GNUNET_CONTAINER_MetaData *md)
Duplicate a MetaData token.
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_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.
void GNUNET_CONTAINER_meta_data_clear(struct GNUNET_CONTAINER_MetaData *md)
Remove all items in the container.
@ GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS
Speed is of the essence, do not allow compression.
@ GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL
Serialize all of the data.
@ GNUNET_CONTAINER_META_DATA_SERIALIZE_PART
If not enough space is available, it is acceptable to only serialize some of the metadata.
#define max(x, y)
static unsigned int size
Size of the "table".
Definition: peer.c:67
void * element
Our element.
struct GNUNET_CONTAINER_Heap * heap
Heap this node belongs to.
GNUNET_CONTAINER_HeapCostType cost
Cost for this element.
Handle to a node in a heap.
enum GNUNET_CONTAINER_HeapOrder order
How is the heap sorted?
Meta data to associate with a file, directory or namespace.
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
Internal representation of the hash map.
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
A 256-bit hashcode.
A UUID, a 128 bit "random" value.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model