parent
fff6d54046
commit
2781aadf55
@ -1,34 +0,0 @@
|
|||||||
#include "wsfs/adapter/status.h"
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
int wsfs_status_to_rc(wsfs_status status)
|
|
||||||
{
|
|
||||||
switch(status)
|
|
||||||
{
|
|
||||||
case WSFS_GOOD: return 0;
|
|
||||||
case WSFS_BAD_NOTIMPLEMENTED: return -ENOSYS;
|
|
||||||
case WSFS_BAD_TIMEOUT: return -ETIMEDOUT;
|
|
||||||
case WSFS_BAD_BUSY: return -ENOENT;
|
|
||||||
case WSFS_BAD_FORMAT: return -ENOENT;
|
|
||||||
case WSFS_BAD_NOENTRY: return -ENOENT;
|
|
||||||
case WSFS_BAD_NOACCESS: return -EACCES;
|
|
||||||
default: return -ENOENT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
char const * wsfs_status_tostring(wsfs_status status)
|
|
||||||
{
|
|
||||||
switch(status)
|
|
||||||
{
|
|
||||||
case WSFS_GOOD: return "Good";
|
|
||||||
case WSFS_BAD: return "Bad";
|
|
||||||
case WSFS_BAD_NOTIMPLEMENTED: return "Bad (not implelemted)";
|
|
||||||
case WSFS_BAD_TIMEOUT: return "Bad (timeout)";
|
|
||||||
case WSFS_BAD_BUSY: return "Bad (busy)";
|
|
||||||
case WSFS_BAD_FORMAT: return "Bad (format)";
|
|
||||||
case WSFS_BAD_NOENTRY: return "Bad (no entry)";
|
|
||||||
case WSFS_BAD_NOACCESS: return "Bad (no access)";
|
|
||||||
default: return "Bad (unknown)";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
#ifndef WSFS_ADAPTER_STATUS_H
|
|
||||||
#define WSFS_ADAPTER_STATUS_H
|
|
||||||
|
|
||||||
#define WSFS_GOOD 0
|
|
||||||
#define WSFS_BAD 1
|
|
||||||
|
|
||||||
#define WSFS_BAD_NOTIMPLEMENTED 2
|
|
||||||
#define WSFS_BAD_TIMEOUT 3
|
|
||||||
#define WSFS_BAD_BUSY 4
|
|
||||||
#define WSFS_BAD_FORMAT 5
|
|
||||||
|
|
||||||
#define WSFS_BAD_NOENTRY 101
|
|
||||||
#define WSFS_BAD_NOACCESS 102
|
|
||||||
|
|
||||||
typedef int wsfs_status;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern int wsfs_status_to_rc(wsfs_status status);
|
|
||||||
|
|
||||||
extern char const * wsfs_status_tostring(wsfs_status status);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in new issue