gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/lua-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua-utils.c')
-rw-r--r--lua-utils.c 13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua-utils.c b/lua-utils.c
index d9006b30..0d4c9aa7 100644
--- a/lua-utils.c
+++ b/lua-utils.c
@@ -302,3 +302,16 @@ mlua_plotref_add (lua_State *L, int key_index, int val_index)
lua_rawset (L, -3);
lua_pop (L, 1);
}
+
+void
+mlua_table_clear (lua_State *L, int index)
+{
+ lua_pushnil (L); /* first key */
+ while (lua_next(L, index) != 0)
+ {
+ lua_pop (L, 1);
+ lua_pushvalue (L, -1);
+ lua_pushnil (L);
+ lua_rawset (L, index);
+ }
+}
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月28日 10:05:53 +0000

AltStyle によって変換されたページ (->オリジナル) /