1 /* SPDX-License-Identifier: BSD-3-Clause */
9 const char *val2str_default(uint32_t val
, const struct valstr
*vs
,
14 for (i
= 0; vs
[i
].str
; i
++) {
22 const char *val2str(uint32_t val
, const struct valstr
*vs
)
24 return val2str_default(val
, vs
, "Unknown");
27 uint32_t str2val(const char *str
, const struct valstr
*vs
)
31 for (i
= 0; vs
[i
].str
; i
++) {
32 if (strcasecmp(vs
[i
].str
, str
) == 0)