diff_tables and patch_table are working and tested

This commit is contained in:
2021-08-31 20:03:33 -04:00
parent 82f1f69c25
commit 013992400e
10 changed files with 261 additions and 87 deletions

View File

@@ -1,16 +1,6 @@
#include "luastack.hpp"
#include "globaldb.hpp"
LuaDefine(globaldb_enable, "c") {
LuaVar globaldb;
LuaStack LS(L, globaldb);
LS.rawget(globaldb, LuaRegistry, "globaldb");
if (!LS.istable(globaldb)) {
LS.newtable(globaldb);
LS.rawset(LuaRegistry, "globaldb", globaldb);
}
return LS.result();
}
// Get a table from the global database.
//
@@ -25,7 +15,7 @@ LuaDefine(globaldb_global, "f") {
LuaVar globaldb;
LuaStack LS(L, globalname, globaltab, globaldb);
// Get a pointer to the globaldb.
// Get a pointer to the globaldb.
LS.rawget(globaldb, LuaRegistry, "globaldb");
if (!LS.istable(globaldb)) {
luaL_error(L, "globaldb is not enabled");