diff --git a/sys/compat/linuxkpi/common/include/linux/string_helpers.h b/sys/compat/linuxkpi/common/include/linux/string_helpers.h new file mode 100644 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/string_helpers.h @@ -0,0 +1,40 @@ +/* Public domain. */ + +#ifndef _LINUXKPI_LINUX_STRING_HELPERS_H +#define _LINUXKPI_LINUX_STRING_HELPERS_H + +#include + +static inline const char * +str_yes_no(bool x) +{ + if (x) + return "yes"; + return "no"; +} + +static inline const char * +str_on_off(bool x) +{ + if (x) + return "on"; + return "off"; +} + +static inline const char * +str_enabled_disabled(bool x) +{ + if (x) + return "enabled"; + return "disabled"; +} + +static inline const char * +str_enable_disable(bool x) +{ + if (x) + return "enable"; + return "disable"; +} + +#endif