From 14cc4d9a56a89671154529602c02929865494f67 Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Mon, 28 Oct 2019 21:27:33 +0000 Subject: lua.getcodepage() for diagnostic purposes (HH) git-svn-id: svn://tug.org/texlive/trunk@52557 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/ChangeLog | 4 ++++ Build/source/texk/web2c/luatexdir/NEWS | 1 + Build/source/texk/web2c/luatexdir/lua/llualib.c | 21 +++++++++++++++++---- .../source/texk/web2c/luatexdir/luatex_svnversion.h | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index 30afe026f3f..fadf29dcd9c 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,7 @@ +2019-10-28 Luigi Scarso + * New callback lua.getcodepage() for diagnostic purposes. + + 2019-10-25 Luigi Scarso * Also support {oeps.foo} filenames in openin/out diff --git a/Build/source/texk/web2c/luatexdir/NEWS b/Build/source/texk/web2c/luatexdir/NEWS index ba63f727ae4..42732fae077 100644 --- a/Build/source/texk/web2c/luatexdir/NEWS +++ b/Build/source/texk/web2c/luatexdir/NEWS @@ -7,6 +7,7 @@ First release of luahbtex / luajithbtex, luatex / luajittex with harfbuzz. Small bug fixes, code clean up and a couple of new primitives to match eTeX. +A new callcback lua.getcodepage() for diagnostic purposes. *** DROPPED the "page_objnum_provider" callback, replaced with "page_order_index". *** See ChangeLog and the manual. diff --git a/Build/source/texk/web2c/luatexdir/lua/llualib.c b/Build/source/texk/web2c/luatexdir/lua/llualib.c index ac9b03ffe60..0586aba026e 100644 --- a/Build/source/texk/web2c/luatexdir/lua/llualib.c +++ b/Build/source/texk/web2c/luatexdir/lua/llualib.c @@ -379,16 +379,29 @@ static int get_call_level(lua_State * L) /* hh */ return 1; } +static int get_code_page(lua_State *L) +{ +# ifdef _WIN32 + lua_pushinteger(L,(int) GetOEMCP()); + lua_pushinteger(L,(int) GetACP()); +# else + lua_pushboolean(L,0); + lua_pushboolean(L,0); +# endif + return 2; +} + static const struct luaL_Reg lualib[] = { /* *INDENT-OFF* */ - {"getluaname", get_luaname}, - {"setluaname", set_luaname}, + {"getluaname", get_luaname}, + {"setluaname", set_luaname}, {"getbytecode", get_bytecode}, {"setbytecode", set_bytecode}, - {"newtable", new_table}, + {"newtable", new_table}, {"get_functions_table",lua_functions_get_table}, - {"getstacktop",get_stack_top}, + {"getstacktop", get_stack_top}, {"getcalllevel", get_call_level}, + {"getcodepage", get_code_page }, /* *INDENT-ON* */ {NULL, NULL} /* sentinel */ }; diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h index 47770e44ed4..b7d2d9796fe 100644 --- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1 +1 @@ -#define luatex_svn_revision 7211 +#define luatex_svn_revision 7215 -- cgit v1.2.3