From 87b0e3d477a8d4af32a2a200a2d8cb2c3aaa05a1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 8 Feb 2002 20:39:36 -0200 Subject: no more `lua_istrue' function --- lua.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index ac0a2f96..a3fb1df5 100644 --- a/lua.h +++ b/lua.h @@ -117,7 +117,6 @@ LUA_API int lua_stackspace (lua_State *L); */ LUA_API int lua_isnumber (lua_State *L, int index); -LUA_API int lua_istrue (lua_State *L, int index); LUA_API int lua_isstring (lua_State *L, int index); LUA_API int lua_iscfunction (lua_State *L, int index); LUA_API int lua_type (lua_State *L, int index); @@ -217,7 +216,11 @@ LUA_API void lua_newuserdatabox (lua_State *L, void *u); #define lua_pop(L,n) lua_settop(L, -(n)-1) -#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n)) +#define lua_register(L,n,f) \ + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_settable(L, LUA_GLOBALSINDEX)) + #define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0) #define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION) -- cgit v1.2.3-55-g6feb