diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-25 10:52:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-04-25 10:52:49 -0300 |
commit | 01b6fe0cbfe59fe74b255ede51806a574f5cf447 (patch) | |
tree | 4b78807b54d99f676aa7e0d90d41194de5244b88 | |
parent | 944709c77b8471c4cf95e3a76d812c6e643338a0 (diff) | |
download | lua-01b6fe0cbfe59fe74b255ede51806a574f5cf447.tar.gz lua-01b6fe0cbfe59fe74b255ede51806a574f5cf447.tar.bz2 lua-01b6fe0cbfe59fe74b255ede51806a574f5cf447.zip |
new API function 'lua_isinteger'
-rw-r--r-- | lapi.c | 8 | ||||
-rw-r--r-- | lua.h | 3 |
2 files changed, 9 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.172 2013/04/12 19:07:09 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.173 2013/04/15 15:43:34 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -264,6 +264,12 @@ LUA_API int lua_iscfunction (lua_State *L, int idx) { | |||
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | LUA_API int lua_isinteger (lua_State *L, int idx) { | ||
268 | StkId o = index2addr(L, idx); | ||
269 | return ttisinteger(o); | ||
270 | } | ||
271 | |||
272 | |||
267 | LUA_API int lua_isnumber (lua_State *L, int idx) { | 273 | LUA_API int lua_isnumber (lua_State *L, int idx) { |
268 | TValue n; | 274 | TValue n; |
269 | const TValue *o = index2addr(L, idx); | 275 | const TValue *o = index2addr(L, idx); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.284 2013/02/19 18:39:04 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.285 2013/03/15 13:04:22 roberto Exp roberto $ |
3 | ** Lua - A Scripting Language | 3 | ** Lua - A Scripting Language |
4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) | 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) |
5 | ** See Copyright Notice at the end of this file | 5 | ** See Copyright Notice at the end of this file |
@@ -161,6 +161,7 @@ LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); | |||
161 | LUA_API int (lua_isnumber) (lua_State *L, int idx); | 161 | LUA_API int (lua_isnumber) (lua_State *L, int idx); |
162 | LUA_API int (lua_isstring) (lua_State *L, int idx); | 162 | LUA_API int (lua_isstring) (lua_State *L, int idx); |
163 | LUA_API int (lua_iscfunction) (lua_State *L, int idx); | 163 | LUA_API int (lua_iscfunction) (lua_State *L, int idx); |
164 | LUA_API int (lua_isinteger) (lua_State *L, int idx); | ||
164 | LUA_API int (lua_isuserdata) (lua_State *L, int idx); | 165 | LUA_API int (lua_isuserdata) (lua_State *L, int idx); |
165 | LUA_API int (lua_type) (lua_State *L, int idx); | 166 | LUA_API int (lua_type) (lua_State *L, int idx); |
166 | LUA_API const char *(lua_typename) (lua_State *L, int tp); | 167 | LUA_API const char *(lua_typename) (lua_State *L, int tp); |