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 | 43f85a15884a344238e25c118768d36976ae783a (patch) | |
| tree | 68a9e2f5e2f496fc630d036fd27f2aae9fb2ad23 /src/lua.c | |
| parent | 618263f6f85d08bfd85d4f0376663aa1e2f58eac (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));
+ }
+}
+
|
