diff options
author | David Robillard <d@drobilla.net> | 2023-04-09 11:54:11 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-04-16 22:17:56 -0400 |
commit | a6cd7dd91d93015ec118286b868c3fd43133f3ac (patch) | |
tree | b10d88ca099c0d0986c2e48ccca62023a0ac1614 /src/serdi.c | |
parent | 1d8cdcef2cc4aaf2e45cfab01a390d6eab56d525 (diff) | |
download | serd-a6cd7dd91d93015ec118286b868c3fd43133f3ac.tar.gz serd-a6cd7dd91d93015ec118286b868c3fd43133f3ac.tar.bz2 serd-a6cd7dd91d93015ec118286b868c3fd43133f3ac.zip |
Gracefully handle errors when writing text
Diffstat (limited to 'src/serdi.c')
-rw-r--r-- | src/serdi.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/serdi.c b/src/serdi.c index d82198ad..f6a329bb 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -144,7 +144,8 @@ choose_style(const SerdSyntax input_syntax, const SerdSyntax output_syntax, const bool ascii, const bool bulk_write, - const bool full_uris) + const bool full_uris, + const bool lax) { unsigned output_style = 0U; if (output_syntax == SERD_NTRIPLES || ascii) { @@ -166,6 +167,10 @@ choose_style(const SerdSyntax input_syntax, output_style |= SERD_STYLE_BULK; } + if (!lax) { + output_style |= SERD_STYLE_STRICT; + } + return (SerdStyle)output_style; } @@ -301,8 +306,8 @@ main(int argc, char** argv) : SERD_NQUADS); } - const SerdStyle output_style = - choose_style(input_syntax, output_syntax, ascii, bulk_write, full_uris); + const SerdStyle output_style = choose_style( + input_syntax, output_syntax, ascii, bulk_write, full_uris, lax); SerdURI base_uri = SERD_URI_NULL; SerdNode base = SERD_NODE_NULL; |