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

35 lines
927 B
C
Raw Normal View History

2020-06-16 21:39:45 +00:00
#include "webfuse_provider/impl/status_intern.h"
2019-03-26 22:04:53 +00:00
#include <errno.h>
int wfp_status_to_rc(wfp_status status)
2019-03-26 22:04:53 +00:00
{
switch(status)
{
case WFP_GOOD: return 0;
case WFP_BAD_NOTIMPLEMENTED: return -ENOSYS;
case WFP_BAD_TIMEOUT: return -ETIMEDOUT;
case WFP_BAD_BUSY: return -ENOENT;
case WFP_BAD_FORMAT: return -ENOENT;
case WFP_BAD_NOENTRY: return -ENOENT;
case WFP_BAD_ACCESS_DENIED: return -EACCES;
2019-03-26 22:04:53 +00:00
default: return -ENOENT;
}
}
char const * wfp_status_tostring(wfp_status status)
2019-03-26 22:04:53 +00:00
{
switch(status)
{
case WFP_GOOD: return "Good";
case WFP_BAD: return "Bad";
case WFP_BAD_NOTIMPLEMENTED: return "Bad (not implemented)";
case WFP_BAD_TIMEOUT: return "Bad (timeout)";
case WFP_BAD_BUSY: return "Bad (busy)";
case WFP_BAD_FORMAT: return "Bad (format)";
case WFP_BAD_NOENTRY: return "Bad (no entry)";
case WFP_BAD_ACCESS_DENIED: return "Bad (access denied)";
2019-03-26 22:04:53 +00:00
default: return "Bad (unknown)";
}
}