From d072adfbe40e15715e2065f1900f8d5a76491c5f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 20 Oct 2022 21:34:20 -0400 Subject: Hide errno utility functions --- src/status.c | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'src/status.c') diff --git a/src/status.c b/src/status.c index e6fbec8..9cdab32 100644 --- a/src/status.c +++ b/src/status.c @@ -3,8 +3,6 @@ #include "zix/common.h" -#include - const char* zix_strerror(const ZixStatus status) { @@ -36,42 +34,3 @@ zix_strerror(const ZixStatus status) } return "Unknown error"; } - -ZixStatus -zix_errno_status_if(const int r) -{ - return r ? zix_errno_status(errno) : ZIX_STATUS_SUCCESS; -} - -ZixStatus -zix_errno_status(const int e) -{ - switch (e) { - case 0: - return ZIX_STATUS_SUCCESS; -#ifdef EAGAIN - case EAGAIN: - return ZIX_STATUS_UNAVAILABLE; -#endif -#ifdef EEXIST - case EEXIST: - return ZIX_STATUS_EXISTS; -#endif -#ifdef EINVAL - case EINVAL: - return ZIX_STATUS_BAD_ARG; -#endif -#ifdef EPERM - case EPERM: - return ZIX_STATUS_BAD_PERMS; -#endif -#ifdef ETIMEDOUT - case ETIMEDOUT: - return ZIX_STATUS_TIMEOUT; -#endif - default: - break; - } - - return ZIX_STATUS_ERROR; -} -- cgit v1.2.1