mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
LinuxKPI: Add str_on_off and other helpers to linux/string_helpers.h
Sponsored by: Serenity Cyber Security, LLC Reviewed by: manu, bz, imp (previous version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42794 (cherry picked from commit ae1084ff01bf9d9a9a2c56caf6c7095f3e96f579)
This commit is contained in:
parent
73832b11e5
commit
1341925217
1 changed files with 28 additions and 1 deletions
|
|
@ -39,4 +39,31 @@ str_yes_no(bool value)
|
|||
return "no";
|
||||
}
|
||||
|
||||
#endif /* _LINUXKPI_LINUX_STRING_HELPERS_H_ */
|
||||
static inline const char *
|
||||
str_on_off(bool value)
|
||||
{
|
||||
if (value)
|
||||
return "on";
|
||||
else
|
||||
return "off";
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
str_enabled_disabled(bool value)
|
||||
{
|
||||
if (value)
|
||||
return "enabled";
|
||||
else
|
||||
return "disabled";
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
str_enable_disable(bool value)
|
||||
{
|
||||
if (value)
|
||||
return "enable";
|
||||
else
|
||||
return "disable";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue