diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/serd/serd.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h index 63d094ef..375a8c5d 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -23,6 +23,7 @@ #include <stdbool.h> #include <stddef.h> #include <stdint.h> +#include <string.h> #if defined(_WIN32) && !defined(SERD_STATIC) && defined(SERD_INTERNAL) # define SERD_API __declspec(dllexport) @@ -393,6 +394,41 @@ typedef size_t (*SerdWriteFunc)(const void* SERD_NONNULL buf, /** @} + @defgroup serd_syntax Syntax Utilities + @{ +*/ + +/** + Get a syntax by name. + + Case-insensitive, supports "Turtle", "NTriples", "NQuads", and "TriG". Zero + is returned if the name is not recognized. +*/ +SERD_PURE_API +SerdSyntax +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. +*/ +SERD_PURE_API +SerdSyntax +serd_guess_syntax(const char* SERD_NONNULL filename); + +/** + Return whether a syntax can represent multiple graphs. + + @return True for SERD_NQUADS and SERD_TRIG, false otherwise. +*/ +SERD_CONST_API +bool +serd_syntax_has_graphs(SerdSyntax syntax); + +/** + @} @defgroup serd_uri URI @{ */ |