aboutsummaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-13 16:40:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-05-13 16:40:28 -0300
commit5a5a834975d135054e803b90711fcb9deb6511b8 (patch)
tree9b028d3e480b677192a6da06271f38599cb33569 /lua.h
parent45c430eac04b070a996437b79e40656942a4c7d4 (diff)
downloadlua-5a5a834975d135054e803b90711fcb9deb6511b8.tar.gz
lua-5a5a834975d135054e803b90711fcb9deb6511b8.tar.bz2
lua-5a5a834975d135054e803b90711fcb9deb6511b8.zip
new API function 'lua_rotate'
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/lua.h b/lua.h
index 464d3717..aa187338 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.304 2014/05/01 18:21:32 roberto Exp roberto $ 2** $Id: lua.h,v 1.305 2014/05/08 13:52:20 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
@@ -145,8 +145,7 @@ LUA_API int (lua_absindex) (lua_State *L, int idx);
145LUA_API int (lua_gettop) (lua_State *L); 145LUA_API int (lua_gettop) (lua_State *L);
146LUA_API void (lua_settop) (lua_State *L, int idx); 146LUA_API void (lua_settop) (lua_State *L, int idx);
147LUA_API void (lua_pushvalue) (lua_State *L, int idx); 147LUA_API void (lua_pushvalue) (lua_State *L, int idx);
148LUA_API void (lua_remove) (lua_State *L, int idx); 148LUA_API void (lua_rotate) (lua_State *L, int idx, int n);
149LUA_API void (lua_insert) (lua_State *L, int idx);
150LUA_API void (lua_replace) (lua_State *L, int idx); 149LUA_API void (lua_replace) (lua_State *L, int idx);
151LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx); 150LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx);
152LUA_API int (lua_checkstack) (lua_State *L, int sz); 151LUA_API int (lua_checkstack) (lua_State *L, int sz);
@@ -326,9 +325,9 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
326** =============================================================== 325** ===============================================================
327*/ 326*/
328 327
329#define lua_tonumber(L,i) lua_tonumberx(L,i,NULL) 328#define lua_tonumber(L,i) lua_tonumberx(L,(i),NULL)
330#define lua_tointeger(L,i) lua_tointegerx(L,i,NULL) 329#define lua_tointeger(L,i) lua_tointegerx(L,(i),NULL)
331#define lua_tounsigned(L,i) lua_tounsignedx(L,i,NULL) 330#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL)
332 331
333#define lua_pop(L,n) lua_settop(L, -(n)-1) 332#define lua_pop(L,n) lua_settop(L, -(n)-1)
334 333
@@ -356,6 +355,10 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud);
356#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) 355#define lua_tostring(L,i) lua_tolstring(L, (i), NULL)
357 356
358 357
358#define lua_insert(L,idx) lua_rotate(L, (idx), 1)
359
360#define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1))
361
359 362
360/* 363/*
361** {====================================================================== 364** {======================================================================