From fcb82f18e7db39aeee726c41007845d9710a9cb8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 28 Jun 2022 19:01:40 -0400 Subject: Move zix_strerror to library --- include/zix/common.h | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'include/zix') 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 /** @@ -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, -- cgit v1.2.1