summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx173
1 files changed, 6 insertions, 167 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index 918f36c3acf..f3afe0a091d 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
@@ -2,7 +2,7 @@
%
%% File: l3luatex.dtx
%
-% Copyright (C) 2010-2021 The LaTeX Project
+% Copyright (C) 2010-2022 The LaTeX Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-11-22}
+% \date{Released 2022-01-12}
%
% \maketitle
%
@@ -125,34 +125,9 @@
% |ltx.utils| table.
% \end{function}
%
-% \begin{function}[deprecated = 2021-12-31]{l3kernel}
-% For compatibility reasons, there are also some deprecated interfaces provided
-% in the |l3kernel| table. These do not return their result as Lua values but
-% instead print them to \TeX.
-% \end{function}
-%
-% \begin{function}{l3kernel.charcat}
-% \begin{syntax}
-% |l3kernel.charcat(|\meta{charcode}, \meta{catcode}|)|
-% \end{syntax}
-% Constructs a character of \meta{charcode} and \meta{catcode} and returns
-% the result to \TeX{}.
-% \end{function}
-%
-% \begin{function}{l3kernel.elapsedtime}
-% \begin{syntax}
-% |l3kernel.elapsedtime()|
-% \end{syntax}
-% Returns the CPU time in \meta{scaled seconds} since the start of the
-% \TeX{} run or since |l3kernel.resettimer| was issued. This only
-% measures the time used by the CPU, not the real time, e.g., waiting
-% for user input.
-% \end{function}
-%
-% \begin{function}{ltx.utils.filedump, l3kernel.filedump}
+% \begin{function}{ltx.utils.filedump}
% \begin{syntax}
% \meta{dump}| = ltx.utils.filedump(|\meta{file}|,|\meta{offset}|,|\meta{length}|)| \\
-% |l3kernel.filedump(|\meta{file}|,|\meta{offset}|,|\meta{length}|)|
% \end{syntax}
% Returns the uppercase hexadecimal representation of the content of the
% \meta{file} read as bytes. If the \meta{length} is given, only this part
@@ -161,10 +136,9 @@
% is read starting at the \meta{offset}.
% \end{function}
%
-% \begin{function}{ltx.utils.filemd5sum, l3kernel.filemdfivesum}
+% \begin{function}{ltx.utils.filemd5sum}
% \begin{syntax}
% \meta{hash}| = ltx.utils.filemd5sum(|\meta{file}|)| \\
-% |l3kernel.filemdfivesum(|\meta{file}|)|
% \end{syntax}
% Returns the MD5 sum of the file contents read as bytes; note that
% the result will depend on the nature of the line endings used in the file,
@@ -172,10 +146,9 @@
% nothing is returned with \emph{no error raised}.
% \end{function}
%
-% \begin{function}{ltx.utils.filemoddate, l3kernel.filemoddate}
+% \begin{function}{ltx.utils.filemoddate}
% \begin{syntax}
% \meta{date}| = ltx.utils.filemoddate(|\meta{file}|)| \\
-% |l3kernel.filemoddate(|\meta{file}|)|
% \end{syntax}
% Returns the date/time of last modification of the \meta{file} in the
% format
@@ -188,37 +161,14 @@
% not found, nothing is returned with \emph{no error raised}.
% \end{function}
%
-% \begin{function}{ltx.utils.filesize, l3kernel.filesize}
+% \begin{function}{ltx.utils.filesize}
% \begin{syntax}
% |size = ltx.utils.filesize(|\meta{file}|)| \\
-% |l3kernel.filesize(|\meta{file}|)|
% \end{syntax}
% Returns the size of the \meta{file} in bytes. If the \meta{file} is not
% found, nothing is returned with \emph{no error raised}.
% \end{function}
%
-% \begin{function}{l3kernel.resettimer}
-% \begin{syntax}
-% |l3kernel.resettimer()|
-% \end{syntax}
-% Resets the timer used by |l3kernel.elapsetime|.
-% \end{function}
-%
-% \begin{function}{l3kernel.shellescape}
-% \begin{syntax}
-% |l3kernel.shellescape(|\meta{cmd}|)|
-% \end{syntax}
-% Executes the \meta{cmd} and prints to the log as for \pdfTeX{}.
-% \end{function}
-%
-% \begin{function}{l3kernel.strcmp}
-% \begin{syntax}
-% |l3kernel.strcmp(|\meta{str one}, \meta{str two}|)|
-% \end{syntax}
-% Compares the two strings and returns |0| to \TeX{}
-% if the two are identical.
-% \end{function}
-%
% \end{documentation}
%
% \begin{implementation}
@@ -322,18 +272,14 @@
% Most of the emulation of \pdfTeX{} here is based heavily on Heiko Oberdiek's
% \pkg{pdftexcmds} package.
%
-% \begin{macro}{l3kernel}
% \begin{macro}{ltx.utils}
% Create a table for the kernel's own use.
% \begin{macrocode}
-l3kernel = l3kernel or { }
-local l3kernel = l3kernel
ltx = ltx or {utils={}}
ltx.utils = ltx.utils or { }
local ltxutils = ltx.utils
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% Local copies of global tables.
% \begin{macrocode}
@@ -413,16 +359,6 @@ if not command_id and tokens and tokens.commands then
end
% \end{macrocode}
%
-% \begin{macrocode}
-local function deprecated(table, name, func)
- table[name] = function(...)
- write_nl(format("Calling deprecated Lua function %s", name))
- table[name] = func
- return func(...)
- end
-end
-% \end{macrocode
-%
% Deal with Con\TeX{}t: doesn't use |kpse| library.
% \begin{macrocode}
local kpse_find = (resolvers and resolvers.findfile) or kpse.find_file
@@ -440,40 +376,7 @@ end
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{l3kernel.charcat}
-% Creating arbitrary chars using |tex.cprint|.
-% The alternative approach using |token.put_next(token.create(...))|
-% would be about 10\% slower.
-% \begin{macrocode}
-deprecated(l3kernel, 'charcat', function(charcode, catcode)
- cprint(catcode, utf8_char(charcode))
-end)
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{l3kernel.elapsedtime, l3kernel.resettimer}
-% Simple timing set up: give the result from the system clock in scaled
-% seconds.
-% \begin{macrocode}
-local os_clock = os.clock
-local base_clock_time = 0
-local function elapsedtime()
- local val = (os_clock() - base_clock_time) * 65536 + 0.5
- if val > 2147483647 then
- val = 2147483647
- end
- write(format("%d",floor(val)))
-end
-l3kernel.elapsedtime = elapsedtime
-local function resettimer()
- base_clock_time = os_clock()
-end
-l3kernel.resettimer = resettimer
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{ltx.utils.filedump}
-% \begin{macro}{l3kernel.filedump}
% Similar comments here to the next function: read the file in binary mode
% to avoid any line-end weirdness.
% \begin{macrocode}
@@ -490,15 +393,8 @@ local function filedump(name,offset,length)
return escapehex(data)
end
ltxutils.filedump = filedump
-deprecated(l3kernel, "filedump", function(name, offset, length)
- local dump = filedump(name, tonumber(offset), tonumber(length))
- if dump then
- write(dump)
- end
-end)
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{md5.HEX}
% Hash a string and return the hash in uppercase hexadecimal format.
@@ -516,7 +412,6 @@ end
% \end{macrocode}
% \end{macro}
% \begin{macro}{ltx.utils.filemd5sum}
-% \begin{macro}{l3kernel.filemdfivesum}
% Read an entire file and hash it: the hash function itself is a built-in.
% As Lua is byte-based there is no work needed here in terms of UTF-8
% (see \pkg{pdftexcmds} and how it handles strings that have passed through
@@ -532,18 +427,10 @@ local function filemd5sum(name)
return md5_HEX(data)
end
ltxutils.filemd5sum = filemd5sum
-deprecated(l3kernel, "filemdfivesum", function(name)
- local hash = filemd5sum(name)
- if hash then
- write(hash)
- end
-end)
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{ltx.utils.filemoddate}
-% \begin{macro}{l3kernel.filemoddate}
% There are two cases: If the C standard library is C99 compliant,
% we can use |%z| to get the timezone in almost the right format.
% We only have to add primes and replace a zero or missing offset
@@ -607,18 +494,10 @@ else
end
end
ltxutils.filemoddate = filemoddate
-deprecated(l3kernel, "filemoddate", function(name)
- local hash = filemoddate(name)
- if hash then
- write(hash)
- end
-end)
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{ltx.utils.filesize}
-% \begin{macro}{l3kernel.filesize}
% A simple disk lookup.
% \begin{macrocode}
local function filesize(name)
@@ -631,46 +510,6 @@ local function filesize(name)
end
end
ltxutils.filesize = filesize
-deprecated(l3kernel, "filesize", function(name)
- local size = filesize(name)
- if size then
- write(size)
- end
-end)
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{l3kernel.strcmp}
-% String comparison which gives the same results as \pdfTeX{}'s
-% \tn{pdfstrcmp}, although the ordering should likely not be relied upon!
-% \begin{macrocode}
-deprecated(l3kernel, "strcmp", function (A, B)
- if A == B then
- write("0")
- elseif A < B then
- write("-1")
- else
- write("1")
- end
-end)
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{l3kernel.shellescape}
-% Replicating the \pdfTeX{} log interaction for shell escape.
-% \begin{macrocode}
-local os_exec = os.execute
-deprecated(l3kernel, "shellescape", function(cmd)
- local status,msg = os_exec(cmd)
- if status == nil then
- write_nl("log","runsystem(" .. cmd .. ")...(" .. msg .. ")\n")
- elseif status == 0 then
- write_nl("log","runsystem(" .. cmd .. ")...executed\n")
- else
- write_nl("log","runsystem(" .. cmd .. ")...failed " .. (msg or "") .. "\n")
- end
-end)
% \end{macrocode}
% \end{macro}
%