#include #include #include #include #include "utils.h" static char namebuf[255]; const char *get_value_string(const struct value_string *vs, uint32_t val) { int i; for (i = 0;; i++) { if (vs[i].value == 0 && vs[i].str == NULL) break; if (vs[i].value == val) return vs[i].str; } snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val); return namebuf; }