aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd/status.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-10-01 20:12:13 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commitcd3d9986f40fd4e605ac2e8168512065439173e2 (patch)
tree72d0418cbd8b8b5c7e43880c68831819e12b1982 /include/serd/status.h
parent1f09497ae009daade56c450e73bf6425b27cea24 (diff)
downloadserd-cd3d9986f40fd4e605ac2e8168512065439173e2.tar.gz
serd-cd3d9986f40fd4e605ac2e8168512065439173e2.tar.bz2
serd-cd3d9986f40fd4e605ac2e8168512065439173e2.zip
Split up public API header
Diffstat (limited to 'include/serd/status.h')
-rw-r--r--include/serd/status.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/serd/status.h b/include/serd/status.h
new file mode 100644
index 00000000..c640b427
--- /dev/null
+++ b/include/serd/status.h
@@ -0,0 +1,43 @@
+// Copyright 2011-2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef SERD_STATUS_H
+#define SERD_STATUS_H
+
+#include "serd/attributes.h"
+
+SERD_BEGIN_DECLS
+
+/**
+ @defgroup serd_status Status Codes
+ @ingroup serd_errors
+ @{
+*/
+
+/// Return status code
+typedef enum {
+ SERD_SUCCESS, ///< No error
+ SERD_FAILURE, ///< Non-fatal failure
+ SERD_ERR_UNKNOWN, ///< Unknown error
+ SERD_ERR_BAD_SYNTAX, ///< Invalid syntax
+ SERD_ERR_BAD_ARG, ///< Invalid argument
+ SERD_ERR_NOT_FOUND, ///< Not found
+ SERD_ERR_ID_CLASH, ///< Encountered clashing blank node IDs
+ SERD_ERR_BAD_CURIE, ///< Invalid CURIE (e.g. prefix does not exist)
+ SERD_ERR_INTERNAL, ///< Unexpected internal error (should not happen)
+ SERD_ERR_BAD_WRITE, ///< Error writing to file/stream
+ SERD_ERR_BAD_TEXT, ///< Invalid text encoding
+} SerdStatus;
+
+/// Return a string describing a status code
+SERD_CONST_API
+const char* SERD_NONNULL
+serd_strerror(SerdStatus status);
+
+/**
+ @}
+*/
+
+SERD_END_DECLS
+
+#endif // SERD_STATUS_H