diff options
author | David Robillard <d@drobilla.net> | 2011-02-11 23:37:12 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-02-11 23:37:12 +0000 |
commit | 0b6bdcce6cea21909553a334629a5b3d004bd553 (patch) | |
tree | 7fa15be6af1700e9169656467d3adcd0856fee05 /slv2/value.h | |
parent | 81d2d2f3abcec251d910358bb2751d5e1ee12985 (diff) | |
download | lilv-0b6bdcce6cea21909553a334629a5b3d004bd553.tar.gz lilv-0b6bdcce6cea21909553a334629a5b3d004bd553.tar.bz2 lilv-0b6bdcce6cea21909553a334629a5b3d004bd553.zip |
Add support for boolean values.
Replace slv2_world_filter_language with extensible option system
(slv2_world_set_option).
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2923 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'slv2/value.h')
-rw-r--r-- | slv2/value.h | 26 |
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 |