aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-19 17:55:02 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit0f9816d67bc67a396607291f845ca2a33c2285a7 (patch)
treeb31fd1b344305dc984a2109084fa183573a0ae43 /tools
parent258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (diff)
downloadserd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.gz
serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.bz2
serd-0f9816d67bc67a396607291f845ca2a33c2285a7.zip
Use ZixAllocator directly
Diffstat (limited to 'tools')
-rw-r--r--tools/console.c9
-rw-r--r--tools/console.h10
-rw-r--r--tools/serd-filter.c14
3 files changed, 17 insertions, 16 deletions
diff --git a/tools/console.c b/tools/console.c
index 53e86389..057656d5 100644
--- a/tools/console.c
+++ b/tools/console.c
@@ -10,6 +10,7 @@
#include "serd/syntax.h"
#include "serd/uri.h"
#include "serd/version.h"
+#include "zix/allocator.h"
#include "zix/attributes.h"
#include "zix/string_view.h"
@@ -392,10 +393,10 @@ serd_parse_common_option(OptionIter* const iter, SerdCommonOptions* const opts)
}
SerdEnv*
-serd_create_env(SerdAllocator* const allocator,
- const char* const program,
- const char* const base_string,
- const char* const out_filename)
+serd_create_env(ZixAllocator* const allocator,
+ const char* const program,
+ const char* const base_string,
+ const char* const out_filename)
{
if (serd_uri_string_has_scheme(base_string)) {
return serd_env_new(allocator, zix_string(base_string));
diff --git a/tools/console.h b/tools/console.h
index 7e59862d..75755360 100644
--- a/tools/console.h
+++ b/tools/console.h
@@ -7,7 +7,6 @@
#include "serd/env.h"
#include "serd/input_stream.h"
#include "serd/log.h"
-#include "serd/memory.h"
#include "serd/output_stream.h"
#include "serd/reader.h"
#include "serd/sink.h"
@@ -15,6 +14,7 @@
#include "serd/syntax.h"
#include "serd/world.h"
#include "serd/writer.h"
+#include "zix/allocator.h"
#include "zix/string_view.h"
#include <stdbool.h>
@@ -108,10 +108,10 @@ SerdStatus
serd_parse_common_option(OptionIter* iter, SerdCommonOptions* opts);
SerdEnv*
-serd_create_env(SerdAllocator* allocator,
- const char* program,
- const char* base_string,
- const char* out_filename);
+serd_create_env(ZixAllocator* allocator,
+ const char* program,
+ const char* base_string,
+ const char* out_filename);
SerdInputStream
serd_open_tool_input(const char* filename);
diff --git a/tools/serd-filter.c b/tools/serd-filter.c
index 464a727e..5c7211b3 100644
--- a/tools/serd-filter.c
+++ b/tools/serd-filter.c
@@ -9,7 +9,6 @@
#include "serd/filter.h"
#include "serd/input_stream.h"
#include "serd/log.h"
-#include "serd/memory.h"
#include "serd/node.h"
#include "serd/nodes.h"
#include "serd/reader.h"
@@ -19,6 +18,7 @@
#include "serd/syntax.h"
#include "serd/world.h"
#include "serd/writer.h"
+#include "zix/allocator.h"
#include "zix/string_view.h"
#include <stdarg.h>
@@ -49,8 +49,8 @@ typedef struct {
// Context for the pattern event callback
typedef struct {
- SerdAllocator* allocator;
- FilterPattern pattern;
+ ZixAllocator* allocator;
+ FilterPattern pattern;
} PatternEventContext;
// Handler for events read from a pattern
@@ -58,7 +58,7 @@ static SerdStatus
on_pattern_event(void* const handle, const SerdEvent* const event)
{
PatternEventContext* const ctx = (PatternEventContext*)handle;
- SerdAllocator* const allocator = ctx->allocator;
+ ZixAllocator* const allocator = ctx->allocator;
if (event->type == SERD_STATEMENT) {
FilterPattern* const pat = &ctx->pattern;
@@ -83,9 +83,9 @@ parse_pattern(SerdWorld* const world,
SerdInputStream* const in,
const bool inclusive)
{
- SerdAllocator* const allocator = serd_world_allocator(world);
- SerdEnv* const env = serd_env_new(allocator, zix_empty_string());
- PatternEventContext ctx = {allocator, {NULL, NULL, NULL, NULL}};
+ ZixAllocator* const allocator = serd_world_allocator(world);
+ SerdEnv* const env = serd_env_new(allocator, zix_empty_string());
+ PatternEventContext ctx = {allocator, {NULL, NULL, NULL, NULL}};
SerdSink* in_sink = serd_sink_new(allocator, &ctx, on_pattern_event, NULL);
SerdReader* reader =