diff options
Diffstat (limited to 'src/serdi.c')
-rw-r--r-- | src/serdi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/serdi.c b/src/serdi.c index 549bf2bd..5db96388 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -123,6 +123,13 @@ print_usage(const char* name, bool error) return error ? 1 : 0; } +static size_t +file_sink(const void* buf, size_t len, void* stream) +{ + FILE* file = (FILE*)stream; + return fwrite(buf, 1, len, file); +} + int main(int argc, char** argv) { @@ -168,10 +175,10 @@ main(int argc, char** argv) } SerdNamespaces ns = serd_namespaces_new(); - State state = { serd_writer_new(SERD_NTRIPLES, ns, out_fd, &base_uri), - ns, - base_uri_str, - base_uri }; + State state = { + serd_writer_new(SERD_NTRIPLES, ns, &base_uri, file_sink, out_fd), + ns, base_uri_str, base_uri + }; SerdReader reader = serd_reader_new( SERD_TURTLE, &state, event_base, event_prefix, event_statement); |