diff options
Diffstat (limited to 'src/var.c')
| -rw-r--r-- | src/var.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -226,6 +226,17 @@ void var_set(const char *name, const char *value, unsigned flags) { } /** + * @brief Can var_set() replace this variable without a side effect or error? + * + * A readonly, integer or dynamic variable is not plain: setting it raises, + * converts the text, or calls a setter. + */ +bool var_is_plain(const char *name) { + var *v = var_find(name, strlen(name), false); + return !v || !(v->flags & (V_READONLY | V_INTEGER | V_DYNAMIC)); +} + +/** * @brief Assign a number to a variable. */ void var_set_long(const char *name, long value) { |
