diff options
author | David Robillard <d@drobilla.net> | 2022-06-28 19:01:40 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-06-28 19:04:05 -0400 |
commit | fcb82f18e7db39aeee726c41007845d9710a9cb8 (patch) | |
tree | 8c9d709d3f745dc4f65a22b1c86414fab66947d2 /include/zix | |
parent | 71c4a3a6d66e96661fd341e1a089c4d8bd63fb13 (diff) | |
download | zix-fcb82f18e7db39aeee726c41007845d9710a9cb8.tar.gz zix-fcb82f18e7db39aeee726c41007845d9710a9cb8.tar.bz2 zix-fcb82f18e7db39aeee726c41007845d9710a9cb8.zip |
Move zix_strerror to library
Diffstat (limited to 'include/zix')
-rw-r--r-- | include/zix/common.h | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/include/zix/common.h b/include/zix/common.h index eaac408..02b0f64 100644 --- a/include/zix/common.h +++ b/include/zix/common.h @@ -4,6 +4,8 @@ #ifndef ZIX_COMMON_H #define ZIX_COMMON_H +#include "zix/attributes.h" + #include <stdbool.h> /** @@ -26,29 +28,10 @@ typedef enum { ZIX_STATUS_REACHED_END } ZixStatus; -static inline const char* -zix_strerror(const ZixStatus status) -{ - switch (status) { - case ZIX_STATUS_SUCCESS: - return "Success"; - case ZIX_STATUS_ERROR: - return "Unknown error"; - case ZIX_STATUS_NO_MEM: - return "Out of memory"; - case ZIX_STATUS_NOT_FOUND: - return "Not found"; - case ZIX_STATUS_EXISTS: - return "Exists"; - case ZIX_STATUS_BAD_ARG: - return "Bad argument"; - case ZIX_STATUS_BAD_PERMS: - return "Bad permissions"; - case ZIX_STATUS_REACHED_END: - return "Reached end"; - } - return "Unknown error"; -} +/// Return a string describing a status code +ZIX_API +const char* +zix_strerror(ZixStatus status); /// Function for comparing two elements typedef int (*ZixComparator)(const void* a, |