From e481791e907a551495f8929756b8ca5e24cac277 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 28 Apr 2019 16:36:02 +0200 Subject: Report writer errors and add strict write mode --- serd/serd.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'serd/serd.h') diff --git a/serd/serd.h b/serd/serd.h index a5b28676..ce0213a7 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -110,7 +110,8 @@ typedef enum { SERD_ERR_INTERNAL, ///< Unexpected internal error (should not happen) SERD_ERR_OVERFLOW, ///< Stack overflow SERD_ERR_INVALID, ///< Invalid data - SERD_ERR_NO_DATA ///< Unexpected end of input + SERD_ERR_NO_DATA, ///< Unexpected end of input + SERD_ERR_BAD_WRITE ///< Error writing to file/stream } SerdStatus; /// RDF syntax type @@ -262,8 +263,9 @@ typedef struct { always ASCII). */ typedef enum { - SERD_WRITE_ASCII = 1 << 0, ///< Escape all non-ASCII characters - SERD_WRITE_TERSE = 1 << 1, ///< Write terser output without newlines + SERD_WRITE_ASCII = 1 << 0, ///< Escape all non-ASCII characters + SERD_WRITE_TERSE = 1 << 1, ///< Write terser output without newlines + SERD_WRITE_STRICT = 1 << 2, ///< Abort with error on lossy output } SerdWriterFlag; /// Bitwise OR of SerdWriterFlag values -- cgit v1.2.1