dhtlog updates
[oweals/gnunet.git] / src / include / gnunet_container_lib.h
index bec0405969c439906c07cb1d5a0732e30cac2cb7..19946d6f7961a0769cf66738056cc0bc1a9c5940 100644 (file)
@@ -171,6 +171,21 @@ void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter
 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.  Assumes that
+ * the size of the data array and the current filter
+ * match.
+ *
+ * @param bf the filter
+ * @param to_or the bloomfilter to or-in
+ * @param size number of bytes in data
+ */
+int
+GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf,
+                                  const struct GNUNET_CONTAINER_BloomFilter *to_or,
+                                  size_t size);
+
 /**
  * Resize a bloom filter.  Note that this operation
  * is pretty costly.  Essentially, the bloom filter
@@ -265,6 +280,18 @@ GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
                                   size_t data_len);
 
 
+/**
+ * Extend metadata.  Merges the meta data from the second argument
+ * into the first, discarding duplicate key-value pairs.
+ *
+ * @param md metadata to extend
+ * @param in metadata to merge
+ */
+void 
+GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md,
+                                 const struct GNUNET_CONTAINER_MetaData *in);
+
+
 /**
  * Remove an item.
  *
@@ -282,6 +309,15 @@ GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
                                   size_t data_len);
 
 
+/**
+ * Remove all items in the container.
+ *
+ * @param md metadata to manipulate
+ */
+void 
+GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md);
+
+
 /**
  * Add the current time as the publication date
  * to the meta-data.
@@ -353,21 +389,6 @@ GNUNET_CONTAINER_meta_data_get_thumbnail (const struct
                                          GNUNET_CONTAINER_MetaData
                                          *md, unsigned char **thumb);
 
-/**
- * Extract meta-data from a file.
- *
- * @param md metadata to set
- * @param filename name of file to inspect
- * @param extractors plugins to use
- * @return GNUNET_SYSERR on error, otherwise the number
- *   of meta-data items obtained
- */
-int 
-GNUNET_CONTAINER_meta_data_extract_from_file (struct
-                                             GNUNET_CONTAINER_MetaData
-                                             *md, const char *filename,
-                                             struct EXTRACTOR_PluginList *
-                                             extractors);
 
 
 /**
@@ -439,18 +460,6 @@ struct GNUNET_CONTAINER_MetaData
   *GNUNET_CONTAINER_meta_data_deserialize (const char *input,
                                            size_t size);
 
-/**
- * Does the meta-data claim that this is a directory?
- * Checks if the mime-type is that of a GNUnet directory.
- *
- * @param md metadata to inspect
- * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if
- *  we have no mime-type information (treat as 'GNUNET_NO')
- */
-int GNUNET_CONTAINER_meta_data_test_for_directory (const struct
-                                                   GNUNET_CONTAINER_MetaData
-                                                   *md);
-
 
 /* ******************************* HashMap **************************** */
 
@@ -504,7 +513,7 @@ enum GNUNET_CONTAINER_MultiHashMapOption
  *         GNUNET_NO if not.
  */
 typedef int (*GNUNET_CONTAINER_HashMapIterator) (void *cls,
-                                                const GNUNET_HashCode * key,
+                                                 const GNUNET_HashCode * key,
                                                  void *value);