diff options
author | David Robillard <d@drobilla.net> | 2020-08-14 17:32:01 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 23:04:14 -0500 |
commit | 4fd1068b4efea839707a4bdbc5066d5c423825bb (patch) | |
tree | 0f0611c99286b3f067357b0090c66ffd774684ea /include | |
parent | 059b4764d6b6b3a9ef04600bda45815c69365d30 (diff) | |
download | serd-4fd1068b4efea839707a4bdbc5066d5c423825bb.tar.gz serd-4fd1068b4efea839707a4bdbc5066d5c423825bb.tar.bz2 serd-4fd1068b4efea839707a4bdbc5066d5c423825bb.zip |
Add empty syntax type for suppressing output
Diffstat (limited to 'include')
-rw-r--r-- | include/serd/serd.h | 22 |
1 files changed, 14 insertions, 8 deletions
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 |