#include "obj.h" static const char *s_typenames[] = { [JOVE_OBJ_NONE] = "NONE", [JOVE_OBJ_UNTYPED] = "UNTYPED", [JOVE_OBJ_OBJDIR] = "OBJDIR", [JOVE_OBJ_PAGEDIR] = "PAGEDIR", [JOVE_OBJ_PROCESSOR] = "PROCESSOR", [JOVE_OBJ_REGION] = "REGION", [JOVE_OBJ_SHMEMORY] = "SHMEMORY", [JOVE_OBJ_INT_HANDLE] = "INT_HANDLES", [JOVE_OBJ_PCB] = "PCB", [JOVE_OBJ_MESSAGE] = "MESSAGE", [JOVE_OBJ_LINK] = "LINK" }; const char* obj_gettypename(jove_owned_obj_t *obj) { uint8_t type = obj_gettype(obj); if(type > JOVE_OBJ_LINK) return "UNKNOWN"; return s_typenames[type]; }