aboutsummaryrefslogtreecommitdiff
path: root/src/regex/regex_block_lib.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-06-26 11:53:06 +0000
committerChristian Grothoff <christian@grothoff.org>2013-06-26 11:53:06 +0000
commitd8076558c37b4b4984d8b6530b378551d9d4ee05 (patch)
tree491e49df60395105fa03090e3ffe0b7dd494064d /src/regex/regex_block_lib.c
parent9058f938b0a651aaa3345755b76395c3385d246d (diff)
-duping comments from declarations to definitions
Diffstat (limited to 'src/regex/regex_block_lib.c')
-rw-r--r--src/regex/regex_block_lib.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/regex/regex_block_lib.c b/src/regex/regex_block_lib.c
index 851bdba14d..b945b9198b 100644
--- a/src/regex/regex_block_lib.c
+++ b/src/regex/regex_block_lib.c
@@ -81,10 +81,22 @@ check_edge (void *cls,
}
+/**
+ * Check if the regex block is well formed, including all edges.
+ *
+ * @param block The start of the block.
+ * @param size The size of the block.
+ * @param xquery String describing the edge we are looking for.
+ * Can be NULL in case this is a put block.
+ *
+ * @return GNUNET_OK in case it's fine.
+ * GNUNET_NO in case the xquery exists and is not found (IRRELEVANT).
+ * GNUNET_SYSERR if the block is invalid.
+ */
int
REGEX_BLOCK_check (const struct RegexBlock *block,
- size_t size,
- const char *xquery)
+ size_t size,
+ const char *xquery)
{
int res;
struct regex_block_xquery_ctx ctx;
@@ -108,6 +120,22 @@ REGEX_BLOCK_check (const struct RegexBlock *block,
}
+/**
+ * Iterate over all edges of a block of a regex state.
+ *
+ * @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 if no error has been encountered.
+ * Note that if the iterator stops the iteration by returning
+ * GNUNET_NO, the block will no longer be checked for further errors.
+ * The return value will be GNUNET_OK meaning that no errors were
+ * found until the edge last notified to the iterator, but there might
+ * be errors in further edges.
+ */
int
REGEX_BLOCK_iterate (const struct RegexBlock *block,
size_t size,