1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/lib/webfuse/impl/status.c
2020-06-28 19:43:08 +02:00

35 lines
902 B
C

#include "webfuse/impl/status.h"
#include <errno.h>
int wf_impl_status_to_rc(wf_status status)
{
switch(status)
{
case WF_GOOD: return 0;
case WF_BAD_NOTIMPLEMENTED: return -ENOSYS;
case WF_BAD_TIMEOUT: return -ETIMEDOUT;
case WF_BAD_BUSY: return -ENOENT;
case WF_BAD_FORMAT: return -ENOENT;
case WF_BAD_NOENTRY: return -ENOENT;
case WF_BAD_ACCESS_DENIED: return -EACCES;
default: return -ENOENT;
}
}
char const * wf_impl_status_tostring(wf_status status)
{
switch(status)
{
case WF_GOOD: return "Good";
case WF_BAD: return "Bad";
case WF_BAD_NOTIMPLEMENTED: return "Bad (not implemented)";
case WF_BAD_TIMEOUT: return "Bad (timeout)";
case WF_BAD_BUSY: return "Bad (busy)";
case WF_BAD_FORMAT: return "Bad (format)";
case WF_BAD_NOENTRY: return "Bad (no entry)";
case WF_BAD_ACCESS_DENIED: return "Bad (access denied)";
default: return "Bad (unknown)";
}
}