aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-28 17:54:00 +0200
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commit2ab2b5f2c7bd4d26aa99eee959f0e5192b3813dc (patch)
tree9fccf392d6eb69fb11b9bc2bbe24cf35eaa63ab2 /src/writer.c
parent01daa5914169d57a6a6c4925d3f8d76db80a2bd8 (diff)
downloadserd-2ab2b5f2c7bd4d26aa99eee959f0e5192b3813dc.tar.gz
serd-2ab2b5f2c7bd4d26aa99eee959f0e5192b3813dc.tar.bz2
serd-2ab2b5f2c7bd4d26aa99eee959f0e5192b3813dc.zip
Replace serd_reader_set_strict() with SerdReaderFlags
This makes reader options extensible and should hopefully prevent the need for grafting on more similar functions in the future.
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/writer.c b/src/writer.c
index 3ac8f4d9..71766d9d 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -343,7 +343,7 @@ write_uri(SerdWriter* writer, const char* utf8, size_t n_bytes, SerdStatus* st)
size_t size = 0;
len += write_character(writer, (const uint8_t*)utf8 + i, &size, st);
i += size;
- if (*st && (writer->flags & SERD_WRITE_STRICT)) {
+ if (*st && !(writer->flags & SERD_WRITE_LAX)) {
break;
}
@@ -366,7 +366,7 @@ ewrite_uri(SerdWriter* writer, const char* utf8, size_t n_bytes)
SerdStatus st = SERD_SUCCESS;
write_uri(writer, utf8, n_bytes, &st);
- return (writer->flags & SERD_WRITE_STRICT) ? st : SERD_SUCCESS;
+ return (writer->flags & SERD_WRITE_LAX) ? SERD_SUCCESS : st;
}
SERD_WARN_UNUSED_RESULT static SerdStatus
@@ -531,7 +531,7 @@ write_text(SerdWriter* writer,
// Write UTF-8 character
size_t size = 0;
len += write_character(writer, (const uint8_t*)utf8 + i - 1, &size, &st);
- if (st && (writer->flags & SERD_WRITE_STRICT)) {
+ if (st && !(writer->flags & SERD_WRITE_LAX)) {
return st;
}
@@ -545,7 +545,7 @@ write_text(SerdWriter* writer,
}
}
- return (writer->flags & SERD_WRITE_STRICT) ? st : SERD_SUCCESS;
+ return (writer->flags & SERD_WRITE_LAX) ? SERD_SUCCESS : st;
}
typedef struct {
@@ -796,7 +796,7 @@ write_uri_node(SerdWriter* const writer,
: serd_write_uri(serd_relative_uri(uri, base_uri), uri_sink, &ctx);
st = ctx.status;
- if (st && (writer->flags & SERD_WRITE_STRICT)) {
+ if (st && !(writer->flags & SERD_WRITE_LAX)) {
return st;
}
} else {