diff options
author | David Robillard <d@drobilla.net> | 2021-08-01 16:54:32 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-28 21:57:07 -0500 |
commit | 633300d4f09f9c6000923dce35bb4a7302d6d92c (patch) | |
tree | 386fc75a321d548a900ad4e6d5f13c25b5368487 /src | |
parent | 8e30b617725a50a5b27d400247095d0577e5874e (diff) | |
download | serd-633300d4f09f9c6000923dce35bb4a7302d6d92c.tar.gz serd-633300d4f09f9c6000923dce35bb4a7302d6d92c.tar.bz2 serd-633300d4f09f9c6000923dce35bb4a7302d6d92c.zip |
Simplify reader and writer flags
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 2 | ||||
-rw-r--r-- | src/node_syntax.c | 2 | ||||
-rw-r--r-- | src/read_ntriples.c | 2 | ||||
-rw-r--r-- | src/serdi.c | 2 | ||||
-rw-r--r-- | src/writer.c | 8 |
5 files changed, 8 insertions, 8 deletions
@@ -374,7 +374,7 @@ read_IRIREF(SerdReader* const reader, SerdNode** const dest) return st; } - return (reader->flags & SERD_READ_RELATIVE) + return (reader->flags & SERD_READ_VERBATIM) ? SERD_SUCCESS : resolve_IRIREF(reader, *dest, string_start_offset); } diff --git a/src/node_syntax.c b/src/node_syntax.c index ff8c32d4..b1d10a5d 100644 --- a/src/node_syntax.c +++ b/src/node_syntax.c @@ -56,7 +56,7 @@ serd_node_from_syntax_in(const char* const str, SerdByteSource* const source = serd_byte_source_new_string(doc, NULL); SerdReader* const reader = serd_reader_new( - world, syntax, SERD_READ_EXACT_BLANKS, env, sink, 1024 + doc_len); + world, syntax, SERD_READ_VERBATIM, env, sink, 1024 + doc_len); serd_reader_start(reader, source); serd_reader_read_document(reader); diff --git a/src/read_ntriples.c b/src/read_ntriples.c index 0d5dba2a..aa8f5468 100644 --- a/src/read_ntriples.c +++ b/src/read_ntriples.c @@ -256,7 +256,7 @@ read_STRING_LITERAL(SerdReader* const reader, static SerdStatus adjust_blank_id(SerdReader* const reader, char* const buf) { - if (!(reader->flags & SERD_READ_EXACT_BLANKS) && + if (!(reader->flags & SERD_READ_VERBATIM) && is_digit(buf[reader->bprefix_len + 1])) { const char tag = buf[reader->bprefix_len]; if (tag == 'b') { diff --git a/src/serdi.c b/src/serdi.c index 7c664b72..ef5a7633 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -248,7 +248,7 @@ main(int argc, char** argv) bulk_read = false; } else if (opt == 'f') { no_inline = true; - writer_flags |= (SERD_WRITE_UNQUALIFIED | SERD_WRITE_UNRESOLVED); + writer_flags |= (SERD_WRITE_EXPANDED | SERD_WRITE_VERBATIM); } else if (opt == 'h') { return print_usage(prog, false); } else if (opt == 'l') { diff --git a/src/writer.c b/src/writer.c index d139ef9d..e56f0b75 100644 --- a/src/writer.c +++ b/src/writer.c @@ -793,10 +793,10 @@ write_literal(SerdWriter* const writer, SERD_WARN_UNUSED_RESULT static SerdStatus write_full_uri_node(SerdWriter* const writer, const SerdNode* const node) { - SerdStatus st = SERD_SUCCESS; - const bool resolve_disabled = writer->flags & SERD_WRITE_UNRESOLVED; + SerdStatus st = SERD_SUCCESS; + const bool verbatim = (writer->flags & SERD_WRITE_VERBATIM); - if (resolve_disabled || !serd_env_base_uri(writer->env)) { + if (verbatim || !serd_env_base_uri(writer->env)) { // Resolution disabled or we have no base URI, simply write the node TRY(st, esink("<", 1, writer)); TRY(st, write_uri_from_node(writer, node)); @@ -848,7 +848,7 @@ write_uri_node(SerdWriter* const writer, return esink("()", 2, writer); } - if (has_scheme && !(writer->flags & SERD_WRITE_UNQUALIFIED) && + if (has_scheme && !(writer->flags & SERD_WRITE_EXPANDED) && !serd_env_qualify(writer->env, node_view, &prefix, &suffix)) { TRY(st, write_lname(writer, prefix.buf, prefix.len)); TRY(st, esink(":", 1, writer)); |