summaryrefslogtreecommitdiffstats
path: root/slv2/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'slv2/value.h')
-rw-r--r--slv2/value.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/slv2/value.h b/slv2/value.h
index 541c3de..84c5b94 100644
--- a/slv2/value.h
+++ b/slv2/value.h
@@ -62,6 +62,14 @@ SLV2_API
SLV2Value
slv2_value_new_float(SLV2World world, float val);
+/** Create a new boolean value.
+ *
+ * Returned value must be freed by caller with slv2_value_free.
+ */
+SLV2_API
+SLV2Value
+slv2_value_new_bool(SLV2World world, bool val);
+
/** Free an SLV2Value.
*/
SLV2_API
@@ -197,6 +205,24 @@ SLV2_API
int
slv2_value_as_int(SLV2Value value);
+/** Return whether this value is a boolean.
+ *
+ * Time = O(1)
+ */
+SLV2_API
+bool
+slv2_value_is_bool(SLV2Value value);
+
+/** Return \a value as a bool.
+ *
+ * Valid to call only if slv2_value_is_bool(\a value) returns true.
+ *
+ * Time = O(1)
+ */
+SLV2_API
+bool
+slv2_value_as_bool(SLV2Value value);
+
/** @} */
#ifdef __cplusplus