From d4c99b26731f2706cb83aca0f5f4c1e821a4f8d7 Mon Sep 17 00:00:00 2001
From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Tue, 1 Nov 2005 14:08:32 -0200
Subject: new function 'getregistry'

---
 ldblib.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'ldblib.c')

diff --git a/ldblib.c b/ldblib.c
index 6aad5751..cd2dc75d 100644
--- 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},
-- 
cgit v1.2.3-55-g6feb