aboutsummaryrefslogtreecommitdiffstats
path: root/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-28 17:54:00 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commit44e792d8da5ef93a88dac76b7b191e588203c42b (patch)
tree654d6767998c0a444f8eff8fd3de2461295e1fa3 /serd
parent02f77d71211825b590e43f571b1d65bcf56cde4d (diff)
downloadserd-44e792d8da5ef93a88dac76b7b191e588203c42b.tar.gz
serd-44e792d8da5ef93a88dac76b7b191e588203c42b.tar.bz2
serd-44e792d8da5ef93a88dac76b7b191e588203c42b.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 'serd')
-rw-r--r--serd/serd.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/serd/serd.h b/serd/serd.h
index bad9a4ac..c48ace10 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -255,6 +255,14 @@ typedef struct {
SerdStringView fragment; ///< Fragment
} SerdURI;
+/// Reader options
+typedef enum {
+ SERD_READ_LAX = 1 << 0 ///< Tolerate invalid input where possible
+} SerdReaderFlag;
+
+/// Bitwise OR of SerdReaderFlag values
+typedef uint32_t SerdReaderFlags;
+
/**
Writer style options
@@ -268,7 +276,7 @@ typedef enum {
SERD_WRITE_UNQUALIFIED = 1 << 1, ///< Do not shorten URIs into CURIEs
SERD_WRITE_UNRESOLVED = 1 << 2, ///< Do not make URIs relative
SERD_WRITE_TERSE = 1 << 3, ///< Write terser output without newlines
- SERD_WRITE_STRICT = 1 << 4 ///< Abort with error on lossy output
+ SERD_WRITE_LAX = 1 << 4 ///< Tolerate lossy output
} SerdWriterFlag;
/// Bitwise OR of SerdWriterFlag values
@@ -1145,21 +1153,11 @@ SERD_API
SerdReader*
serd_reader_new(SerdWorld* world,
SerdSyntax syntax,
+ SerdReaderFlags flags,
const SerdSink* sink,
size_t stack_size);
/**
- Enable or disable strict parsing
-
- The reader is non-strict (lax) by default, which will tolerate URIs with
- invalid characters. Setting strict will fail when parsing such files. An
- error is printed for invalid input in either case.
-*/
-SERD_API
-void
-serd_reader_set_strict(SerdReader* reader, bool strict);
-
-/**
Set a prefix to be added to all blank node identifiers
This is useful when multiple files are to be parsed into the same output