aboutsummaryrefslogtreecommitdiffstats
path: root/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-18 02:00:03 +0000
committerDavid Robillard <d@drobilla.net>2011-05-18 02:00:03 +0000
commitb92d598a22fdad8c96a1167362d4bb79015af006 (patch)
treebf4768c8b4357aafbee9218806f1fe80156dc356 /serd
parent88e6e9a333e99c304451b7755117928a213913ef (diff)
downloadserd-b92d598a22fdad8c96a1167362d4bb79015af006.tar.gz
serd-b92d598a22fdad8c96a1167362d4bb79015af006.tar.bz2
serd-b92d598a22fdad8c96a1167362d4bb79015af006.zip
Add test to ensure blank node IDs don't clash with generated IDs.
Add handle destructor parameter to serd_reader_new. Add serd_reader_get_handle. Rename serd_reader_set_blank_prefix to serd_reader_add_blank_prefix. Rename serd_reader_read_file to serd_reader_read_file_handle. Add new serd_reader_read_file that takes a path/URI parameter. Add serdi -i option to select input syntax. Add serdi -p and -c options to add/chop a prefix to/from blank IDs. Add optional base_uri parameter to serd_env_new. Add serd_writer_chop_blank_prefix. Bump version to 0.3.0. git-svn-id: http://svn.drobilla.net/serd/trunk@183 490d8e77-9747-427b-9fa3-0b8f29cee8a0
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.