From ff43bd2fb2c2617b53a0157d62d07cf96b2ef92f Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sat, 20 Jan 2024 16:37:26 -0800 Subject: add more detailed error messages; fix a couple bugs --- include/builtins.h | 4 ++++ include/stem.h | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/builtins.h b/include/builtins.h index 629b935..38b9965 100644 --- a/include/builtins.h +++ b/include/builtins.h @@ -154,6 +154,10 @@ void stemfwrite(value_t *v); /*! @brief [VINT/VFLOAT] sleep; sleeps for an amount of seconds. */ void stemsleep(value_t *v); +void stemcut(value_t *v); + +void undef(value_t *v); + /*! @brief adds all the custom objects defined to OBJ_TABLE */ void add_objs(); diff --git a/include/stem.h b/include/stem.h index 69bfcb4..381b0ad 100644 --- a/include/stem.h +++ b/include/stem.h @@ -197,6 +197,9 @@ void sll_add(sll_t *l, string_t *key, void *v, void (*freefunc)(void *)); /*! Gets value by key from singly linked list. */ void *sll_get(sll_t *l, string_t *key); +/*! deletes item from singly linked list */ +void sll_delete(sll_t *l, string_t *k, void (*freefunc)(void *)); + /*! Frees singly linked list */ void sll_free(sll_t *l, void (*freefunc)(void *)); @@ -210,6 +213,9 @@ void ht_add(ht_t *h, string_t *key, void *v, void (*freefunc)(void *)); /*! Gets value from hash table by key */ void *ht_get(ht_t *h, string_t *key); +/*! Deletes item from hash table */ +void ht_delete(ht_t *h, string_t *key, void (*freefunc)(void *)); + /*! returns true if key exists in hash table. false otherwise */ bool ht_exists(ht_t *h, string_t *key); -- cgit