diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/init.c | 2 | ||||
-rw-r--r-- | src/emap/script_buildins.c | 12 | ||||
-rw-r--r-- | src/emap/script_buildins.h | 2 | ||||
-rw-r--r-- | src/emap/scriptdefines.h | 3 |
4 files changed, 19 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index cd2c5bf..8f8c986 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -179,6 +179,8 @@ HPExport void plugin_init (void) addScriptCommand("hticheck", "i", htiCheck); addScriptCommand("htidelete", "i", htiDelete); addScriptCommand("setfakecells", "iii??", setFakeCells); + addScriptCommand("getlabel", "l", getLabel); + addScriptCommand("tolabel", "i", toLabel); do_init_langs(); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 3c7dbc3..2ada5ca 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -2088,3 +2088,15 @@ BUILDIN(htiDelete) } #undef checkHtIteratorExists + +BUILDIN(getLabel) +{ + script_pushint(st, script_getnum(st, 2)); + return true; +} + +BUILDIN(toLabel) +{ + script_pushlabel(st, script_getnum(st, 2)); + return true; +} diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h index b38f8de..107ac28 100644 --- a/src/emap/script_buildins.h +++ b/src/emap/script_buildins.h @@ -84,5 +84,7 @@ BUILDIN(htiNextKey); BUILDIN(htiCheck); BUILDIN(htiDelete); BUILDIN(setFakeCells); +BUILDIN(getLabel); +BUILDIN(toLabel); #endif // EVOL_MAP_SCRIPT_BUILDINS diff --git a/src/emap/scriptdefines.h b/src/emap/scriptdefines.h index 274f8f4..69c69b0 100644 --- a/src/emap/scriptdefines.h +++ b/src/emap/scriptdefines.h @@ -123,4 +123,7 @@ if (!nd) \ return def; \ +#define script_pushlabel(st, val) \ + (script->push_val((st)->stack, C_POS, (val),NULL)) + #endif // EVOL_MAP_SCRIPTDEFINES |