[pulseaudio-discuss] [PATCH v3 02/11] core-util: Add pa_boolean_to_string()

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Thu Dec 4 10:44:45 PST 2014


This is useful in log messages that aren't translated (we already have
pa_yes_no(), but that returns translated strings).
---
 src/pulsecore/core-util.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index 8db56c5..b880075 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -91,6 +91,10 @@ int pa_parse_boolean(const char *s) PA_GCC_PURE;
 
 int pa_parse_volume(const char *s, pa_volume_t *volume);
 
+static inline const char *pa_boolean_to_string(bool b) {
+    return b ? "true" : "false";
+}
+
 static inline const char *pa_yes_no(bool b) {
     return b ? _("yes") : _("no");
 }
-- 
1.9.3



More information about the pulseaudio-discuss mailing list