aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/lua.h b/lua.h
index 5beb5411..812df98f 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.306 2014/05/13 19:40:28 roberto Exp roberto $ 2** $Id: lua.h,v 1.307 2014/06/10 17:41:38 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
@@ -175,7 +175,6 @@ LUA_API const char *(lua_typename) (lua_State *L, int tp);
175 175
176LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum); 176LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum);
177LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); 177LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum);
178LUA_API lua_Unsigned (lua_tounsignedx) (lua_State *L, int idx, int *isnum);
179LUA_API int (lua_toboolean) (lua_State *L, int idx); 178LUA_API int (lua_toboolean) (lua_State *L, int idx);
180LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); 179LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len);
181LUA_API size_t (lua_rawlen) (lua_State *L, int idx); 180LUA_API size_t (lua_rawlen) (lua_State *L, int idx);
@@ -220,7 +219,6 @@ LUA_API int (lua_compare) (lua_State *L, int idx1, int idx2, int op);
220LUA_API void (lua_pushnil) (lua_State *L); 219LUA_API void (lua_pushnil) (lua_State *L);
221LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); 220LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
222LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); 221LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
223LUA_API void (lua_pushunsigned) (lua_State *L, lua_Unsigned n);
224LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t l); 222LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t l);
225LUA_API const char *(lua_pushstring) (lua_State *L, const char *s); 223LUA_API const char *(lua_pushstring) (lua_State *L, const char *s);
226LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, 224LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
@@ -326,14 +324,13 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
326 324
327 325
328/* 326/*
329** =============================================================== 327** {==============================================================
330** some useful macros 328** some useful macros
331** =============================================================== 329** ===============================================================
332*/ 330*/
333 331
334#define lua_tonumber(L,i) lua_tonumberx(L,(i),NULL) 332#define lua_tonumber(L,i) lua_tonumberx(L,(i),NULL)
335#define lua_tointeger(L,i) lua_tointegerx(L,(i),NULL) 333#define lua_tointeger(L,i) lua_tointegerx(L,(i),NULL)
336#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL)
337 334
338#define lua_pop(L,n) lua_settop(L, -(n)-1) 335#define lua_pop(L,n) lua_settop(L, -(n)-1)
339 336
@@ -365,6 +362,22 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
365 362
366#define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1)) 363#define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1))
367 364
365/* }============================================================== */
366
367
368/*
369** {==============================================================
370** compatibility macros for unsigned conversions
371** ===============================================================
372*/
373#if defined(LUA_COMPAT_APIUNSIGNED)
374
375#define lua_pushunsigned(L,n) lua_pushinteger(L, (lua_Integer)(n))
376#define lua_tounsignedx(L,i,is) ((lua_Integer)lua_tointegerx(L,i,is))
377#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL)
378
379#endif
380/* }============================================================== */
368 381
369/* 382/*
370** {====================================================================== 383** {======================================================================