From a9dc7c88283a8046ad40c592f9e626d93e8e14a1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 2 Jul 2010 14:35:06 -0300 Subject: functions lua_tonumber/lua_tointeger replaced by lua_tonumberx/lua_tointegerx that have an extra out parameter with conversion status --- lua.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index 586c9388..87c81e75 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.269 2010/05/10 13:50:20 roberto Exp roberto $ +** $Id: lua.h,v 1.270 2010/05/12 14:09:20 roberto Exp roberto $ ** Lua - A Scripting Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -153,8 +153,8 @@ LUA_API int (lua_isuserdata) (lua_State *L, int idx); LUA_API int (lua_type) (lua_State *L, int idx); LUA_API const char *(lua_typename) (lua_State *L, int tp); -LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); -LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); +LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum); +LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); LUA_API int (lua_toboolean) (lua_State *L, int idx); LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); LUA_API size_t (lua_rawlen) (lua_State *L, int idx); @@ -296,6 +296,9 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); ** =============================================================== */ +#define lua_tonumber(L,i) lua_tonumberx(L,i,NULL) +#define lua_tointeger(L,i) lua_tointegerx(L,i,NULL) + #define lua_pop(L,n) lua_settop(L, -(n)-1) #define lua_newtable(L) lua_createtable(L, 0, 0) -- cgit v1.2.3-55-g6feb