commit d4c99b26731f2706cb83aca0f5f4c1e821a4f8d7
parent 88f9843eeea82822ef769efca2f937dade277527
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Tue, 1 Nov 2005 14:08:10 -0200
new function 'getregistry'
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ldblib.c b/ldblib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.101 2005/08/26 17:36:32 roberto Exp roberto $
+** $Id: ldblib.c,v 1.102 2005/10/19 13:05:11 roberto Exp roberto $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -19,6 +19,12 @@
+static int db_getregistry (lua_State *L) {
+ lua_pushvalue(L, LUA_REGISTRYINDEX);
+ return 1;
+}
+
+
static int db_getmetatable (lua_State *L) {
luaL_checkany(L, 1);
if (!lua_getmetatable(L, 1)) {
@@ -371,6 +377,7 @@ static const luaL_Reg dblib[] = {
{"gethook", db_gethook},
{"getinfo", db_getinfo},
{"getlocal", db_getlocal},
+ {"getregistry", db_getregistry},
{"getmetatable", db_getmetatable},
{"getupvalue", db_getupvalue},
{"setfenv", db_setfenv},