aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd/serd.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-02-25 15:48:04 -0500
committerDavid Robillard <d@drobilla.net>2021-03-07 15:32:24 -0500
commite6abc21f9bde66d8f60078493354ba3713f9fcd8 (patch)
treed509c89987e44ba6cbffa52603ab9394fcc7c3e1 /include/serd/serd.h
parentb085fe7aa38e5e2caf82b1fec6b7e6094779dd5a (diff)
downloadserd-e6abc21f9bde66d8f60078493354ba3713f9fcd8.tar.gz
serd-e6abc21f9bde66d8f60078493354ba3713f9fcd8.tar.bz2
serd-e6abc21f9bde66d8f60078493354ba3713f9fcd8.zip
Simplify reader interface
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r--include/serd/serd.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 9c205d26..d51adebe 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -954,11 +954,12 @@ void
serd_reader_set_default_graph(SerdReader* SERD_NONNULL reader,
const SerdNode* SERD_NULLABLE graph);
-/// Read a file at a given `uri`
+/// Prepare to read from the file at a local file `uri`
SERD_API
SerdStatus
-serd_reader_read_file(SerdReader* SERD_NONNULL reader,
- const char* SERD_NONNULL uri);
+serd_reader_start_file(SerdReader* SERD_NONNULL reader,
+ const char* SERD_NONNULL uri,
+ bool bulk);
/**
Prepare to read from a stream.
@@ -1004,18 +1005,20 @@ SERD_API
SerdStatus
serd_reader_read_document(SerdReader* SERD_NONNULL reader);
-/// Finish reading from the source
-SERD_API
-SerdStatus
-serd_reader_end_stream(SerdReader* SERD_NONNULL reader);
+/**
+ Finish reading from the source.
-/// Read `utf8`
+ This should be called before starting to read from another source.
+*/
SERD_API
SerdStatus
-serd_reader_read_string(SerdReader* SERD_NONNULL reader,
- const char* SERD_NONNULL utf8);
+serd_reader_finish(SerdReader* SERD_NONNULL reader);
-/// Free `reader`
+/**
+ Free `reader`.
+
+ The reader will be finished via `serd_reader_finish()` if necessary.
+*/
SERD_API
void
serd_reader_free(SerdReader* SERD_NULLABLE reader);