summaryrefslogtreecommitdiff
path: root/src/cmark.h
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2015-01-10 16:10:35 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2015-01-10 17:40:13 +0100
commit009c3847f004fda437dd5376a9452973b1cb913e (patch)
treef1e51be8affaa4c46231fd10590acc674b21bf16 /src/cmark.h
parentd548d56d604193e4eebb4ab81c347887763b7d69 (diff)
Rework iterators
* Advance to the next node when calling 'cmark_iter_next', not when calling 'cmark_iter_get_node'. * Add 'cmark_iter_get_event_type' accessor. * Allow deletion of nodes after an 'EXIT' event, or an 'ENTER' event for leaf nodes.
Diffstat (limited to 'src/cmark.h')
-rw-r--r--src/cmark.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmark.h b/src/cmark.h
index 72650c9..b153124 100644
--- a/src/cmark.h
+++ b/src/cmark.h
@@ -83,6 +83,7 @@ typedef struct cmark_parser cmark_parser;
typedef struct cmark_iter cmark_iter;
typedef enum {
+ CMARK_EVENT_NONE,
CMARK_EVENT_DONE,
CMARK_EVENT_ENTER,
CMARK_EVENT_EXIT
@@ -204,6 +205,12 @@ CMARK_EXPORT
cmark_node*
cmark_iter_get_node(cmark_iter *iter);
+/** Returns the current event type.
+ */
+CMARK_EXPORT
+cmark_event_type
+cmark_iter_get_event_type(cmark_iter *iter);
+
/**
* ## Accessors
*/