Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
lua.getcodepage() for diagnostic purposes -- trunk (HH).
Browse files Browse the repository at this point in the history
git-svn-id: https://serveur-svn.lri.fr/svn/modhel/luatex/trunk@7219 0b2b3880-5936-4365-a048-eb17d2e5a6bf
  • Loading branch information
luigiScarso committed Oct 28, 2019
1 parent 142fc2d commit a6d9152
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
12 changes: 12 additions & 0 deletions manual/luatex-tex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@

\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

\startsection[title={The \type {status} library}][library=status]
Expand Down
Binary file modified manual/luatex.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions source/texk/web2c/luatexdir/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
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>
* Also support {oeps.foo} filenames in openin/out

Expand Down
1 change: 1 addition & 0 deletions source/texk/web2c/luatexdir/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
21 changes: 17 additions & 4 deletions source/texk/web2c/luatexdir/lua/llualib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};
Expand Down
2 changes: 1 addition & 1 deletion source/texk/web2c/luatexdir/luatex_svnversion.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define luatex_svn_revision 7211
#define luatex_svn_revision 7215

0 comments on commit a6d9152

Please sign in to comment.