summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-11-15 23:16:10 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-11-15 23:16:10 +0000
commit6d0d31fe908c7baa34b717bc696849815e68eb9b (patch)
tree0128125188ac6cb807b6f51a16087706d722666e
parent69c05c719ea47cd9d5810ffee8e685bbcafa1dba (diff)
web2c/luatexdir: Sync with the upstream trunk.
git-svn-id: svn://tug.org/texlive/trunk@38856 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index 437864c87a1..7fdddc3d066 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -884,6 +884,26 @@ static int lua_nodelib_getprev(lua_State * L)
return 1;
}
+static int lua_nodelib_getboth(lua_State * L)
+{
+ halfword *a;
+ halfword *p = lua_touserdata(L, 1);
+ if ( (p == NULL) || (! lua_getmetatable(L,1)) ) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ } else {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(luatex_node));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ if (!lua_rawequal(L, -1, -2)) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ } else {
+ fast_metatable_or_nil(alink(*p));
+ fast_metatable_or_nil(vlink(*p));
+ }
+ }
+ return 2;
+}
/* node.fast.getprev
@@ -6694,6 +6714,7 @@ static const struct luaL_Reg nodelib_f[] = {
/* {"getbox", lua_nodelib_getbox}, */ /* tex.getbox */
{"getnext", lua_nodelib_getnext},
{"getprev", lua_nodelib_getprev},
+ {"getboth", lua_nodelib_getboth},
{"getlist", lua_nodelib_getlist},
{"getleader", lua_nodelib_getleader},
{"getid", lua_nodelib_getid},