Skip to content
Snippets Groups Projects
Commit 93939bce authored by Luigi Scarso's avatar Luigi Scarso
Browse files

lua.getcodepage() for diagnostic purposes -- trunk (HH).

parent fd79cc7c
Branches
Tags
No related merge requests found
...@@ -113,6 +113,18 @@ checking some mechanism going haywire. ...@@ -113,6 +113,18 @@ checking some mechanism going haywire.
\stopsubsection \stopsubsection
\startsubsection[title={Code page (Windows only)}]
\libindex{getcodepage}
The \type {getcodepage} returns the value from \type{GetOEMCP()}
(the current original equipment manufacturer (OEM) code page identifier for the operating system)
and the value from \type{GetACP()} (the current Windows ANSI code page identifier for the operating system).
\stopsubsection
\stopsection \stopsection
\startsection[title={The \type {status} library}][library=status] \startsection[title={The \type {status} library}][library=status]
......
No preview for this file type
2019-10-28 Luigi Scarso <luigi.scarso@gmail.com>
* New callback lua.getcodepage() for diagnostic purposes.
2019-10-25 Luigi Scarso <luigi.scarso@gmail.com> 2019-10-25 Luigi Scarso <luigi.scarso@gmail.com>
* Also support {oeps.foo} filenames in openin/out * Also support {oeps.foo} filenames in openin/out
......
...@@ -7,6 +7,7 @@ First release of luahbtex / luajithbtex, ...@@ -7,6 +7,7 @@ First release of luahbtex / luajithbtex,
luatex / luajittex with harfbuzz. luatex / luajittex with harfbuzz.
Small bug fixes, code clean up and a couple of new primitives Small bug fixes, code clean up and a couple of new primitives
to match eTeX. to match eTeX.
A new callcback lua.getcodepage() for diagnostic purposes.
*** DROPPED the "page_objnum_provider" callback, replaced with "page_order_index". *** *** DROPPED the "page_objnum_provider" callback, replaced with "page_order_index". ***
See ChangeLog and the manual. See ChangeLog and the manual.
......
...@@ -379,16 +379,29 @@ static int get_call_level(lua_State * L) /* hh */ ...@@ -379,16 +379,29 @@ static int get_call_level(lua_State * L) /* hh */
return 1; 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[] = { static const struct luaL_Reg lualib[] = {
/* *INDENT-OFF* */ /* *INDENT-OFF* */
{"getluaname", get_luaname}, {"getluaname", get_luaname},
{"setluaname", set_luaname}, {"setluaname", set_luaname},
{"getbytecode", get_bytecode}, {"getbytecode", get_bytecode},
{"setbytecode", set_bytecode}, {"setbytecode", set_bytecode},
{"newtable", new_table}, {"newtable", new_table},
{"get_functions_table",lua_functions_get_table}, {"get_functions_table",lua_functions_get_table},
{"getstacktop",get_stack_top}, {"getstacktop", get_stack_top},
{"getcalllevel", get_call_level}, {"getcalllevel", get_call_level},
{"getcodepage", get_code_page },
/* *INDENT-ON* */ /* *INDENT-ON* */
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };
......
#define luatex_svn_revision 7211 #define luatex_svn_revision 7215
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment