aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-07-08 18:46:38 +0200
committerDavid Robillard <d@drobilla.net>2018-12-31 11:37:48 -0500
commit87a1b30968d422831615ffb2fce33603a3e24e84 (patch)
treeeb01a18356a0b7f6db9f102b84a9c013cf437990 /src/writer.c
parentb69236b298c0263f7233562d83df5e6278def5a7 (diff)
downloadserd-87a1b30968d422831615ffb2fce33603a3e24e84.tar.gz
serd-87a1b30968d422831615ffb2fce33603a3e24e84.tar.bz2
serd-87a1b30968d422831615ffb2fce33603a3e24e84.zip
Expose SerdByteSink in public API
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/writer.c b/src/writer.c
index 6b83d839..a245f860 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -14,7 +14,6 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include "byte_sink.h"
#include "env.h"
#include "node.h"
#include "serd_internal.h"
@@ -95,7 +94,7 @@ struct SerdWriterImpl {
SerdNode* root_node;
SerdURI root_uri;
SerdStack anon_stack;
- SerdByteSink byte_sink;
+ SerdByteSink* byte_sink;
SerdErrorSink error_sink;
void* error_handle;
WriteContext context;
@@ -160,7 +159,7 @@ ctx(SerdWriter* writer, const SerdField field)
static inline size_t
sink(const void* buf, size_t len, SerdWriter* writer)
{
- return serd_byte_sink_write(buf, len, &writer->byte_sink);
+ return serd_byte_sink_write(buf, 1, len, writer->byte_sink);
}
// Write a single character, as an escape for single byte characters
@@ -855,7 +854,7 @@ serd_writer_finish(SerdWriter* writer)
if (ctx(writer, SERD_GRAPH)) {
write_sep(writer, SEP_GRAPH_END);
}
- serd_byte_sink_flush(&writer->byte_sink);
+ serd_byte_sink_flush(writer->byte_sink);
free_context(writer);
writer->indent = 0;
writer->context = WRITE_CONTEXT_NULL;
@@ -973,7 +972,7 @@ serd_writer_free(SerdWriter* writer)
serd_writer_finish(writer);
serd_stack_free(&writer->anon_stack);
free(writer->bprefix);
- serd_byte_sink_free(&writer->byte_sink);
+ serd_byte_sink_free(writer->byte_sink);
serd_node_free(writer->root_node);
free(writer);
}