summaryrefslogtreecommitdiff
path: root/src/util/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/util.c')
-rw-r--r--src/util/util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/util.c b/src/util/util.c
new file mode 100644
index 0000000..84edd27
--- /dev/null
+++ b/src/util/util.c
@@ -0,0 +1,12 @@
+#include <lua.h>
+
+void append_table(lua_State *L, int tbl_a, int tbl_b)
+{
+ lua_pushnil(L);
+ while(lua_next(L, tbl_b) != 0) {
+ lua_pushvalue(L, -2); // key
+ lua_pushvalue(L, -2); // value
+ lua_settable(L, tbl_a);
+ lua_pop(L, 1);
+ }
+}