aboutsummaryrefslogtreecommitdiffstats
path: root/src/stack.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-10-21 20:57:33 +0200
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commit744a0946735fe975db9625e9ff598b7201293f80 (patch)
treed99dcf8ab538218d74723d42fa1eb4f4530c6fc1 /src/stack.h
parentb603e1e6226c6c07319a51f2ea1cd4db5963b4c7 (diff)
downloadserd-744a0946735fe975db9625e9ff598b7201293f80.tar.gz
serd-744a0946735fe975db9625e9ff598b7201293f80.tar.bz2
serd-744a0946735fe975db9625e9ff598b7201293f80.zip
Simplify streaming API and improve pretty printing
This removes the obligation from the caller to correctly maintain flags to describe the current anonymous context, instead making the writer handle this itself as much as possible. Flags remain for the cases the writer can not infer from context: the start of anonymous subject and object nodes.
Diffstat (limited to 'src/stack.h')
-rw-r--r--src/stack.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stack.h b/src/stack.h
index 62f3402b..f6d33f51 100644
--- a/src/stack.h
+++ b/src/stack.h
@@ -46,6 +46,12 @@ serd_stack_new(size_t size)
return stack;
}
+static inline void
+serd_stack_clear(SerdStack* stack)
+{
+ stack->size = SERD_STACK_BOTTOM;
+}
+
static inline bool
serd_stack_is_empty(SerdStack* stack)
{