diff options
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.62 2002/07/08 18:21:33 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.63 2002/07/08 20:22:08 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 | */ |
@@ -113,7 +113,7 @@ static const char KEY_HOOK = 'h'; | |||
113 | 113 | ||
114 | static void hookf (lua_State *L, lua_Debug *ar) { | 114 | static void hookf (lua_State *L, lua_Debug *ar) { |
115 | static const char *const hooknames[] = {"call", "return", "line", "count"}; | 115 | static const char *const hooknames[] = {"call", "return", "line", "count"}; |
116 | lua_pushudataval(L, (void *)&KEY_HOOK); | 116 | lua_pushlightuserdata(L, (void *)&KEY_HOOK); |
117 | lua_rawget(L, LUA_REGISTRYINDEX); | 117 | lua_rawget(L, LUA_REGISTRYINDEX); |
118 | if (lua_isfunction(L, -1)) { | 118 | if (lua_isfunction(L, -1)) { |
119 | lua_pushstring(L, hooknames[(int)ar->event]); | 119 | lua_pushstring(L, hooknames[(int)ar->event]); |
@@ -157,7 +157,7 @@ static int sethook (lua_State *L) { | |||
157 | luaL_check_type(L, 1, LUA_TFUNCTION); | 157 | luaL_check_type(L, 1, LUA_TFUNCTION); |
158 | lua_sethook(L, hookf, makemask(smask, count)); | 158 | lua_sethook(L, hookf, makemask(smask, count)); |
159 | } | 159 | } |
160 | lua_pushudataval(L, (void *)&KEY_HOOK); | 160 | lua_pushlightuserdata(L, (void *)&KEY_HOOK); |
161 | lua_pushvalue(L, 1); | 161 | lua_pushvalue(L, 1); |
162 | lua_rawset(L, LUA_REGISTRYINDEX); /* set new hook */ | 162 | lua_rawset(L, LUA_REGISTRYINDEX); /* set new hook */ |
163 | return 0; | 163 | return 0; |
@@ -167,7 +167,7 @@ static int sethook (lua_State *L) { | |||
167 | static int gethook (lua_State *L) { | 167 | static int gethook (lua_State *L) { |
168 | char buff[5]; | 168 | char buff[5]; |
169 | int mask = lua_gethookmask(L); | 169 | int mask = lua_gethookmask(L); |
170 | lua_pushudataval(L, (void *)&KEY_HOOK); | 170 | lua_pushlightuserdata(L, (void *)&KEY_HOOK); |
171 | lua_rawget(L, LUA_REGISTRYINDEX); /* get hook */ | 171 | lua_rawget(L, LUA_REGISTRYINDEX); /* get hook */ |
172 | lua_pushstring(L, unmakemask(mask, buff)); | 172 | lua_pushstring(L, unmakemask(mask, buff)); |
173 | lua_pushnumber(L, lua_getmaskcount(mask)); | 173 | lua_pushnumber(L, lua_getmaskcount(mask)); |