summaryrefslogtreecommitdiff
path: root/xmake/scripts/module
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-05 22:26:21 +0800
committerruki <[email protected]>2024-04-05 22:26:21 +0800
commit1f4516a9138f5ea975b1b7122affb83bf09c1b29 (patch)
treefe593b53799134524d2f17902a836027aadc3c0f /xmake/scripts/module
parent5bbb0277feb4c9d10dc47cf6866fc65fa78e69e2 (diff)
add more stack function
Diffstat (limited to 'xmake/scripts/module')
-rw-r--r--xmake/scripts/module/xmi.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/scripts/module/xmi.h b/xmake/scripts/module/xmi.h
index 746867d15..c9688e9fa 100644
--- a/xmake/scripts/module/xmi.h
+++ b/xmake/scripts/module/xmi.h
@@ -156,6 +156,9 @@
#define xmi_lua_copy(lua, fromidx, toidx) (g_lua_ops)->_lua_copy(lua, fromidx, toidx)
#define xmi_lua_checkstack(lua, n) (g_lua_ops)->_lua_checkstack(lua, n)
#define xmi_lua_xmove(from, to, n) (g_lua_ops)->_lua_xmove(from, to, n)
+#define xmi_lua_insert(lua, idx) xmi_lua_rotate(lua, (idx), 1)
+#define xmi_lua_remove(lua, idx) (xmi_lua_rotate(lua, (idx), -1), xmi_lua_pop(lua, 1))
+#define xmi_lua_replace(lua, idx) (xmi_lua_copy(lua, -1, (idx)), xmi_lua_pop(lua, 1))
// miscellaneous functions
#define xmi_lua_error(lua) (g_lua_ops)->_lua_error(lua)
@@ -342,6 +345,9 @@
# define lua_copy xmi_lua_copy
# define lua_checkstack xmi_lua_checkstack
# define lua_xmove xmi_lua_xmove
+# define lua_insert xmi_lua_insert
+# define lua_remove xmi_lua_remove
+# define lua_replace xmi_lua_replace
// miscellaneous functions
# define lua_error xmi_lua_error