summaryrefslogtreecommitdiffhomepage
path: root/value.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-05-18 15:07:43 +0200
committerGitHub <noreply@github.com>2021-05-18 15:07:43 +0200
commit2c2e603204be7ec96cab7504e3ee6951412ad4bc (patch)
tree15db63a3f8c7d74d9013699a067d5c984f820415 /value.c
parent29591422d602ec6b5a3808c3dead91cfbcdbbcf0 (diff)
parented32c42eefbc4560408d53445c603767469c85bd (diff)
Merge pull request #12 from jow-/various-additions
Various additions
Diffstat (limited to 'value.c')
-rw-r--r--value.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/value.c b/value.c
index 0827038..c012b78 100644
--- a/value.c
+++ b/value.c
@@ -248,6 +248,22 @@ uc_setval(uc_vm *vm, uc_value_t *scope, uc_value_t *key, uc_value_t *val)
}
bool
+uc_delval(uc_vm *vm, uc_value_t *scope, uc_value_t *key)
+{
+ char *s;
+ bool rv;
+
+ if (!key)
+ return NULL;
+
+ s = uc_tostring(vm, key);
+ rv = ucv_object_delete(scope, s ? s : ucv_string_get(key));
+ free(s);
+
+ return rv;
+}
+
+bool
uc_cmp(int how, uc_value_t *v1, uc_value_t *v2)
{
uc_type_t t1 = ucv_type(v1);