aboutsummaryrefslogtreecommitdiffstats
path: root/serd
diff options
context:
space:
mode:
Diffstat (limited to 'serd')
-rw-r--r--serd/serd.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 4d87c1a3..977c9e51 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -428,7 +428,7 @@ typedef SerdStatus (*SerdEndSink)(void* handle,
*/
SERD_API
SerdEnv*
-serd_env_new();
+serd_env_new(const SerdNode* base_uri);
/**
Free @a ns.
@@ -512,12 +512,20 @@ SERD_API
SerdReader*
serd_reader_new(SerdSyntax syntax,
void* handle,
+ void (*free_handle)(void*),
SerdBaseSink base_sink,
SerdPrefixSink prefix_sink,
SerdStatementSink statement_sink,
SerdEndSink end_sink);
/**
+ Return the @c handle passed to @ref serd_reader_new.
+*/
+SERD_API
+void*
+serd_reader_get_handle(const SerdReader* reader);
+
+/**
Set a prefix to be added to all blank node identifiers.
This is useful when multiple files are to be parsed into the same output
@@ -528,17 +536,26 @@ serd_reader_new(SerdSyntax syntax,
*/
SERD_API
void
-serd_reader_set_blank_prefix(SerdReader* reader,
+serd_reader_add_blank_prefix(SerdReader* reader,
const uint8_t* prefix);
/**
Read @a file.
+ @param Path or file: URI of file to read.
*/
SERD_API
SerdStatus
serd_reader_read_file(SerdReader* reader,
- FILE* file,
- const uint8_t* name);
+ const uint8_t* uri);
+
+/**
+ Read @a file.
+*/
+SERD_API
+SerdStatus
+serd_reader_read_file_handle(SerdReader* reader,
+ FILE* file,
+ const uint8_t* name);
/**
Read @a utf8.
@@ -580,6 +597,14 @@ void
serd_writer_free(SerdWriter* writer);
/**
+ Set a prefix to be removed from matching blank node identifiers.
+*/
+SERD_API
+void
+serd_writer_chop_blank_prefix(SerdWriter* writer,
+ const uint8_t* prefix);
+
+/**
Set the current output base URI (and emit directive if applicable).
Note this function can be safely casted to SerdBaseSink.