summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-04-25 10:52:49 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-04-25 10:52:49 -0300
commit01b6fe0cbfe59fe74b255ede51806a574f5cf447 (patch)
tree4b78807b54d99f676aa7e0d90d41194de5244b88
parent944709c77b8471c4cf95e3a76d812c6e643338a0 (diff)
downloadlua-01b6fe0cbfe59fe74b255ede51806a574f5cf447.tar.gz
lua-01b6fe0cbfe59fe74b255ede51806a574f5cf447.tar.bz2
lua-01b6fe0cbfe59fe74b255ede51806a574f5cf447.zip
new API function 'lua_isinteger'
-rw-r--r--lapi.c8
-rw-r--r--lua.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/lapi.c b/lapi.c
index 60e3a1ee..f0e219b4 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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
267LUA_API int lua_isinteger (lua_State *L, int idx) {
268 StkId o = index2addr(L, idx);
269 return ttisinteger(o);
270}
271
272
267LUA_API int lua_isnumber (lua_State *L, int idx) { 273LUA_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);
diff --git a/lua.h b/lua.h
index 7e898918..c1efd9a1 100644
--- a/lua.h
+++ b/lua.h
@@ -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);
161LUA_API int (lua_isnumber) (lua_State *L, int idx); 161LUA_API int (lua_isnumber) (lua_State *L, int idx);
162LUA_API int (lua_isstring) (lua_State *L, int idx); 162LUA_API int (lua_isstring) (lua_State *L, int idx);
163LUA_API int (lua_iscfunction) (lua_State *L, int idx); 163LUA_API int (lua_iscfunction) (lua_State *L, int idx);
164LUA_API int (lua_isinteger) (lua_State *L, int idx);
164LUA_API int (lua_isuserdata) (lua_State *L, int idx); 165LUA_API int (lua_isuserdata) (lua_State *L, int idx);
165LUA_API int (lua_type) (lua_State *L, int idx); 166LUA_API int (lua_type) (lua_State *L, int idx);
166LUA_API const char *(lua_typename) (lua_State *L, int tp); 167LUA_API const char *(lua_typename) (lua_State *L, int tp);