aboutsummaryrefslogtreecommitdiff
path: root/src/uniquekey.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/uniquekey.h')
-rw-r--r--src/uniquekey.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/uniquekey.h b/src/uniquekey.h
index 6265a56..67b3279 100644
--- a/src/uniquekey.h
+++ b/src/uniquekey.h
@@ -107,6 +107,23 @@ class RegistryUniqueKey
107 STACK_CHECK(L_, 1); 107 STACK_CHECK(L_, 1);
108 return false; 108 return false;
109 } 109 }
110 // ---------------------------------------------------------------------------------------------
111 void getSubTableMode(lua_State* L_, const char* mode_) const
112 {
113 STACK_CHECK_START_REL(L_, 0);
114 if (!getSubTable(L_, 0, 0)) { // L_: {}
115 // Set its metatable if requested
116 if (mode_) {
117 STACK_GROW(L_, 3);
118 lua_createtable(L_, 0, 1); // L_: {} mt
119 lua_pushliteral(L_, "__mode"); // L_: {} mt "__mode"
120 lua_pushstring(L_, mode_); // L_: {} mt "__mode" mode
121 lua_rawset(L_, -3); // L_: {} mt
122 lua_setmetatable(L_, -2); // L_: {}
123 }
124 }
125 STACK_CHECK(L_, 1);
126 }
110}; 127};
111 128
112// ################################################################################################# 129// #################################################################################################