- Reorder iterator arguments
authorBart Polot <bart@net.in.tum.de>
Wed, 27 Jun 2012 13:48:42 +0000 (13:48 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 27 Jun 2012 13:48:42 +0000 (13:48 +0000)
src/mesh/mesh_block_lib.c
src/mesh/mesh_block_lib.h

index b9c187e3771441df3fb5a9f29041449e48bfb22c..3ab5d5a4741399eccfc1abf6b9c72ac74c442040 100644 (file)
@@ -66,25 +66,25 @@ int
 GNUNET_MESH_regex_block_check (const struct MeshRegexBlock *block,
                                size_t size)
 {
-  return GNUNET_MESH_regex_block_iterate(NULL, block, size, &check_edge);
+  return GNUNET_MESH_regex_block_iterate(block, size, &check_edge, NULL);
 }
 
 
 /**
  * Iterate over all edges of a block of a regex state.
  *
- * @param cls Closure for the iterator.
  * @param block Block to iterate over.
  * @param size Size of block.
  * @param iterator Function to call on each edge in the block.
+ * @param iter_cls Closure for the iterator.
  *
  * @return How many bytes of block have been processed
  */
 int
-GNUNET_MESH_regex_block_iterate (void *cls,
-                                 const struct MeshRegexBlock *block,
+GNUNET_MESH_regex_block_iterate (const struct MeshRegexBlock *block,
                                  size_t size,
-                                 GNUNET_MESH_EgdeIterator iterator)
+                                 GNUNET_MESH_EgdeIterator iterator,
+                                 void *iter_cls)
 {
   struct MeshRegexEdge *edge;
   unsigned int n;
@@ -115,7 +115,7 @@ GNUNET_MESH_regex_block_iterate (void *cls,
       return GNUNET_SYSERR;
     aux = (char *) &edge[1]; // Skip edge block
     if (NULL != iterator)
-        if (GNUNET_NO == iterator (cls, aux, n_token, &edge->key))
+        if (GNUNET_NO == iterator (iter_cls, aux, n_token, &edge->key))
             return GNUNET_OK;
     aux = &aux[n_token];     // Skip edge token
   }
index 47e63289c68a312b59ed93d63505a91cf630a82e..ac8a09956df44333cd5c339ad3c76dbf663ca0ed 100644 (file)
@@ -69,18 +69,18 @@ typedef int (*GNUNET_MESH_EgdeIterator)(void *cls,
 /**
  * Iterate over all edges of a block of a regex state.
  *
- * @param cls Closure for the iterator.
  * @param block Block to iterate over.
  * @param size Size of block.
  * @param iterator Function to call on each edge in the block.
+ * @param iter_cls Closure for the iterator.
  *
  * @return GNUNET_SYSERR if an error has been encountered, GNUNET_OK otherwise
  */
 int
-GNUNET_MESH_regex_block_iterate (void *cls,
-                                 const struct MeshRegexBlock *block,
+GNUNET_MESH_regex_block_iterate (const struct MeshRegexBlock *block,
                                  size_t size,
-                                 GNUNET_MESH_EgdeIterator iterator);
+                                 GNUNET_MESH_EgdeIterator iterator,
+                                 void *iter_cls);
 
 #if 0                           /* keep Emacsens' auto-indent happy */
 {