diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-07-17 13:25:13 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-07-17 13:25:13 -0300 |
| commit | 79c8edb6c423b48270c1f61df6fd5a889ca5da0e (patch) | |
| tree | 1b79c096472f5f799f5576561e831b0d992c8cd0 /ldblib.c | |
| parent | e5146fb01f1ccb40c2663e745feffbf642cbf862 (diff) | |
| download | lua-79c8edb6c423b48270c1f61df6fd5a889ca5da0e.tar.gz lua-79c8edb6c423b48270c1f61df6fd5a889ca5da0e.tar.bz2 lua-79c8edb6c423b48270c1f61df6fd5a889ca5da0e.zip | |
new names for light userdata operations
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)); |
