diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 21 | ||||
-rw-r--r-- | src/reader.c | 9 | ||||
-rw-r--r-- | src/writer.c | 1 |
3 files changed, 13 insertions, 18 deletions
@@ -18,7 +18,6 @@ #include "node.h" #include "reader.h" #include "serd_internal.h" -#include "sink.h" #include "stack.h" #include "string_utils.h" #include "uri_utils.h" @@ -1012,8 +1011,8 @@ read_anon(SerdReader* reader, ReadContext ctx, bool subject, SerdNode** dest) *ctx.flags = old_flags; } - if (reader->sink->end && (!subject || !empty)) { - reader->sink->end(reader->sink->handle, *dest); + if (!subject || !empty) { + serd_sink_write_end(reader->sink, *dest); } return (eat_byte_check(reader, ']') == ']') ? SERD_SUCCESS @@ -1324,10 +1323,9 @@ read_base(SerdReader* reader, bool sparql, bool token) SerdNode* uri = NULL; TRY(st, read_IRIREF(reader, &uri)); - if (reader->sink->base) { - serd_node_zero_pad(uri); - TRY(st, reader->sink->base(reader->sink->handle, uri)); - } + + serd_node_zero_pad(uri); + TRY(st, serd_sink_write_base(reader->sink, uri)); read_ws_star(reader); if (!sparql) { @@ -1363,11 +1361,10 @@ read_prefixID(SerdReader* reader, bool sparql, bool token) SerdNode* uri = NULL; TRY(st, read_IRIREF(reader, &uri)); - if (reader->sink->prefix) { - serd_node_zero_pad(name); - serd_node_zero_pad(uri); - st = reader->sink->prefix(reader->sink->handle, name, uri); - } + serd_node_zero_pad(name); + serd_node_zero_pad(uri); + st = serd_sink_write_prefix(reader->sink, name, uri); + if (!sparql) { read_ws_star(reader); st = eat_byte_check(reader, '.') ? SERD_SUCCESS : SERD_ERR_BAD_SYNTAX; diff --git a/src/reader.c b/src/reader.c index c855b7aa..a79073ee 100644 --- a/src/reader.c +++ b/src/reader.c @@ -18,7 +18,7 @@ #include "system.h" #include "serd_internal.h" -#include "sink.h" +#include "stack.h" #include "statement.h" #include "world.h" @@ -123,11 +123,8 @@ emit_statement(SerdReader* reader, ReadContext ctx, SerdNode* o) &reader->source.cur }; - const SerdStatus st = !reader->sink->statement - ? SERD_SUCCESS - : reader->sink->statement(reader->sink->handle, - *ctx.flags, - &statement); + const SerdStatus st = + serd_sink_write_statement(reader->sink, *ctx.flags, &statement); *ctx.flags = 0; return st; diff --git a/src/writer.c b/src/writer.c index 042d2bfe..d84600e1 100644 --- a/src/writer.c +++ b/src/writer.c @@ -16,6 +16,7 @@ #include "env.h" #include "node.h" +#include "serd_internal.h" #include "sink.h" #include "stack.h" #include "string_utils.h" |