20 lines
474 B
C
20 lines
474 B
C
#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 "";
|
|
}
|
|
}
|