From 4fd1068b4efea839707a4bdbc5066d5c423825bb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Aug 2020 17:32:01 +0200 Subject: Add empty syntax type for suppressing output --- include/serd/serd.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/serd/serd.h b/include/serd/serd.h index e2e610db..e13fc2db 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -349,17 +349,20 @@ serd_byte_sink_free(SerdByteSink* SERD_NULLABLE sink); /// Syntax supported by serd typedef enum { - SERD_TURTLE = 1, ///< Terse triples http://www.w3.org/TR/turtle - SERD_NTRIPLES = 2, ///< Line-based triples http://www.w3.org/TR/n-triples/ - SERD_NQUADS = 3, ///< Line-based quads http://www.w3.org/TR/n-quads/ - SERD_TRIG = 4 ///< Terse quads http://www.w3.org/TR/trig/ + SERD_SYNTAX_EMPTY = 0, ///< Empty syntax + SERD_TURTLE = 1, ///< Terse triples http://www.w3.org/TR/turtle + SERD_NTRIPLES = 2, ///< Flat triples http://www.w3.org/TR/n-triples/ + SERD_NQUADS = 3, ///< Flat quads http://www.w3.org/TR/n-quads/ + SERD_TRIG = 4 ///< Terse quads http://www.w3.org/TR/trig/ } SerdSyntax; /** Get a syntax by name. - Case-insensitive, supports "Turtle", "NTriples", "NQuads", and "TriG". Zero - is returned if the name is not recognized. + Case-insensitive, supports "Turtle", "NTriples", "NQuads", and "TriG". + + @return The syntax with the given name, or the empty syntax if the name is + not recognised. */ SERD_PURE_API SerdSyntax @@ -368,8 +371,11 @@ serd_syntax_by_name(const char* SERD_NONNULL name); /** Guess a syntax from a filename. - This uses the file extension to guess the syntax of a file. Zero is - returned if the extension is not recognized. + This uses the file extension to guess the syntax of a file, for example + recognising ".ttl" as the extension of a Turtle file. + + @return The likely syntax of the given file, or the empty syntax if the + extension is not recognised. */ SERD_PURE_API SerdSyntax -- cgit v1.2.1