1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/lib/webfuse/core/status.c

35 lines
899 B
C
Raw Normal View History

2019-03-26 22:04:53 +00:00
#include "webfuse/core/status_intern.h"
#include <errno.h>
int wf_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;
2019-03-26 22:04:53 +00:00
default: return -ENOENT;
}
}
char const * wf_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)";
2019-03-26 22:04:53 +00:00
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)";
2019-03-26 22:04:53 +00:00
default: return "Bad (unknown)";
}
}