diff options
Diffstat (limited to 'lib/lua/src/ldebug.c')
-rw-r--r-- | lib/lua/src/ldebug.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/lua/src/ldebug.c b/lib/lua/src/ldebug.c index b154c1b..4f69bad 100644 --- a/lib/lua/src/ldebug.c +++ b/lib/lua/src/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 1.5 2004-12-27 22:18:53 pixel Exp $ +** $Id: ldebug.c,v 1.6 2006-02-09 16:59:55 pixel Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -101,6 +101,26 @@ LUA_API lua_CallWrap lua_setcallwrap (lua_State *L, lua_CallWrap func) { } +LUA_API lua_ThreadHook lua_setcreatehook (lua_State *L, lua_ThreadHook func) { + lua_ThreadHook old_func; + lua_lock(L); + old_func = L->createhook; + L->createhook = func; + lua_unlock(L); + return old_func; +} + + +LUA_API lua_ThreadHook lua_setdestroyhook (lua_State *L, lua_ThreadHook func) { + lua_ThreadHook old_func; + lua_lock(L); + old_func = L->destroyhook; + L->destroyhook = func; + lua_unlock(L); + return old_func; +} + + LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { int status; CallInfo *ci; |