diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-22 15:07:47 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-22 15:07:47 -0300 |
commit | 97e299c3958dfd865cda7cce06cf1ea825bbaffb (patch) | |
tree | fb79b7d5ea20c351a0aec7a224307e0b6f06bb19 /lua.h | |
parent | c697aa30bccc80af3b005cfdbe62686edd730a14 (diff) | |
download | lua-97e299c3958dfd865cda7cce06cf1ea825bbaffb.tar.gz lua-97e299c3958dfd865cda7cce06cf1ea825bbaffb.tar.bz2 lua-97e299c3958dfd865cda7cce06cf1ea825bbaffb.zip |
'lua_replace' implemented as a macro using 'lua_copy'
Diffstat (limited to '')
-rw-r--r-- | lua.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.308 2014/06/26 17:25:11 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.309 2014/07/17 13:53:37 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 |
@@ -158,7 +158,6 @@ LUA_API int (lua_gettop) (lua_State *L); | |||
158 | LUA_API void (lua_settop) (lua_State *L, int idx); | 158 | LUA_API void (lua_settop) (lua_State *L, int idx); |
159 | LUA_API void (lua_pushvalue) (lua_State *L, int idx); | 159 | LUA_API void (lua_pushvalue) (lua_State *L, int idx); |
160 | LUA_API void (lua_rotate) (lua_State *L, int idx, int n); | 160 | LUA_API void (lua_rotate) (lua_State *L, int idx, int n); |
161 | LUA_API void (lua_replace) (lua_State *L, int idx); | ||
162 | LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx); | 161 | LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx); |
163 | LUA_API int (lua_checkstack) (lua_State *L, int sz); | 162 | LUA_API int (lua_checkstack) (lua_State *L, int sz); |
164 | 163 | ||
@@ -366,6 +365,8 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); | |||
366 | 365 | ||
367 | #define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1)) | 366 | #define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1)) |
368 | 367 | ||
368 | #define lua_replace(L,idx) (lua_copy(L, -1, (idx)), lua_pop(L, 1)) | ||
369 | |||
369 | /* }============================================================== */ | 370 | /* }============================================================== */ |
370 | 371 | ||
371 | 372 | ||