Added debug print of tree structure
[oweals/gnunet.git] / src / block / block.c
index bdef55aa3ab296c4193fa38c45b102861e35983c..7ab420f7ad2658702cb0db1e6e30b7485655f025 100644 (file)
@@ -66,14 +66,14 @@ struct GNUNET_BLOCK_Context
 
 /**
  * Mingle hash with the mingle_number to produce different bits.
- * 
+ *
  * @param in original hash code
  * @param mingle_number number for hash permutation
  * @param hc where to store the result.
  */
 void
-GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in,
-                          uint32_t mingle_number, GNUNET_HashCode * hc)
+GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, uint32_t mingle_number,
+                          GNUNET_HashCode * hc)
 {
   GNUNET_HashCode m;
 
@@ -105,8 +105,8 @@ GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg)
   if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_string (cfg, "block", "PLUGINS", &plugs))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _("Loading block plugins `%s'\n"), plugs);
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading block plugins `%s'\n"),
+                plugs);
     pos = strtok (plugs, " ");
     while (pos != NULL)
     {
@@ -192,7 +192,7 @@ find_plugin (struct GNUNET_BLOCK_Context *ctx, enum GNUNET_BLOCK_Type type)
 /**
  * Function called to validate a reply or a request.  For
  * request evaluation, simply pass "NULL" for the reply_block.
- * Note that it is assumed that the reply has already been 
+ * Note that it is assumed that the reply has already been
  * matched to the key (and signatures checked) as it would
  * be done with the "get_key" function.
  *
@@ -212,18 +212,16 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx,
                        enum GNUNET_BLOCK_Type type,
                        const GNUNET_HashCode * query,
                        struct GNUNET_CONTAINER_BloomFilter **bf,
-                       int32_t bf_mutator,
-                       const void *xquery,
-                       size_t xquery_size,
-                       const void *reply_block, size_t reply_block_size)
+                       int32_t bf_mutator, const void *xquery,
+                       size_t xquery_size, const void *reply_block,
+                       size_t reply_block_size)
 {
   struct GNUNET_BLOCK_PluginFunctions *plugin = find_plugin (ctx, type);
 
   if (plugin == NULL)
     return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
-  return plugin->evaluate (plugin->cls,
-                           type, query, bf, bf_mutator,
-                           xquery, xquery_size, reply_block, reply_block_size);
+  return plugin->evaluate (plugin->cls, type, query, bf, bf_mutator, xquery,
+                           xquery_size, reply_block, reply_block_size);
 }
 
 
@@ -240,8 +238,7 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx,
  */
 int
 GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx,
-                      enum GNUNET_BLOCK_Type type,
-                      const void *block,
+                      enum GNUNET_BLOCK_Type type, const void *block,
                       size_t block_size, GNUNET_HashCode * key)
 {
   struct GNUNET_BLOCK_PluginFunctions *plugin = find_plugin (ctx, type);
@@ -252,4 +249,25 @@ GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx,
 }
 
 
+
+/**
+ * Construct a bloom filter that would filter out the given
+ * results.
+ *
+ * @param bf_mutator mutation value to use
+ * @param seen_results results already seen
+ * @param seen_results_count number of entries in 'seen_results'
+ * @return NULL if seen_results_count is 0, otherwise a BF
+ *         that would match the given results.
+ */
+struct GNUNET_CONTAINER_BloomFilter *
+GNUNET_BLOCK_construct_bloomfilter (int32_t bf_mutator,
+                                   const GNUNET_HashCode *seen_results,
+                                   unsigned int seen_results_count)
+{
+  GNUNET_break (0);
+  return NULL;
+}
+
+
 /* end of block.c */