common: implement s_get_row and s_get_name in ivy_file

This commit is contained in:
2025-05-08 20:28:24 +01:00
parent 9f963c5757
commit bb55bee7f8
4 changed files with 77 additions and 6 deletions

View File

@@ -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;
}
}