common: implement s_get_row and s_get_name in ivy_file
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <blue/core/status.h>
|
||||
#include <errno.h>
|
||||
#include <ivy/status.h>
|
||||
|
||||
#define ENUM_STR(x) \
|
||||
@@ -34,3 +35,14 @@ enum ivy_status ivy_status_from_b_status(enum b_status status)
|
||||
return IVY_ERR_INTERNAL_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
enum ivy_status ivy_status_from_errno(int err)
|
||||
{
|
||||
switch (err) {
|
||||
ENUM_CONVERT(0, IVY_OK);
|
||||
ENUM_CONVERT(ENOENT, IVY_ERR_NO_ENTRY);
|
||||
ENUM_CONVERT(ENOMEM, IVY_ERR_NO_MEMORY);
|
||||
default:
|
||||
return IVY_ERR_INTERNAL_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user