summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lua
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c6
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c220
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lpdflib.c331
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lstatslib.c12
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexlib.c10
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luainit.w577
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luajitstuff.w50
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luanode.w54
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luastuff.w53
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatex-api.h813
10 files changed, 1267 insertions, 859 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
index 54a7b7602ff..160fbe3bde6 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
@@ -21,13 +21,14 @@
#include "lua/luatex-api.h"
static const char _svn_version[] =
- "$Id: lcallbacklib.c 4877 2014-03-14 01:26:05Z luigi $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lcallbacklib.c $";
+ "$Id: lcallbacklib.c 4956 2014-03-28 12:12:17Z luigi $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lcallbacklib.c $";
int callback_count = 0;
int saved_callback_count = 0;
int callback_set[total_callbacks] = { 0 };
+/* See also callback_callback_type in luatexcallbackids.h: they must have the same order ! */
static const char *const callbacknames[] = {
"", /* empty on purpose */
"find_write_file",
@@ -66,7 +67,8 @@ static const char *const callbacknames[] = {
"mlist_to_hlist",
"finish_pdffile",
"finish_pdfpage",
- "pre_dump",
+ "pre_dump","start_file", "stop_file",
+ "show_error_message","show_lua_error_hook",
NULL
};
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index ba623572641..4f98dc19526 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -96,7 +96,7 @@
*/
static const char _svn_version[] =
- "$Id: lnodelib.c 4847 2014-03-05 18:13:17Z luigi $ "
+ "$Id: lnodelib.c 4956 2014-03-28 12:12:17Z luigi $ "
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lnodelib.c $";
#include "ptexlib.h"
@@ -1467,10 +1467,10 @@ static int lua_nodelib_hpack(lua_State * L)
if (lua_gettop(L) > 2) {
if (lua_type(L, 3) == LUA_TSTRING) {
s = lua_tostring(L, 3);
- if (lua_key_eq(s, additional)) {
- m = 1;
- } else if (lua_key_eq(s, exactly)) {
+ if (lua_key_eq(s, exactly)) {
m = 0;
+ } else if (lua_key_eq(s, additional)) {
+ m = 1;
} else if (lua_key_eq(s, cal_expand_ratio)) {
m = 2;
} else if (lua_key_eq(s, subst_ex_font)) {
@@ -1732,7 +1732,8 @@ static int lua_nodelib_mlist_to_hlist(lua_State * L)
int w;
boolean m;
n = *(check_isnode(L, 1));
- w = luaL_checkoption(L, 2, "text", math_style_names);
+ //w = luaL_checkoption(L, 2, "text", math_style_names);
+ assign_math_style(L,2,w);
luaL_checkany(L, 3);
m = lua_toboolean(L, 3);
mlist_to_hlist_args(n, w, m);
@@ -1877,22 +1878,26 @@ static int lua_nodelib_fields(lua_State * L)
}
lua_checkstack(L, 2);
lua_newtable(L);
- lua_pushstring(L, "next"); /* next, id, subtype, prev could be predefined string */
+ // lua_pushstring(L, "next");
+ lua_push_string_by_name(L,next);
lua_rawseti(L, -2, 0);
- lua_pushstring(L, "id");
+ // lua_pushstring(L, "id");
+ lua_push_string_by_name(L,id);
lua_rawseti(L, -2, 1);
if (nodetype_has_subtype(t)) {
- lua_pushstring(L, "subtype");
- lua_rawseti(L, -2, 2);
- offset++;
+ // lua_pushstring(L, "subtype");
+ lua_push_string_by_name(L,subtype);
+ lua_rawseti(L, -2, 2);
+ offset++;
}
if (fields != NULL) {
if (nodetype_has_prev(t)) {
- lua_pushstring(L, "prev");
- lua_rawseti(L, -2, -1);
+// lua_pushstring(L, "prev");
+ lua_push_string_by_name(L,prev);
+ lua_rawseti(L, -2, -1);
}
for (i = 0; fields[i] != NULL; i++) {
- lua_pushstring(L, fields[i]);
+ lua_pushstring(L, fields[i]); /* todo */
lua_rawseti(L, -2, (i + offset));
}
}
@@ -2386,14 +2391,14 @@ static int lua_nodelib_direct_count(lua_State * L)
/* directions (could be a macro) */
-static void nodelib_pushdir(lua_State * L, int n, boolean dirnode)
-{
- if (dirnode) {
- lua_pushstring(L, dir_strings[n+64]);
- } else {
- lua_pushstring(L, dir_strings[n+64]+1);
- }
-}
+// static void nodelib_pushdir(lua_State * L, int n, boolean dirnode)
+// {
+// if (dirnode) {
+// lua_pushstring(L, dir_strings[n+64]);
+// } else {
+// lua_pushstring(L, dir_strings[n+64]+1);
+// }
+// }
/* getting and setting fields (helpers) */
@@ -2412,8 +2417,8 @@ int nodelib_getdir(lua_State * L, int n, int absolute_only)
{
if (lua_type(L, n) == LUA_TSTRING) {
const char *s = lua_tostring(L, n);
- RETURN_DIR_VALUES(TRT);
RETURN_DIR_VALUES(TLT);
+ RETURN_DIR_VALUES(TRT);
RETURN_DIR_VALUES(LTL);
RETURN_DIR_VALUES(RTT);
luaL_error(L, "Bad direction specifier %s", s);
@@ -2458,7 +2463,8 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
if (t == dir_node) {
if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, dir_dir(n), true);
+ // nodelib_pushdir(L, dir_dir(n), true);
+ lua_push_dir_text(L, dir_dir(n));
} else if (lua_key_eq(s, level)) {
lua_pushnumber(L, dir_level(n));
} else if (lua_key_eq(s, dvi_ptr)) {
@@ -2481,6 +2487,13 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
case 'd':
lua_pushnumber(L, user_node_value(n));
break;
+ case 'l':
+ if (user_node_value(n) != 0) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, user_node_value(n));
+ } else {
+ lua_pushnil(L);
+ }
+ break;
case 'n':
nodelib_pushlist(L, user_node_value(n));
break;
@@ -2503,7 +2516,8 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
} else if (lua_key_eq(s, pen_broken)) {
lua_pushnumber(L, local_pen_broken(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, local_par_dir(n), false);
+// nodelib_pushdir(L, local_par_dir(n), false);
+ lua_push_dir_par(L, local_par_dir(n));
} else if (lua_key_eq(s, box_left)) {
/* can be: fast_metatable_or_nil(local_box_left(n)) */
nodelib_pushlist(L, local_box_left(n));
@@ -2522,7 +2536,7 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
lua_pushnumber(L, pdf_literal_mode(n));
} else if (lua_key_eq(s, data)) {
if (pdf_literal_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, pdf_literal_data(n));
} else {
tokenlist_to_luastring(L, pdf_literal_data(n));
}
@@ -2530,14 +2544,14 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
lua_pushnil(L);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, name)) {
- tokenlist_to_luastring(L, late_lua_name(n));
- } else if (lua_key_eq(s, data) || lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string) || lua_key_eq(s, data)) {
if (late_lua_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, late_lua_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, late_lua_data(n));
} else {
tokenlist_to_luastring(L, late_lua_data(n));
}
+ } else if (lua_key_eq(s, name)) {
+ tokenlist_to_luastring(L, late_lua_name(n));
} else {
lua_pushnil(L);
}
@@ -2742,7 +2756,11 @@ static int lua_nodelib_fast_getfield(lua_State * L)
p = vlink(p);
while (p != null) {
if (attribute_id(p) == i) {
- lua_pushnumber(L, (int) attribute_value(p));
+ if ((int) attribute_value(p) > UNUSED_ATTRIBUTE) {
+ lua_pushnumber(L, (int) attribute_value(p));
+ } else {
+ lua_pushnil(L);
+ }
return 1;
} else if (attribute_id(p) > i) {
lua_pushnil(L);
@@ -2814,7 +2832,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shift)) {
lua_pushnumber(L, shift_amount(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -2897,7 +2916,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, rule_dir(n), false);
+ // nodelib_pushdir(L, rule_dir(n), false);
+ lua_push_dir_par(L, rule_dir(n));
} else {
lua_pushnil(L);
}
@@ -2984,7 +3004,7 @@ static int lua_nodelib_fast_getfield(lua_State * L)
if (lua_key_eq(s, subtype)) {
lua_pushnumber(L, subtype(n));
} else if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ lua_push_math_style_name(L,subtype(n));
} else {
lua_pushnil(L);
}
@@ -3150,7 +3170,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shrink)) {
lua_pushnumber(L, glue_shrink(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -3208,7 +3229,8 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
if (t == dir_node) {
if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, dir_dir(n), true);
+ // nodelib_pushdir(L, dir_dir(n), true);
+ lua_push_dir_text(L, dir_dir(n));
} else if (lua_key_eq(s, level)) {
lua_pushnumber(L, dir_level(n));
} else if (lua_key_eq(s, dvi_ptr)) {
@@ -3231,6 +3253,13 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
case 'd':
lua_pushnumber(L, user_node_value(n));
break;
+ case 'l':
+ if (user_node_value(n) != 0) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, user_node_value(n));
+ } else {
+ lua_pushnil(L);
+ }
+ break;
case 'n':
nodelib_pushdirect(user_node_value(n));
break;
@@ -3253,7 +3282,8 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
} else if (lua_key_eq(s, pen_broken)) {
lua_pushnumber(L, local_pen_broken(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, local_par_dir(n), false);
+// nodelib_pushdir(L, local_par_dir(n), false);
+ lua_push_dir_par(L, local_par_dir(n));
} else if (lua_key_eq(s, box_left)) {
nodelib_pushdirect_or_nil(local_box_left(n));
} else if (lua_key_eq(s, box_left_width)) {
@@ -3270,7 +3300,7 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
lua_pushnumber(L, pdf_literal_mode(n));
} else if (lua_key_eq(s, data)) {
if (pdf_literal_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, pdf_literal_data(n));
} else {
tokenlist_to_luastring(L, pdf_literal_data(n));
}
@@ -3278,14 +3308,14 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
lua_pushnil(L);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, name)) {
- tokenlist_to_luastring(L, late_lua_name(n));
- } else if (lua_key_eq(s, data) || lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string) || lua_key_eq(s, data)) {
if (late_lua_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, late_lua_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, late_lua_data(n));
} else {
tokenlist_to_luastring(L, late_lua_data(n));
}
+ } else if (lua_key_eq(s, name)) {
+ tokenlist_to_luastring(L, late_lua_name(n));
} else {
lua_pushnil(L);
}
@@ -3477,7 +3507,11 @@ static int lua_nodelib_direct_getfield(lua_State * L)
p = vlink(p);
while (p != null) {
if (attribute_id(p) == i) {
- lua_pushnumber(L, (int) attribute_value(p));
+ if ((int) attribute_value(p) > UNUSED_ATTRIBUTE) {
+ lua_pushnumber(L, (int) attribute_value(p));
+ } else {
+ lua_pushnil(L);
+ }
return 1;
} else if (attribute_id(p) > i) {
lua_pushnil(L) ;
@@ -3550,7 +3584,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shift)) {
lua_pushnumber(L, shift_amount(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -3621,7 +3656,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, rule_dir(n), false);
+ // nodelib_pushdir(L, rule_dir(n), false);
+ lua_push_dir_par(L, rule_dir(n));
} else {
lua_pushnil(L);
}
@@ -3689,7 +3725,7 @@ static int lua_nodelib_direct_getfield(lua_State * L)
}
} else if (t == style_node) {
if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ lua_push_math_style_name(L,subtype(n));
} else {
lua_pushnil(L);
}
@@ -3829,7 +3865,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shrink)) {
lua_pushnumber(L, glue_shrink(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -4353,6 +4390,24 @@ static int lua_nodelib_direct_tonode(lua_State * L)
/* node.setfield */
+/* ls-hh: normally a value will not be reassigned */
+
+#define cleanup_late_lua(n) do { \
+ if (late_lua_data(n) != 0) { \
+ if (late_lua_type(n) == normal) { \
+ delete_token_ref(late_lua_data(n)); \
+ } else if (late_lua_type(n) == lua_refid_literal) { \
+ luaL_unref(L, LUA_REGISTRYINDEX,late_lua_data(n)); \
+ } \
+ } \
+} while (0)
+
+#define cleanup_late_lua_name(n) do { \
+ if (late_lua_name(n) != 0) { \
+ delete_token_ref(late_lua_name(n)); \
+ } \
+} while (0)
+
static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
{
int t ;
@@ -4385,12 +4440,8 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
return nodelib_cantset(L, n, s);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, data)) {
- late_lua_data(n) = nodelib_gettoks(L, 3);
- late_lua_type(n) = normal;
- } else if (lua_key_eq(s, name)) {
- late_lua_name(n) = nodelib_gettoks(L, 3);
- } else if (lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string)) {
+ cleanup_late_lua(n) ; /* ls-hh */
if (ini_version) {
late_lua_data(n) = nodelib_gettoks(L, 3);
late_lua_type(n) = normal;
@@ -4399,9 +4450,17 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
late_lua_data(n) = luaL_ref(L, LUA_REGISTRYINDEX);
late_lua_type(n) = lua_refid_literal;
}
+ } else if (lua_key_eq(s, data)) {
+ cleanup_late_lua(n) ; /* ls-hh */
+ late_lua_data(n) = nodelib_gettoks(L, 3);
+ late_lua_type(n) = normal;
+ } else if (lua_key_eq(s, name)) {
+ cleanup_late_lua_name(n) ; /* ls-hh */
+ late_lua_name(n) = nodelib_gettoks(L, 3);
} else {
return nodelib_cantset(L, n, s);
}
+ /* done */
} else if (t == user_defined_node) {
if (lua_key_eq(s, user_id)) {
user_node_id(n) = (halfword) lua_tointeger(L, 3);
@@ -4415,6 +4474,13 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
case 'd':
user_node_value(n) = (halfword) lua_tointeger(L, 3);
break;
+ case 'l':
+ lua_pushvalue(L, 3);
+ if (user_node_value(n) != 0) {
+ luaL_unref(L, LUA_REGISTRYINDEX,user_node_value(n));
+ }
+ user_node_value(n) = luaL_ref(L, LUA_REGISTRYINDEX);
+ break;
case 'n':
user_node_value(n) = nodelib_getlist(L, 3);
break;
@@ -4641,9 +4707,10 @@ static int lua_nodelib_fast_setfield(lua_State * L)
s = lua_tostring(L, 2);
- if (lua_key_eq(s, id)) {
- lua_pushnumber(L, t);
- } else if (lua_key_eq(s, next)) {
+ /*if (lua_key_eq(s, id)) {
+ type(n) = (quarteword) lua_tointeger(L, 3);
+ }* else */
+ if (lua_key_eq(s, next)) {
halfword x = nodelib_getlist(L, 3);
if (x>0 && type(x) == glue_spec_node) {
return luaL_error(L, "You can't assign a %s node to a next field\n", node_data[type(x)].name);
@@ -4749,7 +4816,7 @@ static int lua_nodelib_fast_setfield(lua_State * L)
} else if (lua_key_eq(s, stretch_order)) {
stretch_order(n) = (quarterword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, shrink_order)) {
- lua_pushnumber(L, shrink_order(n));
+ shrink_order(n) = (quarterword) lua_tointeger(L, 3);
/* } else if (lua_key_eq(s, ref_count)) {
glue_ref_count(n) = (halfword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, writable)) {
@@ -4872,10 +4939,10 @@ static int lua_nodelib_fast_setfield(lua_State * L)
if (lua_key_eq(s, subtype)) {
/* dummy subtype */
} else if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ assign_math_style(L,3,subtype(n));
+ //subtype(n) = (quarterword) luaL_checkoption(L, 3, "text", math_style_names); /* not 2? */
} else {
/* return nodelib_cantset(L, n, s); */
- subtype(n) = (quarterword) luaL_checkoption(L, 3, "text", math_style_names); /* not 2? */
}
} else if (t == accent_noad) {
if (lua_key_eq(s, subtype)) {
@@ -5120,12 +5187,8 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char
return nodelib_cantset(L, n, s);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, data)) {
- late_lua_data(n) = nodelib_gettoks(L, 3);
- late_lua_type(n) = normal;
- } else if (lua_key_eq(s, name)) {
- late_lua_name(n) = nodelib_gettoks(L, 3);
- } else if (lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string)) {
+ cleanup_late_lua(n) ; /* ls-hh */
if (ini_version) {
late_lua_data(n) = nodelib_gettoks(L, 3);
late_lua_type(n) = normal;
@@ -5134,6 +5197,13 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char
late_lua_data(n) = luaL_ref(L, LUA_REGISTRYINDEX);
late_lua_type(n) = lua_refid_literal;
}
+ } else if (lua_key_eq(s, data)) {
+ cleanup_late_lua(n) ; /* ls-hh */
+ late_lua_data(n) = nodelib_gettoks(L, 3);
+ late_lua_type(n) = normal;
+ } else if (lua_key_eq(s, name)) {
+ cleanup_late_lua_name(n) ; /* ls-hh */
+ late_lua_name(n) = nodelib_gettoks(L, 3);
} else {
return nodelib_cantset(L, n, s);
}
@@ -5150,6 +5220,13 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char
case 'd':
user_node_value(n) = (halfword) lua_tointeger(L, 3);
break;
+ case 'l':
+ lua_pushvalue(L, 3);
+ if (user_node_value(n) != 0) {
+ luaL_unref(L, LUA_REGISTRYINDEX,user_node_value(n));
+ }
+ user_node_value(n) = luaL_ref(L, LUA_REGISTRYINDEX);
+ break;
case 'n':
user_node_value(n) = nodelib_getlist(L, 3);
break;
@@ -5376,9 +5453,10 @@ static int lua_nodelib_direct_setfield(lua_State * L)
s = lua_tostring(L, 2);
- if (lua_key_eq(s, id)) {
- lua_pushnumber(L, t);
- } else if (lua_key_eq(s, next)) {
+ /*if (lua_key_eq(s, id)) {
+ type(n) = (quarteword) lua_tointeger(L, 3);
+ } else*/
+ if (lua_key_eq(s, next)) {
halfword x = nodelib_popdirect(3);
if (x>0 && type(x) == glue_spec_node) {
return luaL_error(L, "You can't assign a %s node to a next field\n", node_data[type(x)].name);
@@ -5484,7 +5562,7 @@ static int lua_nodelib_direct_setfield(lua_State * L)
} else if (lua_key_eq(s, stretch_order)) {
stretch_order(n) = (quarterword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, shrink_order)) {
- lua_pushnumber(L, shrink_order(n));
+ shrink_order(n) = (quarterword) lua_tointeger(L, 3);
/* } else if (lua_key_eq(s, ref_count)) {
glue_ref_count(n) = (halfword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, writable)) {
@@ -5606,10 +5684,10 @@ static int lua_nodelib_direct_setfield(lua_State * L)
if (lua_key_eq(s, subtype)) {
/* dummy subtype */
} else if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ assign_math_style(L,2,subtype(n));
+ //subtype(n) = (quarterword) luaL_checkoption(L, 2, "text", math_style_names); /* was 3 */
} else {
/* return nodelib_cantset(L, n, s); */
- subtype(n) = (quarterword) luaL_checkoption(L, 2, "text", math_style_names); /* was 3 */
}
} else if (t == accent_noad) {
if (lua_key_eq(s, subtype)) {
@@ -6024,7 +6102,7 @@ static int lua_nodelib_attributes_to_properties(lua_State * L)
}
}
}
- lua_rawset(Luas,-3);
+ lua_rawset(L,-3);
n = vlink(n);
}
return 1 ;
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
index 00cffd398d7..a93f75a2aa0 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -18,14 +18,12 @@
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
static const char _svn_version[] =
- "$Id: lpdflib.c 4877 2014-03-14 01:26:05Z luigi $ "
+ "$Id: lpdflib.c 4956 2014-03-28 12:12:17Z luigi $ "
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lpdflib.c $";
#include "ptexlib.h"
#include "lua/luatex-api.h"
-#define PDF_ENV "pdf.env"
-
static int luapdfprint(lua_State * L)
{
int n;
@@ -185,47 +183,10 @@ static int l_immediateobj(lua_State * L)
return 1;
}
-/**********************************************************************/
-/* for lookup within table in LUA_REGISTRYINDEX (instead of repeated strcmp()) */
-
-typedef enum { P__ZERO,
- P_CATALOG,
- P_H,
- P_INFO,
- P_NAMES,
- P_PDFCATALOG,
- P_PDFINFO,
- P_PDFNAMES,
- P_PDFTRAILER,
- P_RAW,
- P_STREAM,
- P_TRAILER,
- P_V,
- P__SENTINEL
-} parm_idx;
-
-static const parm_struct pdf_parms[] = {
- {NULL, P__ZERO}, /* dummy; lua indices run from 1 */
- {"catalog", P_CATALOG},
- {"h", P_H},
- {"info", P_INFO},
- {"names", P_NAMES},
- {"pdfcatalog", P_PDFCATALOG}, /* obsolescent */
- {"pdfinfo", P_PDFINFO}, /* obsolescent */
- {"pdfnames", P_PDFNAMES}, /* obsolescent */
- {"pdftrailer", P_PDFTRAILER}, /* obsolescent */
- {"raw", P_RAW},
- {"stream", P_STREAM},
- {"trailer", P_TRAILER},
- {"v", P_V},
- {NULL, P__SENTINEL}
-};
-
-/**********************************************************************/
-
static int table_obj(lua_State * L)
{
- int k, type, obj_compression;
+ const char *type;
+ int k, obj_compression;
int compress_level = -1; /* unset */
int os_threshold = OBJSTM_ALWAYS; /* default: put non-stream objects into object streams */
int saved_compress_level = static_pdf->compress_level;
@@ -238,33 +199,20 @@ static int table_obj(lua_State * L)
/* get object "type" */
- /* lua_pushstring(L, "type"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* vs? t *\/ */
lua_key_rawgeti(type);
if (lua_isnil(L, -1)) /* !vs t */
luaL_error(L, "pdf.obj(): object \"type\" missing");
if (!lua_isstring(L, -1)) /* !vs t */
luaL_error(L, "pdf.obj(): object \"type\" must be string");
- lua_pushstring(L, PDF_ENV); /* s vs t */
- lua_gettable(L, LUA_REGISTRYINDEX); /* t vs t */
- lua_pushvalue(L, -2); /* vs t vs t */
- lua_gettable(L, -2); /* i? t vs t */
- if (!lua_isnumber(L, -1)) /* !i t vs t */
- luaL_error(L, "pdf.obj(): \"%s\" is not a valid object type", lua_tostring(L, -3));
- type = (int) lua_tointeger(L, -1); /* i t vs t */
- switch (type) {
- case P_RAW:
- case P_STREAM:
- break;
- default:
- luaL_error(L, "pdf.obj(): \"%s\" is not a valid object type", lua_tostring(L, -3)); /* i vs t */
+ type = lua_tostring(L, -1);
+
+ if (! (lua_key_eq(type, raw) || lua_key_eq(type, stream))) {
+ luaL_error(L, "pdf.obj(): \"%s\" is not a valid object type", type); /* i vs t */
}
- lua_pop(L, 3); /* t */
+ lua_pop(L, 1); /* t */
/* get optional "immediate" */
- /* lua_pushstring(L, "immediate"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* b? t *\/ */
lua_key_rawgeti(immediate);
if (!lua_isnil(L, -1)) { /* b? t */
if (!lua_isboolean(L, -1)) /* !b t */
@@ -275,8 +223,6 @@ static int table_obj(lua_State * L)
/* is a reserved object referenced by "objnum"? */
- /* lua_pushstring(L, "objnum"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* vi? t *\/ */
lua_key_rawgeti(objnum);
if (!lua_isnil(L, -1)) { /* vi? t */
if (!lua_isnumber(L, -1)) /* !vi t */
@@ -298,11 +244,9 @@ static int table_obj(lua_State * L)
/* get optional "attr" (allowed only for stream case) */
- /* lua_pushstring(L, "attr"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* attr-s? t *\/ */
lua_key_rawgeti(attr);
if (!lua_isnil(L, -1)) { /* attr-s? t */
- if (type != P_STREAM)
+ if (! lua_key_eq(type, stream))
luaL_error(L, "pdf.obj(): \"attr\" key not allowed for non-stream object");
if (!lua_isstring(L, -1)) /* !attr-s t */
luaL_error(L, "pdf.obj(): object \"attr\" must be string");
@@ -311,16 +255,15 @@ static int table_obj(lua_State * L)
lua_pop(L, 1); /* t */
} else
obj_obj_stream_attr(static_pdf, k) = luaL_ref(Luas, LUA_REGISTRYINDEX); /* t */
- } else
+ } else {
lua_pop(L, 1); /* t */
+ }
/* get optional "compresslevel" (allowed only for stream case) */
- /* lua_pushstring(L, "compresslevel"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* vi? t *\/ */
lua_key_rawgeti(compresslevel);
if (!lua_isnil(L, -1)) { /* vi? t */
- if (type == P_RAW)
+ if (lua_key_eq(type, raw))
luaL_error(L, "pdf.obj(): \"compresslevel\" key not allowed for raw object");
if (!lua_isnumber(L, -1)) /* !vi t */
luaL_error(L, "pdf.obj(): \"compresslevel\" must be integer");
@@ -336,11 +279,9 @@ static int table_obj(lua_State * L)
/* get optional "objcompression" (allowed only for non-stream case) */
- /* lua_pushstring(L, "objcompression"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* b? t *\/ */
lua_key_rawgeti(objcompression);
if (!lua_isnil(L, -1)) { /* b? t */
- if (type == P_STREAM)
+ if (lua_key_eq(type, stream))
luaL_error(L, "pdf.obj(): \"objcompression\" key not allowed for stream object");
if (!lua_isboolean(L, -1)) /* !b t */
luaL_error(L, "pdf.obj(): \"objcompression\" must be boolean");
@@ -357,21 +298,15 @@ static int table_obj(lua_State * L)
/* now the object contents for all cases are handled */
- /* lua_pushstring(L, "string"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* string-s? t *\/ */
lua_key_rawgeti(string);
- /* lua_pushstring(L, "file"); /\* ks string-s? t *\/ */
- /* lua_gettable(L, -3); /\* file-s? string-s? t *\/ */
- lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(file));
- lua_gettable(L, -3);
+ lua_key_rawgeti_n(file,-2);
if (!lua_isnil(L, -1) && !lua_isnil(L, -2)) /* file-s? string-s? t */
luaL_error(L, "pdf.obj(): \"string\" and \"file\" must not be given together");
if (lua_isnil(L, -1) && lua_isnil(L, -2)) /* nil nil t */
luaL_error(L, "pdf.obj(): no \"string\" or \"file\" given");
- switch (type) {
- case P_RAW:
+ if (lua_key_eq(type, raw)) {
if (immediate == 1)
pdf_begin_obj(static_pdf, k, os_threshold);
if (!lua_isnil(L, -2)) { /* file-s? string-s? t */
@@ -408,8 +343,7 @@ static int table_obj(lua_State * L)
}
if (immediate == 1)
pdf_end_obj(static_pdf);
- break;
- case P_STREAM:
+ } else {
if (immediate == 1) {
pdf_begin_obj(static_pdf, k, OBJSTM_NEVER); /* 0 = not an object stream candidate! */
pdf_begin_dict(static_pdf);
@@ -456,9 +390,6 @@ static int table_obj(lua_State * L)
pdf_end_stream(static_pdf);
pdf_end_obj(static_pdf);
}
- break;
- default:
- assert(0);
}
static_pdf->compress_level = saved_compress_level;
return k;
@@ -511,7 +442,7 @@ static int orig_obj(lua_State * L)
}
if (lua_key_eq(st_s, stream)) {
set_obj_obj_is_stream(static_pdf, k);
- } else if (lua_key_eq(st_s, streamfile)) {
+ } else if (lua_key_eq(st_s, streamfile)) {
set_obj_obj_is_stream(static_pdf, k);
set_obj_obj_is_file(static_pdf, k);
} else
@@ -566,7 +497,7 @@ static int l_reserveobj(lua_State * L)
case 1:
if (!lua_isstring(L, -1))
luaL_error(L, "pdf.reserveobj() optional argument must be string");
- if (lua_key_eq(st_s, annot)) {
+ if (lua_key_eq(st_s, annot)) {
pdf_last_annot = pdf_create_obj(static_pdf, obj_type_annot, 0);
} else {
luaL_error(L, "pdf.reserveobj() optional string must be \"annot\"");
@@ -599,102 +530,135 @@ static int l_registerannot(lua_State * L)
return 0;
}
+static int l_get_pdf_value(lua_State * L, int key)
+{
+ lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [table] */
+ lua_rawgeti(L, LUA_REGISTRYINDEX, key);
+ /* [table] [key] */
+ lua_rawget(L,-2);
+ return 1;
+}
+static int l_get_pageresources(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(pageresources));
+}
+static int l_get_pageattributes(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(pageattributes));
+}
+static int l_get_pagesattributes(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(pagesattributes));
+}
+static int l_get_catalog(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(catalog));
+}
+static int l_get_info(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(info));
+}
+static int l_get_names(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(names));
+}
+
+
+static int l_get_trailer(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(trailer));
+}
+
+
static int getpdf(lua_State * L)
{
- char *s;
- int i, l;
- if (lua_isstring(L, 2) && (lua_tostring(L, 2) != NULL)) {
- lua_pushstring(L, PDF_ENV); /* s ... */
- lua_gettable(L, LUA_REGISTRYINDEX); /* t ... */
- lua_pushvalue(L, 2); /* st t ... */
- lua_gettable(L, -2); /* i? t ... */
- if (lua_isnumber(L, -1)) { /* i t ... */
- i = (int) lua_tointeger(L, -1); /* i t ... */
- lua_pop(L, 2); /* ... */
- switch (i) {
- case P_PDFCATALOG:
- case P_CATALOG:
- s = tokenlist_to_cstring(pdf_catalog_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_PDFINFO:
- case P_INFO:
- s = tokenlist_to_cstring(pdf_info_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_PDFNAMES:
- case P_NAMES:
- s = tokenlist_to_cstring(pdf_names_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_PDFTRAILER:
- case P_TRAILER:
- s = tokenlist_to_cstring(pdf_trailer_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_H:
- lua_pushnumber(L, static_pdf->posstruct->pos.h);
- break;
- case P_V:
- lua_pushnumber(L, static_pdf->posstruct->pos.v);
- break;
- default:
- lua_rawget(L, -2);
- }
- } else {
- lua_pop(L, 2); /* ... */
- lua_rawget(L, -2);
+ /* [pdf table] [key] */
+ const char *s ;
+ if (lua_gettop(L) != 2) {
+ return 0;
+ }
+ if (lua_isstring(L, -1)) {
+ s = lua_tostring(L, -1);
+ if (lua_key_eq(s,h)) {
+ lua_pushnumber(L, static_pdf->posstruct->pos.h);
+ } else if (lua_key_eq(s,v)) {
+ lua_pushnumber(L, static_pdf->posstruct->pos.v);
+ } else if (
+ lua_key_eq(s,catalog) || lua_key_eq(s,info) || lua_key_eq(s,trailer) || lua_key_eq(s,names) ||
+ lua_key_eq(s,pageattributes) || lua_key_eq(s,pagesattributes) || lua_key_eq(s,pageresources)
+ ) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [pdf table] [key] [pdf.data table] */
+ lua_replace(L, -3);
+ /* [pdf.data table] [key] */
}
- } else {
- lua_pushnil(L);
}
- return 1;
+ lua_rawget(L, -2);
+ return 0;
}
+
+
+
+static int l_set_pdf_value(lua_State * L, int key)
+{
+ if (lua_isstring(L, -1)) {
+ /* [value] */
+ lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [value] [table] */
+ lua_rawgeti(L, LUA_REGISTRYINDEX, key);
+ /* [value] [table] [key] */
+ lua_pushvalue(L, -3);
+ /* [table] [key] [value] */
+ lua_rawset(L,-3);
+ }
+ return 0;
+}
+static int l_set_pageresources(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(pageresources));
+}
+static int l_set_pageattributes(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(pageattributes));
+}
+static int l_set_pagesattributes(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(pagesattributes));
+}
+static int l_set_catalog(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(catalog));
+}
+static int l_set_info(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(info));
+}
+static int l_set_names(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(names));
+}
+static int l_set_trailer(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(trailer));
+}
+
+
static int setpdf(lua_State * L)
{
- int i;
+ /* [pdf table] [key] [value] */
+ const char *s ;
if (lua_gettop(L) != 3) {
return 0;
}
- (void) luaL_checkstring(L, 2); /* ... */
- lua_pushstring(L, PDF_ENV); /* s ... */
- lua_gettable(L, LUA_REGISTRYINDEX); /* t ... */
- lua_pushvalue(L, 2); /* st t ... */
- lua_gettable(L, -2); /* i? t ... */
- if (lua_isnumber(L, -1)) { /* i t ... */
- i = (int) lua_tointeger(L, -1); /* i t ... */
- lua_pop(L, 2); /* ... */
- switch (i) {
- case P_PDFCATALOG:
- case P_CATALOG:
- pdf_catalog_toks = tokenlist_from_lua(L);
- break;
- case P_PDFINFO:
- case P_INFO:
- pdf_info_toks = tokenlist_from_lua(L);
- break;
- case P_PDFNAMES:
- case P_NAMES:
- pdf_names_toks = tokenlist_from_lua(L);
- break;
- case P_PDFTRAILER:
- case P_TRAILER:
- pdf_trailer_toks = tokenlist_from_lua(L);
- break;
- case P_H:
- case P_V:
- /* can't set |h| and |v| yet */
- default:
- lua_rawset(L, -3);
+ if (lua_isstring(L, -2)) {
+ s = lua_tostring(L, -1);
+ if (
+ lua_key_eq(s,catalog) || lua_key_eq(s,info) || lua_key_eq(s,trailer) || lua_key_eq(s,names) ||
+ lua_key_eq(s,pageattributes) || lua_key_eq(s,pagesattributes) || lua_key_eq(s,pageresources)
+ ) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [pdf table] [key] [value] [pdf.data table] */
+ lua_replace(L, -4);
+ /* [pdf.data table] [key] [value] */
}
- } else {
- lua_pop(L, 2); /* ... */
- lua_rawset(L, -3);
}
+ lua_rawset(L, -3);
return 0;
}
+
static int l_objtype(lua_State * L)
{
int n = lua_gettop(L);
@@ -741,18 +705,6 @@ static int l_mapline(lua_State * L)
return 0;
}
-static int l_pdfmapfile(lua_State * L)
-{
- luaL_error(L, "pdf.pdfmapfile() is obsolete. Use pdf.mapfile() instead.");
- return 0;
-}
-
-static int l_pdfmapline(lua_State * L)
-{
- luaL_error(L, "pdf.pdfmapline() is obsolete. Use pdf.mapline() instead.");
- return 0;
-}
-
static int l_pageref(lua_State * L)
{
int n = lua_gettop(L);
@@ -821,8 +773,6 @@ static const struct luaL_Reg pdflib[] = {
{"obj", l_obj},
{"objtype", l_objtype},
{"pageref", l_pageref},
- {"pdfmapfile", l_pdfmapfile}, /* obsolete */
- {"pdfmapline", l_pdfmapline}, /* obsolete */
{"print", luapdfprint},
{"refobj", l_refobj},
{"registerannot", l_registerannot},
@@ -832,6 +782,20 @@ static const struct luaL_Reg pdflib[] = {
{"getvpos", l_getvpos},
{"getmatrix", l_getmatrix},
{"hasmatrix", l_hasmatrix},
+ {"setcatalog", l_set_catalog},
+ {"setinfo", l_set_info},
+ {"setnames", l_set_names},
+ {"settrailer", l_set_trailer},
+ {"setpageresources", l_set_pageresources},
+ {"setpageattributes", l_set_pageattributes},
+ {"setpagesattributes", l_set_pagesattributes},
+ {"getcatalog", l_get_catalog},
+ {"getinfo", l_get_info},
+ {"getnames", l_get_names},
+ {"gettrailer", l_get_trailer},
+ {"getpageresources", l_get_pageresources},
+ {"getpageattributes", l_get_pageattributes},
+ {"getpagesattributes", l_get_pagesattributes},
{NULL, NULL} /* sentinel */
};
@@ -839,7 +803,10 @@ static const struct luaL_Reg pdflib[] = {
int luaopen_pdf(lua_State * L)
{
- preset_environment(L, pdf_parms, PDF_ENV);
+ lua_pushstring(L,"pdf.data");
+ lua_newtable(L);
+ lua_settable(L,LUA_REGISTRYINDEX);
+ /* */
luaL_register(L, "pdf", pdflib);
/* build meta table */
luaL_newmetatable(L, "pdf.meta");
diff --git a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
index 6c2413137c7..eae0bcb98f4 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
@@ -18,7 +18,7 @@
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
static const char _svn_version[] =
- "$Id: lstatslib.c 4857 2014-03-07 00:01:41Z luigi $ "
+ "$Id: lstatslib.c 4956 2014-03-28 12:12:17Z luigi $ "
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lstatslib.c $";
#include "ptexlib.h"
@@ -34,6 +34,8 @@ typedef const char *(*charfunc) (void);
typedef lua_Number(*numfunc) (void);
typedef int (*intfunc) (void);
+const char *last_lua_error;
+
static const char *getbanner(void)
{
return (const char *) ptexbanner;
@@ -73,6 +75,13 @@ static const char *getlasterror(void)
return last_error;
}
+static const char *getlastluaerror(void)
+{
+ return last_lua_error;
+}
+
+
+
static const char *luatexrevision(void)
{
return (const char *) (strrchr(luatex_version_string, '.') + 1);
@@ -245,6 +254,7 @@ static struct statistic stats[] = {
{"inputid", 'g', &(iname)},
{"linenumber", 'g', &line},
{"lasterrorstring", 'S', (void *) &getlasterror},
+ {"lastluaerrorstring", 'S', (void *) &getlastluaerror},
{"luabytecodes", 'g', &luabytecode_max},
{"luabytecode_bytes", 'g', &luabytecode_bytes},
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
index 905b1694164..48c9e6f17ac 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
@@ -27,7 +27,7 @@ setter no prev link is created so we can presume that it's not used later on. */
static const char _svn_version[] =
- "$Id: ltexlib.c 4878 2014-03-14 10:48:03Z taco $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/ltexlib.c $";
+ "$Id: ltexlib.c 4956 2014-03-28 12:12:17Z luigi $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/ltexlib.c $";
#define attribute(A) eqtb[attribute_base+(A)].hh.rh
#define dimen(A) eqtb[scaled_base+(A)].hh.rh
@@ -2520,7 +2520,12 @@ static int tex_run_end(lua_State * L)
return 0;
}
-
+static int tex_show_context(lua_State * L)
+{
+ (void) L;
+ show_context();
+ return 0;
+}
void init_tex_table(lua_State * L)
{
@@ -2604,6 +2609,7 @@ static const struct luaL_Reg texlib[] = {
{"normal_rand", tex_norm_rand},
{"lua_math_randomseed", tex_init_rand}, /* syntactic sugar */
{"lua_math_random", lua_math_random},
+ {"show_context", tex_show_context},
{NULL, NULL} /* sentinel */
};
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.w b/Build/source/texk/web2c/luatexdir/lua/luainit.w
index 66312164133..c95ecb43867 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: luainit.w 4881 2014-03-14 12:51:16Z taco $"
+ "$Id: luainit.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/luainit.w $";
#include "ptexlib.h"
@@ -29,251 +29,8 @@ static const char _svn_version[] =
#include "lua/luatex-api.h"
/* internalized strings: see luatex-api.h */
-make_lua_key(LTL);
-make_lua_key(MathConstants);
-make_lua_key(RTT);
-make_lua_key(TLT);
-make_lua_key(TRT);
-make_lua_key(accent);
-make_lua_key(action);
-make_lua_key(action_id);
-make_lua_key(action_type);
-make_lua_key(additional);
-make_lua_key(adjust_head);
-make_lua_key(advance);
-make_lua_key(aleph);
-make_lua_key(align_head);
-make_lua_key(area);
-make_lua_key(attr);
-make_lua_key(attributes);
-make_lua_key(auto_expand);
-make_lua_key(best_ins_ptr);
-make_lua_key(best_page_break);
-make_lua_key(best_size);
-make_lua_key(bot);
-make_lua_key(bot_accent);
-make_lua_key(bottom_left);
-make_lua_key(bottom_right);
-make_lua_key(box_left);
-make_lua_key(box_left_width);
-make_lua_key(box_right);
-make_lua_key(box_right_width);
-make_lua_key(broken_ins);
-make_lua_key(broken_ptr);
-make_lua_key(cache);
-make_lua_key(cal_expand_ratio);
-make_lua_key(char);
-make_lua_key(characters);
-make_lua_key(checksum);
-make_lua_key(cidinfo);
-make_lua_key(class);
-make_lua_key(command);
-make_lua_key(commands);
-make_lua_key(comment);
-make_lua_key(components);
-make_lua_key(contrib_head);
-make_lua_key(core);
-make_lua_key(cost);
-make_lua_key(count);
-make_lua_key(data);
-make_lua_key(degree);
-make_lua_key(delim);
-make_lua_key(delimptr);
-make_lua_key(denom);
-make_lua_key(depth);
-make_lua_key(designsize);
-make_lua_key(dest_id);
-make_lua_key(dest_type);
-make_lua_key(dir);
-make_lua_key(dir_h);
-make_lua_key(direction);
-make_lua_key(dirs);
-make_lua_key(display);
-make_lua_key(down);
-make_lua_key(dvi_ptr);
-make_lua_key(embedding);
-make_lua_key(encodingbytes);
-make_lua_key(encodingname);
-make_lua_key(end);
-make_lua_key(etex);
-make_lua_key(exactly);
-make_lua_key(expansion_factor);
-make_lua_key(ext);
-make_lua_key(extend);
-make_lua_key(extender);
-make_lua_key(extensible);
-make_lua_key(extra_space);
-make_lua_key(fam);
-make_lua_key(fast);
-make_lua_key(file);
-make_lua_key(filename);
-make_lua_key(font);
-make_lua_key(fonts);
-make_lua_key(format);
-make_lua_key(fullname);
-make_lua_key(global);
-make_lua_key(glue_order);
-make_lua_key(glue_set);
-make_lua_key(glue_sign);
-make_lua_key(glyph);
-make_lua_key(head);
-make_lua_key(height);
-make_lua_key(hold_head);
-make_lua_key(horiz_variants);
-make_lua_key(hyphenchar);
-make_lua_key(id);
-make_lua_key(image);
-make_lua_key(index);
-make_lua_key(italic);
-make_lua_key(kern);
-make_lua_key(kerns);
-make_lua_key(lang);
-make_lua_key(large_char);
-make_lua_key(large_fam);
-make_lua_key(last_ins_ptr);
-make_lua_key(leader);
-make_lua_key(least_page_cost);
-make_lua_key(left);
-make_lua_key(left_boundary);
-make_lua_key(left_protruding);
-make_lua_key(level);
-make_lua_key(ligatures);
-make_lua_key(link_attr);
-make_lua_key(list);
-make_lua_key(log);
-make_lua_key(lua);
-make_lua_key(luatex);
-make_lua_key(luatex_node);
-make_lua_key(mLTL);
-make_lua_key(mRTT);
-make_lua_key(mTLT);
-make_lua_key(mTRT);
-make_lua_key(mark);
-make_lua_key(mathdir);
-make_lua_key(mathkern);
-make_lua_key(mathstyle);
-make_lua_key(mid);
-make_lua_key(mode);
-make_lua_key(modeline);
-make_lua_key(name);
-make_lua_key(named_id);
-make_lua_key(new_window);
-make_lua_key(next);
-make_lua_key(no);
-make_lua_key(noad);
-make_lua_key(node);
-make_lua_key(node_properties);
-make_lua_key(node_properties_indirect);
-make_lua_key(nomath);
-make_lua_key(nop);
-make_lua_key(nucleus);
-make_lua_key(num);
-make_lua_key(number);
-make_lua_key(objnum);
-make_lua_key(omega);
-make_lua_key(ordering);
-make_lua_key(pLTL);
-make_lua_key(pRTT);
-make_lua_key(pTLT);
-make_lua_key(pTRT);
-make_lua_key(page_head);
-make_lua_key(page_ins_head);
-make_lua_key(parameters);
-make_lua_key(pdftex);
-make_lua_key(pen_broken);
-make_lua_key(pen_inter);
-make_lua_key(penalty);
-make_lua_key(pop);
-make_lua_key(post);
-make_lua_key(pre);
-make_lua_key(pre_adjust_head);
-make_lua_key(prev);
-make_lua_key(prevdepth);
-make_lua_key(prevgraf);
-make_lua_key(psname);
-make_lua_key(ptr);
-make_lua_key(push);
-make_lua_key(quad);
-make_lua_key(ref_count);
-make_lua_key(reg);
-make_lua_key(registry);
-make_lua_key(renew);
-make_lua_key(rep);
-make_lua_key(replace);
-make_lua_key(right);
-make_lua_key(right_boundary);
-make_lua_key(right_protruding);
-make_lua_key(rule);
-make_lua_key(scale);
-make_lua_key(script);
-make_lua_key(scriptscript);
-make_lua_key(shift);
-make_lua_key(shrink);
-make_lua_key(shrink_order);
-make_lua_key(size);
-make_lua_key(skewchar);
-make_lua_key(slant);
-make_lua_key(slot);
-make_lua_key(small_char);
-make_lua_key(small_fam);
-make_lua_key(space);
-make_lua_key(space_shrink);
-make_lua_key(space_stretch);
-make_lua_key(spacefactor);
-make_lua_key(spec);
-make_lua_key(special);
-make_lua_key(stack);
-make_lua_key(start);
-make_lua_key(step);
-make_lua_key(stream);
-make_lua_key(stretch);
-make_lua_key(stretch_order);
-make_lua_key(string);
-make_lua_key(style);
-make_lua_key(sub);
-make_lua_key(subst_ex_font);
-make_lua_key(subtype);
-make_lua_key(sup);
-make_lua_key(supplement);
-make_lua_key(surround);
-make_lua_key(tail);
-make_lua_key(temp_head);
-make_lua_key(term);
-make_lua_key(term_and_log);
-make_lua_key(tex);
-make_lua_key(text);
-make_lua_key(thread_attr);
-make_lua_key(thread_id);
-make_lua_key(top);
-make_lua_key(top_accent);
-make_lua_key(top_left);
-make_lua_key(top_right);
-make_lua_key(tounicode);
-make_lua_key(transform);
-make_lua_key(type);
-make_lua_key(uchyph);
-make_lua_key(umath);
-make_lua_key(units_per_em);
-make_lua_key(used);
-make_lua_key(user_id);
-make_lua_key(value);
-make_lua_key(version);
-make_lua_key(vert_variants);
-make_lua_key(width);
-make_lua_key(writable);
-make_lua_key(x_height);
-make_lua_key(xoffset);
-make_lua_key(xyz_zoom);
-make_lua_key(yoffset);
-
-make_lua_key(immediate);
-make_lua_key(compresslevel);
-make_lua_key(objcompression);
-make_lua_key(direct);
-make_lua_key(page);
-make_lua_key(streamfile);
-make_lua_key(annot);
-make_lua_key(lua_functions);
+set_make_keys;
+
@
TH: TODO
@@ -284,7 +41,7 @@ Better to wait until Karl has some time (after texlive 2008) so we can
synchronize with kpathsea. One problem, for instance, is that I would
like to resolve the full executable path. |kpse_set_program_name()| does
that, indirectly (by setting SELFAUTOLOC in the environment), but it
-does much more, making it hard to use for our purpose.
+does much more, making it hard to use for our purpose.
In fact, it sets three C variables:
@@ -449,11 +206,11 @@ char *jithash_hashname = NULL;
int safer_option = 0;
int nosocket_option = 0;
-@ Reading the options.
+@ Reading the options.
@ Test whether getopt found an option ``A''.
Assumes the option index is in the variable |option_index|, and the
-option table in a variable |long_options|.
+option table in a variable |long_options|.
@c
#define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a)
@@ -550,7 +307,7 @@ static void parse_options(int ac, char **av)
if (g == -1) /* End of arguments, exit the loop. */
break;
if (g == '?') { /* Unknown option. */
- if (!luainit)
+ if (!luainit)
fprintf(stderr,"%s: unrecognized option '%s'\n", argv[0], argv[optind-1]);
continue;
}
@@ -571,15 +328,15 @@ static void parse_options(int ac, char **av)
} else if (ARGUMENT_IS("jithash")) {
size_t len = strlen(optarg);
if (len<16)
- jithash_hashname = optarg;
+ jithash_hashname = optarg;
else{
- WARNING2("hash name truncated to 15 characters from %d. (%s)",
+ WARNING2("hash name truncated to 15 characters from %d. (%s)",
(int) len, optarg);
jithash_hashname = (string) xmalloc(16);
strncpy(jithash_hashname, optarg, 15);
jithash_hashname[15] = 0;
}
-#endif
+#endif
} else if (ARGUMENT_IS("luahashchars")) {
show_luahashchars = 1;
@@ -670,7 +427,7 @@ static void parse_options(int ac, char **av)
"There is NO warranty. Redistribution of this software is covered by\n"
"the terms of the GNU General Public License, version 2 or (at your option)\n"
"any later version. For more information about these matters, see the file\n"
- "named COPYING and the LuaTeX source.\n\n"
+ "named COPYING and the LuaTeX source.\n\n"
#ifdef LuajitTeX
"LuaTeX is Copyright 2014 Taco Hoekwater, the LuaTeX Team.\n"
"Libraries and JIT extensions by Luigi Scarso, the LuaTeX SwigLib team.\n");
@@ -684,31 +441,31 @@ static void parse_options(int ac, char **av)
initversionstring(&versions);
print_version_banner();
/* *INDENT-OFF* */
- puts("\n\nThe LuaTeX team is Hans Hagen, Hartmut Henkel, Taco Hoekwater.\n"
+ puts("\n\nThe LuaTeX team is Hans Hagen, Hartmut Henkel, Taco Hoekwater.\n"
#ifdef LuajitTex
- "LuajitTeX merges and builds upon (parts of) the code from these projects:\n\n"
+ "LuajitTeX merges and builds upon (parts of) the code from these projects:\n\n"
#else
- "LuaTeX merges and builds upon (parts of) the code from these projects:\n\n"
+ "LuaTeX merges and builds upon (parts of) the code from these projects:\n\n"
#endif
- "tex by Donald Knuth\n"
- "etex by Peter Breitenlohner, Phil Taylor and friends\n"
- "omega by John Plaice and Yannis Haralambous\n"
- "aleph by Giuseppe Bilotta\n"
- "pdftex by Han The Thanh and friends\n"
- "kpathsea by Karl Berry, Olaf Weber and others\n"
- "lua by Roberto Ierusalimschy, Waldemar Celes,\n"
- " Luiz Henrique de Figueiredo\n"
- "metapost by John Hobby, Taco Hoekwater and friends.\n"
- "poppler by Derek Noonburg, Kristian H\\ogsberg (partial)\n"
+ "tex by Donald Knuth\n"
+ "etex by Peter Breitenlohner, Phil Taylor and friends\n"
+ "omega by John Plaice and Yannis Haralambous\n"
+ "aleph by Giuseppe Bilotta\n"
+ "pdftex by Han The Thanh and friends\n"
+ "kpathsea by Karl Berry, Olaf Weber and others\n"
+ "lua by Roberto Ierusalimschy, Waldemar Celes,\n"
+ " Luiz Henrique de Figueiredo\n"
+ "metapost by John Hobby, Taco Hoekwater and friends.\n"
+ "poppler by Derek Noonburg, Kristian H\\ogsberg (partial)\n"
#ifdef LuajitTeX
- "fontforge by George Williams (partial)\n"
- "luajit by Mike Pall\n\n"
+ "fontforge by George Williams (partial)\n"
+ "luajit by Mike Pall\n\n"
#else
- "fontforge by George Williams (partial)\n\n"
+ "fontforge by George Williams (partial)\n\n"
#endif
- "Some extensions to lua and additional lua libraries are used, as well as\n"
- "libraries for graphic inclusion. More details can be found in the source.\n"
- "Code development was sponsored by a grant from Colorado State University\n"
+ "Some extensions to lua and additional lua libraries are used, as well as\n"
+ "libraries for graphic inclusion. More details can be found in the source.\n"
+ "Code development was sponsored by a grant from Colorado State University\n"
#ifdef LuajitTeX
"via the 'oriental tex' project, the TeX User Groups, and donations.\n"
"The additional libraries and the LuaJIT extensions are provided by the LuaTeX SwigLib project.\n");
@@ -787,7 +544,7 @@ static void parse_options(int ac, char **av)
}
}
-@ test for readability
+@ test for readability
@c
#define is_readable(a) (stat(a,&finfo)==0) && S_ISREG(finfo.st_mode) && \
(f=fopen(a,"r")) != NULL && !fclose(f)
@@ -903,12 +660,12 @@ static const char *luatex_kpse_find_aux(lua_State *L, const char *name,
}
@ The lua search function.
-
+
When kpathsea is not initialized, then it runs the
normal lua function that is saved in the registry, otherwise
it uses kpathsea.
-two registry ref variables are needed: one for the actual lua
+two registry ref variables are needed: one for the actual lua
function, the other for its environment .
@c
@@ -971,7 +728,7 @@ static int luatex_kpse_clua_find(lua_State * L)
break;
}
if ((unsigned char)temp_name[j]=='.'){
- temp_name[j]=LUA_DIRSEP[0];
+ temp_name[j]=LUA_DIRSEP[0];
}
}
p = strstr(extensionless, temp_name);
@@ -1009,9 +766,9 @@ static int luatex_kpse_clua_find(lua_State * L)
}
}
-@ Setting up the new search functions.
+@ Setting up the new search functions.
-This replaces package.searchers[2] and package.searchers[3] with the
+This replaces package.searchers[2] and package.searchers[3] with the
functions defined above.
@c
@@ -1044,6 +801,13 @@ int pdf_table_id;
int token_table_id;
int node_table_id;
+@ @c
+int l_pack_type_index [PACK_TYPE_SIZE] ;
+int l_group_code_index [GROUP_CODE_SIZE];
+int l_math_style_name_index [MATH_STYLE_NAME_SIZE];
+int l_dir_par_index [DIR_PAR_SIZE];
+int l_dir_text_index [DIR_TEXT_SIZE];
+
#if defined(WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
char **suffixlist;
@@ -1126,7 +890,7 @@ void lua_initialize(int ac, char **av)
#endif
size_t len;
len = strlen(fmt) + strlen(luatex_version_string) ;
-
+
banner = xmalloc(len);
sprintf(banner, fmt, luatex_version_string);
} else {
@@ -1197,256 +961,19 @@ void lua_initialize(int ac, char **av)
luainterpreter();
/* init internalized strings */
- init_lua_key(LTL);
- init_lua_key(MathConstants);
- init_lua_key(RTT);
- init_lua_key(TLT);
- init_lua_key(TRT);
- init_lua_key(accent);
- init_lua_key(action);
- init_lua_key(action_id);
- init_lua_key(action_type);
- init_lua_key(additional);
- init_lua_key(adjust_head);
- init_lua_key(advance);
- init_lua_key(aleph);
- init_lua_key(align_head);
- init_lua_key(area);
- init_lua_key(attr);
- init_lua_key(attributes);
- init_lua_key(auto_expand);
- init_lua_key(best_ins_ptr);
- init_lua_key(best_page_break);
- init_lua_key(best_size);
- init_lua_key(bot);
- init_lua_key(bot_accent);
- init_lua_key(bottom_left);
- init_lua_key(bottom_right);
- init_lua_key(box_left);
- init_lua_key(box_left_width);
- init_lua_key(box_right);
- init_lua_key(box_right_width);
- init_lua_key(broken_ins);
- init_lua_key(broken_ptr);
- init_lua_key(cache);
- init_lua_key(cal_expand_ratio);
- init_lua_key(char);
- init_lua_key(characters);
- init_lua_key(checksum);
- init_lua_key(cidinfo);
- init_lua_key(class);
- init_lua_key(command);
- init_lua_key(commands);
- init_lua_key(comment);
- init_lua_key(components);
- init_lua_key(contrib_head);
- init_lua_key(core);
- init_lua_key(cost);
- init_lua_key(count);
- init_lua_key(data);
- init_lua_key(degree);
- init_lua_key(delim);
- init_lua_key(delimptr);
- init_lua_key(denom);
- init_lua_key(depth);
- init_lua_key(designsize);
- init_lua_key(dest_id);
- init_lua_key(dest_type);
- init_lua_key(dir);
- init_lua_key(dir_h);
- init_lua_key(direction);
- init_lua_key(dirs);
- init_lua_key(display);
- init_lua_key(down);
- init_lua_key(dvi_ptr);
- init_lua_key(embedding);
- init_lua_key(encodingbytes);
- init_lua_key(encodingname);
- init_lua_key(end);
- init_lua_key(etex);
- init_lua_key(exactly);
- init_lua_key(expansion_factor);
- init_lua_key(ext);
- init_lua_key(extend);
- init_lua_key(extender);
- init_lua_key(extensible);
- init_lua_key(extra_space);
- init_lua_key(fam);
- init_lua_key(fast);
- init_lua_key(file);
- init_lua_key(filename);
- init_lua_key(font);
- init_lua_key(fonts);
- init_lua_key(format);
- init_lua_key(fullname);
- init_lua_key(global);
- init_lua_key(glue_order);
- init_lua_key(glue_set);
- init_lua_key(glue_sign);
- init_lua_key(glyph);
- init_lua_key(head);
- init_lua_key(height);
- init_lua_key(hold_head);
- init_lua_key(horiz_variants);
- init_lua_key(hyphenchar);
- init_lua_key(id);
- init_lua_key(image);
- init_lua_key(index);
- init_lua_key(italic);
- init_lua_key(kern);
- init_lua_key(kerns);
- init_lua_key(lang);
- init_lua_key(large_char);
- init_lua_key(large_fam);
- init_lua_key(last_ins_ptr);
- init_lua_key(leader);
- init_lua_key(least_page_cost);
- init_lua_key(left);
- init_lua_key(left_boundary);
- init_lua_key(left_protruding);
- init_lua_key(level);
- init_lua_key(ligatures);
- init_lua_key(link_attr);
- init_lua_key(list);
- init_lua_key(log);
- init_lua_key(lua);
- init_lua_key(luatex);
- init_lua_key(mark);
- init_lua_key(mathdir);
- init_lua_key(mathkern);
- init_lua_key(mathstyle);
- init_lua_key(mid);
- init_lua_key(mode);
- init_lua_key(modeline);
- init_lua_key(name);
- init_lua_key(named_id);
- init_lua_key(new_window);
- init_lua_key(next);
- init_lua_key(no);
- init_lua_key(noad);
- init_lua_key(node);
- init_lua_key(nomath);
- init_lua_key(nop);
- init_lua_key(nucleus);
- init_lua_key(num);
- init_lua_key(number);
- init_lua_key(objnum);
- init_lua_key(omega);
- init_lua_key(ordering);
- init_lua_key(page_head);
- init_lua_key(page_ins_head);
- init_lua_key(parameters);
- init_lua_key(pdftex);
- init_lua_key(pen_broken);
- init_lua_key(pen_inter);
- init_lua_key(penalty);
- init_lua_key(pop);
- init_lua_key(post);
- init_lua_key(pre);
- init_lua_key(pre_adjust_head);
- init_lua_key(prev);
- init_lua_key(prevdepth);
- init_lua_key(prevgraf);
- init_lua_key(psname);
- init_lua_key(ptr);
- init_lua_key(push);
- init_lua_key(quad);
- init_lua_key(ref_count);
- init_lua_key(reg);
- init_lua_key(registry);
- init_lua_key(renew);
- init_lua_key(rep);
- init_lua_key(replace);
- init_lua_key(right);
- init_lua_key(right_boundary);
- init_lua_key(right_protruding);
- init_lua_key(rule);
- init_lua_key(scale);
- init_lua_key(script);
- init_lua_key(scriptscript);
- init_lua_key(shift);
- init_lua_key(shrink);
- init_lua_key(shrink_order);
- init_lua_key(size);
- init_lua_key(skewchar);
- init_lua_key(slant);
- init_lua_key(slot);
- init_lua_key(small_char);
- init_lua_key(small_fam);
- init_lua_key(space);
- init_lua_key(space_shrink);
- init_lua_key(space_stretch);
- init_lua_key(spacefactor);
- init_lua_key(spec);
- init_lua_key(special);
- init_lua_key(stack);
- init_lua_key(start);
- init_lua_key(step);
- init_lua_key(stream);
- init_lua_key(stretch);
- init_lua_key(stretch_order);
- init_lua_key(string);
- init_lua_key(style);
- init_lua_key(sub);
- init_lua_key(subst_ex_font);
- init_lua_key(subtype);
- init_lua_key(sup);
- init_lua_key(supplement);
- init_lua_key(surround);
- init_lua_key(tail);
- init_lua_key(temp_head);
- init_lua_key(term);
- init_lua_key(tex);
- init_lua_key(text);
- init_lua_key(thread_attr);
- init_lua_key(thread_id);
- init_lua_key(top);
- init_lua_key(top_accent);
- init_lua_key(top_left);
- init_lua_key(top_right);
- init_lua_key(tounicode);
- init_lua_key(transform);
- init_lua_key(type);
- init_lua_key(uchyph);
- init_lua_key(umath);
- init_lua_key(units_per_em);
- init_lua_key(used);
- init_lua_key(user_id);
- init_lua_key(value);
- init_lua_key(version);
- init_lua_key(vert_variants);
- init_lua_key(width);
- init_lua_key(writable);
- init_lua_key(x_height);
- init_lua_key(xoffset);
- init_lua_key(xyz_zoom);
- init_lua_key(yoffset);
- init_lua_key_alias(luatex_node, "luatex.node");
- init_lua_key_alias(mLTL,"-LTL");
- init_lua_key_alias(mRTT,"-RTT");
- init_lua_key_alias(mTLT,"-TLT");
- init_lua_key_alias(mTRT,"-TRT");
- init_lua_key_alias(node_properties,"node.properties");
- init_lua_key_alias(node_properties_indirect,"node.properties.indirect");
- init_lua_key_alias(pLTL,"+LTL");
- init_lua_key_alias(pRTT,"+RTT");
- init_lua_key_alias(pTLT,"+TLT");
- init_lua_key_alias(pTRT,"+TRT");
- init_lua_key_alias(term_and_log,"term and log");
- init_lua_key_alias(lua_functions,"lua.functions");
-
- init_lua_key(immediate);
- init_lua_key(compresslevel);
- init_lua_key(objcompression);
- init_lua_key(direct);
- init_lua_key(page);
- init_lua_key(streamfile);
- init_lua_key(annot);
+ set_init_keys;
lua_pushstring(Luas,"lua.functions");
lua_newtable(Luas);
lua_settable(Luas,LUA_REGISTRYINDEX);
+ /* here start the key definitions */
+ set_pack_type_index;
+ set_l_group_code_index;
+ set_l_math_style_name_index;
+ set_l_dir_par_index;
+ set_l_dir_text_index;
+
prepare_cmdline(Luas, argv, argc, lua_offset); /* collect arguments */
setup_lua_path(Luas);
diff --git a/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w b/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w
index 6c20e9d10fb..3e78fd2d940 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w
@@ -451,16 +451,30 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
}
lua_active++;
if (is_string) {
- const char *ss = NULL;
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
- ss = lua_tolstring(Luas, -1, &ll);
- s = xmalloc(ll+1);
- memcpy(s,ss,ll+1);
- lua_pop(Luas,1);
+ const char *ss = NULL;
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
+ if (lua_isfunction(Luas,-1)) {
+ int base = lua_gettop(Luas); /* function index */
+ lua_checkstack(Luas, 1);
+ lua_pushcfunction(Luas, lua_traceback); /* push traceback function */
+ lua_insert(Luas, base); /* put it under chunk */
+ i = lua_pcall(Luas, 0, 0, base);
+ lua_remove(Luas, base); /* remove traceback function */
+ if (i != 0) {
+ lua_gc(Luas, LUA_GCCOLLECT, 0);
+ Luas = luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1));
+ }
+ lua_active--;
+ return ;
+ }
+ ss = lua_tolstring(Luas, -1, &ll);
+ s = xmalloc(ll+1);
+ memcpy(s,ss,ll+1);
+ lua_pop(Luas,1);
} else {
- int l = 0;
- s = tokenlist_to_cstring(p, 1, &l);
- ll = (size_t)l;
+ int l = 0;
+ s = tokenlist_to_cstring(p, 1, &l);
+ ll = (size_t)l;
}
ls.s = s;
ls.size = ll;
@@ -469,17 +483,16 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
int l = 0; /* not used */
lua_id = tokenlist_to_cstring(nameptr, 1, &l);
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
+ xfree(lua_id);
} else if (nameptr < 0) {
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ");
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]");
}
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ");
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]");
}
if (i != 0) {
Luas = luatex_error(Luas, (i == LUA_ERRSYNTAX ? 0 : 1));
@@ -500,6 +513,7 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
lua_active--;
}
+
@ @c
void late_lua(PDF pdf, halfword p)
{
@@ -530,17 +544,16 @@ void luatokencall(int p, int nameptr) /* hh-ls: optimized lua_id resolving */
if (nameptr > 0) {
lua_id = tokenlist_to_cstring(nameptr, 1, &l);
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
+ xfree(lua_id);
} else if (nameptr < 0) {
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ");
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]");
}
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ");
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]");
}
xfree(s);
if (i != 0) {
@@ -571,6 +584,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
luaerr.s = lua_tolstring(L, -1, &luaerr.l);
err = (char *) xmalloc((unsigned) (luaerr.l + 1));
snprintf(err, (luaerr.l + 1), "%s", luaerr.s);
+ last_lua_error = err;
}
if (is_fatal > 0) {
/* Normally a memory error from lua.
@@ -583,7 +597,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
return (lua_State *) NULL;
} else {
lua_norm_error(err);
- xfree(err);
+ /* last_lua_error = err so no need to xfree(err) */
return L;
}
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luanode.w b/Build/source/texk/web2c/luatexdir/lua/luanode.w
index 879b0b3d27e..b0a9849c561 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luanode.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luanode.w
@@ -22,13 +22,13 @@ nodes are removedor inserted, temp nodes don't interfere */
@ @c
static const char _svn_version[] =
- "$Id: luanode.w 4442 2012-05-25 22:40:34Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/lua/luanode.w $";
+ "$Id: luanode.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/luanode.w $";
#include "ptexlib.h"
#include "lua/luatex-api.h"
-@ @c
+/* TO BE REMOVED
static const char *group_code_names[] = {
"",
"simple",
@@ -56,10 +56,11 @@ static const char *group_code_names[] = {
};
const char *pack_type_name[] = { "exactly", "additional" };
-
+*/
@ @c
-void lua_node_filter_s(int filterid, const char *extrainfo)
+void
+lua_node_filter_s(int filterid, int extrainfo)
{
lua_State *L = Luas;
int callback_id = callback_defined(filterid);
@@ -72,7 +73,7 @@ void lua_node_filter_s(int filterid, const char *extrainfo)
lua_settop(L, s_top);
return;
}
- lua_pushstring(L, extrainfo); /* arg 1 */
+ lua_push_string_by_index(L,extrainfo); /* arg 1 */
if (lua_pcall(L, 1, 0, 0) != 0) {
fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
lua_settop(L, s_top);
@@ -83,16 +84,15 @@ void lua_node_filter_s(int filterid, const char *extrainfo)
return;
}
+
@ @c
void
-lua_node_filter(int filterid, int xextrainfo, halfword head_node,
- halfword * tail_node)
+lua_node_filter(int filterid, int extrainfo, halfword head_node, halfword * tail_node)
{
halfword ret;
int a;
lua_State *L = Luas;
int s_top = lua_gettop(L);
- const char *extrainfo = group_code_names[xextrainfo];
int callback_id = callback_defined(filterid);
if (head_node == null || vlink(head_node) == null || callback_id <= 0) {
lua_settop(L, s_top);
@@ -104,7 +104,7 @@ lua_node_filter(int filterid, int xextrainfo, halfword head_node,
}
alink(vlink(head_node)) = null ; /* hh-ls */
nodelist_to_lua(L, vlink(head_node)); /* arg 1 */
- lua_pushstring(L, extrainfo); /* arg 2 */
+ lua_push_group_code(L,extrainfo); /* arg 2 */
if (lua_pcall(L, 2, 1, 0) != 0) { /* no arg, 1 result */
fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
lua_settop(L, s_top);
@@ -135,7 +135,6 @@ lua_node_filter(int filterid, int xextrainfo, halfword head_node,
return;
}
-
@ @c
int
lua_linebreak_callback(int is_broken, halfword head_node, halfword * new_head)
@@ -195,11 +194,11 @@ lua_hpack_filter(halfword head_node, scaled size, int pack_type, int extrainfo,
}
alink(head_node) = null ; /* hh-ls */
nodelist_to_lua(L, head_node);
- lua_pushstring(L, group_code_names[extrainfo]);
+ lua_push_group_code(L,extrainfo);
lua_pushnumber(L, size);
- lua_pushstring(L, pack_type_name[pack_type]);
+ lua_push_pack_type(L,pack_type);
if (pack_direction >= 0)
- lua_pushstring(L, string_dir(pack_direction));
+ lua_push_dir_par(L, pack_direction);
else
lua_pushnil(L);
if (lua_pcall(L, 5, 1, 0) != 0) { /* no arg, 1 result */
@@ -239,7 +238,7 @@ lua_vpack_filter(halfword head_node, scaled size, int pack_type, scaled maxd,
lua_settop(L, s_top);
return head_node;
}
- if (strcmp("output", group_code_names[extrainfo]) == 0) {
+ if (extrainfo == 8) { /* output */
callback_id = callback_defined(pre_output_filter_callback);
} else {
callback_id = callback_defined(vpack_filter_callback);
@@ -254,12 +253,12 @@ lua_vpack_filter(halfword head_node, scaled size, int pack_type, scaled maxd,
}
alink(head_node) = null ; /* hh-ls */
nodelist_to_lua(L, head_node);
- lua_pushstring(L, group_code_names[extrainfo]);
+ lua_push_group_code(L,extrainfo);
lua_pushnumber(L, size);
- lua_pushstring(L, pack_type_name[pack_type]);
+ lua_push_pack_type(L,pack_type);
lua_pushnumber(L, maxd);
if (pack_direction >= 0)
- lua_pushstring(L, string_dir(pack_direction));
+ lua_push_dir_par(L, pack_direction);
else
lua_pushnil(L);
if (lua_pcall(L, 6, 1, 0) != 0) { /* no arg, 1 result */
@@ -338,6 +337,7 @@ void copy_pdf_literal(pointer r, pointer p)
}
}
+@ @c
void copy_late_lua(pointer r, pointer p)
{
late_lua_type(r) = late_lua_type(p);
@@ -352,6 +352,15 @@ void copy_late_lua(pointer r, pointer p)
}
}
+@ @c
+void copy_user_lua(pointer r, pointer p)
+{
+ if (user_node_value(p) != 0) {
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, user_node_value(p));
+ user_node_value(r) = luaL_ref(Luas, LUA_REGISTRYINDEX);
+ }
+}
+
@ @c
void free_pdf_literal(pointer p)
@@ -375,6 +384,15 @@ void free_late_lua(pointer p)
}
@ @c
+void free_user_lua(pointer p)
+{
+ if (user_node_value(p) != 0) {
+ luaL_unref(Luas, LUA_REGISTRYINDEX, user_node_value(p));
+ }
+}
+
+
+@ @c
void show_pdf_literal(pointer p)
{
tprint_esc("pdfliteral");
diff --git a/Build/source/texk/web2c/luatexdir/lua/luastuff.w b/Build/source/texk/web2c/luatexdir/lua/luastuff.w
index e9942881baf..b8df4a79cb4 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luastuff.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luastuff.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: luastuff.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: luastuff.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/luastuff.w $";
#include "ptexlib.h"
@@ -367,7 +367,7 @@ void unhide_lua_value(lua_State * L, const char *name, const char *item, int r)
@ @c
int lua_traceback(lua_State * L)
-{
+{
lua_getglobal(L, "debug");
if (!lua_istable(L, -1)) {
lua_pop(L, 1);
@@ -398,16 +398,30 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
}
lua_active++;
if (is_string) {
- const char *ss = NULL;
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
- ss = lua_tolstring(Luas, -1, &ll);
- s = xmalloc(ll+1);
- memcpy(s,ss,ll+1);
- lua_pop(Luas,1);
+ const char *ss = NULL;
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
+ if (lua_isfunction(Luas,-1)) {
+ int base = lua_gettop(Luas); /* function index */
+ lua_checkstack(Luas, 1);
+ lua_pushcfunction(Luas, lua_traceback); /* push traceback function */
+ lua_insert(Luas, base); /* put it under chunk */
+ i = lua_pcall(Luas, 0, 0, base);
+ lua_remove(Luas, base); /* remove traceback function */
+ if (i != 0) {
+ lua_gc(Luas, LUA_GCCOLLECT, 0);
+ Luas = luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1));
+ }
+ lua_active--;
+ return ;
+ }
+ ss = lua_tolstring(Luas, -1, &ll);
+ s = xmalloc(ll+1);
+ memcpy(s,ss,ll+1);
+ lua_pop(Luas,1);
} else {
- int l = 0;
- s = tokenlist_to_cstring(p, 1, &l);
- ll = (size_t)l;
+ int l = 0;
+ s = tokenlist_to_cstring(p, 1, &l);
+ ll = (size_t)l;
}
ls.s = s;
ls.size = ll;
@@ -421,12 +435,11 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id, NULL);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]", NULL);
}
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]", NULL);
}
if (i != 0) {
Luas = luatex_error(Luas, (i == LUA_ERRSYNTAX ? 0 : 1));
@@ -447,6 +460,8 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
lua_active--;
}
+
+
@ @c
void late_lua(PDF pdf, halfword p)
{
@@ -477,17 +492,16 @@ void luatokencall(int p, int nameptr) /* hh-ls: optimized lua_id resolving */
if (nameptr > 0) {
lua_id = tokenlist_to_cstring(nameptr, 1, &l);
i = lua_load(Luas, getS, &ls, lua_id, NULL);
- xfree(lua_id);
+ xfree(lua_id);
} else if (nameptr < 0) {
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id, NULL);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]", NULL);
}
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]", NULL);
}
xfree(s);
if (i != 0) {
@@ -518,6 +532,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
luaerr.s = lua_tolstring(L, -1, &luaerr.l);
err = (char *) xmalloc((unsigned) (luaerr.l + 1));
snprintf(err, (luaerr.l + 1), "%s", luaerr.s);
+ last_lua_error = err;
}
if (is_fatal > 0) {
/* Normally a memory error from lua.
@@ -530,7 +545,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
return (lua_State *) NULL;
} else {
lua_norm_error(err);
- xfree(err);
+ /* last_lua_error = err so no need to xfree(err) */
return L;
}
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
index 3fe463d8068..77792e94b4d 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
+++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: luatex-api.h 4877 2014-03-14 01:26:05Z luigi $ */
+/* $Id: luatex-api.h 4956 2014-03-28 12:12:17Z luigi $ */
#ifndef LUATEX_API_H
# define LUATEX_API_H 1
@@ -137,9 +137,9 @@ extern char *jithash_hashname ;
#ifdef LuajitTeX
#define LUAJITTEX_HASHCHARS 6 /* todo: It must be like that one on lj_str.c */
-#else
+#else
#define LUATEX_HASHCHARS 6 /* todo: It must be LUAI_HASHLIMIT! */
-#endif
+#endif
extern unsigned char show_luahashchars ;
extern void unhide_lua_table(lua_State * lua, const char *name, int r);
@@ -169,6 +169,9 @@ extern int saved_callback_count;
extern const char *ptexbanner;
+extern const char *last_lua_error;
+
+
/* luastuff.h */
typedef struct {
@@ -210,6 +213,7 @@ extern int lua_traceback(lua_State * L);
extern int luainit;
+
extern char *luanames[];
extern int ff_get_ttc_index(char *ffname, char *psname); /* luafontloader/src/luafflib.c */
@@ -241,14 +245,14 @@ extern char **environ;
luaS_##a##_index = luaL_ref (Luas,LUA_REGISTRYINDEX); \
} while (0)
- /*#define init_luaS_index_s(a,b) do { */
+ /*#define init_luaS_index_s(a,b) do { */
#define init_lua_key_alias(a,b) do { \
lua_pushliteral(Luas,b); \
luaS_##a##_ptr = lua_tostring(Luas,-1); \
luaS_##a##_index = luaL_ref (Luas,LUA_REGISTRYINDEX); \
} while (0)
- /*#define make_luaS_index(a) */
+ /*#define make_luaS_index(a) */
#define make_lua_key(a) \
int luaS_##a##_index = 0; \
const char * luaS_##a##_ptr = NULL
@@ -262,26 +266,747 @@ extern char **environ;
#define lua_key(a) luaS_##a##_ptr
#define use_lua_key(a) \
extern int luaS_##a##_index ; \
- extern const char * luaS_##a##_ptr
+ extern const char * luaS_##a##_ptr
#define lua_key_rawgeti(a) \
lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_##a##_index);\
lua_rawget(L, -2)
+#define lua_key_rawgeti_n(a,n) \
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_##a##_index);\
+ lua_rawget(L, -1+n)
#define lua_roundnumber(a,b) (int)floor((double)lua_tonumber(L,-1)+0.5)
extern int lua_numeric_field_by_index(lua_State *, int , int);
-
+
+
+
+/* Currently we sometimes use numbers and sometimes strings in node properties. We can
+make that consistent by having a check on number and if not then assign a string. The
+strings are prehashed and we make a bunch of lua tables that have these values. We can
+preassign these at startup time. */
+
+/* no need for L state argument */
+
+#define PACK_TYPE_SIZE 4
+#define GROUP_CODE_SIZE 23
+#define MATH_STYLE_NAME_SIZE 8
+#define DIR_PAR_SIZE 128
+#define DIR_TEXT_SIZE 128
+
+extern int l_pack_type_index [PACK_TYPE_SIZE] ;
+extern int l_group_code_index [GROUP_CODE_SIZE];
+extern int l_math_style_name_index [MATH_STYLE_NAME_SIZE];
+extern int l_dir_par_index [DIR_PAR_SIZE];
+extern int l_dir_text_index [DIR_TEXT_SIZE];
+
+#define lua_push_pack_type(L,pack_type) lua_rawgeti(L, LUA_REGISTRYINDEX, l_pack_type_index [pack_type] );
+#define lua_push_group_code(L,group_code) lua_rawgeti(L, LUA_REGISTRYINDEX, l_group_code_index [group_code]);
+#define lua_push_math_style_name(L,style_name) lua_rawgeti(L, LUA_REGISTRYINDEX, l_math_style_name_index[style_name]);
+#define lua_push_dir_par(L,dir) lua_rawgeti(L, LUA_REGISTRYINDEX, l_dir_par_index[dir+64])
+#define lua_push_dir_text(L,dir) lua_rawgeti(L, LUA_REGISTRYINDEX, l_dir_text_index[dir+64])
+
+
+#define lua_push_string_by_index(L,index) lua_rawgeti(L, LUA_REGISTRYINDEX, index)
+#define lua_push_string_by_name(L,index) lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(index))
+
+
+#define set_pack_type_index \
+l_pack_type_index[0] = lua_key_index(exactly); \
+l_pack_type_index[1] = lua_key_index(additional); \
+l_pack_type_index[2] = lua_key_index(cal_expand_ratio);\
+l_pack_type_index[3] = lua_key_index(subst_ex_font);
+
+#define set_l_group_code_index \
+l_group_code_index[0] = lua_key_index(empty_string);\
+l_group_code_index[1] = lua_key_index(simple);\
+l_group_code_index[2] = lua_key_index(hbox);\
+l_group_code_index[3] = lua_key_index(adjusted_hbox);\
+l_group_code_index[4] = lua_key_index(vbox);\
+l_group_code_index[5] = lua_key_index(vtop);\
+l_group_code_index[6] = lua_key_index(align);\
+l_group_code_index[7] = lua_key_index(no_align);\
+l_group_code_index[8] = lua_key_index(output);\
+l_group_code_index[9] = lua_key_index(math);\
+l_group_code_index[10] = lua_key_index(disc);\
+l_group_code_index[11] = lua_key_index(insert);\
+l_group_code_index[12] = lua_key_index(vcenter);\
+l_group_code_index[13] = lua_key_index(math_choice);\
+l_group_code_index[14] = lua_key_index(semi_simple);\
+l_group_code_index[15] = lua_key_index(math_shift);\
+l_group_code_index[16] = lua_key_index(math_left);\
+l_group_code_index[17] = lua_key_index(local_box);\
+l_group_code_index[18] = lua_key_index(split_off);\
+l_group_code_index[19] = lua_key_index(split_keep);\
+l_group_code_index[20] = lua_key_index(preamble);\
+l_group_code_index[21] = lua_key_index(align_set);\
+l_group_code_index[22] = lua_key_index(fin_row)
+
+#define set_l_math_style_name_index \
+l_math_style_name_index[0] = lua_key_index(display);\
+l_math_style_name_index[1] = lua_key_index(crampeddisplay);\
+l_math_style_name_index[2] = lua_key_index(text);\
+l_math_style_name_index[3] = lua_key_index(crampedtext);\
+l_math_style_name_index[4] = lua_key_index(script);\
+l_math_style_name_index[5] = lua_key_index(crampedscript);\
+l_math_style_name_index[6] = lua_key_index(scriptscript);\
+l_math_style_name_index[7] = lua_key_index(crampedscriptscript)
+
+#define set_l_dir_par_index \
+l_dir_par_index[0] = lua_key_index(TLT);\
+l_dir_par_index[4] = lua_key_index(TRT);\
+l_dir_par_index[9] = lua_key_index(LTL);\
+l_dir_par_index[24] = lua_key_index(RTT);\
+l_dir_par_index[64] = lua_key_index(TLT);\
+l_dir_par_index[68] = lua_key_index(TRT);\
+l_dir_par_index[73] = lua_key_index(LTL);\
+l_dir_par_index[88] = lua_key_index(RTT);\
+
+#define set_l_dir_text_index \
+l_dir_text_index[0] = lua_key_index(mTLT);\
+l_dir_text_index[4] = lua_key_index(mTRT);\
+l_dir_text_index[9] = lua_key_index(mLTL);\
+l_dir_text_index[24] = lua_key_index(mRTT);\
+l_dir_text_index[64] = lua_key_index(pTLT);\
+l_dir_text_index[68] = lua_key_index(pTRT);\
+l_dir_text_index[73] = lua_key_index(pLTL);\
+l_dir_text_index[88] = lua_key_index(pRTT);\
+
+
+#define set_make_keys \
+make_lua_key(LTL);\
+make_lua_key(MathConstants);\
+make_lua_key(RTT);\
+make_lua_key(TLT);\
+make_lua_key(TRT);\
+make_lua_key(accent);\
+make_lua_key(action);\
+make_lua_key(action_id);\
+make_lua_key(action_type);\
+make_lua_key(additional);\
+make_lua_key(adjust);\
+make_lua_key(adjust_head);\
+make_lua_key(adjusted_hbox);\
+make_lua_key(advance);\
+make_lua_key(after_display);\
+make_lua_key(after_output);\
+make_lua_key(aleph);\
+make_lua_key(align);\
+make_lua_key(align_head);\
+make_lua_key(align_set);\
+make_lua_key(alignment);\
+make_lua_key(annot);\
+make_lua_key(area);\
+make_lua_key(attr);\
+make_lua_key(attributes);\
+make_lua_key(auto_expand);\
+make_lua_key(before_display);\
+make_lua_key(best_ins_ptr);\
+make_lua_key(best_page_break);\
+make_lua_key(best_size);\
+make_lua_key(bot);\
+make_lua_key(bot_accent);\
+make_lua_key(bottom_left);\
+make_lua_key(bottom_right);\
+make_lua_key(box);\
+make_lua_key(box_left);\
+make_lua_key(box_left_width);\
+make_lua_key(box_right);\
+make_lua_key(box_right_width);\
+make_lua_key(broken_ins);\
+make_lua_key(broken_ptr);\
+make_lua_key(cache);\
+make_lua_key(cal_expand_ratio);\
+make_lua_key(catalog);\
+make_lua_key(char);\
+make_lua_key(characters);\
+make_lua_key(checksum);\
+make_lua_key(cidinfo);\
+make_lua_key(class);\
+make_lua_key(command);\
+make_lua_key(commands);\
+make_lua_key(comment);\
+make_lua_key(components);\
+make_lua_key(compresslevel);\
+make_lua_key(contrib_head);\
+make_lua_key(core);\
+make_lua_key(cost);\
+make_lua_key(count);\
+make_lua_key(crampeddisplay);\
+make_lua_key(crampedscript);\
+make_lua_key(crampedscriptscript);\
+make_lua_key(crampedtext);\
+make_lua_key(data);\
+make_lua_key(degree);\
+make_lua_key(delim);\
+make_lua_key(delimptr);\
+make_lua_key(denom);\
+make_lua_key(depth);\
+make_lua_key(designsize);\
+make_lua_key(dest_id);\
+make_lua_key(dest_type);\
+make_lua_key(dir);\
+make_lua_key(dir_h);\
+make_lua_key(direct);\
+make_lua_key(direction);\
+make_lua_key(dirs);\
+make_lua_key(disc);\
+make_lua_key(display);\
+make_lua_key(down);\
+make_lua_key(dvi_ptr);\
+make_lua_key(embedding);\
+make_lua_key(empty_string);\
+make_lua_key(encodingbytes);\
+make_lua_key(encodingname);\
+make_lua_key(end);\
+make_lua_key(etex);\
+make_lua_key(exactly);\
+make_lua_key(expansion_factor);\
+make_lua_key(ext);\
+make_lua_key(extend);\
+make_lua_key(extender);\
+make_lua_key(extensible);\
+make_lua_key(extra_space);\
+make_lua_key(fam);\
+make_lua_key(fast);\
+make_lua_key(file);\
+make_lua_key(filename);\
+make_lua_key(fin_row);\
+make_lua_key(font);\
+make_lua_key(fonts);\
+make_lua_key(format);\
+make_lua_key(fullname);\
+make_lua_key(global);\
+make_lua_key(glue_order);\
+make_lua_key(glue_set);\
+make_lua_key(glue_sign);\
+make_lua_key(glyph);\
+make_lua_key(h);\
+make_lua_key(hbox);\
+make_lua_key(head);\
+make_lua_key(height);\
+make_lua_key(hmode_par);\
+make_lua_key(hold_head);\
+make_lua_key(horiz_variants);\
+make_lua_key(hyphenchar);\
+make_lua_key(id);\
+make_lua_key(image);\
+make_lua_key(immediate);\
+make_lua_key(index);\
+make_lua_key(info);\
+make_lua_key(insert);\
+make_lua_key(italic);\
+make_lua_key(kern);\
+make_lua_key(kerns);\
+make_lua_key(lang);\
+make_lua_key(large_char);\
+make_lua_key(large_fam);\
+make_lua_key(last_ins_ptr);\
+make_lua_key(leader);\
+make_lua_key(least_page_cost);\
+make_lua_key(left);\
+make_lua_key(left_boundary);\
+make_lua_key(left_protruding);\
+make_lua_key(level);\
+make_lua_key(ligatures);\
+make_lua_key(link_attr);\
+make_lua_key(list);\
+make_lua_key(local_box);\
+make_lua_key(log);\
+make_lua_key(lua);\
+make_lua_key(lua_functions);\
+make_lua_key(luatex);\
+make_lua_key(luatex_node);\
+make_lua_key(mLTL);\
+make_lua_key(mRTT);\
+make_lua_key(mTLT);\
+make_lua_key(mTRT);\
+make_lua_key(mark);\
+make_lua_key(math);\
+make_lua_key(math_choice);\
+make_lua_key(math_left);\
+make_lua_key(math_shift);\
+make_lua_key(mathdir);\
+make_lua_key(mathkern);\
+make_lua_key(mathstyle);\
+make_lua_key(mid);\
+make_lua_key(mode);\
+make_lua_key(modeline);\
+make_lua_key(name);\
+make_lua_key(named_id);\
+make_lua_key(names);\
+make_lua_key(new_graf);\
+make_lua_key(new_window);\
+make_lua_key(next);\
+make_lua_key(no);\
+make_lua_key(no_align);\
+make_lua_key(noad);\
+make_lua_key(node);\
+make_lua_key(node_properties);\
+make_lua_key(node_properties_indirect);\
+make_lua_key(nomath);\
+make_lua_key(nop);\
+make_lua_key(nucleus);\
+make_lua_key(num);\
+make_lua_key(number);\
+make_lua_key(objcompression);\
+make_lua_key(objnum);\
+make_lua_key(omega);\
+make_lua_key(ordering);\
+make_lua_key(output);\
+make_lua_key(pLTL);\
+make_lua_key(pRTT);\
+make_lua_key(pTLT);\
+make_lua_key(pTRT);\
+make_lua_key(page);\
+make_lua_key(page_head);\
+make_lua_key(page_ins_head);\
+make_lua_key(pageattributes);\
+make_lua_key(pageresources);\
+make_lua_key(pagesattributes);\
+make_lua_key(parameters);\
+make_lua_key(pdf_data);\
+make_lua_key(pdftex);\
+make_lua_key(pen_broken);\
+make_lua_key(pen_inter);\
+make_lua_key(penalty);\
+make_lua_key(pop);\
+make_lua_key(post);\
+make_lua_key(pre);\
+make_lua_key(pre_adjust);\
+make_lua_key(pre_adjust_head);\
+make_lua_key(pre_align);\
+make_lua_key(pre_box);\
+make_lua_key(preamble);\
+make_lua_key(prev);\
+make_lua_key(prevdepth);\
+make_lua_key(prevgraf);\
+make_lua_key(psname);\
+make_lua_key(ptr);\
+make_lua_key(push);\
+make_lua_key(quad);\
+make_lua_key(raw);\
+make_lua_key(ref_count);\
+make_lua_key(reg);\
+make_lua_key(registry);\
+make_lua_key(renew);\
+make_lua_key(rep);\
+make_lua_key(replace);\
+make_lua_key(right);\
+make_lua_key(right_boundary);\
+make_lua_key(right_protruding);\
+make_lua_key(rule);\
+make_lua_key(scale);\
+make_lua_key(script);\
+make_lua_key(scriptscript);\
+make_lua_key(semi_simple);\
+make_lua_key(shift);\
+make_lua_key(shrink);\
+make_lua_key(shrink_order);\
+make_lua_key(simple);\
+make_lua_key(size);\
+make_lua_key(skewchar);\
+make_lua_key(slant);\
+make_lua_key(slot);\
+make_lua_key(small_char);\
+make_lua_key(small_fam);\
+make_lua_key(space);\
+make_lua_key(space_shrink);\
+make_lua_key(space_stretch);\
+make_lua_key(spacefactor);\
+make_lua_key(spec);\
+make_lua_key(special);\
+make_lua_key(split_keep);\
+make_lua_key(split_off);\
+make_lua_key(stack);\
+make_lua_key(start);\
+make_lua_key(step);\
+make_lua_key(stream);\
+make_lua_key(streamfile);\
+make_lua_key(stretch);\
+make_lua_key(stretch_order);\
+make_lua_key(string);\
+make_lua_key(style);\
+make_lua_key(sub);\
+make_lua_key(subst_ex_font);\
+make_lua_key(subtype);\
+make_lua_key(sup);\
+make_lua_key(supplement);\
+make_lua_key(surround);\
+make_lua_key(tail);\
+make_lua_key(temp_head);\
+make_lua_key(term);\
+make_lua_key(term_and_log);\
+make_lua_key(tex);\
+make_lua_key(text);\
+make_lua_key(thread_attr);\
+make_lua_key(thread_id);\
+make_lua_key(top);\
+make_lua_key(top_accent);\
+make_lua_key(top_left);\
+make_lua_key(top_right);\
+make_lua_key(tounicode);\
+make_lua_key(trailer);\
+make_lua_key(transform);\
+make_lua_key(type);\
+make_lua_key(uchyph);\
+make_lua_key(umath);\
+make_lua_key(units_per_em);\
+make_lua_key(used);\
+make_lua_key(user_id);\
+make_lua_key(v);\
+make_lua_key(value);\
+make_lua_key(vbox);\
+make_lua_key(vcenter);\
+make_lua_key(version);\
+make_lua_key(vert_variants);\
+make_lua_key(vmode_par);\
+make_lua_key(vtop);\
+make_lua_key(width);\
+make_lua_key(writable);\
+make_lua_key(x_height);\
+make_lua_key(xoffset);\
+make_lua_key(xyz_zoom);\
+make_lua_key(yoffset)
+
+
+ #define set_init_keys \
+init_lua_key(LTL);\
+init_lua_key(MathConstants);\
+init_lua_key(RTT);\
+init_lua_key(TLT);\
+init_lua_key(TRT);\
+init_lua_key(accent);\
+init_lua_key(action);\
+init_lua_key(action_id);\
+init_lua_key(action_type);\
+init_lua_key(additional);\
+init_lua_key(adjust);\
+init_lua_key(adjust_head);\
+init_lua_key(adjusted_hbox);\
+init_lua_key(advance);\
+init_lua_key(after_display);\
+init_lua_key(after_output);\
+init_lua_key(aleph);\
+init_lua_key(align);\
+init_lua_key(align_head);\
+init_lua_key(align_set);\
+init_lua_key(alignment);\
+init_lua_key(annot);\
+init_lua_key(area);\
+init_lua_key(attr);\
+init_lua_key(attributes);\
+init_lua_key(auto_expand);\
+init_lua_key(before_display);\
+init_lua_key(best_ins_ptr);\
+init_lua_key(best_page_break);\
+init_lua_key(best_size);\
+init_lua_key(bot);\
+init_lua_key(bot_accent);\
+init_lua_key(bottom_left);\
+init_lua_key(bottom_right);\
+init_lua_key(box);\
+init_lua_key(box_left);\
+init_lua_key(box_left_width);\
+init_lua_key(box_right);\
+init_lua_key(box_right_width);\
+init_lua_key(broken_ins);\
+init_lua_key(broken_ptr);\
+init_lua_key(cache);\
+init_lua_key(cal_expand_ratio);\
+init_lua_key(catalog);\
+init_lua_key(char);\
+init_lua_key(characters);\
+init_lua_key(checksum);\
+init_lua_key(cidinfo);\
+init_lua_key(class);\
+init_lua_key(command);\
+init_lua_key(commands);\
+init_lua_key(comment);\
+init_lua_key(components);\
+init_lua_key(compresslevel);\
+init_lua_key(contrib_head);\
+init_lua_key(core);\
+init_lua_key(cost);\
+init_lua_key(count);\
+init_lua_key(crampeddisplay);\
+init_lua_key(crampedscript);\
+init_lua_key(crampedscriptscript);\
+init_lua_key(crampedtext);\
+init_lua_key(data);\
+init_lua_key(degree);\
+init_lua_key(delim);\
+init_lua_key(delimptr);\
+init_lua_key(denom);\
+init_lua_key(depth);\
+init_lua_key(designsize);\
+init_lua_key(dest_id);\
+init_lua_key(dest_type);\
+init_lua_key(dir);\
+init_lua_key(dir_h);\
+init_lua_key(direct);\
+init_lua_key(direction);\
+init_lua_key(dirs);\
+init_lua_key(disc);\
+init_lua_key(display);\
+init_lua_key(down);\
+init_lua_key(dvi_ptr);\
+init_lua_key(embedding);\
+init_lua_key(encodingbytes);\
+init_lua_key(encodingname);\
+init_lua_key(end);\
+init_lua_key(etex);\
+init_lua_key(exactly);\
+init_lua_key(expansion_factor);\
+init_lua_key(ext);\
+init_lua_key(extend);\
+init_lua_key(extender);\
+init_lua_key(extensible);\
+init_lua_key(extra_space);\
+init_lua_key(fam);\
+init_lua_key(fast);\
+init_lua_key(file);\
+init_lua_key(filename);\
+init_lua_key(fin_row);\
+init_lua_key(font);\
+init_lua_key(fonts);\
+init_lua_key(format);\
+init_lua_key(fullname);\
+init_lua_key(global);\
+init_lua_key(glue_order);\
+init_lua_key(glue_set);\
+init_lua_key(glue_sign);\
+init_lua_key(glyph);\
+init_lua_key(h);\
+init_lua_key(hbox);\
+init_lua_key(head);\
+init_lua_key(height);\
+init_lua_key(hmode_par);\
+init_lua_key(hold_head);\
+init_lua_key(horiz_variants);\
+init_lua_key(hyphenchar);\
+init_lua_key(id);\
+init_lua_key(image);\
+init_lua_key(immediate);\
+init_lua_key(index);\
+init_lua_key(info);\
+init_lua_key(insert);\
+init_lua_key(italic);\
+init_lua_key(kern);\
+init_lua_key(kerns);\
+init_lua_key(lang);\
+init_lua_key(large_char);\
+init_lua_key(large_fam);\
+init_lua_key(last_ins_ptr);\
+init_lua_key(leader);\
+init_lua_key(least_page_cost);\
+init_lua_key(left);\
+init_lua_key(left_boundary);\
+init_lua_key(left_protruding);\
+init_lua_key(level);\
+init_lua_key(ligatures);\
+init_lua_key(link_attr);\
+init_lua_key(list);\
+init_lua_key(local_box);\
+init_lua_key(log);\
+init_lua_key(lua);\
+init_lua_key(luatex);\
+init_lua_key(mark);\
+init_lua_key(math);\
+init_lua_key(math_choice);\
+init_lua_key(math_left);\
+init_lua_key(math_shift);\
+init_lua_key(mathdir);\
+init_lua_key(mathkern);\
+init_lua_key(mathstyle);\
+init_lua_key(mid);\
+init_lua_key(mode);\
+init_lua_key(modeline);\
+init_lua_key(name);\
+init_lua_key(named_id);\
+init_lua_key(names);\
+init_lua_key(new_graf);\
+init_lua_key(new_window);\
+init_lua_key(next);\
+init_lua_key(no);\
+init_lua_key(no_align);\
+init_lua_key(noad);\
+init_lua_key(node);\
+init_lua_key(nomath);\
+init_lua_key(nop);\
+init_lua_key(nucleus);\
+init_lua_key(num);\
+init_lua_key(number);\
+init_lua_key(objcompression);\
+init_lua_key(objnum);\
+init_lua_key(omega);\
+init_lua_key(ordering);\
+init_lua_key(output);\
+init_lua_key(page);\
+init_lua_key(page_head);\
+init_lua_key(page_ins_head);\
+init_lua_key(pageattributes);\
+init_lua_key(pageresources);\
+init_lua_key(pagesattributes);\
+init_lua_key(parameters);\
+init_lua_key(pdftex);\
+init_lua_key(pen_broken);\
+init_lua_key(pen_inter);\
+init_lua_key(penalty);\
+init_lua_key(pop);\
+init_lua_key(post);\
+init_lua_key(pre);\
+init_lua_key(pre_adjust);\
+init_lua_key(pre_adjust_head);\
+init_lua_key(pre_align);\
+init_lua_key(pre_box);\
+init_lua_key(preamble);\
+init_lua_key(prev);\
+init_lua_key(prevdepth);\
+init_lua_key(prevgraf);\
+init_lua_key(psname);\
+init_lua_key(ptr);\
+init_lua_key(push);\
+init_lua_key(quad);\
+init_lua_key(raw);\
+init_lua_key(ref_count);\
+init_lua_key(reg);\
+init_lua_key(registry);\
+init_lua_key(renew);\
+init_lua_key(rep);\
+init_lua_key(replace);\
+init_lua_key(right);\
+init_lua_key(right_boundary);\
+init_lua_key(right_protruding);\
+init_lua_key(rule);\
+init_lua_key(scale);\
+init_lua_key(script);\
+init_lua_key(scriptscript);\
+init_lua_key(semi_simple);\
+init_lua_key(shift);\
+init_lua_key(shrink);\
+init_lua_key(shrink_order);\
+init_lua_key(simple);\
+init_lua_key(size);\
+init_lua_key(skewchar);\
+init_lua_key(slant);\
+init_lua_key(slot);\
+init_lua_key(small_char);\
+init_lua_key(small_fam);\
+init_lua_key(space);\
+init_lua_key(space_shrink);\
+init_lua_key(space_stretch);\
+init_lua_key(spacefactor);\
+init_lua_key(spec);\
+init_lua_key(special);\
+init_lua_key(split_keep);\
+init_lua_key(split_off);\
+init_lua_key(stack);\
+init_lua_key(start);\
+init_lua_key(step);\
+init_lua_key(stream);\
+init_lua_key(streamfile);\
+init_lua_key(stretch);\
+init_lua_key(stretch_order);\
+init_lua_key(string);\
+init_lua_key(style);\
+init_lua_key(sub);\
+init_lua_key(subst_ex_font);\
+init_lua_key(subtype);\
+init_lua_key(sup);\
+init_lua_key(supplement);\
+init_lua_key(surround);\
+init_lua_key(tail);\
+init_lua_key(temp_head);\
+init_lua_key(term);\
+init_lua_key(tex);\
+init_lua_key(text);\
+init_lua_key(thread_attr);\
+init_lua_key(thread_id);\
+init_lua_key(top);\
+init_lua_key(top_accent);\
+init_lua_key(top_left);\
+init_lua_key(top_right);\
+init_lua_key(tounicode);\
+init_lua_key(trailer);\
+init_lua_key(transform);\
+init_lua_key(type);\
+init_lua_key(uchyph);\
+init_lua_key(umath);\
+init_lua_key(units_per_em);\
+init_lua_key(used);\
+init_lua_key(user_id);\
+init_lua_key(v);\
+init_lua_key(value);\
+init_lua_key(vbox);\
+init_lua_key(vcenter);\
+init_lua_key(version);\
+init_lua_key(vert_variants);\
+init_lua_key(vmode_par);\
+init_lua_key(vtop);\
+init_lua_key(width);\
+init_lua_key(writable);\
+init_lua_key(x_height);\
+init_lua_key(xoffset);\
+init_lua_key(xyz_zoom);\
+init_lua_key(yoffset);\
+init_lua_key_alias(empty_string,"");\
+init_lua_key_alias(lua_functions,"lua.functions");\
+init_lua_key_alias(luatex_node, "luatex.node");\
+init_lua_key_alias(mLTL,"-LTL");\
+init_lua_key_alias(mRTT,"-RTT");\
+init_lua_key_alias(mTLT,"-TLT");\
+init_lua_key_alias(mTRT,"-TRT");\
+init_lua_key_alias(node_properties,"node.properties");\
+init_lua_key_alias(node_properties_indirect,"node.properties.indirect");\
+init_lua_key_alias(pLTL,"+LTL");\
+init_lua_key_alias(pRTT,"+RTT");\
+init_lua_key_alias(pTLT,"+TLT");\
+init_lua_key_alias(pTRT,"+TRT");\
+init_lua_key_alias(pdf_data,"pdf.data");\
+init_lua_key_alias(term_and_log,"term and log")
+
+
+#define assign_math_style(L,n,target) do { \
+ if (lua_isnumber(L,n)) { \
+ /* new, often same as subtype anyway */ \
+ target = lua_tonumber(L,n); \
+ } else if (lua_isstring(L,n)) { \
+ const char *s = lua_tostring(L, n); \
+ if (lua_key_eq(s,display)) { \
+ target = 0; \
+ } else if (lua_key_eq(s,crampeddisplay)) { \
+ target = 1; \
+ } else if (lua_key_eq(s,text)) { \
+ target = 2; \
+ } else if (lua_key_eq(s,crampedtext)) { \
+ target = 3; \
+ } else if (lua_key_eq(s,script)) { \
+ target = 4; \
+ } else if (lua_key_eq(s,crampedscript)) { \
+ target = 5; \
+ } else if (lua_key_eq(s,scriptscript)) { \
+ target = 6; \
+ } else if (lua_key_eq(s,crampedscriptscript)) { \
+ target = 7; \
+ } else { \
+ target = 2; \
+ } \
+ } else { \
+ target = 2; /* text by default */ \
+ } \
+} while(0)
+
#endif /* LUATEX_API_H */
-/* */
+/* */
/* These keys have to available to different files */
-/* */
+/* */
use_lua_key(LTL);
@@ -294,14 +1019,23 @@ use_lua_key(action);
use_lua_key(action_id);
use_lua_key(action_type);
use_lua_key(additional);
+use_lua_key(adjust);
use_lua_key(adjust_head);
+use_lua_key(adjusted_hbox);
use_lua_key(advance);
+use_lua_key(after_display);
+use_lua_key(after_output);
use_lua_key(aleph);
+use_lua_key(align);
use_lua_key(align_head);
+use_lua_key(align_set);
+use_lua_key(alignment);
+use_lua_key(annot);
use_lua_key(area);
use_lua_key(attr);
use_lua_key(attributes);
use_lua_key(auto_expand);
+use_lua_key(before_display);
use_lua_key(best_ins_ptr);
use_lua_key(best_page_break);
use_lua_key(best_size);
@@ -309,6 +1043,7 @@ use_lua_key(bot);
use_lua_key(bot_accent);
use_lua_key(bottom_left);
use_lua_key(bottom_right);
+use_lua_key(box);
use_lua_key(box_left);
use_lua_key(box_left_width);
use_lua_key(box_right);
@@ -317,6 +1052,7 @@ use_lua_key(broken_ins);
use_lua_key(broken_ptr);
use_lua_key(cache);
use_lua_key(cal_expand_ratio);
+use_lua_key(catalog);
use_lua_key(char);
use_lua_key(characters);
use_lua_key(checksum);
@@ -326,10 +1062,15 @@ use_lua_key(command);
use_lua_key(commands);
use_lua_key(comment);
use_lua_key(components);
+use_lua_key(compresslevel);
use_lua_key(contrib_head);
use_lua_key(core);
use_lua_key(cost);
use_lua_key(count);
+use_lua_key(crampeddisplay);
+use_lua_key(crampedscript);
+use_lua_key(crampedscriptscript);
+use_lua_key(crampedtext);
use_lua_key(data);
use_lua_key(degree);
use_lua_key(delim);
@@ -341,12 +1082,15 @@ use_lua_key(dest_id);
use_lua_key(dest_type);
use_lua_key(dir);
use_lua_key(dir_h);
+use_lua_key(direct);
use_lua_key(direction);
use_lua_key(dirs);
+use_lua_key(disc);
use_lua_key(display);
use_lua_key(down);
use_lua_key(dvi_ptr);
use_lua_key(embedding);
+use_lua_key(empty_string);
use_lua_key(encodingbytes);
use_lua_key(encodingname);
use_lua_key(end);
@@ -362,6 +1106,7 @@ use_lua_key(fam);
use_lua_key(fast);
use_lua_key(file);
use_lua_key(filename);
+use_lua_key(fin_row);
use_lua_key(font);
use_lua_key(fonts);
use_lua_key(format);
@@ -371,14 +1116,20 @@ use_lua_key(glue_order);
use_lua_key(glue_set);
use_lua_key(glue_sign);
use_lua_key(glyph);
+use_lua_key(h);
+use_lua_key(hbox);
use_lua_key(head);
use_lua_key(height);
+use_lua_key(hmode_par);
use_lua_key(hold_head);
use_lua_key(horiz_variants);
use_lua_key(hyphenchar);
use_lua_key(id);
use_lua_key(image);
+use_lua_key(immediate);
use_lua_key(index);
+use_lua_key(info);
+use_lua_key(insert);
use_lua_key(italic);
use_lua_key(kern);
use_lua_key(kerns);
@@ -395,8 +1146,10 @@ use_lua_key(level);
use_lua_key(ligatures);
use_lua_key(link_attr);
use_lua_key(list);
+use_lua_key(local_box);
use_lua_key(log);
use_lua_key(lua);
+use_lua_key(lua_functions);
use_lua_key(luatex);
use_lua_key(luatex_node);
use_lua_key(mLTL);
@@ -404,6 +1157,10 @@ use_lua_key(mRTT);
use_lua_key(mTLT);
use_lua_key(mTRT);
use_lua_key(mark);
+use_lua_key(math);
+use_lua_key(math_choice);
+use_lua_key(math_left);
+use_lua_key(math_shift);
use_lua_key(mathdir);
use_lua_key(mathkern);
use_lua_key(mathstyle);
@@ -412,9 +1169,12 @@ use_lua_key(mode);
use_lua_key(modeline);
use_lua_key(name);
use_lua_key(named_id);
+use_lua_key(names);
+use_lua_key(new_graf);
use_lua_key(new_window);
use_lua_key(next);
use_lua_key(no);
+use_lua_key(no_align);
use_lua_key(noad);
use_lua_key(node);
use_lua_key(node_properties);
@@ -424,16 +1184,23 @@ use_lua_key(nop);
use_lua_key(nucleus);
use_lua_key(num);
use_lua_key(number);
+use_lua_key(objcompression);
use_lua_key(objnum);
use_lua_key(omega);
use_lua_key(ordering);
+use_lua_key(output);
use_lua_key(pLTL);
use_lua_key(pRTT);
use_lua_key(pTLT);
use_lua_key(pTRT);
+use_lua_key(page);
use_lua_key(page_head);
use_lua_key(page_ins_head);
+use_lua_key(pageattributes);
+use_lua_key(pageresources);
+use_lua_key(pagesattributes);
use_lua_key(parameters);
+use_lua_key(pdf_data);
use_lua_key(pdftex);
use_lua_key(pen_broken);
use_lua_key(pen_inter);
@@ -441,7 +1208,11 @@ use_lua_key(penalty);
use_lua_key(pop);
use_lua_key(post);
use_lua_key(pre);
+use_lua_key(pre_adjust);
use_lua_key(pre_adjust_head);
+use_lua_key(pre_align);
+use_lua_key(pre_box);
+use_lua_key(preamble);
use_lua_key(prev);
use_lua_key(prevdepth);
use_lua_key(prevgraf);
@@ -449,6 +1220,7 @@ use_lua_key(psname);
use_lua_key(ptr);
use_lua_key(push);
use_lua_key(quad);
+use_lua_key(raw);
use_lua_key(ref_count);
use_lua_key(reg);
use_lua_key(registry);
@@ -462,9 +1234,11 @@ use_lua_key(rule);
use_lua_key(scale);
use_lua_key(script);
use_lua_key(scriptscript);
+use_lua_key(semi_simple);
use_lua_key(shift);
use_lua_key(shrink);
use_lua_key(shrink_order);
+use_lua_key(simple);
use_lua_key(size);
use_lua_key(skewchar);
use_lua_key(slant);
@@ -477,10 +1251,13 @@ use_lua_key(space_stretch);
use_lua_key(spacefactor);
use_lua_key(spec);
use_lua_key(special);
+use_lua_key(split_keep);
+use_lua_key(split_off);
use_lua_key(stack);
use_lua_key(start);
use_lua_key(step);
use_lua_key(stream);
+use_lua_key(streamfile);
use_lua_key(stretch);
use_lua_key(stretch_order);
use_lua_key(string);
@@ -504,6 +1281,7 @@ use_lua_key(top_accent);
use_lua_key(top_left);
use_lua_key(top_right);
use_lua_key(tounicode);
+use_lua_key(trailer);
use_lua_key(transform);
use_lua_key(type);
use_lua_key(uchyph);
@@ -511,24 +1289,17 @@ use_lua_key(umath);
use_lua_key(units_per_em);
use_lua_key(used);
use_lua_key(user_id);
+use_lua_key(v);
use_lua_key(value);
+use_lua_key(vbox);
+use_lua_key(vcenter);
use_lua_key(version);
use_lua_key(vert_variants);
+use_lua_key(vmode_par);
+use_lua_key(vtop);
use_lua_key(width);
use_lua_key(writable);
use_lua_key(x_height);
use_lua_key(xoffset);
use_lua_key(xyz_zoom);
use_lua_key(yoffset);
-
-use_lua_key(immediate);
-use_lua_key(compresslevel);
-use_lua_key(objcompression);
-use_lua_key(direct);
-use_lua_key(page);
-use_lua_key(streamfile);
-use_lua_key(annot);
-use_lua_key(lua_functions);
-
-
-