summaryrefslogtreecommitdiff
path: root/sexp.h
diff options
context:
space:
mode:
Diffstat (limited to 'sexp.h')
-rw-r--r--sexp.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sexp.h b/sexp.h
index 21e88eaf..72bbae9c 100644
--- a/sexp.h
+++ b/sexp.h
@@ -36,7 +36,9 @@ struct sexp_iterator
{
unsigned length;
const uint8_t *buffer;
-
+
+ /* Points at the start of the current sub expression. */
+ unsigned start;
/* If type is SEXP_LIST, pos points at the start of the current
* element. Otherwise, it points at the end. */
unsigned pos;
@@ -75,6 +77,12 @@ sexp_iterator_enter_list(struct sexp_iterator *iterator);
int
sexp_iterator_exit_list(struct sexp_iterator *iterator);
+/* Gets start and length of the current subexpression. Implies
+ * sexp_iterator_next. */
+const uint8_t *
+sexp_iterator_subexpr(struct sexp_iterator *iterator,
+ unsigned *length);
+
/* Checks the type of the current expression, which should be a list
*