aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-26 20:04:27 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:07 -0500
commit9c00583bd37522a4f1703bf289587b4546edcf53 (patch)
tree745b6fd07df09ab2a5d6eb7119951dcbb9674e5d /src/reader.c
parent6ea89ed78d344d01de4566ae7cc690c0cfe5673e (diff)
downloadserd-9c00583bd37522a4f1703bf289587b4546edcf53.tar.gz
serd-9c00583bd37522a4f1703bf289587b4546edcf53.tar.bz2
serd-9c00583bd37522a4f1703bf289587b4546edcf53.zip
Remove serd_reader_set_default_graph()
Diffstat (limited to 'src/reader.c')
-rw-r--r--src/reader.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/reader.c b/src/reader.c
index 90fee2db..2ef3b66a 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -110,11 +110,6 @@ emit_statement(SerdReader* const reader,
const ReadContext ctx,
SerdNode* const o)
{
- SerdNode* graph = ctx.graph;
- if (!graph && reader->default_graph) {
- graph = reader->default_graph;
- }
-
if (reader->stack.size + (2 * sizeof(SerdNode)) > reader->stack.buf_size) {
return SERD_BAD_STACK;
}
@@ -124,7 +119,7 @@ emit_statement(SerdReader* const reader,
serd_node_zero_pad(o);
const SerdStatus st = serd_sink_write(
- reader->sink, *ctx.flags, ctx.subject, ctx.predicate, o, graph);
+ reader->sink, *ctx.flags, ctx.subject, ctx.predicate, o, ctx.graph);
*ctx.flags &= SERD_ANON_CONT | SERD_LIST_CONT; // Preserve only cont flags
return st;
@@ -156,13 +151,12 @@ serd_reader_new(SerdWorld* const world,
SerdReader* me = (SerdReader*)calloc(1, sizeof(SerdReader));
- me->world = world;
- me->sink = sink;
- me->default_graph = NULL;
- me->stack = serd_stack_new(stack_size);
- me->syntax = syntax;
- me->next_id = 1;
- me->strict = true;
+ me->world = world;
+ me->sink = sink;
+ me->stack = serd_stack_new(stack_size);
+ me->syntax = syntax;
+ me->next_id = 1;
+ me->strict = true;
// Reserve a bit of space at the end of the stack to zero pad nodes
me->stack.buf_size -= serd_node_align;
@@ -193,7 +187,6 @@ serd_reader_free(SerdReader* const reader)
}
serd_reader_finish(reader);
- serd_node_free(reader->default_graph);
free(reader->stack.buf);
free(reader->bprefix);
@@ -215,14 +208,6 @@ serd_reader_add_blank_prefix(SerdReader* const reader, const char* const prefix)
}
}
-void
-serd_reader_set_default_graph(SerdReader* const reader,
- const SerdNode* const graph)
-{
- serd_node_free(reader->default_graph);
- reader->default_graph = serd_node_copy(graph);
-}
-
static SerdStatus
skip_bom(SerdReader* const me)
{