diff options
| author | ame <[email protected]> | 2024-05-07 14:09:48 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-05-07 14:09:48 -0500 |
| commit | 3200f04de946049e950c6f7fd1e9d4d2f599c9ea (patch) | |
| tree | 68a9e2f5e2f496fc630d036fd27f2aae9fb2ad23 /src/lua.c | |
| parent | a571dd1ac9fc4d46e0bbc95a3ab88f52ee37b1a1 (diff) | |
more work on threads
Diffstat (limited to 'src/lua.c')
| -rw-r--r-- | src/lua.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -158,3 +158,16 @@ void i_dcopy(lua_State* src, lua_State* dest, void* _seen){ //lua_settop(src, old_top);
_seen = seen;
}
+
+/**
+ * @brief extracts a table to be global
+ *
+ * @param {lua_State*} source
+*/
+void lua_set_global_table(lua_State* L){
+ lua_pushnil(L);
+ for(;lua_next(L, -2) != 0;){
+ lua_setglobal(L, lua_tostring(L, -2));
+ }
+}
+
|
