common: add generic input-line interface, and an implementation of it for text files
This commit is contained in:
19
common/status.c
Normal file
19
common/status.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <ivy/status.h>
|
||||
|
||||
#define ENUM_STR(x) \
|
||||
case x: \
|
||||
return #x
|
||||
|
||||
const char *ivy_status_to_string(enum ivy_status status)
|
||||
{
|
||||
switch (status) {
|
||||
ENUM_STR(IVY_OK);
|
||||
ENUM_STR(IVY_ERR_EOF);
|
||||
ENUM_STR(IVY_ERR_IO_FAILURE);
|
||||
ENUM_STR(IVY_ERR_BAD_SYNTAX);
|
||||
ENUM_STR(IVY_ERR_NO_MEMORY);
|
||||
ENUM_STR(IVY_ERR_NOT_SUPPORTED);
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user