From a90341129953e9b8e0e1d96fa52b10cbf34d1ea1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 26 Dec 2018 20:04:27 -0500 Subject: Remove serd_reader_set_default_graph() --- src/reader.c | 28 +++++++--------------------- src/reader.h | 1 - 2 files changed, 7 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/reader.c b/src/reader.c index 3be28a53..76b28295 100644 --- a/src/reader.c +++ b/src/reader.c @@ -118,17 +118,12 @@ push_node(SerdReader* reader, SerdStatus emit_statement(SerdReader* reader, ReadContext ctx, SerdNode* o) { - SerdNode* graph = ctx.graph; - if (!graph && reader->default_graph) { - graph = reader->default_graph; - } - /* Zero the pad of the object node on the top of the stack. Lower nodes (subject and predicate) were already zeroed by subsequent pushes. */ 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; @@ -162,13 +157,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; me->rdf_first = push_node(me, SERD_URI, NS_RDF "first", 48); me->rdf_rest = push_node(me, SERD_URI, NS_RDF "rest", 47); @@ -191,7 +185,6 @@ serd_reader_free(SerdReader* reader) } serd_reader_finish(reader); - serd_node_free(reader->default_graph); #ifdef SERD_STACK_CHECK free(reader->allocs); @@ -216,13 +209,6 @@ serd_reader_add_blank_prefix(SerdReader* reader, const char* prefix) } } -void -serd_reader_set_default_graph(SerdReader* reader, const SerdNode* graph) -{ - serd_node_free(reader->default_graph); - reader->default_graph = serd_node_copy(graph); -} - static SerdStatus skip_bom(SerdReader* me) { diff --git a/src/reader.h b/src/reader.h index ce377fd3..6e9ac513 100644 --- a/src/reader.h +++ b/src/reader.h @@ -57,7 +57,6 @@ struct SerdReaderImpl { SerdNode* rdf_first; SerdNode* rdf_rest; SerdNode* rdf_nil; - SerdNode* default_graph; SerdByteSource source; SerdStack stack; SerdSyntax syntax; -- cgit v1.2.1