aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-03-01 19:38:01 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commitc2e59da8865a8c5719b8ddaf5f68204729a8ebab (patch)
tree4a8c2eb24c4a274eac41a226df6679a6319b6ac4 /src/n3.c
parentb631e7a3d6a807aaf4919396b62ba96e1a9f0bd9 (diff)
downloadserd-c2e59da8865a8c5719b8ddaf5f68204729a8ebab.tar.gz
serd-c2e59da8865a8c5719b8ddaf5f68204729a8ebab.tar.bz2
serd-c2e59da8865a8c5719b8ddaf5f68204729a8ebab.zip
Add SerdSink interface and hide implementations
Diffstat (limited to 'src/n3.c')
-rw-r--r--src/n3.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/n3.c b/src/n3.c
index 929b1a97..cd7e5a03 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -11,6 +11,7 @@
#include "serd/node.h"
#include "serd/reader.h"
+#include "serd/sink.h"
#include "serd/statement.h"
#include "serd/status.h"
#include "serd/syntax.h"
@@ -1099,9 +1100,7 @@ read_anon(SerdReader* const reader,
return r_err(reader, SERD_BAD_SYNTAX, "'.' inside blank\n");
}
read_ws_star(reader);
- if (reader->end_func) {
- reader->end_func(reader->handle, deref(reader, *dest));
- }
+ serd_sink_write_end(reader->sink, deref(reader, *dest));
*ctx.flags = old_flags;
}
@@ -1453,9 +1452,7 @@ read_base(SerdReader* const reader, const bool sparql, const bool token)
Ref uri = 0;
TRY(st, read_IRIREF(reader, &uri));
- if (reader->base_func) {
- TRY(st, reader->base_func(reader->handle, deref(reader, uri)));
- }
+ TRY(st, serd_sink_write_base(reader->sink, deref(reader, uri)));
pop_node(reader, uri);
read_ws_star(reader);
@@ -1491,10 +1488,8 @@ read_prefixID(SerdReader* const reader, const bool sparql, const bool token)
Ref uri = 0;
TRY(st, read_IRIREF(reader, &uri));
- if (reader->prefix_func) {
- st = reader->prefix_func(
- reader->handle, deref(reader, name), deref(reader, uri));
- }
+ st = serd_sink_write_prefix(
+ reader->sink, deref(reader, name), deref(reader, uri));
pop_node(reader, uri);
pop_node(reader, name);
@@ -1502,7 +1497,6 @@ read_prefixID(SerdReader* const reader, const bool sparql, const bool token)
read_ws_star(reader);
st = eat_byte_check(reader, '.') ? SERD_SUCCESS : SERD_BAD_SYNTAX;
}
-
return st;
}