From 592a309177edc52847b1196969ad6d49ba21f4fb Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 5 Dec 2001 18:15:18 -0200 Subject: tag system replaced by event tables --- lauxlib.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index 1189af50..849daa33 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.53 2001/10/31 19:40:14 roberto Exp $ +** $Id: lauxlib.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -43,7 +43,8 @@ LUALIB_API void luaL_argerror (lua_State *L, int narg, const char *extramsg) { LUALIB_API void luaL_typerror (lua_State *L, int narg, const char *tname) { char buff[80]; - sprintf(buff, "%.25s expected, got %.25s", tname, lua_type(L,narg)); + sprintf(buff, "%.25s expected, got %.25s", tname, + lua_typename(L, lua_type(L,narg))); luaL_argerror(L, narg, buff); } @@ -59,26 +60,18 @@ LUALIB_API void luaL_check_stack (lua_State *L, int space, const char *mes) { } -LUALIB_API void luaL_check_rawtype(lua_State *L, int narg, int t) { - if (lua_rawtag(L, narg) != t) +LUALIB_API void luaL_check_type(lua_State *L, int narg, int t) { + if (lua_type(L, narg) != t) tag_error(L, narg, t); } LUALIB_API void luaL_check_any (lua_State *L, int narg) { - if (lua_rawtag(L, narg) == LUA_TNONE) + if (lua_type(L, narg) == LUA_TNONE) luaL_argerror(L, narg, "value expected"); } -LUALIB_API void *luaL_check_userdata (lua_State *L, int narg, - const char *name) { - if (strcmp(lua_type(L, narg), name) != 0) - luaL_typerror(L, narg, name); - return lua_touserdata(L, narg); -} - - LUALIB_API const char *luaL_check_lstr (lua_State *L, int narg, size_t *len) { const char *s = lua_tostring(L, narg); if (!s) tag_error(L, narg, LUA_TSTRING); -- cgit v1.2.3-55-g6feb