diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-11-01 14:08:32 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-11-01 14:08:32 -0200 |
commit | d4c99b26731f2706cb83aca0f5f4c1e821a4f8d7 (patch) | |
tree | c95e7b1de9e5582566fa0b90eba2eabe4a23345f | |
parent | 88f9843eeea82822ef769efca2f937dade277527 (diff) | |
download | lua-d4c99b26731f2706cb83aca0f5f4c1e821a4f8d7.tar.gz lua-d4c99b26731f2706cb83aca0f5f4c1e821a4f8d7.tar.bz2 lua-d4c99b26731f2706cb83aca0f5f4c1e821a4f8d7.zip |
new function 'getregistry'
-rw-r--r-- | ldblib.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.101 2005/08/26 17:36:32 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.102 2005/10/19 13:05:11 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -19,6 +19,12 @@ | |||
19 | 19 | ||
20 | 20 | ||
21 | 21 | ||
22 | static int db_getregistry (lua_State *L) { | ||
23 | lua_pushvalue(L, LUA_REGISTRYINDEX); | ||
24 | return 1; | ||
25 | } | ||
26 | |||
27 | |||
22 | static int db_getmetatable (lua_State *L) { | 28 | static int db_getmetatable (lua_State *L) { |
23 | luaL_checkany(L, 1); | 29 | luaL_checkany(L, 1); |
24 | if (!lua_getmetatable(L, 1)) { | 30 | if (!lua_getmetatable(L, 1)) { |
@@ -371,6 +377,7 @@ static const luaL_Reg dblib[] = { | |||
371 | {"gethook", db_gethook}, | 377 | {"gethook", db_gethook}, |
372 | {"getinfo", db_getinfo}, | 378 | {"getinfo", db_getinfo}, |
373 | {"getlocal", db_getlocal}, | 379 | {"getlocal", db_getlocal}, |
380 | {"getregistry", db_getregistry}, | ||
374 | {"getmetatable", db_getmetatable}, | 381 | {"getmetatable", db_getmetatable}, |
375 | {"getupvalue", db_getupvalue}, | 382 | {"getupvalue", db_getupvalue}, |
376 | {"setfenv", db_setfenv}, | 383 | {"setfenv", db_setfenv}, |