diff options
Diffstat (limited to 'src/emap')
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/script_buildins.c | 6 | ||||
-rw-r--r-- | src/emap/script_buildins.h | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index 85d9bc5..ecd0de9 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -181,6 +181,7 @@ HPExport void plugin_init (void) addScriptCommand("htclear", "i", htClear); addScriptCommand("htdelete", "i", htDelete); addScriptCommand("htsize", "i", htSize); + addScriptCommand("htexists", "i", htExists); addScriptCommand("htiterator", "i", htIterator); addScriptCommand("htinextkey", "i", htiNextKey); addScriptCommand("hticheck", "i", htiCheck); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 520f16f..6359ff6 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -1965,6 +1965,12 @@ BUILDIN(htSize) return true; } +BUILDIN(htExists) +{ + int64 id = script_getnum(st, 2); + script_pushint(st, htreg->hashtable_exists(id)); +} + BUILDIN(htIterator) { int64 id = script_getnum(st, 2); diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h index 176feb0..2066432 100644 --- a/src/emap/script_buildins.h +++ b/src/emap/script_buildins.h @@ -80,6 +80,7 @@ BUILDIN(htPut); BUILDIN(htClear); BUILDIN(htDelete); BUILDIN(htSize); +BUILDIN(htExists); BUILDIN(htIterator); BUILDIN(htiNextKey); BUILDIN(htiCheck); |