summaryrefslogtreecommitdiff
path: root/src/emap/script_buildins.c
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-03-26 17:11:34 -0400
committergumi <git@gumi.ca>2018-03-26 17:11:34 -0400
commit3a56da3c09845676534f460f75c8adb6c65fbb79 (patch)
treeb37c703cc7dc07725235a5d916db5d83b65e8ecf /src/emap/script_buildins.c
parentc3262df069c597bd3c56e167cadc077c077d0096 (diff)
downloadevol-hercules-3a56da3c09845676534f460f75c8adb6c65fbb79.tar.gz
evol-hercules-3a56da3c09845676534f460f75c8adb6c65fbb79.tar.bz2
evol-hercules-3a56da3c09845676534f460f75c8adb6c65fbb79.tar.xz
evol-hercules-3a56da3c09845676534f460f75c8adb6c65fbb79.zip
add missing hashtable iterator buildinss20180406
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r--src/emap/script_buildins.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 703307a..78fb940 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -1991,6 +1991,32 @@ BUILDIN(htIterator)
return false; \
}
+BUILDIN(htiFirstKey)
+{
+ int64 id = script_getnum(st, 2);
+ checkHtIteratorExists(id);
+
+ const char * key = htreg->iterator_firstkey(id);
+ if (key)
+ script_pushstrcopy(st, key);
+ else
+ script_pushstrcopy(st, "");
+ return true;
+}
+
+BUILDIN(htiLastKey)
+{
+ int64 id = script_getnum(st, 2);
+ checkHtIteratorExists(id);
+
+ const char * key = htreg->iterator_lastkey(id);
+ if (key)
+ script_pushstrcopy(st, key);
+ else
+ script_pushstrcopy(st, "");
+ return true;
+}
+
BUILDIN(htiNextKey)
{
int64 id = script_getnum(st, 2);
@@ -2004,6 +2030,19 @@ BUILDIN(htiNextKey)
return true;
}
+BUILDIN(htiPrevKey)
+{
+ int64 id = script_getnum(st, 2);
+ checkHtIteratorExists(id);
+
+ const char * key = htreg->iterator_prevkey(id);
+ if (key)
+ script_pushstrcopy(st, key);
+ else
+ script_pushstrcopy(st, "");
+ return true;
+}
+
BUILDIN(htiCheck)
{
int64 id = script_getnum(st, 2);