aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-08-13 20:31:57 -0400
committerDavid Robillard <d@drobilla.net>2022-01-28 21:57:07 -0500
commit0e739f34801ff6810064a8fac570f6be2b61ae70 (patch)
tree4451739f8e9b00d490d2d59aa6b1f370ae99c356 /tools/console.h
parent63e7e57237a79d0447b0450a7fd3148c43052299 (diff)
downloadserd-0e739f34801ff6810064a8fac570f6be2b61ae70.tar.gz
serd-0e739f34801ff6810064a8fac570f6be2b61ae70.tar.bz2
serd-0e739f34801ff6810064a8fac570f6be2b61ae70.zip
Simplify output stream API
This makes the paging mechanism an internal detail once again. While it's conceptually elegant to simply have a single write interface and have the block dumper just be another implementation of that, unfortunately it is not practical. The inlining of serd_block_dumper_write() is a significant performance boost, because it avoids a non-inlinable function call of overhead per character. Compared to the SerdByteSink approach, this removes the burden and overhead of needing to dynamically allocate the structure itself.
Diffstat (limited to 'tools/console.h')
-rw-r--r--tools/console.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/console.h b/tools/console.h
index cb227e8e..97251f68 100644
--- a/tools/console.h
+++ b/tools/console.h
@@ -47,10 +47,10 @@ typedef struct {
// Common "global" state of a command-line tool that writes data
typedef struct {
- SerdByteSink* out;
- SerdWorld* world;
- SerdEnv* env;
- SerdWriter* writer;
+ SerdOutputStream out;
+ SerdWorld* world;
+ SerdEnv* env;
+ SerdWriter* writer;
} SerdTool;
static inline bool
@@ -122,8 +122,8 @@ serd_choose_syntax(SerdWorld* world,
SerdByteSource*
serd_open_input(const char* filename, size_t block_size);
-SerdByteSink*
-serd_open_output(const char* filename, size_t block_size);
+SerdOutputStream
+serd_open_output(const char* filename);
SerdStatus
serd_set_base_uri_from_path(SerdEnv* env, const char* path);