From f100e939b3262ac391fe767d591d1a316ab59f3a Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Wed, 17 Jan 2018 18:00:12 +0000 Subject: Luatex 1.07 --- luatex and luatex53 git-svn-id: svn://tug.org/texlive/trunk@46348 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/ChangeLog | 3 + Build/source/texk/web2c/luatexdir/NEWS | 38 +- Build/source/texk/web2c/luatexdir/am/libluatex.am | 28 +- Build/source/texk/web2c/luatexdir/am/luaffi.am | 11 +- Build/source/texk/web2c/luatexdir/am/luamisc.am | 10 +- Build/source/texk/web2c/luatexdir/am/luasocket.am | 168 +- Build/source/texk/web2c/luatexdir/am/luatex.am | 35 +- Build/source/texk/web2c/luatexdir/dvi/dvigen.w | 19 - Build/source/texk/web2c/luatexdir/font/luafont.w | 43 +- .../source/texk/web2c/luatexdir/font/luatexfont.h | 15 - Build/source/texk/web2c/luatexdir/font/mapfile.h | 10 +- Build/source/texk/web2c/luatexdir/font/mapfile.w | 27 +- Build/source/texk/web2c/luatexdir/font/texfont.h | 1 + Build/source/texk/web2c/luatexdir/font/vfpacket.w | 14 +- Build/source/texk/web2c/luatexdir/font/writecff.h | 8 - Build/source/texk/web2c/luatexdir/font/writecff.w | 203 +- Build/source/texk/web2c/luatexdir/font/writettf.w | 56 +- .../source/texk/web2c/luatexdir/image/pdftoepdf.w | 8 +- Build/source/texk/web2c/luatexdir/image/writeimg.w | 20 +- .../source/texk/web2c/luatexdir/lua/lcallbacklib.c | 1 - Build/source/texk/web2c/luatexdir/lua/lepdflib.cc | 28 +- Build/source/texk/web2c/luatexdir/lua/lfontlib.c | 4 +- Build/source/texk/web2c/luatexdir/lua/limglib.c | 6 +- Build/source/texk/web2c/luatexdir/lua/liolibext.c | 4 +- Build/source/texk/web2c/luatexdir/lua/lkpselib.c | 4 +- Build/source/texk/web2c/luatexdir/lua/llanglib.c | 4 +- Build/source/texk/web2c/luatexdir/lua/llualib.c | 20 +- .../source/texk/web2c/luatexdir/lua/lnewtokenlib.c | 4 +- Build/source/texk/web2c/luatexdir/lua/lnodelib.c | 8 +- Build/source/texk/web2c/luatexdir/lua/lpdflib.c | 14 +- .../texk/web2c/luatexdir/lua/lpdfscannerlib.cc | 4 +- Build/source/texk/web2c/luatexdir/lua/lstatslib.c | 2 +- Build/source/texk/web2c/luatexdir/lua/lstrlibext.c | 7 + Build/source/texk/web2c/luatexdir/lua/ltexiolib.c | 2 +- Build/source/texk/web2c/luatexdir/lua/luanode.w | 1 + Build/source/texk/web2c/luatexdir/lua/luastuff.w | 3 + .../source/texk/web2c/luatexdir/lua/luatex-core.c | 816 ++++-- .../texk/web2c/luatexdir/lua/luatex-core.lua | 648 +++-- Build/source/texk/web2c/luatexdir/lua/texluac.w | 18 +- .../texk/web2c/luatexdir/luafilesystem/LICENSE | 21 + .../texk/web2c/luatexdir/luafilesystem/Makefile | 9 +- .../texk/web2c/luatexdir/luafilesystem/README | 66 - .../texk/web2c/luatexdir/luafilesystem/README.md | 28 + .../web2c/luatexdir/luafilesystem/doc/us/doc.css | 209 ++ .../luatexdir/luafilesystem/doc/us/examples.html | 14 +- .../luatexdir/luafilesystem/doc/us/index.html | 90 +- .../luatexdir/luafilesystem/doc/us/license.html | 16 +- .../luatexdir/luafilesystem/doc/us/manual.html | 65 +- .../texk/web2c/luatexdir/luafilesystem/src/lfs.c | 937 +++--- .../texk/web2c/luatexdir/luafilesystem/src/lfs.def | 3 +- .../texk/web2c/luatexdir/luafilesystem/src/lfs.h | 31 +- .../web2c/luatexdir/luafilesystem/tests/test.lua | 146 +- .../web2c/luatexdir/luafontloader/src/luafflib.c | 2 +- .../source/texk/web2c/luatexdir/luasocket/LICENSE | 4 +- .../texk/web2c/luatexdir/luasocket/Lua51.props | 28 + .../texk/web2c/luatexdir/luasocket/Lua52.props | 28 + Build/source/texk/web2c/luatexdir/luasocket/NEW | 76 +- Build/source/texk/web2c/luatexdir/luasocket/README | 11 +- Build/source/texk/web2c/luatexdir/luasocket/config | 60 - .../texk/web2c/luatexdir/luasocket/doc/ftp.html | 1 - .../texk/web2c/luatexdir/luasocket/doc/http.html | 7 +- .../texk/web2c/luatexdir/luasocket/doc/index.html | 59 +- .../luatexdir/luasocket/doc/installation.html | 14 +- .../texk/web2c/luatexdir/luasocket/doc/ltn12.html | 8 +- .../texk/web2c/luatexdir/luasocket/doc/lua05.ppt | Bin 0 -> 304128 bytes .../texk/web2c/luatexdir/luasocket/doc/mime.html | 59 +- .../web2c/luatexdir/luasocket/doc/reference.css | 1 + .../web2c/luatexdir/luasocket/doc/reference.html | 6 + .../texk/web2c/luatexdir/luasocket/doc/smtp.html | 235 +- .../texk/web2c/luatexdir/luasocket/doc/socket.html | 118 +- .../texk/web2c/luatexdir/luasocket/doc/tcp.html | 405 +-- .../texk/web2c/luatexdir/luasocket/doc/udp.html | 447 +-- .../web2c/luatexdir/luasocket/etc/check-links.lua | 2 +- .../texk/web2c/luatexdir/luasocket/etc/cookie.lua | 88 + .../web2c/luatexdir/luasocket/etc/dispatch.lua | 42 +- .../texk/web2c/luatexdir/luasocket/etc/forward.lua | 2 +- .../texk/web2c/luatexdir/luasocket/etc/get.lua | 2 +- .../texk/web2c/luatexdir/luasocket/etc/links | 17 + .../source/texk/web2c/luatexdir/luasocket/makefile | 29 +- .../texk/web2c/luatexdir/luasocket/mime.vcproj | 141 - .../texk/web2c/luatexdir/luasocket/mime.vcxproj | 217 ++ .../web2c/luatexdir/luasocket/mime.vcxproj.filters | 16 + .../texk/web2c/luatexdir/luasocket/samples/lpr.lua | 2 +- .../web2c/luatexdir/luasocket/samples/mclisten.lua | 18 + .../web2c/luatexdir/luasocket/samples/mcsend.lua | 20 + .../texk/web2c/luatexdir/luasocket/socket.vcproj | 182 -- .../texk/web2c/luatexdir/luasocket/socket.vcxproj | 307 ++ .../luatexdir/luasocket/socket.vcxproj.filters | 51 + .../texk/web2c/luatexdir/luasocket/src/Makefile | 63 - .../texk/web2c/luatexdir/luasocket/src/auxiliar.c | 12 +- .../texk/web2c/luatexdir/luasocket/src/auxiliar.h | 11 +- .../texk/web2c/luatexdir/luasocket/src/buffer.c | 37 +- .../texk/web2c/luatexdir/luasocket/src/compat.c | 19 + .../web2c/luatexdir/luasocket/src/compat.c.orig | 19 + .../texk/web2c/luatexdir/luasocket/src/compat.h | 11 + .../web2c/luatexdir/luasocket/src/compat.h.orig | 11 + .../texk/web2c/luatexdir/luasocket/src/except.c | 88 +- .../texk/web2c/luatexdir/luasocket/src/except.h | 23 +- .../texk/web2c/luatexdir/luasocket/src/ftp.lua | 135 +- .../web2c/luatexdir/luasocket/src/ftp.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/ftp_lua.c | 1202 +++++--- .../texk/web2c/luatexdir/luasocket/src/headers.lua | 11 +- .../luatexdir/luasocket/src/headers.lua_lua.c | 0 .../web2c/luatexdir/luasocket/src/headers_lua.c | 481 ++-- .../texk/web2c/luatexdir/luasocket/src/http.lua | 109 +- .../web2c/luatexdir/luasocket/src/http.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/http_lua.c | 1435 ++++++---- .../texk/web2c/luatexdir/luasocket/src/inet.c | 368 ++- .../texk/web2c/luatexdir/luasocket/src/inet.h | 27 +- .../source/texk/web2c/luatexdir/luasocket/src/io.c | 2 +- .../texk/web2c/luatexdir/luasocket/src/ltn12.lua | 43 +- .../web2c/luatexdir/luasocket/src/ltn12.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/ltn12_lua.c | 974 ++++--- .../web2c/luatexdir/luasocket/src/lua_preload.c | 13 +- .../texk/web2c/luatexdir/luasocket/src/luasocket.c | 11 +- .../web2c/luatexdir/luasocket/src/luasocket.c.orig | 114 + .../texk/web2c/luatexdir/luasocket/src/luasocket.h | 9 +- .../texk/web2c/luatexdir/luasocket/src/makefile | 438 +++ .../texk/web2c/luatexdir/luasocket/src/mbox.lua | 38 +- .../web2c/luatexdir/luasocket/src/mbox.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/mbox_lua.c | 364 ++- .../texk/web2c/luatexdir/luasocket/src/mime.c | 130 +- .../texk/web2c/luatexdir/luasocket/src/mime.h | 4 +- .../texk/web2c/luatexdir/luasocket/src/mime.lua | 41 +- .../web2c/luatexdir/luasocket/src/mime.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/mime_lua.c | 269 +- .../texk/web2c/luatexdir/luasocket/src/options.c | 158 +- .../texk/web2c/luatexdir/luasocket/src/options.h | 20 +- .../texk/web2c/luatexdir/luasocket/src/pierror.h | 28 + .../texk/web2c/luatexdir/luasocket/src/select.c | 32 +- .../texk/web2c/luatexdir/luasocket/src/serial.c | 25 +- .../texk/web2c/luatexdir/luasocket/src/smtp.lua | 42 +- .../web2c/luatexdir/luasocket/src/smtp.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/smtp_lua.c | 904 +++--- .../texk/web2c/luatexdir/luasocket/src/socket.lua | 35 +- .../web2c/luatexdir/luasocket/src/socket_lua.c | 527 ++-- .../luatexdir/luasocket/src/socket_lua.c.module | 317 +++ .../texk/web2c/luatexdir/luasocket/src/tcp.c | 170 +- .../texk/web2c/luatexdir/luasocket/src/timeout.c | 21 +- .../texk/web2c/luatexdir/luasocket/src/timeout.h | 1 + .../texk/web2c/luatexdir/luasocket/src/tp.lua | 25 +- .../web2c/luatexdir/luasocket/src/tp.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/tp_lua.c | 422 +-- .../texk/web2c/luatexdir/luasocket/src/udp.c | 319 ++- .../texk/web2c/luatexdir/luasocket/src/udp.h | 3 +- .../texk/web2c/luatexdir/luasocket/src/unix.c | 358 +-- .../texk/web2c/luatexdir/luasocket/src/unix.h | 6 +- .../texk/web2c/luatexdir/luasocket/src/unixdgram.c | 408 +++ .../texk/web2c/luatexdir/luasocket/src/unixdgram.h | 20 + .../web2c/luatexdir/luasocket/src/unixstream.c | 357 +++ .../web2c/luatexdir/luasocket/src/unixstream.h | 21 + .../texk/web2c/luatexdir/luasocket/src/url.lua | 51 +- .../web2c/luatexdir/luasocket/src/url.lua_lua.c | 0 .../texk/web2c/luatexdir/luasocket/src/url_lua.c | 1100 ++++--- .../texk/web2c/luatexdir/luasocket/src/usocket.c | 116 +- .../texk/web2c/luatexdir/luasocket/src/usocket.h | 16 + .../texk/web2c/luatexdir/luasocket/src/wsocket.c | 156 +- .../texk/web2c/luatexdir/luasocket/src/wsocket.h | 11 +- .../web2c/luatexdir/luasocket/test/auth/.htaccess | 4 + .../web2c/luatexdir/luasocket/test/auth/.htpasswd | 1 + .../web2c/luatexdir/luasocket/test/auth/index.html | 3002 ++++++++++++++++++++ .../texk/web2c/luatexdir/luasocket/test/cgi/cat | 6 + .../luatexdir/luasocket/test/cgi/cat-index-html | 5 + .../texk/web2c/luatexdir/luasocket/test/cgi/env | 5 + .../luatexdir/luasocket/test/cgi/query-string | 4 + .../luatexdir/luasocket/test/cgi/redirect-loop | 3 + .../web2c/luatexdir/luasocket/test/cgi/request-uri | 4 + .../web2c/luatexdir/luasocket/test/dicttest.lua | 5 + .../web2c/luatexdir/luasocket/test/excepttest.lua | 30 + .../luatexdir/luasocket/test/find-connect-limit | 32 + .../web2c/luatexdir/luasocket/test/ftptest.lua | 122 + .../texk/web2c/luatexdir/luasocket/test/hello.lua | 3 + .../web2c/luatexdir/luasocket/test/httptest.lua | 441 +++ .../texk/web2c/luatexdir/luasocket/test/index.html | 3002 ++++++++++++++++++++ .../web2c/luatexdir/luasocket/test/ltn12test.lua | 299 ++ .../web2c/luatexdir/luasocket/test/luasocket.png | Bin 0 -> 11732 bytes .../web2c/luatexdir/luasocket/test/mimetest.lua | 299 ++ .../web2c/luatexdir/luasocket/test/smtptest.lua | 259 ++ .../web2c/luatexdir/luasocket/test/stufftest.lua | 21 + .../web2c/luatexdir/luasocket/test/tcp-getoptions | 41 + .../web2c/luatexdir/luasocket/test/test_bind.lua | 6 + .../luatexdir/luasocket/test/test_getaddrinfo.lua | 15 + .../luatexdir/luasocket/test/test_socket_error.lua | 31 + .../web2c/luatexdir/luasocket/test/testclnt.lua | 132 +- .../web2c/luatexdir/luasocket/test/testmesg.lua | 96 + .../web2c/luatexdir/luasocket/test/testsrvr.lua | 2 +- .../web2c/luatexdir/luasocket/test/tftptest.lua | 20 + .../luatexdir/luasocket/test/udp-zero-length-send | 25 + .../luasocket/test/udp-zero-length-send-recv | 37 + .../luatexdir/luasocket/test/udpconnectclnt.lua | 19 + .../luatexdir/luasocket/test/udpconnectsrvr.lua | 16 + .../luatexdir/luasocket/test/unixdgramclnt.lua | 9 + .../luatexdir/luasocket/test/unixdgramsrvr.lua | 9 + .../luatexdir/luasocket/test/unixstreamclnt.lua | 8 + .../luatexdir/luasocket/test/unixstreamsrvr.lua | 9 + .../web2c/luatexdir/luasocket/test/upload.html | 15 + .../web2c/luatexdir/luasocket/test/urltest.lua | 635 +++++ .../web2c/luatexdir/luasocket/test/utestclnt.lua | 644 +++++ .../web2c/luatexdir/luasocket/test/utestsrvr.lua | 17 + Build/source/texk/web2c/luatexdir/luatex.c | 756 ++--- .../texk/web2c/luatexdir/luatex_svnversion.h | 2 +- .../texk/web2c/luatexdir/luatexcallbackids.h | 1 - Build/source/texk/web2c/luatexdir/pdf/pdfliteral.h | 1 + Build/source/texk/web2c/luatexdir/pdf/pdfliteral.w | 65 +- Build/source/texk/web2c/luatexdir/pdf/pdfpage.h | 1 + Build/source/texk/web2c/luatexdir/pdf/pdfpage.w | 15 + Build/source/texk/web2c/luatexdir/pdf/pdftables.h | 1 + Build/source/texk/web2c/luatexdir/pdf/pdftables.w | 2 +- .../texk/web2c/luatexdir/slnunicode/slnunico.c | 36 +- Build/source/texk/web2c/luatexdir/tex/extensions.h | 1 - Build/source/texk/web2c/luatexdir/tex/extensions.w | 5 +- Build/source/texk/web2c/luatexdir/tex/texnodes.h | 2 + Build/source/texk/web2c/luatexdir/tex/textoken.w | 4 + 213 files changed, 21168 insertions(+), 7893 deletions(-) create mode 100644 Build/source/texk/web2c/luatexdir/luafilesystem/LICENSE delete mode 100644 Build/source/texk/web2c/luatexdir/luafilesystem/README create mode 100644 Build/source/texk/web2c/luatexdir/luafilesystem/README.md create mode 100644 Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/doc.css create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/Lua51.props create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/Lua52.props delete mode 100644 Build/source/texk/web2c/luatexdir/luasocket/config create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.ppt create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/etc/cookie.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/etc/links delete mode 100644 Build/source/texk/web2c/luatexdir/luasocket/mime.vcproj create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/mime.vcxproj create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/mime.vcxproj.filters create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/samples/mclisten.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/samples/mcsend.lua delete mode 100644 Build/source/texk/web2c/luatexdir/luasocket/socket.vcproj create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/socket.vcxproj create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/socket.vcxproj.filters delete mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/Makefile create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/compat.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/compat.c.orig create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/compat.h create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/compat.h.orig create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/ftp.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/headers.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/http.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/ltn12.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.c.orig create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/makefile create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/mbox.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/mime.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/pierror.h create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/smtp.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/socket_lua.c.module create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/tp.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/unixdgram.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/unixdgram.h create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/unixstream.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/unixstream.h create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/src/url.lua_lua.c create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/auth/.htaccess create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/auth/.htpasswd create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/auth/index.html create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/cgi/cat create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/cgi/cat-index-html create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/cgi/env create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/cgi/query-string create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/cgi/redirect-loop create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/cgi/request-uri create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/dicttest.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/excepttest.lua create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/find-connect-limit create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/ftptest.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/hello.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/httptest.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/index.html create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/ltn12test.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/luasocket.png create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/mimetest.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/smtptest.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/stufftest.lua create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/tcp-getoptions create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/test_bind.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/test_getaddrinfo.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/test_socket_error.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/testmesg.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/tftptest.lua create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/udp-zero-length-send create mode 100755 Build/source/texk/web2c/luatexdir/luasocket/test/udp-zero-length-send-recv create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/udpconnectclnt.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/udpconnectsrvr.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/unixdgramclnt.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/unixdgramsrvr.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/unixstreamclnt.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/unixstreamsrvr.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/upload.html create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/urltest.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/utestclnt.lua create mode 100644 Build/source/texk/web2c/luatexdir/luasocket/test/utestsrvr.lua (limited to 'Build/source/texk/web2c/luatexdir') diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index 89c26f5ce1e..1fb4c9ef692 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,6 @@ +2017-02-11 Luigi Scarso + LuaFilesystem 1.7.0 + 2017-10-03 Luigi Scarso A not exhaustive list of changes: diff --git a/Build/source/texk/web2c/luatexdir/NEWS b/Build/source/texk/web2c/luatexdir/NEWS index eacbe3cd34d..91a4ec7fec1 100644 --- a/Build/source/texk/web2c/luatexdir/NEWS +++ b/Build/source/texk/web2c/luatexdir/NEWS @@ -1,5 +1,41 @@ +============================================================== +LuaTeX 1.07 2018-01-17 +============================================================== + +(1) This release brings Lua 5.3 to LuaTeX. We have tested an experimental version +for a few months and not encountered issues. + +(2) If you use Lua 5.3 you should be aware of a few changes in the language and +its implementation. Numbers are now either integers or floats but are cast +automatically. + +(3) In some cases (e.g. string.format) there is a more strict check. A float always +has a decimal appended when serialized, so 1 becomes 1.0 as string. + +(4) We keep supporting the bit32 library on top of the new bit operators. Be aware +of the fact that currently LuajitTeX does not have these operators. + +(5) Performance of LuaTeX with Lua 5.3 can be slightly better than with 5.2 but this +really depends on your usage of Lua. In practice there should be no slowdown. + +(6) We are aware of possible substantial slowdown of string.format depending on the +platform and compiler. This depends on Lua too and will be resolved in due time. + +(7) If you want to test with Lua 5.3 then have to build LuaTeX with --lua53. Because +ConTeXt will switch to 5.3 after this release there will be binaries available at the +ConTeXt garden. + +(8) The 2018 TeXlive distribution will ship with LuaTeX using Lua 5.2 but there will +likely be an additional binary LuaTeX53 available. + +(9) From 2019 TeXlive will ship with LuaTeX and Lua 5.3 as default. We provide --lua52 +as build flag for a while. By then we might be looking at Lua 5.4 already. + +(10) There are the usual patches and cleanups and a few small additions (mentioned +in the manual) but there have been no fundamental changes in the API (apart from +removing depricated and undocumented functionality). + -This file is in the public domain. ============================================================== LuaTeX Release 1.0.4 was released 2017033109 diff --git a/Build/source/texk/web2c/luatexdir/am/libluatex.am b/Build/source/texk/web2c/luatexdir/am/libluatex.am index cabbaa0b5d6..3e90186acc3 100644 --- a/Build/source/texk/web2c/luatexdir/am/libluatex.am +++ b/Build/source/texk/web2c/luatexdir/am/libluatex.am @@ -9,11 +9,20 @@ LUA_INCLUDES = $(LUA52_INCLUDES) $(LUA52_DEFINES) LUA_LIBS = $(LUA52_LIBS) LUA_DEPEND = $(LUA52_DEPEND) +## liblua53 +## +LUA_LUA53_INCLUDES = $(LUA53_INCLUDES) $(LUA53_DEFINES) +LUA_LUA53_LIBS = $(LUA53_LIBS) +LUA_LUA53_DEPEND = $(LUA53_DEPEND) + + + ## libluatex ## -EXTRA_LIBRARIES += libluatex.a libluajittex.a +EXTRA_LIBRARIES += libluatex.a liblua53tex.a libluajittex.a libluatex_a_DEPENDENCIES = libff.a libluamisc.a +liblua53tex_a_DEPENDENCIES = libff.a liblua53misc.a libluajittex_a_DEPENDENCIES = libff.a libluajitmisc.a libluatex_a_preflags = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) @@ -25,10 +34,12 @@ libluatex_a_preflags += -DLUA_FF_LIB=1 -I$(srcdir)/luatexdir/luafontloader/fontf libluatex_a_preflags += -DSYNCTEX_ENGINE_H='' -I$(srcdir)/synctexdir libluatex_a_CPPFLAGS = $(libluatex_a_preflags) $(LUA_INCLUDES) +liblua53tex_a_CPPFLAGS = $(libluatex_a_preflags) $(LUA_LUA53_INCLUDES) libluajittex_a_CPPFLAGS = $(libluatex_a_preflags) $(LUAJIT_INCLUDES) $(LUAJIT_DEFINES) libluajittex_a_CPPFLAGS += -DLuajitTeX libluatex_a_CXXFLAGS = $(WARNING_CXXFLAGS) +liblua53tex_a_CXXFLAGS = $(WARNING_CXXFLAGS) libluajittex_a_CXXFLAGS = $(WARNING_CXXFLAGS) dist_libluatex_a_SOURCES = \ @@ -37,6 +48,12 @@ nodist_libluatex_a_SOURCES = \ helpers.c luastuff.c texluac.c \ $(dist_libluatex_sources) \ $(nodist_libluatex_sources) +dist_liblua53tex_a_SOURCES = \ + luatexdir/lua/lstrlibext.c +nodist_liblua53tex_a_SOURCES = \ + helpers.c luastuff.c texluac.c \ + $(dist_libluatex_sources) \ + $(nodist_libluatex_sources) dist_libluajittex_a_SOURCES = \ luatexdir/lua/lauxlib_bridge.h \ luatexdir/lua/lstrlibext.c @@ -47,6 +64,7 @@ nodist_libluajittex_a_SOURCES = \ ## mplib "stub" backends are in mplibstuff.c $(libluatex_a_OBJECTS): libff.a libmplibcore.a libluamisc.a $(POPPLER_DEPEND) +$(liblua53tex_a_OBJECTS): libff.a libmplibcore.a liblua53misc.a $(POPPLER_DEPEND) $(libluajittex_a_OBJECTS): libff.a libmplibcore.a libluajitmisc.a $(POPPLER_DEPEND) @@ -97,8 +115,6 @@ pkin.c: ctangle$(EXEEXT) luatexdir/font/pkin.w $(luatex_font_ctangle) pkin.w sfnt.c: ctangle$(EXEEXT) luatexdir/font/sfnt.w $(luatex_font_ctangle) sfnt.w -subfont.c: ctangle$(EXEEXT) luatexdir/font/subfont.w - $(luatex_font_ctangle) subfont.w texfont.c: ctangle$(EXEEXT) luatexdir/font/texfont.w $(luatex_font_ctangle) texfont.w tfmofm.c: ctangle$(EXEEXT) luatexdir/font/tfmofm.w @@ -131,7 +147,7 @@ writetype2.c: ctangle$(EXEEXT) luatexdir/font/writetype2.w $(luatex_font_ctangle) writetype2.w libluatex_web += luatexdir/font/dofont.w luatexdir/font/luafont.w luatexdir/font/mapfile.w -libluatex_web += luatexdir/font/pkin.w luatexdir/font/sfnt.w luatexdir/font/subfont.w +libluatex_web += luatexdir/font/pkin.w luatexdir/font/sfnt.w libluatex_web += luatexdir/font/texfont.w luatexdir/font/tfmofm.w libluatex_web += luatexdir/font/tounicode.w luatexdir/font/tt_glyf.w libluatex_web += luatexdir/font/tt_table.w luatexdir/font/vfovf.w @@ -141,7 +157,7 @@ libluatex_web += luatexdir/font/writet1.w luatexdir/font/writet3.w libluatex_web += luatexdir/font/writettf.w luatexdir/font/writetype0.w libluatex_web += luatexdir/font/writetype2.w -nodist_libluatex_sources += dofont.c luafont.c mapfile.c pkin.c sfnt.c subfont.c +nodist_libluatex_sources += dofont.c luafont.c mapfile.c pkin.c sfnt.c nodist_libluatex_sources += texfont.c tfmofm.c tounicode.c tt_glyf.c tt_table.c vfovf.c vfpacket.c nodist_libluatex_sources += writecff.c writeenc.c writefont.c writet1.c writet3.c writettf.c nodist_libluatex_sources += writetype0.c writetype2.c @@ -550,6 +566,8 @@ dist_libluatex_sources += \ synctexdir/synctex.c \ synctexdir/synctex.h +dist_liblua53tex_sources = $(dist_libluatex_sources) + EXTRA_DIST += \ $(dist_libluatex_sources) \ $(libluatex_web) diff --git a/Build/source/texk/web2c/luatexdir/am/luaffi.am b/Build/source/texk/web2c/luatexdir/am/luaffi.am index 3e64258cacf..c927b3df7af 100644 --- a/Build/source/texk/web2c/luatexdir/am/luaffi.am +++ b/Build/source/texk/web2c/luatexdir/am/luaffi.am @@ -12,19 +12,25 @@ ## -EXTRA_LIBRARIES += libluaffi.a +EXTRA_LIBRARIES += libluaffi.a liblua53ffi.a #libluaffi_a_DEPENDENCIES = $(ZLIB_DEPEND) $(libluaffi_a_OBJECTS): $(LUA_DEPEND) +$(liblua53ffi_a_OBJECTS): $(LUA_LUA53_DEPEND) libluaffi_a_CPPFLAGS = \ -I$(top_srcdir)/luatexdir/luaffi -I$(top_srcdir)/luatexdir/luaffi/dynasm $(LUA_INCLUDES) +liblua53ffi_a_CPPFLAGS = \ + -I$(top_srcdir)/luatexdir/luaffi -I$(top_srcdir)/luatexdir/luaffi/dynasm $(LUA_LUA53_INCLUDES) + + libluaffi_a_CFLAGS = # $(WARNING_CFLAGS) +liblua53ffi_a_CFLAGS = # $(WARNING_CFLAGS) nodist_libluaffi_a_SOURCES = $(libluaffi_sources) - +nodist_liblua53ffi_a_SOURCES = $(libluaffi_sources) libluaffi_sources = \ @@ -38,6 +44,7 @@ libluaffi_sources = \ luatexdir/luaffi/ffi.h \ luatexdir/luaffi/parser.c +liblua53ffi_sources = $(libluaffi_sources) ## Not used ## #EXTRA_DIST diff --git a/Build/source/texk/web2c/luatexdir/am/luamisc.am b/Build/source/texk/web2c/luatexdir/am/luamisc.am index 1a9c22f854d..7e874ae09af 100644 --- a/Build/source/texk/web2c/luatexdir/am/luamisc.am +++ b/Build/source/texk/web2c/luatexdir/am/luamisc.am @@ -6,22 +6,27 @@ ## libluamisc (luafilesystem, luamd5, luapeg, luazip, luazlib, ## and slnunicode) -EXTRA_LIBRARIES += libluamisc.a libluajitmisc.a +EXTRA_LIBRARIES += libluamisc.a liblua53misc.a libluajitmisc.a libluamisc_a_DEPENDENCIES = $(ZZIPLIB_DEPEND) libluasocket.a libluaffi.a +liblua53misc_a_DEPENDENCIES = $(ZZIPLIB_DEPEND) liblua53socket.a liblua53ffi.a libluajitmisc_a_DEPENDENCIES = $(ZZIPLIB_DEPEND) libluajitsocket.a $(libluamisc_a_OBJECTS): $(libluamisc_a_DEPENDENCIES) +$(liblua53misc_a_OBJECTS): $(liblua53misc_a_DEPENDENCIES) $(libluajitmisc_a_OBJECTS): $(libluajitmisc_a_DEPENDENCIES) libluamisc_a_CPPFLAGS = $(ZLIB_INCLUDES) $(ZZIPLIB_INCLUDES) $(LUA_INCLUDES) +liblua53misc_a_CPPFLAGS = $(ZLIB_INCLUDES) $(ZZIPLIB_INCLUDES) $(LUA_LUA53_INCLUDES) libluajitmisc_a_CPPFLAGS = $(ZLIB_INCLUDES) $(ZZIPLIB_INCLUDES) $(LUAJIT_INCLUDES) libluajitmisc_a_CPPFLAGS += -DLuajitTeX -I$(srcdir)/luatexdir libluamisc_a_CFLAGS = # $(WARNING_CFLAGS) +liblua53misc_a_CFLAGS = # $(WARNING_CFLAGS) libluajitmisc_a_CFLAGS = # $(WARNING_CFLAGS) nodist_libluamisc_a_SOURCES = $(libluamisc_sources) +nodist_liblua53misc_a_SOURCES = $(libluamisc_sources) nodist_libluajitmisc_a_SOURCES = $(libluamisc_sources) libluamisc_sources = \ @@ -49,7 +54,8 @@ EXTRA_DIST += \ EXTRA_DIST += \ luatexdir/luafilesystem/Makefile \ luatexdir/luafilesystem/Makefile.win \ - luatexdir/luafilesystem/README \ + luatexdir/luafilesystem/LICENSE \ + luatexdir/luafilesystem/README.md \ luatexdir/luafilesystem/config \ luatexdir/luafilesystem/config.win \ luatexdir/luafilesystem/doc \ diff --git a/Build/source/texk/web2c/luatexdir/am/luasocket.am b/Build/source/texk/web2c/luatexdir/am/luasocket.am index dd1c2fbd48d..8f8e1ab44ee 100644 --- a/Build/source/texk/web2c/luatexdir/am/luasocket.am +++ b/Build/source/texk/web2c/luatexdir/am/luasocket.am @@ -5,16 +5,22 @@ ## luasocket ## -EXTRA_LIBRARIES += libluasocket.a libluajitsocket.a +EXTRA_LIBRARIES += libluasocket.a liblua53socket.a libluajitsocket.a libluasocket_a_DEPENDENCIES = $(ZLIB_DEPEND) +liblua53socket_a_DEPENDENCIES = $(ZLIB_DEPEND) libluajitsocket_a_DEPENDENCIES = $(ZLIB_DEPEND) $(libluasocket_a_OBJECTS): $(LUA_DEPEND) +$(liblua53socket_a_OBJECTS): $(LUA_DEPEND) $(libluajitsocket_a_OBJECTS): $(LUAJIT_DEPEND) libluasocket_a_CPPFLAGS = \ -DLUASOCKET_DEBUG -I$(top_srcdir)/luatexdir/luasocket $(LUA_INCLUDES) + +liblua53socket_a_CPPFLAGS = \ + -DLUASOCKET_DEBUG -I$(top_srcdir)/luatexdir/luasocket $(LUA_LUA53_INCLUDES) + libluajitsocket_a_CPPFLAGS = \ -DLUASOCKET_DEBUG -I$(top_srcdir)/luatexdir/luasocket $(LUAJIT_INCLUDES) @@ -22,38 +28,42 @@ libluasocket_a_CFLAGS = # $(WARNING_CFLAGS) libluajitsocket_a_CFLAGS = # $(WARNING_CFLAGS) nodist_libluasocket_a_SOURCES = $(libluasocket_sources) +nodist_liblua53socket_a_SOURCES = $(libluasocket_sources) nodist_libluajitsocket_a_SOURCES = $(libluasocket_sources) libluasocket_sources = \ - luatexdir/luasocket/src/auxiliar.c \ - luatexdir/luasocket/src/auxiliar.h \ - luatexdir/luasocket/src/buffer.c \ - luatexdir/luasocket/src/buffer.h \ - luatexdir/luasocket/src/except.c \ - luatexdir/luasocket/src/except.h \ - luatexdir/luasocket/src/inet.c \ - luatexdir/luasocket/src/inet.h \ - luatexdir/luasocket/src/io.c \ - luatexdir/luasocket/src/io.h \ + luatexdir/luasocket/src/auxiliar.c \ + luatexdir/luasocket/src/auxiliar.h \ + luatexdir/luasocket/src/buffer.c \ + luatexdir/luasocket/src/buffer.h \ + luatexdir/luasocket/src/compat.c \ + luatexdir/luasocket/src/compat.h \ + luatexdir/luasocket/src/except.c \ + luatexdir/luasocket/src/except.h \ + luatexdir/luasocket/src/inet.c \ + luatexdir/luasocket/src/inet.h \ + luatexdir/luasocket/src/io.c \ + luatexdir/luasocket/src/io.h \ luatexdir/luasocket/src/lua_preload.c \ - luatexdir/luasocket/src/luasocket.c \ - luatexdir/luasocket/src/luasocket.h \ - luatexdir/luasocket/src/mime.c \ - luatexdir/luasocket/src/mime.h \ - luatexdir/luasocket/src/options.c \ - luatexdir/luasocket/src/options.h \ - luatexdir/luasocket/src/select.c \ - luatexdir/luasocket/src/select.h \ - luatexdir/luasocket/src/serial.c \ - luatexdir/luasocket/src/socket.c \ - luatexdir/luasocket/src/socket.h \ - luatexdir/luasocket/src/tcp.c \ - luatexdir/luasocket/src/tcp.h \ - luatexdir/luasocket/src/timeout.c \ - luatexdir/luasocket/src/timeout.h \ - luatexdir/luasocket/src/udp.c \ - luatexdir/luasocket/src/udp.h \ - luatexdir/luasocket/src/usocket.h + luatexdir/luasocket/src/luasocket.c \ + luatexdir/luasocket/src/luasocket.h \ + luatexdir/luasocket/src/mime.c \ + luatexdir/luasocket/src/mime.h \ + luatexdir/luasocket/src/options.c \ + luatexdir/luasocket/src/options.h \ + luatexdir/luasocket/src/select.c \ + luatexdir/luasocket/src/select.h \ + luatexdir/luasocket/src/serial.c \ + luatexdir/luasocket/src/socket.h \ + luatexdir/luasocket/src/socket.c \ + luatexdir/luasocket/src/tcp.c \ + luatexdir/luasocket/src/tcp.h \ + luatexdir/luasocket/src/timeout.c \ + luatexdir/luasocket/src/timeout.h \ + luatexdir/luasocket/src/udp.c \ + luatexdir/luasocket/src/udp.h \ + luatexdir/luasocket/src/usocket.h + ## The files *_lua.c are included from lua_preload.c ## @@ -68,35 +78,16 @@ EXTRA_DIST += \ luatexdir/luasocket/src/smtp_lua.c \ luatexdir/luasocket/src/socket_lua.c \ luatexdir/luasocket/src/tp_lua.c \ - luatexdir/luasocket/src/url_lua.c + luatexdir/luasocket/src/url_lua.c ## Not used ## EXTRA_DIST += \ - luatexdir/luasocket/src/Makefile \ - luatexdir/luasocket/src/unix.c \ - luatexdir/luasocket/src/unix.h \ - luatexdir/luasocket/src/usocket.c \ - luatexdir/luasocket/src/wsocket.c \ - luatexdir/luasocket/src/wsocket.h \ - luatexdir/luasocket/src/ftp.lua \ - luatexdir/luasocket/src/headers.lua \ - luatexdir/luasocket/src/http.lua \ - luatexdir/luasocket/src/smtp.lua \ - luatexdir/luasocket/src/socket.lua \ - luatexdir/luasocket/src/tp.lua \ - luatexdir/luasocket/src/url.lua \ - luatexdir/luasocket/src/ltn12.lua \ - luatexdir/luasocket/src/mbox.lua \ - luatexdir/luasocket/src/mime.lua \ luatexdir/luasocket/LICENSE \ + luatexdir/luasocket/Lua51.props \ + luatexdir/luasocket/Lua52.props \ luatexdir/luasocket/NEW \ luatexdir/luasocket/README \ - luatexdir/luasocket/config \ - luatexdir/luasocket/luasocket.sln \ - luatexdir/luasocket/makefile \ - luatexdir/luasocket/mime.vcproj \ - luatexdir/luasocket/socket.vcproj \ luatexdir/luasocket/doc/dns.html \ luatexdir/luasocket/doc/ftp.html \ luatexdir/luasocket/doc/http.html \ @@ -104,6 +95,7 @@ EXTRA_DIST += \ luatexdir/luasocket/doc/installation.html \ luatexdir/luasocket/doc/introduction.html \ luatexdir/luasocket/doc/ltn12.html \ + luatexdir/luasocket/doc/lua05.ppt \ luatexdir/luasocket/doc/luasocket.png \ luatexdir/luasocket/doc/mime.html \ luatexdir/luasocket/doc/reference.css \ @@ -117,14 +109,20 @@ EXTRA_DIST += \ luatexdir/luasocket/etc/b64.lua \ luatexdir/luasocket/etc/check-links.lua \ luatexdir/luasocket/etc/check-memory.lua \ + luatexdir/luasocket/etc/cookie.lua \ luatexdir/luasocket/etc/dict.lua \ luatexdir/luasocket/etc/dispatch.lua \ luatexdir/luasocket/etc/eol.lua \ luatexdir/luasocket/etc/forward.lua \ luatexdir/luasocket/etc/get.lua \ + luatexdir/luasocket/etc/links \ luatexdir/luasocket/etc/lp.lua \ luatexdir/luasocket/etc/qp.lua \ luatexdir/luasocket/etc/tftp.lua \ + luatexdir/luasocket/luasocket.sln \ + luatexdir/luasocket/makefile \ + luatexdir/luasocket/mime.vcxproj \ + luatexdir/luasocket/mime.vcxproj.filters \ luatexdir/luasocket/samples/README \ luatexdir/luasocket/samples/cddb.lua \ luatexdir/luasocket/samples/daytimeclnt.lua \ @@ -132,10 +130,76 @@ EXTRA_DIST += \ luatexdir/luasocket/samples/echosrvr.lua \ luatexdir/luasocket/samples/listener.lua \ luatexdir/luasocket/samples/lpr.lua \ + luatexdir/luasocket/samples/mclisten.lua \ + luatexdir/luasocket/samples/mcsend.lua \ luatexdir/luasocket/samples/talker.lua \ luatexdir/luasocket/samples/tinyirc.lua \ + luatexdir/luasocket/socket.vcxproj \ + luatexdir/luasocket/socket.vcxproj.filters \ + luatexdir/luasocket/src/ftp.lua \ + luatexdir/luasocket/src/headers.lua \ + luatexdir/luasocket/src/http.lua \ + luatexdir/luasocket/src/ltn12.lua \ + luatexdir/luasocket/src/makefile \ + luatexdir/luasocket/src/mbox.lua \ + luatexdir/luasocket/src/mime.lua \ + luatexdir/luasocket/src/pierror.h \ + luatexdir/luasocket/src/serial.c \ + luatexdir/luasocket/src/smtp.lua \ + luatexdir/luasocket/src/socket.h \ + luatexdir/luasocket/src/socket.lua \ + luatexdir/luasocket/src/tp.lua \ + luatexdir/luasocket/src/unix.c \ + luatexdir/luasocket/src/unix.h \ + luatexdir/luasocket/src/unixdgram.c \ + luatexdir/luasocket/src/unixdgram.h \ + luatexdir/luasocket/src/unixstream.c \ + luatexdir/luasocket/src/unixstream.h \ + luatexdir/luasocket/src/url.lua \ + luatexdir/luasocket/src/usocket.c \ + luatexdir/luasocket/src/wsocket.c \ + luatexdir/luasocket/src/wsocket.h \ luatexdir/luasocket/test/README \ + luatexdir/luasocket/test/auth/.htaccess \ + luatexdir/luasocket/test/auth/.htpasswd \ + luatexdir/luasocket/test/auth/index.html \ + luatexdir/luasocket/test/cgi/cat \ + luatexdir/luasocket/test/cgi/cat-index-html \ + luatexdir/luasocket/test/cgi/env \ + luatexdir/luasocket/test/cgi/query-string \ + luatexdir/luasocket/test/cgi/redirect-loop \ + luatexdir/luasocket/test/cgi/request-uri \ + luatexdir/luasocket/test/dicttest.lua \ + luatexdir/luasocket/test/excepttest.lua \ + luatexdir/luasocket/test/find-connect-limit \ + luatexdir/luasocket/test/ftptest.lua \ + luatexdir/luasocket/test/hello.lua \ + luatexdir/luasocket/test/httptest.lua \ + luatexdir/luasocket/test/index.html \ + luatexdir/luasocket/test/ltn12test.lua \ + luatexdir/luasocket/test/luasocket.png \ + luatexdir/luasocket/test/mimetest.lua \ + luatexdir/luasocket/test/smtptest.lua \ + luatexdir/luasocket/test/stufftest.lua \ + luatexdir/luasocket/test/tcp-getoptions \ + luatexdir/luasocket/test/test_bind.lua \ + luatexdir/luasocket/test/test_getaddrinfo.lua \ + luatexdir/luasocket/test/test_socket_error.lua \ luatexdir/luasocket/test/testclnt.lua \ + luatexdir/luasocket/test/testmesg.lua \ luatexdir/luasocket/test/testsrvr.lua \ - luatexdir/luasocket/test/testsupport.lua + luatexdir/luasocket/test/testsupport.lua \ + luatexdir/luasocket/test/tftptest.lua \ + luatexdir/luasocket/test/udp-zero-length-send \ + luatexdir/luasocket/test/udp-zero-length-send-recv \ + luatexdir/luasocket/test/udpconnectclnt.lua \ + luatexdir/luasocket/test/udpconnectsrvr.lua \ + luatexdir/luasocket/test/unixdgramclnt.lua \ + luatexdir/luasocket/test/unixdgramsrvr.lua \ + luatexdir/luasocket/test/unixstreamclnt.lua \ + luatexdir/luasocket/test/unixstreamsrvr.lua \ + luatexdir/luasocket/test/upload.html \ + luatexdir/luasocket/test/urltest.lua \ + luatexdir/luasocket/test/utestclnt.lua \ + luatexdir/luasocket/test/utestsrvr.lua diff --git a/Build/source/texk/web2c/luatexdir/am/luatex.am b/Build/source/texk/web2c/luatexdir/am/luatex.am index 41b8610a251..048adfa6c85 100644 --- a/Build/source/texk/web2c/luatexdir/am/luatex.am +++ b/Build/source/texk/web2c/luatexdir/am/luatex.am @@ -16,6 +16,17 @@ bin_links += luatex$(EXEEXT):texlua luatex$(EXEEXT):texluac endif !WIN32 endif LUATEX +if LUATEX53 +bin_PROGRAMS += luatex53 +if WIN32 +noinst_PROGRAMS += call_luatex53 +install_exe_links += install-luatex53-links +uninstall_exe_links += uninstall-luatex53-links +else !WIN32 +bin_links += luatex53$(EXEEXT):texlua53 luatex53$(EXEEXT):texlua53c +endif !WIN32 +endif LUATEX53 + if LUAJITTEX bin_PROGRAMS += luajittex if WIN32 @@ -27,10 +38,11 @@ bin_links += luajittex$(EXEEXT):texluajit luajittex$(EXEEXT):texluajitc endif !WIN32 endif LUAJITTEX -EXTRA_PROGRAMS += luatex luajittex +EXTRA_PROGRAMS += luatex luatex53 luajittex # Force Automake to use CXXLD for linking nodist_EXTRA_luatex_SOURCES = dummy.cxx +nodist_EXTRA_luatex53_SOURCES = dummy.cxx nodist_EXTRA_luajittex_SOURCES = dummy.cxx luatex_preflags = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(POPPLER_INCLUDES) @@ -39,32 +51,41 @@ luatex_postflags += -Dextra_version_info=`date +-%Y%m%d%H` luatex_postflags += -I$(srcdir)/synctexdir -DSYNCTEX_ENGINE_H='' luatex_CPPFLAGS = $(luatex_preflags) $(LUA_INCLUDES) $(luatex_postflags) +luatex53_CPPFLAGS = $(luatex_preflags) $(LUA_LUA53_INCLUDES) $(luatex_postflags) luajittex_CPPFLAGS = $(luatex_preflags) $(LUAJIT_INCLUDES) $(LUAJIT_DEFINES) $(luatex_postflags) luajittex_CPPFLAGS += -DLuajitTeX luatex_CXXFLAGS = $(WARNING_CXXFLAGS) +luatex53_CXXFLAGS = $(WARNING_CXXFLAGS) luajittex_CXXFLAGS = $(WARNING_CXXFLAGS) luatex_LDFLAGS = -export-dynamic +luatex53_LDFLAGS = -export-dynamic luajittex_LDFLAGS = -export-dynamic $(LUAJIT_LDEXTRA) luatex_postldadd = libmplibcore.a $(MPFR_LIBS) $(GMP_LIBS) luatex_postldadd += $(ZZIPLIB_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) $(POPPLER_LIBS) luatex_postldadd += $(LDADD) libmputil.a libunilib.a libmd5.a $(lua_socketlibs) + luatex_LDADD = libluatex.a libff.a libluamisc.a libluasocket.a libluaffi.a $(LUA_LIBS) $(luatex_postldadd) +luatex53_LDADD = liblua53tex.a libff.a liblua53misc.a liblua53socket.a liblua53ffi.a $(LUA_LUA53_LIBS) $(luatex_postldadd) luajittex_LDADD = libluajittex.a libff.a libluajitmisc.a libluajitsocket.a $(LUAJIT_LIBS) $(luatex_postldadd) luatex_depend = $(proglib) $(KPATHSEA_DEPEND) $(LIBPNG_DEPEND) libmputil.a libmd5.a luatex_DEPENDENCIES = $(luatex_depend) libluatex.a +luatex53_DEPENDENCIES = $(luatex_depend) liblua53tex.a luajittex_DEPENDENCIES = $(luatex_depend) libluajittex.a $(luatex_OBJECTS): libluatex.a +$(luatex53_OBJECTS): liblua53tex.a $(luajittex_OBJECTS): libluajittex.a nodist_luatex_SOURCES = $(luatex_sources) +nodist_luatex53_SOURCES = $(luatex_sources) nodist_luajittex_SOURCES = $(luatex_sources) + luatex_sources = \ luatexdir/luatex_svnversion.h \ luatexdir/luatex.c \ @@ -77,6 +98,11 @@ EXTRA_DIST += \ call_luatex_CPPFLAGS = -DEXEPROG=\"luatex.exe\" nodist_call_luatex_SOURCES = callexe.c call_luatex_LDADD = + +call_luatex53_CPPFLAGS = -DEXEPROG=\"luatex53.exe\" +nodist_call_luatex53_SOURCES = callexe.c +call_luatex53_LDADD = + call_luajittex_CPPFLAGS = -DEXEPROG=\"luajittex.exe\" nodist_call_luajittex_SOURCES = callexe.c call_luajittex_LDADD = @@ -102,6 +128,10 @@ endif WIN32 # luatex_tests = luatexdir/luatex.test luatexdir/luaimage.test luatexdir/luatex.log luatexdir/luaimage.log: luatex$(EXEEXT) +luatex53_tests = luatexdir/luatex.test luatexdir/luaimage.test +luatexdir/luatex53.log luatexdir/luaimage53.log: luatex53$(EXEEXT) + + luajittex_tests = luatexdir/luajittex.test luatexdir/luajitimage.test luatexdir/luajittex.log luatexdir/luajitimage.log: luajittex$(EXEEXT) @@ -110,6 +140,9 @@ EXTRA_DIST += $(luatex_tests) $(luajittex_tests) if LUATEX TESTS += $(luatex_tests) endif LUATEX +if LUATEX53 +TESTS += $(luatex_tests) +endif LUATEX53 if LUAJITTEX TESTS += $(luajittex_tests) endif LUAJITTEX diff --git a/Build/source/texk/web2c/luatexdir/dvi/dvigen.w b/Build/source/texk/web2c/luatexdir/dvi/dvigen.w index d703db1a2a8..d991445a59f 100644 --- a/Build/source/texk/web2c/luatexdir/dvi/dvigen.w +++ b/Build/source/texk/web2c/luatexdir/dvi/dvigen.w @@ -1165,25 +1165,6 @@ void dvi_end_page(PDF pdf) { (void) pdf; dvi_out(eop); - -#ifdef IPC - if (ipcon > 0) { - if (dvi_limit == half_buf) { - write_dvi(half_buf, dvi_buf_size - 1); - fflush(static_pdf->file); - dvi_gone = dvi_gone + half_buf; - } - if (dvi_ptr > 0) { - write_dvi(0, dvi_ptr - 1); - fflush(static_pdf->file); - dvi_offset = dvi_offset + dvi_ptr; - dvi_gone = dvi_gone + dvi_ptr; - } - dvi_ptr = 0; - dvi_limit = dvi_buf_size; - ipcpage(dvi_gone); - } -#endif /* IPC */ } @ At the end of the program, we must finish things off by writing the diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.w b/Build/source/texk/web2c/luatexdir/font/luafont.w index 7065f96d904..f63b71a1c15 100644 --- a/Build/source/texk/web2c/luatexdir/font/luafont.w +++ b/Build/source/texk/web2c/luatexdir/font/luafont.w @@ -834,16 +834,31 @@ static void read_char_packets(lua_State * L, int *l_fonts, charinfo * co, intern lua_pop(L, 2); break; case packet_pdf_code: - append_packet(cmd); ts = (int) lua_rawlen(L, -2); lua_rawgeti(L, -2, 2); if (ts == 3) { + /* mode on stack */ + s = lua_tostring(L, -1); + if (lua_type(L, -1) == LUA_TSTRING) { + /* */ + if (lua_key_eq(s, mode)) { + cmd = packet_pdf_mode; + lua_rawgeti(L, -3, 3); + /* mode on stack */ + s = lua_tostring(L, -1); + } + } else { + /* */ + } if (lua_type(L, -1) == LUA_TSTRING) { - s = lua_tostring(L, -1); if (lua_key_eq(s, direct)) { n = direct_always; } else if (lua_key_eq(s, page)) { n = direct_page; + } else if (lua_key_eq(s, text)) { + n = direct_text; + } else if (lua_key_eq(s, font)) { + n = direct_font; } else if (lua_key_eq(s, raw)) { n = direct_raw; } else if (lua_key_eq(s, origin)) { @@ -854,23 +869,29 @@ static void read_char_packets(lua_State * L, int *l_fonts, charinfo * co, intern } } else { n = (int) lua_roundnumber(L, -1); - if (n < set_origin || n > direct_raw) { + if (n < set_origin || n >= scan_special) { n = set_origin ; } } - lua_rawgeti(L, -3, 3); + if (cmd == packet_pdf_code) { + lua_rawgeti(L, -3, 3); + /* string on stack */ + } } else { n = set_origin; } + append_packet(cmd); do_store_four(n); - s = luaL_checklstring(L, -1, &l); - if (l > 0) { + if (cmd == packet_pdf_code) { + s = luaL_checklstring(L, -1, &l); do_store_four(l); - m = (int) l; - while (m > 0) { - n = *s++; - m--; - append_packet(n); + if (l > 0) { + m = (int) l; + while (m > 0) { + n = *s++; + m--; + append_packet(n); + } } } lua_pop(L,ts == 3 ? 2 : 1); diff --git a/Build/source/texk/web2c/luatexdir/font/luatexfont.h b/Build/source/texk/web2c/luatexdir/font/luatexfont.h index 9ef5110db24..459d2092b54 100644 --- a/Build/source/texk/web2c/luatexdir/font/luatexfont.h +++ b/Build/source/texk/web2c/luatexdir/font/luatexfont.h @@ -63,19 +63,8 @@ typedef struct { extern const key_entry font_key[FONT_KEYS_NUM]; -typedef struct _subfont_entry { - char *infix; /* infix for this subfont, eg "01" */ - long charcodes[256]; /* the mapping for this subfont as read from sfd */ - struct _subfont_entry *next; -} subfont_entry; - # include "mapfile.h" -typedef struct { - char *name; /* sfd name, eg "Unicode" */ - subfont_entry *subfont; /* linked list of subfonts */ -} sfd_entry; - typedef struct { int val; /* value */ boolean set; /* true if parameter has been set */ @@ -182,10 +171,6 @@ void pdf_add_stream(pdf_obj * stream, unsigned char *buf, long len); void pdf_release_obj(pdf_obj * stream); unsigned long ttc_read_offset(sfnt * sfont, int ttc_idx, fd_entry *fd); -/* subfont.c */ -void sfd_free(void); -boolean handle_subfont_fm(fm_entry *, int); - /* writeenc.c */ fe_entry *get_fe_entry(char *); void enc_free(void); diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.h b/Build/source/texk/web2c/luatexdir/font/mapfile.h index 8ad05c77bb1..928a0e91904 100644 --- a/Build/source/texk/web2c/luatexdir/font/mapfile.h +++ b/Build/source/texk/web2c/luatexdir/font/mapfile.h @@ -24,7 +24,7 @@ # define F_INCLUDED (1 << 0) # define F_SUBSETTED (1 << 1) # define F_STDT1FONT (1 << 2) -# define F_SUBFONT (1 << 3) +/* we don't support sub fonts */ # define F_TYPE1 (1 << 4) # define F_TRUETYPE (1 << 5) # define F_OTF (1 << 6) @@ -38,7 +38,6 @@ typedef enum { MAPFILE, MAPLINE } maptype; # define set_included(fm) ((fm)->type = (unsigned short)((fm)->type | F_INCLUDED)) # define set_subsetted(fm) ((fm)->type = (unsigned short)((fm)->type | F_SUBSETTED)) # define set_std_t1font(fm) ((fm)->type = (unsigned short)((fm)->type | F_STDT1FONT)) -# define set_subfont(fm) ((fm)->type = (unsigned short)((fm)->type | F_SUBFONT)) # define set_type1(fm) ((fm)->type = (unsigned short)((fm)->type | F_TYPE1)) # define set_truetype(fm) ((fm)->type = (unsigned short)((fm)->type | F_TRUETYPE)) # define set_opentype(fm) ((fm)->type = (unsigned short)((fm)->type | F_OTF)) @@ -50,7 +49,6 @@ typedef enum { MAPFILE, MAPLINE } maptype; # define unset_included(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_INCLUDED)) # define unset_subsetted(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_SUBSETTED)) # define unset_std_t1font(fm)((fm)->type = (unsigned short)((fm)->type & ~F_STDT1FONT)) -# define unset_subfont(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_SUBFONT)) # define unset_type1(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_TYPE1)) # define unset_truetype(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_TRUETYPE)) # define unset_opentype(fm) ((fm)->type = (unsigned short)((fm)->type & ~F_OTF)) @@ -62,7 +60,6 @@ typedef enum { MAPFILE, MAPLINE } maptype; # define is_included(fm) (((fm)->type & F_INCLUDED) != 0) # define is_subsetted(fm) (((fm)->type & F_SUBSETTED) != 0) # define is_std_t1font(fm) (((fm)->type & F_STDT1FONT) != 0) -# define is_subfont(fm) (((fm)->type & F_SUBFONT) != 0) # define is_type1(fm) (((fm)->type & F_TYPE1) != 0) # define is_truetype(fm) (((fm)->type & F_TRUETYPE) != 0) # define is_opentype(fm) (((fm)->type & F_OTF) != 0) @@ -85,7 +82,6 @@ typedef enum { MAPFILE, MAPLINE } maptype; typedef struct { /* parameters scanned from the map file: */ char *tfm_name; /* TFM file name (1st field in map line) */ - char *sfd_name; /* subfont directory name, like @sfd_name@ */ char *ps_name; /* PostScript name (optional 2nd field in map line) */ int fd_flags; /* font descriptor /Flags (PDF Ref. section 5.7.1) */ int slant; /* SlantFont */ @@ -93,10 +89,6 @@ typedef struct { char *encname; /* encoding file name */ char *ff_name; /* font file name */ unsigned short type; /* various flags */ - short pid; /* Pid for truetype fonts */ - short eid; /* Eid for truetype fonts */ - /* parameters NOT scanned from the map file: */ - subfont_entry *subfont; /* subfont mapping */ } fm_entry; typedef struct { diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.w b/Build/source/texk/web2c/luatexdir/font/mapfile.w index f4f31e5a833..9460dac5a9f 100644 --- a/Build/source/texk/web2c/luatexdir/font/mapfile.w +++ b/Build/source/texk/web2c/luatexdir/font/mapfile.w @@ -73,7 +73,6 @@ fm_entry *new_fm_entry(void) fm_entry *fm; fm = xtalloc(1, fm_entry); fm->tfm_name = NULL; - fm->sfd_name = NULL; fm->ps_name = NULL; fm->fd_flags = FD_FLAGS_NOT_SET_IN_MAPLINE; fm->ff_name = NULL; @@ -81,9 +80,6 @@ fm_entry *new_fm_entry(void) fm->type = 0; fm->slant = 0; fm->extend = 1000; - fm->pid = -1; - fm->eid = -1; - fm->subfont = NULL; unset_slantset(fm); unset_extendset(fm); unset_inuse(fm); @@ -93,7 +89,6 @@ fm_entry *new_fm_entry(void) void delete_fm_entry(fm_entry * fm) { xfree(fm->tfm_name); - xfree(fm->sfd_name); xfree(fm->ps_name); xfree(fm->ff_name); xfree(fm); @@ -251,15 +246,6 @@ static int check_fm_entry(fm_entry * fm, boolean warn) a += 16; } - /* subfonts must be used with subsetted non-reencoded TrueType fonts */ - if (fm->pid != -1 && - !(is_truetype(fm) && is_subsetted(fm) && !is_reencoded(fm))) { - if (warn) - formatted_warning("map file", "invalid entry for '%s': PidEid can be used only with subsetted non-reencoded TrueType fonts", - fm->tfm_name); - a += 32; - } - return a; } @@ -408,13 +394,10 @@ static void fm_scan_line(void) goto bad_line; } break; - case 'P': /* handle cases for subfonts like 'PidEid=3,1' */ - if (sscanf(r, "PidEid=%i, %i %n", &a, &b, &c) >= 2) { - fm->pid = (short) a; - fm->eid = (short) b; - r += c; - break; - } + case 'P': /* handle cases for sub fonts like 'PidEid=3,1' */ + formatted_warning("map file", "invalid entry for '%s': subfonts are not supported", fm->tfm_name); + goto bad_line; + break; default: /* encoding or font file specification */ a = b = 0; if (*r == '<') { @@ -468,8 +451,6 @@ static void fm_scan_line(void) fm points to a valid, freshly filled-out fm_entry structure. Now follows the actual work of registering/deleting. */ - if (handle_subfont_fm(fm, mitem->mode)) /* is this a subfont? */ - return; if (avl_do_entry(fm, mitem->mode) == 0) return; bad_line: diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.h b/Build/source/texk/web2c/luatexdir/font/texfont.h index d415460b1e1..75beafe66f1 100644 --- a/Build/source/texk/web2c/luatexdir/font/texfont.h +++ b/Build/source/texk/web2c/luatexdir/font/texfont.h @@ -625,6 +625,7 @@ typedef enum { packet_char_code, packet_scale_code, packet_lua_code, packet_pdf_code, + packet_pdf_mode, } packet_command_codes; extern scaled store_scaled_f(scaled sq, int fw); diff --git a/Build/source/texk/web2c/luatexdir/font/vfpacket.w b/Build/source/texk/web2c/luatexdir/font/vfpacket.w index 14a6ca61169..d2329916a31 100644 --- a/Build/source/texk/web2c/luatexdir/font/vfpacket.w +++ b/Build/source/texk/web2c/luatexdir/font/vfpacket.w @@ -83,11 +83,12 @@ int vf_packet_bytes(charinfo * co) case packet_image_code: case packet_node_code: case packet_right_code: - vfp += 4; - break; case packet_rule_code: vfp += 8; break; + case packet_pdf_mode: + vfp += 4; + break; case packet_pdf_code: vfp += 4; /* plus a string so we fall through */ @@ -243,6 +244,10 @@ void do_vf_packet(PDF pdf, internal_font_number vf_f, int c, int ex_glyph) pdf_literal(pdf, s, mode, false); flush_str(s); break; + case packet_pdf_mode: + packet_number(mode); + pdf_literal_set_mode(pdf, mode); + break; case packet_special_code: packet_number(k); str_room(k); @@ -397,11 +402,12 @@ replace_packet_fonts(internal_font_number f, int *old_fontid, case packet_image_code: case packet_node_code: case packet_right_code: - vfp += 4; - break; case packet_rule_code: vfp += 8; break; + case packet_pdf_mode: + vfp += 4; + break; case packet_pdf_code: vfp += 4; /* plus a string so we fall through */ diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.h b/Build/source/texk/web2c/luatexdir/font/writecff.h index 1a24df483b4..f05822a893b 100644 --- a/Build/source/texk/web2c/luatexdir/font/writecff.h +++ b/Build/source/texk/web2c/luatexdir/font/writecff.h @@ -247,22 +247,14 @@ extern long cff_set_name(cff_font * cff, char *name); extern long cff_read_subrs(cff_font * cff); /* Encoding */ -extern long cff_read_encoding(cff_font * cff); -extern long cff_pack_encoding(cff_font * cff, card8 * dest, long destlen); -extern card16 cff_encoding_lookup(cff_font * cff, card8 code); extern void cff_release_encoding(cff_encoding * encoding); /* Charsets */ extern long cff_read_charsets(cff_font * cff); extern long cff_pack_charsets(cff_font * cff, card8 * dest, long destlen); -/* Returns GID of PS name "glyph" */ -extern card16 cff_glyph_lookup(cff_font * cff, const char *glyph); -/* Returns GID of glyph with SID/CID "cid" */ -extern card16 cff_charsets_lookup(cff_font * cff, card16 cid); extern void cff_release_charsets(cff_charsets * charset); /* Returns SID or CID */ -extern card16 cff_charsets_lookup_inverse(cff_font * cff, card16 gid); /* FDSelect */ extern long cff_read_fdselect(cff_font * cff); diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.w b/Build/source/texk/web2c/luatexdir/font/writecff.w index 9707c751e25..a71e16f6f5c 100644 --- a/Build/source/texk/web2c/luatexdir/font/writecff.w +++ b/Build/source/texk/web2c/luatexdir/font/writecff.w @@ -2589,142 +2589,6 @@ static long cs_copy_charstring(card8 * dst, long dstlen, card8 * src, long srcle return (long) (dst - save); } -@* encodings. - -@ Encoding and Charset arrays always begin with GID = 1. - -@c -long cff_read_encoding(cff_font * cff) -{ - cff_encoding *encoding; - long offset, length; - card8 i; - - if (cff->topdict == NULL) { - normal_error("cff","top DICT data not found"); - } - - if (!cff_dict_known(cff->topdict, "Encoding")) { - cff->flag |= ENCODING_STANDARD; - cff->encoding = NULL; - return 0; - } - - offset = (long) cff_dict_get(cff->topdict, "Encoding", 0); - if (offset == 0) { /* predefined */ - cff->flag |= ENCODING_STANDARD; - cff->encoding = NULL; - return 0; - } else if (offset == 1) { - cff->flag |= ENCODING_EXPERT; - cff->encoding = NULL; - return 0; - } - - cff->offset = (l_offset) offset; - cff->encoding = encoding = xcalloc(1, sizeof(cff_encoding)); - encoding->format = get_card8(cff); - length = 1; - - switch (encoding->format & (~0x80)) { - case 0: - encoding->num_entries = get_card8(cff); - (encoding->data).codes = xmalloc(encoding->num_entries * sizeof(card8)); - for (i = 0; i < (encoding->num_entries); i++) { - (encoding->data).codes[i] = get_card8(cff); - } - length += encoding->num_entries + 1; - break; - case 1: - { - cff_range1 *ranges; - encoding->num_entries = get_card8(cff); - encoding->data.range1 = ranges - = xcalloc(encoding->num_entries, sizeof(cff_range1)); - for (i = 0; i < (encoding->num_entries); i++) { - ranges[i].first = get_card8(cff); - ranges[i].n_left = get_card8(cff); - } - length += (encoding->num_entries) * 2 + 1; - } - break; - default: - xfree(encoding); - normal_error("cff","unknown encoding format"); - break; - } - /* Supplementary data */ - if ((encoding->format) & 0x80) { - cff_map *map; - encoding->num_supps = get_card8(cff); - encoding->supp = map = xcalloc(encoding->num_supps, sizeof(cff_map)); - for (i = 0; i < (encoding->num_supps); i++) { - map[i].code = get_card8(cff); - map[i].glyph = get_card16(cff); /* SID */ - } - length += (encoding->num_supps) * 3 + 1; - } else { - encoding->num_supps = 0; - encoding->supp = NULL; - } - - return length; -} - -@ @c -long cff_pack_encoding(cff_font * cff, card8 * dest, long destlen) -{ - long len = 0; - cff_encoding *encoding; - card16 i; - - if (cff->flag & HAVE_STANDARD_ENCODING || cff->encoding == NULL) - return 0; - - if (destlen < 2) - normal_error("cff","buffer overflow (19)"); - - encoding = cff->encoding; - - dest[len++] = encoding->format; - dest[len++] = encoding->num_entries; - switch (encoding->format & (~0x80)) { - case 0: - if (destlen < len + encoding->num_entries) - normal_error("cff","buffer overflow (20)"); - for (i = 0; i < (encoding->num_entries); i++) { - dest[len++] = (encoding->data).codes[i]; - } - break; - case 1: - { - if (destlen < len + (encoding->num_entries) * 2) - normal_error("cff","buffer overflow (21)"); - for (i = 0; i < (encoding->num_entries); i++) { - dest[len++] = (card8) ((encoding->data).range1[i].first & 0xff); - dest[len++] = (card8) ((encoding->data).range1[i].n_left); - } - } - break; - default: - normal_error("cff","unknown encoding format"); - break; - } - - if ((encoding->format) & 0x80) { - if (destlen < len + (encoding->num_supps) * 3 + 1) - normal_error("cff","buffer overflow (22)"); - dest[len++] = encoding->num_supps; - for (i = 0; i < (encoding->num_supps); i++) { - dest[len++] = (card8) ((encoding->supp)[i].code); - dest[len++] = (card8) (((encoding->supp)[i].glyph >> 8) & 0xff); - dest[len++] = (card8) ((encoding->supp)[i].glyph & 0xff); - } - } - - return len; -} - @ CID-Keyed font specific @c long cff_read_fdselect(cff_font * cff) @@ -3229,68 +3093,6 @@ cffont->_string = NULL; cff_close(cffont); } -@ @c -#undef ERROR /* for mingw */ -#define ERROR(a) { perror(a); return 0; } - -@ Input : SID or CID (16-bit unsigned int) Output: glyph index - -@c -card16 cff_charsets_lookup(cff_font * cff, card16 cid) -{ - card16 gid = 0; - cff_charsets *charset; - card16 i; - - if (cff->flag & (CHARSETS_ISOADOBE | CHARSETS_EXPERT | CHARSETS_EXPSUB)) { - ERROR("Predefined CFF charsets not supported yet"); - } else if (cff->charsets == NULL) { - normal_error("cff","charsets data not available"); - } - - if (cid == 0) { - return 0; /* GID 0 (.notdef) */ - } - - charset = cff->charsets; - - gid = 0; - switch (charset->format) { - case 0: - for (i = 0; i < charset->num_entries; i++) { - if (cid == charset->data.glyphs[i]) { - gid = (card16) (i + 1); - return gid; - } - } - break; - case 1: - for (i = 0; i < charset->num_entries; i++) { - if (cid >= charset->data.range1[i].first && - cid <= charset->data.range1[i].first + charset->data.range1[i].n_left) { - gid = (card16) (gid + cid - charset->data.range1[i].first + 1); - return gid; - } - gid = (card16) (gid + charset->data.range1[i].n_left + 1); - } - break; - case 2: - for (i = 0; i < charset->num_entries; i++) { - if (cid >= charset->data.range2[i].first && - cid <= charset->data.range2[i].first + charset->data.range2[i].n_left) { - gid = (card16) (gid + cid - charset->data.range2[i].first + 1); - return gid; - } - gid = (card16) (gid + charset->data.range2[i].n_left + 1); - } - break; - default: - normal_error("cff","unknown charset format"); - } - - return 0; /* not found */ -} - @ @c #define is_cidfont(a) ((a)->flag & FONTTYPE_CIDFONT) #define CID_MAX 65535 @@ -3319,7 +3121,7 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd) cff_charsets *charset = NULL; if (!is_cidfont(cffont)) { - perror("Not a CIDfont."); + normal_error("cff","invalid CIDfont"); return; } @@ -3359,9 +3161,6 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd) for (cid = 0; cid <= CID_MAX; cid++) { glyph->id = (unsigned) cid; if (avl_find(fd->gl_tree, glyph) != NULL) { - /* - gid = (card16) cff_charsets_lookup(cffont, (card16) cid); - */ gid = (card16) cid; CIDToGIDMap[2 * cid] = (unsigned char) ((gid >> 8) & 0xff); CIDToGIDMap[2 * cid + 1] = (unsigned char) (gid & 0xff); diff --git a/Build/source/texk/web2c/luatexdir/font/writettf.w b/Build/source/texk/web2c/luatexdir/font/writettf.w index ff968eef9e2..2a13b889979 100644 --- a/Build/source/texk/web2c/luatexdir/font/writettf.w +++ b/Build/source/texk/web2c/luatexdir/font/writettf.w @@ -38,7 +38,6 @@ int ttf_curbyte = 0; typedef struct { char *name; /* name of glyph */ - long code; /* charcode in case of subfonts */ long newindex; /* new index of glyph in output file */ } ttfenc_entry; @@ -571,30 +570,6 @@ static void ttf_copy_encoding(void) ttfenc_tab[*q].name = glyph_names[*q]; } make_subset_tag(fd_cur); - } else if (is_subfont(fd_cur->fm)) { - charcodes = fd_cur->fm->subfont->charcodes; - assert(charcodes != NULL); - - for (i = 0; i < 256; i++) - ttfenc_tab[i].code = -1; - - /* take over collected characters from \TeX */ - avl_t_init(&t, fd_cur->tx_tree); - for (q = (int *) avl_t_first(&t, fd_cur->tx_tree); q != NULL; - q = (int *) avl_t_next(&t)) { - assert(*q >= 0 && *q < 256); - e = ttfenc_tab + *q; - e->code = charcodes[*q]; - if (e->code == -1) - formatted_warning("ttf font", "character %i in subfont %s is not mapped to any charcode", *q, fd_cur->fm->tfm_name); - else { - assert(e->code < 0x10000); - sprintf(buf, "/c%4.4X", (int) e->code); - aa = avl_probe(fd_cur->gl_tree, xstrdup(buf)); - assert(aa != NULL); - } - } - make_subset_tag(fd_cur); } else assert(0); } @@ -1366,33 +1341,6 @@ static void ttf_reindex_glyphs(void) for (e = ttfenc_tab; e - ttfenc_tab < 256; e++) { e->newindex = 0; /* index of ".notdef" glyph */ - /* handle case of subfonts first */ - if (is_subfont(fd_cur->fm)) { - if (e->code == -1) - continue; - assert(fd_cur->fm->pid != -1 && fd_cur->fm->eid != -1); - if (cmap == NULL && !cmap_not_found) { - cmap = - ttf_read_cmap(fd_cur->fm->ff_name, fd_cur->fm->pid, - fd_cur->fm->eid, true); - if (cmap == NULL) - cmap_not_found = true; - } - if (cmap == NULL) - continue; - t = cmap->table; - assert(t != NULL && e->code < 0x10000); - if (t[e->code] < 0) { - formatted_warning("ttf font", - "subfont %s has a wrong mapping, character %li -> 0x%4.4lX -> .notdef", - fd_cur->fm->tfm_name, (long) (e - ttfenc_tab), e->code); - continue; - } - assert(t[e->code] >= 0 && t[e->code] < glyphs_count); /* t has been read from ttf */ - glyph = glyph_tab + t[e->code]; - goto append_new_glyph; - } - /* handle case of reencoded fonts */ if (e->name == notdef) continue; @@ -1706,8 +1654,8 @@ void writettf(PDF pdf, fd_entry * fd) assert(is_truetype(fd_cur->fm)); assert(is_included(fd_cur->fm)); - if (is_subsetted(fd_cur->fm) && (fd_cur->fe == NULL) && !is_subfont(fd_cur->fm)) { - normal_error("ttf font","subset must be a reencoded or a subfont"); + if (is_subsetted(fd_cur->fm) && (fd_cur->fe == NULL)) { + normal_error("ttf font","subset must be a reencoded font"); } ttf_curbyte = 0; ttf_size = 0; diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w index 09dcd251584..7ba29731c19 100644 --- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w +++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w @@ -693,7 +693,7 @@ void read_pdf_info(image_dict * idict) unrefPdfDocument(img_filepath(idict)); } - and also unref'd in the finalizer zo we got an extra unrefs when garbage was + and also unref'd in the finalizer so we got an extra unrefs when garbage was collected. However it is more efficient to keep the file open so we do that now. The (slower) alternative is to unref here (which in most cases forcing a close of the file) but then we must not call flush_pdf_info. @@ -893,6 +893,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info) unrefPdfDocument(img_filepath(idict)); */ + +if (! img_keepopen(idict)) { + unrefPdfDocument(img_filepath(idict)); +} + + } /* Deallocate a PdfDocument with all its resources. */ diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.w b/Build/source/texk/web2c/luatexdir/image/writeimg.w index 95e1ec3049d..1532dbe39c3 100644 --- a/Build/source/texk/web2c/luatexdir/image/writeimg.w +++ b/Build/source/texk/web2c/luatexdir/image/writeimg.w @@ -430,14 +430,30 @@ void scan_pdfximage(PDF pdf) /* static_pdf */ @ @c void scan_pdfrefximage(PDF pdf) { - int transform = 0; /* one could scan transform as well */ + /* one could scan transform as well */ + int transform = 0; + /* begin of experiment */ + int open = 0; + /* end of experiment */ image_dict *idict; + /* scans || to |alt_rule| */ scaled_whd alt_rule, dim; - alt_rule = scan_alt_rule(); /* scans || to |alt_rule| */ + alt_rule = scan_alt_rule(); + /* begin of experiment */ + if (scan_keyword("keepopen")) { + open = 1; + } + /* end of experiment */ scan_int(); check_obj_type(pdf, obj_type_ximage, cur_val); tail_append(new_rule(image_rule)); idict = idict_array[obj_data_ptr(pdf, cur_val)]; + /* begin of experiment */ + if (open) { + /* so we keep the original value when no close is given */ + idict->keepopen = 1; + } + /* end of experiment */ if (img_state(idict) == DICT_NEW) { normal_warning("image","don't rely on the image data to be okay"); width(tail_par) = 0; diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c index adb1ffd52e2..f3ff58a752f 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c @@ -42,7 +42,6 @@ static const char *const callbacknames[] = { "find_type1_file", "read_type1_file", "find_truetype_file", "read_truetype_file", "find_opentype_file", "read_opentype_file", - "find_sfd_file", "read_sfd_file", "find_cidmap_file", "read_cidmap_file", "find_pk_file", "read_pk_file", "show_error_hook", diff --git a/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc index cac1bd024b0..a537e0a7c03 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc +++ b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc @@ -21,7 +21,7 @@ #include "image/epdf.h" -// Patches for the new poppler 0.59 from +// Patches for the new poppler 0.59 from // https://www.mail-archive.com/arch-commits@archlinux.org/msg357548.html // with some modifications to comply the poppler API. @@ -442,7 +442,7 @@ static int l_new_Object(lua_State * L) uout->d = new Object(lua_toboolean(L, 1)? gTrue : gFalse); uout->atype = ALLOC_LEPDF; uout->pc = 0; - uout->pd = NULL; + uout->pd = NULL; } else if (lua_isnumber (L,1)) { double d = lua_tonumber(L,1); // Missed :Object(long long int64gA) @@ -453,7 +453,7 @@ static int l_new_Object(lua_State * L) } uout->atype = ALLOC_LEPDF; uout->pc = 0; - uout->pd = NULL; + uout->pd = NULL; } else if (lua_isstring (L,1)){ GooString *gs; const char *s; @@ -463,7 +463,7 @@ static int l_new_Object(lua_State * L) uout->d = new Object(gs); uout->atype = ALLOC_LEPDF; uout->pc = 0; - uout->pd = NULL; + uout->pd = NULL; } else if (luaL_testudata(L,1,M_Array)){ udstruct *u; Array *a; @@ -472,7 +472,7 @@ static int l_new_Object(lua_State * L) uout->d = new Object(a); uout->atype = ALLOC_LEPDF; uout->pc = 0; - uout->pd = NULL; + uout->pd = NULL; } else if (luaL_testudata(L,1,M_Dict)){ udstruct *u; Dict *d; @@ -481,7 +481,7 @@ static int l_new_Object(lua_State * L) uout->d = new Object(d); uout->atype = ALLOC_LEPDF; uout->pc = 0; - uout->pd = NULL; + uout->pd = NULL; } else if (luaL_testudata(L,1,M_Stream)){ udstruct *u; Stream *s; @@ -499,7 +499,7 @@ static int l_new_Object(lua_State * L) uout->d = new Object((int)(numA), (int)(genA)); uout->atype = ALLOC_LEPDF; uout->pc = 0; - uout->pd = NULL; + uout->pd = NULL; } } else if (lua_isnumber (L,1) && (lua_isstring(L,2)|| lua_isnoneornil(L,2))) { double d_typeA = lua_tonumber(L,1); @@ -528,19 +528,19 @@ static int l_new_Object(lua_State * L) uout->d = new Object((ObjType)(typeA)); uout->atype = ALLOC_LEPDF; uout->pc = 0; - uout->pd = NULL; + uout->pd = NULL; break; default: luaL_error(L, "Invalid values for Object constructor"); break; }//switch((int)(d)) - } else // (d_typeA)!=(typeA) - luaL_error(L, "Invalid/unsupported values for Object constructor"); - } // if (lua_isnumber (L,1) && (lua_isstring(L,2)|| lua_isnoneornil(L,2))) + } else // (d_typeA)!=(typeA) + luaL_error(L, "Invalid/unsupported values for Object constructor"); + } // if (lua_isnumber (L,1) && (lua_isstring(L,2)|| lua_isnoneornil(L,2))) break; default: - luaL_error(L, "Invalid specification for Object constructor"); + luaL_error(L, "Invalid specification for Object constructor"); } lua_settop(L,1); return 1; @@ -3599,7 +3599,7 @@ static const struct luaL_Reg XRefEntry_m[] = { lua_setfield(L, -2, "__index"); \ lua_pushstring(L, "no user access"); \ lua_setfield(L, -2, "__metatable"); \ - luaL_register(L, NULL, type##_m) + luaL_openlib(L, NULL, type##_m, 0) #else #define setfuncs_meta(type) \ luaL_newmetatable(L, M_##type); \ @@ -3634,6 +3634,6 @@ int luaopen_epdf(lua_State * L) setfuncs_meta(TextSpan); setfuncs_meta(XRef); setfuncs_meta(XRefEntry); - luaL_register(L, "epdf", epdflib_f); + luaL_openlib(L, "epdf", epdflib_f, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c index 0304be8bd11..a709e42c45c 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c @@ -296,7 +296,7 @@ static const struct luaL_Reg fontlib[] = { int luaopen_font(lua_State * L) { - luaL_register(L, "font", fontlib); + luaL_openlib(L, "font", fontlib, 0); make_table(L, "fonts", "tex.fonts", "getfont", "setfont"); return 1; } @@ -481,6 +481,6 @@ static const struct luaL_Reg vflib[] = { int luaopen_vf(lua_State * L) { - luaL_register(L, "vf", vflib); + luaL_openlib(L, "vf", vflib, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/limglib.c b/Build/source/texk/web2c/luatexdir/lua/limglib.c index 6010bfd8500..f9d863eef13 100644 --- a/Build/source/texk/web2c/luatexdir/lua/limglib.c +++ b/Build/source/texk/web2c/luatexdir/lua/limglib.c @@ -758,14 +758,14 @@ int luaopen_img(lua_State * L) { luaL_newmetatable(L, TYPE_IMG); #ifdef LuajitTeX - luaL_register(L, NULL, img_m); + luaL_openlib(L, NULL, img_m, 0); luaL_newmetatable(L, TYPE_IMG_DICT); - luaL_register(L, NULL, img_dict_m); + luaL_openlib(L, NULL, img_dict_m, 0); #else luaL_setfuncs(L, img_m, 0); luaL_newmetatable(L, TYPE_IMG_DICT); luaL_setfuncs(L, img_dict_m, 0); #endif - luaL_register(L, "img", imglib_f); + luaL_openlib(L, "img", imglib_f, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/liolibext.c b/Build/source/texk/web2c/luatexdir/lua/liolibext.c index 7bd6fa4519b..29ad8447ad0 100644 --- a/Build/source/texk/web2c/luatexdir/lua/liolibext.c +++ b/Build/source/texk/web2c/luatexdir/lua/liolibext.c @@ -696,7 +696,7 @@ static const luaL_Reg siolib[] = { */ int luaopen_fio(lua_State *L) { - luaL_register(L, "fio", fiolib); - luaL_register(L, "sio", siolib); + luaL_openlib(L, "fio", fiolib, 0); + luaL_openlib(L, "sio", siolib, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c index e45cda0af6f..b1dafa58ac2 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c @@ -863,7 +863,7 @@ int luaopen_kpse(lua_State * L) luaL_newmetatable(L, KPATHSEA_METATABLE); lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); - luaL_register(L, NULL, kpselib_m); - luaL_register(L, "kpse", kpselib_l); + luaL_openlib(L, NULL, kpselib_m, 0); + luaL_openlib(L, "kpse", kpselib_l, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/llanglib.c b/Build/source/texk/web2c/luatexdir/lua/llanglib.c index 27f3c84d25e..382d4094403 100644 --- a/Build/source/texk/web2c/luatexdir/lua/llanglib.c +++ b/Build/source/texk/web2c/luatexdir/lua/llanglib.c @@ -307,7 +307,7 @@ int luaopen_lang(lua_State * L) luaL_newmetatable(L, LANG_METATABLE); lua_pushvalue(L, -1); /* push metatable */ lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ - luaL_register(L, NULL, langlib_d); /* dict methods */ - luaL_register(L, "lang", langlib); + luaL_openlib(L, NULL, langlib_d, 0); /* dict methods */ + luaL_openlib(L, "lang", langlib, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/llualib.c b/Build/source/texk/web2c/luatexdir/lua/llualib.c index 461c211472d..a73e3abf2e6 100644 --- a/Build/source/texk/web2c/luatexdir/lua/llualib.c +++ b/Build/source/texk/web2c/luatexdir/lua/llualib.c @@ -212,6 +212,12 @@ static int set_bytecode(lua_State * L) { int k, ltype; unsigned int i; + int strip = 0; + int top = lua_gettop(L); + if (lua_type(L,top) == LUA_TBOOLEAN) { + strip = lua_toboolean(L,top); + lua_settop(L,top - 1); + } k = (int) luaL_checkinteger(L, -2); i = (unsigned) k + 1; if ((int) (UINT_MAX32 / sizeof(bytecode) + 1) < i) { @@ -254,7 +260,17 @@ static int set_bytecode(lua_State * L) lua_bytecode_registers[k].buf = xmalloc(LOAD_BUF_SIZE); lua_bytecode_registers[k].alloc = LOAD_BUF_SIZE; memset(lua_bytecode_registers[k].buf, 0, LOAD_BUF_SIZE); - lua_dump(L, writer, (void *) (lua_bytecode_registers + k)); +#ifdef LuajitTeX + RESERVED_lua_dump(L, writer, (void *) (lua_bytecode_registers + k),strip); + /*lua_dump(L, writer, (void *) (lua_bytecode_registers + k));*/ +#else +#if LUA_VERSION_NUM == 503 + lua_dump(L, writer, (void *) (lua_bytecode_registers + k),strip); +#endif +#if LUA_VERSION_NUM == 502 + lua_dump(L, writer, (void *) (lua_bytecode_registers + k)); +#endif +#endif } lua_pop(L, 1); return 0; @@ -327,7 +343,7 @@ static const struct luaL_Reg lualib[] = { int luaopen_lua(lua_State * L, char *fname) { - luaL_register(L, "lua", lualib); + luaL_openlib(L, "lua", lualib, 0); make_table(L, "bytecode", "tex.bytecode", "getbytecode", "setbytecode"); make_table(L, "name", "tex.name", "getluaname", "setluaname"); lua_newtable(L); diff --git a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c index a891c59bcbb..085129d54c0 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c @@ -1019,7 +1019,7 @@ int luaopen_token(lua_State * L) { /* the main metatable of token userdata */ luaL_newmetatable(L, TOKEN_METATABLE); - luaL_register(L, NULL, tokenlib_m); - luaL_register(L, "token", tokenlib); + luaL_openlib(L, NULL, tokenlib_m, 0); + luaL_openlib(L, "token", tokenlib, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c index 5ee46a7269d..7b4c614ea4a 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c @@ -7984,7 +7984,7 @@ static void lua_new_properties_table(lua_State * L) lua_pushstring(L,"node.properties.indirect"); lua_newtable(L); luaL_newmetatable(L,"node.properties.indirect.meta"); - luaL_register(L, NULL, nodelib_p); + luaL_openlib(L, NULL, nodelib_p, 0); lua_setmetatable(L,-2); lua_settable(L,LUA_REGISTRYINDEX); } @@ -8239,12 +8239,12 @@ int luaopen_node(lua_State * L) /* the main metatable of node userdata */ luaL_newmetatable(L, NODE_METATABLE); /* node.* */ - luaL_register(L, NULL, nodelib_m); - luaL_register(L, "node", nodelib_f); + luaL_openlib(L, NULL, nodelib_m, 0); + luaL_openlib(L, "node", nodelib_f, 0); /* node.direct */ lua_pushstring(L,"direct"); lua_newtable(L); - luaL_register(L, NULL, direct_nodelib_f); + luaL_openlib(L, NULL, direct_nodelib_f, 0); lua_rawset(L,-3); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c index 88f9eac7c24..096600de34f 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c @@ -43,9 +43,13 @@ static int luapdfprint(lua_State * L) literal_mode = direct_always; else if (lua_key_eq(modestr_s,page)) literal_mode = direct_page; + else if (lua_key_eq(modestr_s,text)) + literal_mode = direct_text; else if (lua_key_eq(modestr_s,raw)) literal_mode = direct_raw; - else { + else if (lua_key_eq(modestr_s,origin)) + literal_mode = set_origin; + else { luaL_error(L, "invalid first argument for print literal mode"); } } @@ -63,6 +67,10 @@ static int luapdfprint(lua_State * L) pdf_goto_pagemode(static_pdf); (void) calc_pdfpos(static_pdf->pstruct, static_pdf->posstruct->pos); break; + case (direct_text): + pdf_goto_textmode(static_pdf); + (void) calc_pdfpos(static_pdf->pstruct, static_pdf->posstruct->pos); + break; case (direct_always): pdf_end_string_nl(static_pdf); break; @@ -1126,6 +1134,8 @@ static int newpdfcolorstack(lua_State * L) literal_mode = set_origin; } else if (lua_key_eq(l,page)) { literal_mode = direct_page; + } else if (lua_key_eq(l,text)) { + literal_mode = direct_text; } else if (lua_key_eq(l,direct)) { literal_mode = direct_always; } else if (lua_key_eq(l,raw)) { @@ -1255,7 +1265,7 @@ int luaopen_pdf(lua_State * L) lua_newtable(L); lua_settable(L,LUA_REGISTRYINDEX); /* */ - luaL_register(L, "pdf", pdflib); + luaL_openlib(L, "pdf", pdflib, 0); /* luaL_newmetatable(L, "pdf.meta"); lua_pushstring(L, "__index"); diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc index eb881b63c3d..8bafd61229c 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc +++ b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc @@ -944,8 +944,8 @@ LUALIB_API int luaopen_pdfscanner(lua_State * L) luaL_openlib(L, 0, scannerlib_meta, 0); lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); - luaL_register(L, NULL, scannerlib_m); - luaL_register(L, "pdfscanner", scannerlib); + luaL_openlib(L, NULL, scannerlib_m, 0); + luaL_openlib(L, "pdfscanner", scannerlib, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c index 943cd0fb07a..43f33008db4 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c @@ -492,7 +492,7 @@ static const struct luaL_Reg statslib[] = { int luaopen_stats(lua_State * L) { - luaL_register(L, "status", statslib); + luaL_openlib(L, "status", statslib, 0); luaL_newmetatable(L, "tex.stats"); lua_pushstring(L, "__index"); lua_pushcfunction(L, getstats); diff --git a/Build/source/texk/web2c/luatexdir/lua/lstrlibext.c b/Build/source/texk/web2c/luatexdir/lua/lstrlibext.c index f7f8cbf10ea..50c7235ee55 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lstrlibext.c +++ b/Build/source/texk/web2c/luatexdir/lua/lstrlibext.c @@ -311,6 +311,7 @@ static int str_split (lua_State *L) { #ifdef LuajitTeX /* dump is built in */ #else +#if (LUA_VERSION_NUM == 502) static int writer (lua_State *L, const void* b, size_t size, void* B) { (void)L; luaL_addlstring((luaL_Buffer*) B, (const char *)b, size); @@ -331,6 +332,7 @@ static int lua_sdump (lua_State *L, lua_Writer writer, void *data, int stripping return status; } + static int str_dump (lua_State *L) { luaL_Buffer b; int stripping = 0; @@ -345,6 +347,7 @@ static int str_dump (lua_State *L) { luaL_pushresult(&b); return 1; } +#endif #endif /*ifdef LuajitTeX*/ static int str_bytetable (lua_State *L) { @@ -501,8 +504,12 @@ static const luaL_Reg strlibext[] = { #ifdef LuajitTeX /* luajit has dump built in */ #else +/* lua 5.3.4 doesn't need this patch */ +#if (LUA_VERSION_NUM == 502) {"dump", str_dump}, #endif + +#endif /* #ifdef LuajitTeX */ {NULL, NULL} }; diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c b/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c index 370c457b91f..f0fa5d369fe 100644 --- a/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c +++ b/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c @@ -164,6 +164,6 @@ static const struct luaL_Reg texiolib[] = { int luaopen_texio(lua_State * L) { - luaL_register(L, "texio", texiolib); + luaL_openlib(L, "texio", texiolib, 0); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/luanode.w b/Build/source/texk/web2c/luatexdir/lua/luanode.w index c09cac1ff01..ef2f0b92655 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luanode.w +++ b/Build/source/texk/web2c/luatexdir/lua/luanode.w @@ -410,6 +410,7 @@ void show_pdf_literal(pointer p) tprint_esc("pdfliteral"); switch (pdf_literal_mode(p)) { case set_origin: + tprint(" origin"); break; case direct_page: tprint(" page"); diff --git a/Build/source/texk/web2c/luatexdir/lua/luastuff.w b/Build/source/texk/web2c/luatexdir/lua/luastuff.w index 7274a683637..a2b1dd14327 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luastuff.w +++ b/Build/source/texk/web2c/luatexdir/lua/luastuff.w @@ -153,6 +153,9 @@ static const luaL_Reg lualibs[] = { /* coroutine is loaded in a special way */ { "bit", luaopen_bit }, #else +#if LUA_VERSION_NUM == 503 + { "utf8", luaopen_utf8 }, +#endif { "coroutine", luaopen_coroutine }, #endif /* additional (public) libraries */ diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-core.c b/Build/source/texk/web2c/luatexdir/lua/luatex-core.c index 780c12f4c50..6551b0bc443 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-core.c +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-core.c @@ -8,297 +8,555 @@ int load_luatex_core_lua (lua_State * L); int load_luatex_core_lua (lua_State * L) { static unsigned char luatex_core_lua[] = { - 0x2d, 0x2d, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x73, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3d, - 0x20, 0x7b, 0x20, 0x7d, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, - 0x20, 0x5b, 0x27, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x27, 0x5d, - 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x30, 0x31, 0x2c, 0x0a, 0x2d, - 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x20, 0x20, - 0x3d, 0x20, 0x27, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, - 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x27, 0x2c, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x27, 0x48, 0x61, 0x6e, - 0x73, 0x20, 0x48, 0x61, 0x67, 0x65, 0x6e, 0x20, 0x26, 0x20, 0x4c, 0x75, 0x69, 0x67, 0x69, 0x20, - 0x53, 0x63, 0x61, 0x72, 0x73, 0x6f, 0x27, 0x2c, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, 0x20, 0x27, 0x4c, 0x75, 0x61, - 0x54, 0x65, 0x58, 0x20, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x20, - 0x54, 0x65, 0x61, 0x6d, 0x27, 0x2c, 0x0a, 0x2d, 0x2d, 0x20, 0x7d, 0x0a, 0x0a, 0x4c, 0x55, 0x41, - 0x54, 0x45, 0x58, 0x43, 0x4f, 0x52, 0x45, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x20, 0x3d, - 0x20, 0x31, 0x2e, 0x30, 0x30, 0x33, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, - 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x20, 0x73, - 0x6f, 0x6d, 0x65, 0x20, 0x4c, 0x75, 0x61, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x20, - 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x0a, 0x2d, 0x2d, 0x20, 0x66, 0x75, 0x6e, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x61, 0x73, 0x20, 0x4c, 0x75, - 0x61, 0x54, 0x65, 0x58, 0x20, 0x3c, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x34, 0x20, 0x61, 0x6e, 0x64, - 0x20, 0x64, 0x6f, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x77, - 0x61, 0x79, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x75, 0x73, 0x20, 0x74, 0x6f, - 0x20, 0x6b, 0x65, 0x65, 0x70, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2d, 0x2d, 0x20, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6f, 0x20, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, - 0x65, 0x73, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x2e, 0x20, 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x6c, - 0x79, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x62, 0x69, 0x74, 0x20, 0x62, 0x65, 0x74, - 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x77, 0x2e, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, - 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x2c, 0x20, 0x67, 0x65, 0x74, 0x6d, - 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x20, 0x3d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x2c, 0x20, - 0x67, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x20, 0x72, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x6e, 0x64, - 0x2c, 0x20, 0x67, 0x73, 0x75, 0x62, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d, - 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2c, 0x20, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x73, 0x75, 0x62, 0x2c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, - 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x0a, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x20, 0x69, 0x6f, 0x5f, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, - 0x65, 0x6e, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, - 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, - 0x6f, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, - 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x3d, 0x20, 0x66, 0x69, 0x6f, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, - 0x65, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x69, - 0x6f, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x3d, 0x20, 0x66, 0x69, - 0x6f, 0x2e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x74, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x67, 0x65, - 0x74, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x69, 0x6f, 0x2e, 0x73, 0x74, - 0x64, 0x65, 0x72, 0x72, 0x29, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x74, 0x5f, 0x6c, - 0x69, 0x6e, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x3d, 0x20, 0x6d, 0x74, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x20, 0x73, 0x61, 0x66, 0x65, 0x72, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x73, 0x61, - 0x66, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x20, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x73, 0x68, - 0x65, 0x6c, 0x6c, 0x5f, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x20, 0x2d, 0x2d, 0x20, 0x30, 0x20, - 0x28, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x20, 0x31, 0x20, 0x28, 0x61, 0x6e, - 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x29, 0x20, 0x32, 0x20, 0x28, 0x72, 0x65, 0x73, 0x74, 0x72, - 0x69, 0x63, 0x74, 0x65, 0x64, 0x29, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6b, 0x70, 0x73, - 0x65, 0x75, 0x73, 0x65, 0x64, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x6b, 0x70, 0x73, 0x65, 0x5f, 0x75, - 0x73, 0x65, 0x64, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x30, 0x20, 0x31, 0x0a, 0x0a, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x6c, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x69, 0x6f, - 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x6c, 0x0a, 0x0a, 0x69, 0x6f, 0x2e, 0x73, 0x61, - 0x76, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, - 0x2d, 0x2d, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, - 0x6c, 0x79, 0x0a, 0x6d, 0x74, 0x2e, 0x73, 0x61, 0x76, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, - 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6d, - 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x2d, 0x2d, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, - 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, - 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, - 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, - 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x27, 0x72, 0x27, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, - 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x20, 0x3d, 0x20, - 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, - 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x66, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x74, 0x79, 0x70, 0x65, 0x28, - 0x68, 0x6f, 0x77, 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x27, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x27, - 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x6e, 0x64, 0x28, 0x68, 0x6f, 0x77, 0x2c, 0x27, 0x77, - 0x27, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x66, 0x69, - 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x27, 0x77, 0x27, 0x29, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, + 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x20, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6f, 0x20, 0x6f, + 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x20, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, + 0x2e, 0x2e, 0x2e, 0x2e, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x7d, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x5b, 0x27, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x2d, + 0x63, 0x6f, 0x72, 0x65, 0x27, 0x5d, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x31, 0x2e, + 0x30, 0x30, 0x35, 0x2c, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x27, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x69, + 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x27, 0x2c, 0x0a, 0x2d, + 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x20, 0x20, 0x20, 0x20, + 0x3d, 0x20, 0x27, 0x48, 0x61, 0x6e, 0x73, 0x20, 0x48, 0x61, 0x67, 0x65, 0x6e, 0x20, 0x26, 0x20, + 0x4c, 0x75, 0x69, 0x67, 0x69, 0x20, 0x53, 0x63, 0x61, 0x72, 0x73, 0x6f, 0x27, 0x2c, 0x0a, 0x2d, + 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, + 0x3d, 0x20, 0x27, 0x4c, 0x75, 0x61, 0x54, 0x65, 0x58, 0x20, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x65, 0x61, 0x6d, 0x27, 0x2c, 0x0a, 0x2d, 0x2d, 0x20, + 0x7d, 0x0a, 0x0a, 0x4c, 0x55, 0x41, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x52, 0x45, 0x56, 0x45, 0x52, + 0x53, 0x49, 0x4f, 0x4e, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x30, 0x35, 0x0a, 0x0a, 0x2d, 0x2d, + 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x6c, + 0x6f, 0x61, 0x64, 0x73, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x4c, 0x75, 0x61, 0x20, 0x66, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x72, 0x65, 0x61, + 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x0a, + 0x2d, 0x2d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, + 0x20, 0x61, 0x73, 0x20, 0x4c, 0x75, 0x61, 0x54, 0x65, 0x58, 0x20, 0x3c, 0x3d, 0x20, 0x31, 0x2e, + 0x30, 0x34, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x6f, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x77, 0x61, 0x79, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x73, + 0x20, 0x75, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6b, 0x65, 0x65, 0x70, 0x20, 0x74, 0x68, 0x65, 0x0a, + 0x2d, 0x2d, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6f, 0x20, 0x6c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x2e, 0x20, + 0x50, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x69, 0x73, 0x20, 0x70, + 0x72, 0x6f, 0x62, 0x61, 0x62, 0x6c, 0x79, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x62, + 0x69, 0x74, 0x20, 0x62, 0x65, 0x74, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x77, 0x2e, 0x0a, 0x0a, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x6e, 0x65, 0x78, 0x74, + 0x2c, 0x20, 0x67, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x20, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x20, 0x3d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, + 0x6e, 0x65, 0x78, 0x74, 0x2c, 0x20, 0x67, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x0a, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x20, 0x66, 0x69, 0x6e, 0x64, 0x2c, 0x20, 0x67, 0x73, 0x75, 0x62, 0x2c, 0x20, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x69, + 0x6e, 0x64, 0x2c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x73, 0x75, 0x62, 0x2c, + 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x0a, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x6f, 0x5f, 0x70, 0x6f, 0x70, + 0x65, 0x6e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, + 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, + 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x0a, 0x0a, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, + 0x65, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x66, 0x69, 0x6f, 0x2e, 0x72, + 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x69, + 0x6f, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x69, + 0x6f, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, + 0x20, 0x20, 0x3d, 0x20, 0x66, 0x69, 0x6f, 0x2e, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x66, 0x69, + 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x74, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x3d, 0x20, 0x67, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x28, 0x69, 0x6f, 0x2e, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x29, 0x0a, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x20, 0x6d, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6d, 0x74, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, + 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x61, 0x66, 0x65, 0x72, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2e, 0x73, 0x61, 0x66, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x63, 0x61, + 0x70, 0x65, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2e, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x5f, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, + 0x20, 0x2d, 0x2d, 0x20, 0x30, 0x20, 0x28, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, + 0x20, 0x31, 0x20, 0x28, 0x61, 0x6e, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x29, 0x20, 0x32, 0x20, + 0x28, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x29, 0x0a, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x20, 0x6b, 0x70, 0x73, 0x65, 0x75, 0x73, 0x65, 0x64, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, + 0x6b, 0x70, 0x73, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, + 0x30, 0x20, 0x31, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x5f, 0x6e, 0x6c, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, + 0x20, 0x74, 0x65, 0x78, 0x69, 0x6f, 0x2e, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x6c, 0x0a, + 0x0a, 0x69, 0x6f, 0x2e, 0x73, 0x61, 0x76, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x5f, + 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x2d, 0x2d, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, + 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x6d, 0x74, 0x2e, 0x73, 0x61, 0x76, 0x65, + 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6d, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x2d, 0x2d, + 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, + 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, + 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x27, 0x72, 0x27, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x20, 0x66, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, + 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x66, + 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, + 0x20, 0x74, 0x79, 0x70, 0x65, 0x28, 0x68, 0x6f, 0x77, 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x27, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x27, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x6e, 0x64, 0x28, + 0x68, 0x6f, 0x77, 0x2c, 0x27, 0x77, 0x27, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, - 0x65, 0x2c, 0x27, 0x72, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, - 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, - 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6f, - 0x6e, 0x6c, 0x79, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x69, 0x66, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x27, 0x72, 0x27, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x67, 0x73, 0x75, 0x62, 0x28, 0x68, 0x6f, 0x77, 0x2c, - 0x27, 0x5b, 0x5e, 0x72, 0x62, 0x5d, 0x27, 0x2c, 0x27, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x27, 0x27, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x27, 0x72, 0x27, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x20, 0x3d, 0x20, 0x69, 0x6f, - 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x29, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x66, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x27, 0x72, - 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, - 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, - 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, - 0x6f, 0x6b, 0x61, 0x79, 0x2c, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x69, - 0x6f, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6f, - 0x6b, 0x61, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x74, 0x68, - 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x20, 0x69, 0x6f, 0x5f, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x66, 0x6f, 0x75, 0x6e, 0x64, - 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x65, 0x6e, + 0x65, 0x2c, 0x27, 0x77, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, + 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x27, 0x72, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, - 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x69, 0x66, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x20, 0x3d, 0x20, 0x69, - 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x20, - 0x6f, 0x72, 0x20, 0x27, 0x72, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x69, 0x66, 0x20, 0x66, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, - 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x28, 0x66, 0x29, 0x0a, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, - 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x20, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x28, 0x29, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, - 0x5f, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x28, 0x66, 0x29, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, - 0x65, 0x28, 0x66, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x65, 0x6e, 0x64, - 0x0a, 0x0a, 0x69, 0x6f, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x75, 0x61, - 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x0a, 0x6d, 0x74, 0x2e, - 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, - 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x57, - 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6b, 0x70, 0x73, 0x65, 0x2e, 0x20, 0x54, - 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2d, 0x2d, 0x20, 0x63, 0x61, - 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x43, 0x6f, 0x6e, 0x54, 0x65, 0x58, 0x74, 0x2e, 0x0a, 0x0a, - 0x69, 0x66, 0x20, 0x6b, 0x70, 0x73, 0x65, 0x75, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x3d, 0x20, 0x31, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, - 0x6f, 0x70, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, 0x65, - 0x6e, 0x20, 0x3d, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x70, 0x6f, - 0x70, 0x65, 0x6e, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x73, 0x61, 0x66, - 0x65, 0x72, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x20, 0x74, 0x68, - 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, - 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, - 0x6d, 0x6d, 0x79, 0x28, 0x73, 0x74, 0x72, 0x2c, 0x66, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, - 0x64, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x6c, - 0x28, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x73, 0x61, 0x66, 0x65, 0x72, 0x20, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x20, 0x25, 0x71, 0x20, 0x69, 0x73, 0x20, 0x25, 0x73, 0x22, 0x2c, 0x0a, 0x20, + 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, + 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, + 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, + 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, + 0x3d, 0x20, 0x27, 0x72, 0x27, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x67, 0x73, 0x75, + 0x62, 0x28, 0x68, 0x6f, 0x77, 0x2c, 0x27, 0x5b, 0x5e, 0x72, 0x62, 0x5d, 0x27, 0x2c, 0x27, 0x27, + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x68, 0x6f, 0x77, + 0x20, 0x3d, 0x3d, 0x20, 0x27, 0x27, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x27, 0x72, + 0x27, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, + 0x66, 0x20, 0x3d, 0x20, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, + 0x2c, 0x68, 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x66, 0x20, 0x74, + 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x69, 0x6f, 0x5f, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x28, 0x6e, + 0x61, 0x6d, 0x65, 0x2c, 0x27, 0x72, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x0a, 0x65, 0x6e, + 0x64, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x70, 0x6f, 0x70, 0x65, + 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6f, 0x6b, 0x61, 0x79, 0x2c, 0x20, 0x66, 0x6f, 0x75, 0x6e, + 0x64, 0x20, 0x3d, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x69, 0x66, 0x20, 0x6f, 0x6b, 0x61, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x6f, + 0x75, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x6f, 0x5f, 0x70, 0x6f, 0x70, 0x65, 0x6e, + 0x28, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x65, 0x6e, 0x64, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, + 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, + 0x68, 0x6f, 0x77, 0x29, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x20, 0x3d, 0x20, 0x69, 0x6f, + 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x20, 0x6f, + 0x72, 0x20, 0x27, 0x72, 0x27, 0x29, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x69, 0x66, 0x20, 0x66, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x2d, 0x2d, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x73, 0x74, 0x72, 0x2c, 0x66, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x65, 0x64, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x22, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, - 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x66, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, - 0x75, 0x72, 0x6e, 0x20, 0x66, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x28, - 0x73, 0x74, 0x72, 0x2c, 0x66, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, - 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, - 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x20, 0x3d, 0x20, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, - 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, - 0x73, 0x2e, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x73, 0x70, 0x61, - 0x77, 0x6e, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, - 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, - 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x22, 0x29, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x65, 0x6e, 0x76, 0x20, 0x20, 0x3d, 0x20, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x65, 0x6e, 0x76, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, - 0x74, 0x65, 0x6d, 0x70, 0x64, 0x69, 0x72, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x64, - 0x69, 0x72, 0x22, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, - 0x65, 0x6e, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, - 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x22, 0x29, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x20, 0x20, 0x20, 0x3d, - 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x69, - 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x22, 0x2c, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, - 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x29, - 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, - 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, - 0x22, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, - 0x20, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x22, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, - 0x74, 0x6d, 0x70, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x69, 0x6f, 0x2e, 0x74, 0x6d, 0x70, 0x66, 0x69, - 0x6c, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, - 0x6d, 0x79, 0x28, 0x22, 0x69, 0x6f, 0x2e, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x29, 0x0a, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x63, 0x68, 0x64, 0x69, 0x72, 0x20, 0x20, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, + 0x69, 0x6e, 0x65, 0x28, 0x66, 0x29, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x28, + 0x29, 0x0a, 0x2d, 0x2d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x2d, 0x2d, 0x20, + 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x73, 0x6f, 0x6d, 0x65, + 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x63, 0x20, 0x64, + 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x6b, 0x69, 0x63, 0x6b, 0x20, 0x69, 0x6e, 0x20, 0x73, + 0x6f, 0x20, 0x77, 0x65, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6c, 0x6f, + 0x73, 0x65, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x74, 0x6c, 0x79, 0x0a, 0x2d, 0x2d, 0x20, 0x73, + 0x6f, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x20, 0x69, 0x73, 0x20, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x74, 0x79, 0x70, 0x65, + 0x20, 0x3d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x74, 0x79, 0x70, 0x65, 0x0a, 0x0a, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, + 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x28, 0x6e, + 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, + 0x74, 0x79, 0x70, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x20, 0x3d, 0x20, 0x69, 0x6f, + 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x68, 0x6f, 0x77, 0x20, 0x6f, + 0x72, 0x20, 0x27, 0x72, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, + 0x66, 0x20, 0x66, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x20, 0x3d, + 0x20, 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x28, 0x66, 0x29, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x66, 0x3a, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, + 0x77, 0x68, 0x6f, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x69, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, + 0x20, 0x77, 0x61, 0x79, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, + 0x20, 0x27, 0x69, 0x6f, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x27, 0x20, 0x63, 0x61, 0x6e, 0x27, + 0x74, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x27, 0x22, 0x20, 0x2e, 0x2e, 0x20, 0x6e, 0x61, 0x6d, + 0x65, 0x20, 0x2e, 0x2e, 0x20, 0x22, 0x27, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x6f, + 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, + 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x72, + 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x28, 0x66, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, + 0x66, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x28, 0x66, 0x29, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x6f, 0x2e, + 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, + 0x6f, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x0a, 0x6d, 0x74, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, + 0x20, 0x3d, 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x61, + 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x57, 0x65, 0x20, 0x61, 0x73, 0x73, + 0x75, 0x6d, 0x65, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x74, + 0x6f, 0x20, 0x62, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x62, 0x79, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x20, 0x6f, 0x66, 0x20, 0x6b, 0x70, 0x73, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, + 0x73, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2d, 0x2d, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x69, 0x6e, + 0x20, 0x43, 0x6f, 0x6e, 0x54, 0x65, 0x58, 0x74, 0x2e, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6b, 0x70, + 0x73, 0x65, 0x75, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x20, 0x74, 0x68, 0x65, 0x6e, + 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x20, 0x3d, + 0x20, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x6c, + 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x0a, 0x0a, + 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x73, 0x61, 0x66, 0x65, 0x72, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x73, + 0x74, 0x72, 0x2c, 0x66, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x2e, 0x2e, 0x2e, + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x74, 0x68, + 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x6c, 0x28, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x28, 0x22, 0x73, 0x61, 0x66, 0x65, 0x72, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x25, + 0x71, 0x20, 0x69, 0x73, 0x20, 0x25, 0x73, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, + 0x72, 0x2c, 0x66, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, + 0x22, 0x20, 0x6f, 0x72, 0x20, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, + 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, + 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, + 0x20, 0x66, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, + 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, + 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x28, 0x73, 0x74, 0x72, 0x2c, 0x66, + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x73, 0x70, 0x61, + 0x77, 0x6e, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, + 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x22, 0x29, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x20, 0x20, 0x20, 0x20, 0x3d, + 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, + 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, + 0x73, 0x65, 0x74, 0x65, 0x6e, 0x76, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x65, 0x6e, + 0x76, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x64, + 0x69, 0x72, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, + 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x74, 0x65, 0x6d, 0x70, 0x64, 0x69, 0x72, 0x22, 0x29, 0x0a, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, - 0x6c, 0x66, 0x73, 0x2e, 0x63, 0x68, 0x64, 0x69, 0x72, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x6c, 0x66, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6c, 0x66, 0x73, 0x2e, 0x6c, - 0x6f, 0x63, 0x6b, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x74, 0x6f, - 0x75, 0x63, 0x68, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, - 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6c, 0x66, 0x73, 0x2e, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x22, 0x29, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x6d, 0x64, 0x69, 0x72, 0x20, 0x20, + 0x69, 0x6f, 0x2e, 0x70, 0x6f, 0x70, 0x65, 0x6e, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, + 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x22, 0x2c, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6f, 0x5f, 0x6f, 0x70, 0x65, + 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x72, + 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x73, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6f, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x22, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x74, 0x6d, 0x70, 0x66, 0x69, + 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, + 0x79, 0x28, 0x22, 0x69, 0x6f, 0x2e, 0x74, 0x6d, 0x70, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x29, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x20, 0x3d, + 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x69, + 0x6f, 0x2e, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x6c, 0x66, 0x73, 0x2e, 0x63, 0x68, 0x64, 0x69, 0x72, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6c, 0x66, 0x73, 0x2e, 0x63, + 0x68, 0x64, 0x69, 0x72, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x6c, + 0x6f, 0x63, 0x6b, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, + 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6c, 0x66, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x29, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, - 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x6d, 0x64, 0x69, 0x72, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x6c, 0x66, 0x73, 0x2e, 0x6d, 0x6b, 0x64, 0x69, 0x72, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6c, 0x66, 0x73, 0x2e, 0x6d, - 0x6b, 0x64, 0x69, 0x72, 0x22, 0x29, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, - 0x73, 0x61, 0x66, 0x65, 0x72, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x31, - 0x20, 0x6f, 0x72, 0x20, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x20, - 0x7e, 0x3d, 0x20, 0x31, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, - 0x66, 0x69, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x27, 0x66, 0x66, - 0x69, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x2c, 0x20, 0x76, - 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x78, 0x74, 0x2c, 0x20, 0x66, 0x66, 0x69, 0x20, 0x64, 0x6f, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6b, 0x20, 0x7e, 0x3d, - 0x20, 0x27, 0x67, 0x63, 0x27, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, 0x5b, 0x6b, 0x5d, 0x20, 0x3d, 0x20, - 0x6e, 0x69, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, 0x20, - 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x6f, - 0x73, 0x2e, 0x5b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x7c, 0x6f, 0x73, 0x2e, 0x73, 0x70, - 0x61, 0x77, 0x6e, 0x7c, 0x6f, 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x5d, 0x20, 0x61, 0x6c, 0x72, - 0x65, 0x61, 0x64, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, - 0x63, 0x61, 0x70, 0x65, 0x20, 0x61, 0x77, 0x61, 0x72, 0x65, 0x29, 0x0a, 0x0a, 0x0a, 0x69, 0x66, - 0x20, 0x6d, 0x64, 0x35, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x75, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6d, 0x64, - 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, - 0x67, 0x73, 0x75, 0x62, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x67, 0x73, 0x75, 0x62, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, - 0x62, 0x79, 0x74, 0x65, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, - 0x62, 0x79, 0x74, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x68, 0x65, 0x78, 0x61, 0x28, 0x6b, - 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x20, 0x28, 0x67, 0x73, 0x75, 0x62, 0x28, 0x73, 0x75, 0x6d, 0x28, 0x6b, 0x29, 0x2c, 0x20, 0x22, - 0x2e, 0x22, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x25, 0x30, 0x32, 0x78, 0x22, - 0x2c, 0x62, 0x79, 0x74, 0x65, 0x28, 0x63, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x65, 0x6e, 0x64, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, + 0x6c, 0x66, 0x73, 0x2e, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x6d, 0x64, 0x69, 0x72, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6c, 0x66, 0x73, 0x2e, 0x72, + 0x6d, 0x64, 0x69, 0x72, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x6d, + 0x6b, 0x64, 0x69, 0x72, 0x20, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x64, + 0x75, 0x6d, 0x6d, 0x79, 0x28, 0x22, 0x6c, 0x66, 0x73, 0x2e, 0x6d, 0x6b, 0x64, 0x69, 0x72, 0x22, + 0x29, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x73, 0x61, 0x66, 0x65, 0x72, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x20, 0x6f, 0x72, 0x20, 0x73, + 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x20, 0x7e, 0x3d, 0x20, 0x31, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, 0x20, 0x3d, 0x20, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x27, 0x66, 0x66, 0x69, 0x27, 0x29, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x2c, 0x20, 0x76, 0x20, 0x69, 0x6e, 0x20, 0x6e, + 0x65, 0x78, 0x74, 0x2c, 0x20, 0x66, 0x66, 0x69, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6b, 0x20, 0x7e, 0x3d, 0x20, 0x27, 0x67, 0x63, 0x27, + 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x66, 0x66, 0x69, 0x5b, 0x6b, 0x5d, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, + 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x66, 0x69, 0x20, 0x3d, 0x20, 0x6e, 0x69, 0x6c, + 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x6f, 0x73, 0x2e, 0x5b, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x7c, 0x6f, 0x73, 0x2e, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x7c, 0x6f, + 0x73, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x5d, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, + 0x61, 0x72, 0x65, 0x20, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x20, + 0x61, 0x77, 0x61, 0x72, 0x65, 0x29, 0x0a, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6d, 0x64, 0x35, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, + 0x73, 0x75, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x67, 0x73, 0x75, 0x62, 0x20, + 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x73, 0x75, 0x62, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, + 0x20, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x64, - 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x48, 0x45, 0x58, 0x41, 0x28, 0x6b, 0x29, 0x0a, 0x20, 0x20, 0x20, + 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x68, 0x65, 0x78, 0x61, 0x28, 0x6b, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x67, 0x73, 0x75, 0x62, 0x28, 0x73, 0x75, 0x6d, 0x28, 0x6b, 0x29, 0x2c, 0x20, 0x22, 0x2e, 0x22, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x25, 0x30, 0x32, 0x58, 0x22, 0x2c, 0x62, 0x79, 0x74, 0x65, + 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x25, 0x30, 0x32, 0x78, 0x22, 0x2c, 0x62, 0x79, 0x74, 0x65, 0x28, 0x63, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, - 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, - 0x0a, 0x00 + 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, + 0x48, 0x45, 0x58, 0x41, 0x28, 0x6b, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x67, 0x73, 0x75, 0x62, 0x28, 0x73, 0x75, 0x6d, + 0x28, 0x6b, 0x29, 0x2c, 0x20, 0x22, 0x2e, 0x22, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, + 0x22, 0x25, 0x30, 0x32, 0x58, 0x22, 0x2c, 0x62, 0x79, 0x74, 0x65, 0x28, 0x63, 0x29, 0x29, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x29, 0x29, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x67, 0x6f, 0x20, 0x61, 0x77, 0x61, 0x79, + 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, + 0x3d, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x0a, 0x65, + 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x73, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x20, 0x3d, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x65, 0x72, 0x73, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x69, 0x66, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, + 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, + 0x2d, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x3a, + 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x73, 0x74, 0x61, 0x79, + 0x0a, 0x0a, 0x69, 0x66, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x20, 0x35, 0x2e, 0x32, 0x3a, + 0x20, 0x77, 0x65, 0x27, 0x72, 0x65, 0x20, 0x6f, 0x6b, 0x61, 0x79, 0x0a, 0x0a, 0x65, 0x6c, 0x73, + 0x65, 0x69, 0x66, 0x20, 0x75, 0x74, 0x66, 0x38, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x6c, 0x75, 0x61, 0x20, 0x35, 0x2e, 0x33, 0x3a, 0x20, 0x20, + 0x62, 0x69, 0x74, 0x77, 0x69, 0x73, 0x65, 0x2e, 0x6c, 0x75, 0x61, 0x2c, 0x20, 0x76, 0x20, 0x31, + 0x2e, 0x32, 0x34, 0x20, 0x32, 0x30, 0x31, 0x34, 0x2f, 0x31, 0x32, 0x2f, 0x32, 0x36, 0x20, 0x31, + 0x37, 0x3a, 0x32, 0x30, 0x3a, 0x35, 0x33, 0x20, 0x72, 0x6f, 0x62, 0x65, 0x72, 0x74, 0x6f, 0x0a, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, + 0x64, 0x20, 0x28, 0x20, 0x5b, 0x5b, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x2d, 0x2d, 0x20, + 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66, 0x3a, 0x20, 0x61, 0x72, 0x67, 0x20, + 0x3d, 0x20, 0x7b, 0x20, 0x2e, 0x2e, 0x2e, 0x20, 0x7d, 0x0a, 0x0a, 0x62, 0x69, 0x74, 0x33, 0x32, + 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, + 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x7e, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, + 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, + 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x78, + 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, 0x20, 0x26, 0x20, 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, + 0x2d, 0x31, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, 0x26, + 0x20, 0x79, 0x20, 0x26, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, + 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, 0x2c, + 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x73, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, + 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x29, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, 0x74, 0x68, + 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, + 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x79, 0x20, 0x6f, + 0x72, 0x20, 0x30, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, + 0x7c, 0x20, 0x79, 0x20, 0x7c, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, + 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, + 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x7c, 0x20, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, + 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x78, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, 0x20, 0x2e, 0x2e, + 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x7a, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x20, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x20, 0x7e, 0x20, 0x28, 0x79, + 0x20, 0x6f, 0x72, 0x20, 0x30, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, + 0x78, 0x20, 0x7e, 0x20, 0x79, 0x20, 0x7e, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, + 0x23, 0x22, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x7e, 0x20, 0x73, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, + 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x74, 0x65, 0x73, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x78, 0x2c, 0x20, 0x79, 0x2c, 0x20, 0x7a, 0x2c, + 0x20, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, + 0x20, 0x7a, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x28, 0x78, 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, + 0x20, 0x26, 0x20, 0x28, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x2d, 0x31, 0x29, 0x29, 0x20, 0x26, 0x20, + 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x30, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x78, 0x20, 0x26, 0x20, + 0x79, 0x20, 0x26, 0x20, 0x7a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, + 0x69, 0x3d, 0x31, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x23, 0x22, 0x2c, 0x2e, + 0x2e, 0x2e, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x73, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x28, 0x69, 0x2c, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x20, 0x28, 0x72, 0x65, 0x73, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x46, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, + 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, + 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, + 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, + 0x28, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x29, + 0x20, 0x3c, 0x3c, 0x20, 0x62, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x73, 0x68, + 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, + 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x20, 0x28, 0x28, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x29, 0x20, 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x61, + 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, + 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x62, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x20, 0x6f, 0x72, + 0x20, 0x28, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x62, + 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x62, 0x29, 0x20, 0x7c, + 0x20, 0x7e, 0x28, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x20, 0x3e, 0x3e, + 0x20, 0x62, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, + 0x0a, 0x20, 0x20, 0x6c, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x20, 0x2c, 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x62, 0x20, 0x3d, 0x20, 0x62, 0x20, 0x26, 0x20, 0x33, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x61, 0x20, 0x3d, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x20, 0x3c, 0x3c, + 0x20, 0x62, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x28, 0x33, 0x32, 0x20, + 0x2d, 0x20, 0x62, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, + 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, + 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, + 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, + 0x62, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x3d, 0x20, 0x2d, 0x62, 0x20, 0x26, 0x20, + 0x33, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3d, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, + 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, + 0x3d, 0x20, 0x28, 0x61, 0x20, 0x3c, 0x3c, 0x20, 0x62, 0x29, 0x20, 0x7c, 0x20, 0x28, 0x61, 0x20, + 0x3e, 0x3e, 0x20, 0x28, 0x33, 0x32, 0x20, 0x2d, 0x20, 0x62, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, + 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x28, 0x61, 0x2c, 0x20, 0x66, 0x2c, 0x20, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x61, 0x20, 0x3e, 0x3e, 0x20, 0x66, 0x29, + 0x20, 0x26, 0x20, 0x7e, 0x28, 0x2d, 0x31, 0x20, 0x3c, 0x3c, 0x20, 0x28, 0x77, 0x20, 0x6f, 0x72, + 0x20, 0x31, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x65, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x28, 0x61, 0x2c, 0x20, 0x76, 0x2c, 0x20, 0x66, 0x2c, 0x20, 0x77, 0x29, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x3d, 0x20, 0x7e, + 0x28, 0x2d, 0x31, 0x20, 0x3c, 0x3c, 0x20, 0x28, 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x29, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x28, 0x28, 0x61, 0x20, + 0x26, 0x20, 0x7e, 0x28, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x3c, 0x3c, 0x20, 0x66, 0x29, 0x29, 0x20, + 0x7c, 0x20, 0x28, 0x28, 0x76, 0x20, 0x26, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x29, 0x20, 0x3c, 0x3c, + 0x20, 0x66, 0x29, 0x29, 0x20, 0x26, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, + 0x46, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x5d, 0x5d, 0x20, 0x29, 0x0a, 0x0a, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, + 0x62, 0x69, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, + 0x20, 0x6c, 0x75, 0x61, 0x6a, 0x69, 0x74, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x77, + 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x6c, + 0x6f, 0x61, 0x64, 0x20, 0x28, 0x20, 0x5b, 0x5b, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x62, + 0x61, 0x6e, 0x64, 0x2c, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x2c, 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, + 0x74, 0x2c, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, + 0x62, 0x61, 0x6e, 0x64, 0x2c, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, 0x6e, 0x6f, 0x74, 0x2c, 0x20, + 0x62, 0x69, 0x74, 0x2e, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x20, 0x62, 0x69, 0x74, 0x2e, + 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x0a, 0x0a, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, + 0x7b, 0x0a, 0x20, 0x20, 0x61, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x3d, 0x20, 0x62, 0x69, + 0x74, 0x2e, 0x61, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x61, 0x6e, + 0x64, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x62, + 0x6e, 0x6f, 0x74, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, 0x6e, 0x6f, 0x74, 0x2c, 0x0a, 0x20, + 0x20, 0x62, 0x6f, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x62, + 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x78, 0x6f, 0x72, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, + 0x62, 0x69, 0x74, 0x2e, 0x62, 0x78, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x62, 0x74, 0x65, 0x73, + 0x74, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x2e, + 0x2e, 0x2e, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, + 0x61, 0x6e, 0x64, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x30, 0x0a, 0x20, 0x20, + 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x20, 0x3d, + 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x66, 0x2c, 0x77, 0x29, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x61, 0x6e, 0x64, + 0x28, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x61, 0x2c, 0x66, 0x29, 0x2c, 0x32, 0x5e, 0x28, + 0x77, 0x20, 0x6f, 0x72, 0x20, 0x31, 0x29, 0x2d, 0x31, 0x29, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, + 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x62, 0x69, + 0x74, 0x2e, 0x72, 0x6f, 0x6c, 0x2c, 0x0a, 0x20, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, + 0x20, 0x3d, 0x20, 0x6c, 0x73, 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, + 0x61, 0x2c, 0x76, 0x2c, 0x66, 0x2c, 0x77, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x3d, 0x20, 0x32, 0x5e, 0x28, 0x77, 0x20, 0x6f, + 0x72, 0x20, 0x31, 0x29, 0x2d, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x61, 0x2c, 0x62, 0x6e, 0x6f, 0x74, 0x28, 0x6c, 0x73, + 0x68, 0x69, 0x66, 0x74, 0x28, 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x66, 0x29, 0x29, 0x29, 0x2b, 0x6c, + 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x62, 0x61, 0x6e, 0x64, 0x28, 0x76, 0x2c, 0x6d, 0x61, 0x73, + 0x6b, 0x29, 0x2c, 0x66, 0x29, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2c, 0x0a, 0x20, 0x20, 0x72, + 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x62, 0x69, 0x74, 0x2e, 0x72, 0x6f, 0x72, + 0x2c, 0x0a, 0x20, 0x20, 0x72, 0x73, 0x68, 0x69, 0x66, 0x74, 0x20, 0x20, 0x3d, 0x20, 0x72, 0x73, + 0x68, 0x69, 0x66, 0x74, 0x2c, 0x0a, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x5d, 0x5d, 0x20, 0x29, 0x0a, 0x0a, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x2d, 0x2d, 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x62, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x0a, 0x0a, 0x20, 0x20, + 0x20, 0x20, 0x62, 0x69, 0x74, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x28, 0x22, 0x62, 0x69, 0x74, 0x33, 0x32, 0x22, 0x29, 0x0a, 0x0a, 0x65, 0x6e, 0x64, 0x0a, + 0x0a, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x65, 0x65, 0x64, + 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x29, + 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x0a, 0x64, 0x6f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x70, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x0a, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, + 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x61, + 0x64, 0x65, 0x64, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, + 0x64, 0x65, 0x64, 0x5b, 0x22, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x22, 0x5d, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, + 0x74, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6d, 0x69, 0x6d, 0x65, 0x20, 0x20, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x2e, 0x6d, 0x69, 0x6d, 0x65, + 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5b, 0x22, 0x6d, 0x69, 0x6d, + 0x65, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x5d, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x0a, + 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x73, 0x6f, 0x20, 0x66, 0x61, 0x72, 0x0a, 0x0a, 0x00 }; return luaL_dostring(L, (const char*) luatex_core_lua); } \ No newline at end of file diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-core.lua b/Build/source/texk/web2c/luatexdir/lua/luatex-core.lua index 18bb7fcf0ed..35005d1c885 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-core.lua +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-core.lua @@ -1,229 +1,419 @@ --- if not modules then modules = { } end modules ['luatex-core'] = { --- version = 1.001, --- comment = 'companion to luatex', --- author = 'Hans Hagen & Luigi Scarso', --- copyright = 'LuaTeX Development Team', --- } - -LUATEXCOREVERSION = 1.003 - --- This file overloads some Lua functions. The readline variants provide the same --- functionality as LuaTeX <= 1.04 and doing it this way permits us to keep the --- original io libraries clean. Performance is probably even a bit better now. - -local type, next, getmetatable, require = type, next, getmetatable, require -local find, gsub, format = string.find, string.gsub, string.format - -local io_open = io.open -local io_popen = io.popen -local io_lines = io.lines - -local fio_readline = fio.readline -local fio_checkpermission = fio.checkpermission -local fio_recordfilename = fio.recordfilename - -local mt = getmetatable(io.stderr) -local mt_lines = mt.lines -local saferoption = status.safer_option -local shellescape = status.shell_escape -- 0 (disabled) 1 (anything) 2 (restricted) -local kpseused = status.kpse_used -- 0 1 - -local write_nl = texio.write_nl - -io.saved_lines = io_lines -- always readonly -mt.saved_lines = mt_lines -- always readonly - -local function luatex_io_open(name,how) - if not how then - how = 'r' - end - local f = io_open(name,how) - if f then - if type(how) == 'string' and find(how,'w') then - fio_recordfilename(name,'w') - else - fio_recordfilename(name,'r') - end - end - return f -end - -local function luatex_io_open_readonly(name,how) - if how then - how = 'r' - else - how = gsub(how,'[^rb]','') - if how == '' then - how = 'r' - end - end - local f = io_open(name,how) - if f then - fio_recordfilename(name,'r') - end - return f -end - -local function luatex_io_popen(name,...) - local okay, found = fio_checkpermission(name) - if okay and found then - return io_popen(found,...) - end -end - -local function luatex_io_lines(name,how) - if name then - local f = io_open(name,how or 'r') - if f then - return function() - return fio_readline(f) - end - end - else - return io_lines() - end -end - -local function luatex_io_readline(f) - return function() - return fio_readline(f) - end -end - -io.lines = luatex_io_lines -mt.lines = luatex_io_readline - --- We assume management to be provided by the replacement of kpse. This is the --- case in ConTeXt. - -if kpseused == 1 then - - io.open = luatex_io_open - io.popen = luatex_io_popen - -end - -if saferoption == 1 then - - local function installdummy(str,f) - local reported = false - return function(...) - if not reported then - write_nl(format("safer option set, function %q is %s", - str,f and "limited" or "disabled")) - reported = true - end - if f then - return f(...) - end - end - end - - local function installlimit(str,f) - local reported = false - end - - os.execute = installdummy("os.execute") - os.spawn = installdummy("os.spawn") - os.exec = installdummy("os.exec") - os.setenv = installdummy("os.setenv") - os.tempdir = installdummy("os.tempdir") - - io.popen = installdummy("io.popen") - io.open = installdummy("io.open",luatex_io_open_readonly) - - os.rename = installdummy("os.rename") - os.remove = installdummy("os.remove") - - io.tmpfile = installdummy("io.tmpfile") - io.output = installdummy("io.output") - - lfs.chdir = installdummy("lfs.chdir") - lfs.lock = installdummy("lfs.lock") - lfs.touch = installdummy("lfs.touch") - lfs.rmdir = installdummy("lfs.rmdir") - lfs.mkdir = installdummy("lfs.mkdir") - -end - -if saferoption == 1 or shellescape ~= 1 then - - ffi = require('ffi') - for k, v in next, ffi do - if k ~= 'gc' then - ffi[k] = nil - end - end - ffi = nil - -end - --- os.[execute|os.spawn|os.exec] already are shellescape aware) - - -if md5 then - - local sum = md5.sum - local gsub = string.gsub - local format = string.format - local byte = string.byte - - function md5.sumhexa(k) - return (gsub(sum(k), ".", function(c) - return format("%02x",byte(c)) - end)) - end - - function md5.sumHEXA(k) - return (gsub(sum(k), ".", function(c) - return format("%02X",byte(c)) - end)) - end - -end - -if utilities and utilities.merger and utilities.merger.compact then - - local byte, format, gmatch = string.byte, string.format, string.gmatch - local concat = table.concat - - local data = gsub(io.loaddata('luatex-core.lua'),'if%s+utilities.*','') - local t = { } - local r = { } - local n = 0 - local d = gsub(data,'\r\n','\n') -- be nice for unix - local s = utilities.merger.compact(d) -- no comments and less spaces - - t[#t+1] = '/* generated from and by luatex-core.lua */' - t[#t+1] = '' - -- t[#t+1] = format('/*\n\n%s\n\n*/',d) - -- t[#t+1] = '' - t[#t+1] = '#include "lua.h"' - t[#t+1] = '#include "lauxlib.h"' - t[#t+1] = '' - t[#t+1] = 'int load_luatex_core_lua (lua_State * L);' - t[#t+1] = '' - t[#t+1] = 'int load_luatex_core_lua (lua_State * L)' - t[#t+1] = '{' - t[#t+1] = ' static unsigned char luatex_core_lua[] = {' - for c in gmatch(d,'.') do - if n == 16 then - n = 1 - t[#t+1] = ' ' .. concat(r,', ') .. ',' - else - n = n + 1 - end - r[n] = format('0x%02x',byte(c)) - end - n = n + 1 - r[n] = '0x00' - t[#t+1] = ' ' .. concat(r,', ',1,n) - t[#t+1] = ' };' - -- t[#t+1] = format('unsigned int luatex_core_lua_len = 0x%x;',#d+1) - t[#t+1] = ' return luaL_dostring(L, (const char*) luatex_core_lua);' - t[#t+1] = '}' - - io.savedata('luatex-core.c',concat(t,'\n')) - io.savedata('luatex-core-stripped.lua',s) - -end +-- luatex-core security and io overloads ........... + +-- if not modules then modules = { } end modules ['luatex-core'] = { +-- version = 1.005, +-- comment = 'companion to luatex', +-- author = 'Hans Hagen & Luigi Scarso', +-- copyright = 'LuaTeX Development Team', +-- } + +LUATEXCOREVERSION = 1.005 + +-- This file overloads some Lua functions. The readline variants provide the same +-- functionality as LuaTeX <= 1.04 and doing it this way permits us to keep the +-- original io libraries clean. Performance is probably even a bit better now. + +local type, next, getmetatable, require = type, next, getmetatable, require +local find, gsub, format = string.find, string.gsub, string.format + +local io_open = io.open +local io_popen = io.popen +local io_lines = io.lines + +local fio_readline = fio.readline +local fio_checkpermission = fio.checkpermission +local fio_recordfilename = fio.recordfilename + +local mt = getmetatable(io.stderr) +local mt_lines = mt.lines +local saferoption = status.safer_option +local shellescape = status.shell_escape -- 0 (disabled) 1 (anything) 2 (restricted) +local kpseused = status.kpse_used -- 0 1 + +local write_nl = texio.write_nl + +io.saved_lines = io_lines -- always readonly +mt.saved_lines = mt_lines -- always readonly + +local function luatex_io_open(name,how) + if not how then + how = 'r' + end + local f = io_open(name,how) + if f then + if type(how) == 'string' and find(how,'w') then + fio_recordfilename(name,'w') + else + fio_recordfilename(name,'r') + end + end + return f +end + +local function luatex_io_open_readonly(name,how) + if how then + how = 'r' + else + how = gsub(how,'[^rb]','') + if how == '' then + how = 'r' + end + end + local f = io_open(name,how) + if f then + fio_recordfilename(name,'r') + end + return f +end + +local function luatex_io_popen(name,...) + local okay, found = fio_checkpermission(name) + if okay and found then + return io_popen(found,...) + end +end + +-- local function luatex_io_lines(name,how) +-- if name then +-- local f = io_open(name,how or 'r') +-- if f then +-- return function() +-- return fio_readline(f) +-- end +-- end +-- else +-- return io_lines() +-- end +-- end + +-- For some reason the gc doesn't kick in so we need to close explitly +-- so that the handle is flushed. + +local error, type = error, type + +local function luatex_io_lines(name,how) + if type(name) == "string" then + local f = io_open(name,how or 'r') + if f then + return function() + local l = fio_readline(f) + if not l then + f:close() + end + return l + end + else + -- for those who like it this way: + error("patched 'io.lines' can't open '" .. name .. "'") + end + else + return io_lines() + end +end + +local function luatex_io_readline(f) + return function() + return fio_readline(f) + end +end + +io.lines = luatex_io_lines +mt.lines = luatex_io_readline + +-- We assume management to be provided by the replacement of kpse. This is the +-- case in ConTeXt. + +if kpseused == 1 then + + io.open = luatex_io_open + io.popen = luatex_io_popen + +end + +if saferoption == 1 then + + local function installdummy(str,f) + local reported = false + return function(...) + if not reported then + write_nl(format("safer option set, function %q is %s", + str,f and "limited" or "disabled")) + reported = true + end + if f then + return f(...) + end + end + end + + local function installlimit(str,f) + local reported = false + end + + os.execute = installdummy("os.execute") + os.spawn = installdummy("os.spawn") + os.exec = installdummy("os.exec") + os.setenv = installdummy("os.setenv") + os.tempdir = installdummy("os.tempdir") + + io.popen = installdummy("io.popen") + io.open = installdummy("io.open",luatex_io_open_readonly) + + os.rename = installdummy("os.rename") + os.remove = installdummy("os.remove") + + io.tmpfile = installdummy("io.tmpfile") + io.output = installdummy("io.output") + + lfs.chdir = installdummy("lfs.chdir") + lfs.lock = installdummy("lfs.lock") + lfs.touch = installdummy("lfs.touch") + lfs.rmdir = installdummy("lfs.rmdir") + lfs.mkdir = installdummy("lfs.mkdir") + +end + +if saferoption == 1 or shellescape ~= 1 then + + ffi = require('ffi') + for k, v in next, ffi do + if k ~= 'gc' then + ffi[k] = nil + end + end + ffi = nil + +end + +-- os.[execute|os.spawn|os.exec] already are shellescape aware) + + +if md5 then + + local sum = md5.sum + local gsub = string.gsub + local format = string.format + local byte = string.byte + + function md5.sumhexa(k) + return (gsub(sum(k), ".", function(c) + return format("%02x",byte(c)) + end)) + end + + function md5.sumHEXA(k) + return (gsub(sum(k), ".", function(c) + return format("%02X",byte(c)) + end)) + end + +end + +-- compatibility: this might go away + +if not unpack then + unpack = table.unpack +end + +if not package.loaders then + package.loaders = package.searchers +end + +if not loadstring then + loadstring = load +end + +-- compatibility: this might stay + +if bit32 then + + -- lua 5.2: we're okay + +elseif utf8 then + + -- lua 5.3: bitwise.lua, v 1.24 2014/12/26 17:20:53 roberto + + bit32 = load ( [[ +local select = select -- instead of: arg = { ... } + +bit32 = { + bnot = function (a) + return ~a & 0xFFFFFFFF + end, + band = function (x, y, z, ...) + if not z then + return ((x or -1) & (y or -1)) & 0xFFFFFFFF + else + local res = x & y & z + for i=1,select("#",...) do + res = res & select(i,...) + end + return res & 0xFFFFFFFF + end + end, + bor = function (x, y, z, ...) + if not z then + return ((x or 0) | (y or 0)) & 0xFFFFFFFF + else + local res = x | y | z + for i=1,select("#",...) do + res = res | select(i,...) + end + return res & 0xFFFFFFFF + end + end, + bxor = function (x, y, z, ...) + if not z then + return ((x or 0) ~ (y or 0)) & 0xFFFFFFFF + else + local res = x ~ y ~ z + for i=1,select("#",...) do + res = res ~ select(i,...) + end + return res & 0xFFFFFFFF + end + end, + btest = function (x, y, z, ...) + if not z then + return (((x or -1) & (y or -1)) & 0xFFFFFFFF) ~= 0 + else + local res = x & y & z + for i=1,select("#",...) do + res = res & select(i,...) + end + return (res & 0xFFFFFFFF) ~= 0 + end + end, + lshift = function (a, b) + return ((a & 0xFFFFFFFF) << b) & 0xFFFFFFFF + end, + rshift = function (a, b) + return ((a & 0xFFFFFFFF) >> b) & 0xFFFFFFFF + end, + arshift = function (a, b) + a = a & 0xFFFFFFFF + if b <= 0 or (a & 0x80000000) == 0 then + return (a >> b) & 0xFFFFFFFF + else + return ((a >> b) | ~(0xFFFFFFFF >> b)) & 0xFFFFFFFF + end + end, + lrotate = function (a ,b) + b = b & 31 + a = a & 0xFFFFFFFF + a = (a << b) | (a >> (32 - b)) + return a & 0xFFFFFFFF + end, + rrotate = function (a, b) + b = -b & 31 + a = a & 0xFFFFFFFF + a = (a << b) | (a >> (32 - b)) + return a & 0xFFFFFFFF + end, + extract = function (a, f, w) + return (a >> f) & ~(-1 << (w or 1)) + end, + replace = function (a, v, f, w) + local mask = ~(-1 << (w or 1)) + return ((a & ~(mask << f)) | ((v & mask) << f)) & 0xFFFFFFFF + end, +} + ]] ) + +elseif bit then + + -- luajit (for now) + + bit32 = load ( [[ +local band, bnot, rshift, lshift = bit.band, bit.bnot, bit.rshift, bit.lshift + +bit32 = { + arshift = bit.arshift, + band = band, + bnot = bnot, + bor = bit.bor, + bxor = bit.bxor, + btest = function(...) + return band(...) ~= 0 + end, + extract = function(a,f,w) + return band(rshift(a,f),2^(w or 1)-1) + end, + lrotate = bit.rol, + lshift = lshift, + replace = function(a,v,f,w) + local mask = 2^(w or 1)-1 + return band(a,bnot(lshift(mask,f)))+lshift(band(v,mask),f) + end, + rrotate = bit.ror, + rshift = rshift, +} + ]] ) + +else + + -- hope for the best or fail + + bit32 = require("bit32") + +end + +-- this is needed for getting require("socket") right + +do + + local loaded = package.loaded + + if not loaded.socket then loaded.socket = loaded["socket.core"] end + if not loaded.mime then loaded.mime = loaded["mime.core"] end + +end + +-- so far + +if utilities and utilities.merger and utilities.merger.compact then + + local byte, format, gmatch = string.byte, string.format, string.gmatch + local concat = table.concat + + local data = gsub(io.loaddata('luatex-core.lua'),'if%s+utilities.*','') + + local t = { } + local r = { } + local n = 0 + local d = gsub(data,'\r\n','\n') -- be nice for unix + local s = utilities.merger.compact(d) -- no comments and less spaces + + t[#t+1] = '/* generated from and by luatex-core.lua */' + t[#t+1] = '' + -- t[#t+1] = format('/*\n\n%s\n\n*/',d) + -- t[#t+1] = '' + t[#t+1] = '#include "lua.h"' + t[#t+1] = '#include "lauxlib.h"' + t[#t+1] = '' + t[#t+1] = 'int load_luatex_core_lua (lua_State * L);' + t[#t+1] = '' + t[#t+1] = 'int load_luatex_core_lua (lua_State * L)' + t[#t+1] = '{' + t[#t+1] = ' static unsigned char luatex_core_lua[] = {' + for c in gmatch(d,'.') do + if n == 16 then + n = 1 + t[#t+1] = ' ' .. concat(r,', ') .. ',' + else + n = n + 1 + end + r[n] = format('0x%02x',byte(c)) + end + n = n + 1 + r[n] = '0x00' + t[#t+1] = ' ' .. concat(r,', ',1,n) + t[#t+1] = ' };' + -- t[#t+1] = format('unsigned int luatex_core_lua_len = 0x%x;',#d+1) + t[#t+1] = ' return luaL_dostring(L, (const char*) luatex_core_lua);' + t[#t+1] = '}' + + io.savedata('luatex-core.c',concat(t,'\n')) + io.savedata('luatex-core-stripped.lua',s) + +end diff --git a/Build/source/texk/web2c/luatexdir/lua/texluac.w b/Build/source/texk/web2c/luatexdir/lua/texluac.w index 6ae7672482c..2c515670e55 100644 --- a/Build/source/texk/web2c/luatexdir/lua/texluac.w +++ b/Build/source/texk/web2c/luatexdir/lua/texluac.w @@ -269,10 +269,24 @@ int luac_main(int ac, char *av[]) #define VOID(p) ((const void*)(p)) +#if (defined(LuajitTeX)) || (LUA_VERSION_NUM == 502) +#define TSVALUE(o) rawtsvalue(o) +#endif +#if (LUA_VERSION_NUM == 503) +#define TSVALUE(o) tsvalue(o) +#endif + + static void PrintString(const TString* ts) { const char* s=getstr(ts); - size_t i,n=ts->tsv.len; + size_t i,n; +#if (defined(LuajitTeX)) || (LUA_VERSION_NUM == 502) + n=ts->tsv.len; +#endif +#if (LUA_VERSION_NUM == 503) + n=ts->u.lnglen; +#endif printf("%c",'"'); for (i=0; i 2 Gb again (bug report and patch by KUBO Takehiro). - * fixed bug [#39794] Compile error on Solaris 10 (bug report and patch by Aaron B). - * fixed compilation problems with Borland C. - -Version 1.4.1 [07/May/2008] - - * documentation review - * fixed Windows compilation issues - * fixed bug in the Windows tests (patch by Shmuel Zeigerman) - * fixed bug [#2185] lfs.attributes(filename, 'size') overflow on files > 2 Gb - -Version 1.4.0 [13/Feb/2008] - - * added function lfs.setmode (works only in Windows systems). - * lfs.attributes raises an error if attribute does not exist - -Version 1.3.0 [26/Oct/2007] - - * added function lfs.symlinkattributes (works only in non Windows systems). - -Version 1.2.1 [08/May/2007] - - * compatible only with Lua 5.1 (Lua 5.0 support was dropped) - -Version 1.2 [15/Mar/2006] - - * added optional argument to lfs.attributes - * added function lfs.rmdir - * bug correction on lfs.dir - -Version 1.1 [30/May/2005] - - * added function lfs.touch. - -Version 1.0 [21/Jan/2005] -Version 1.0 Beta [10/Nov/2004] diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/README.md b/Build/source/texk/web2c/luatexdir/luafilesystem/README.md new file mode 100644 index 00000000000..ee493738052 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/README.md @@ -0,0 +1,28 @@ +[![License](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE) +[![Build Status](https://travis-ci.org/keplerproject/luafilesystem.svg?branch=master)](https://travis-ci.org/keplerproject/luafilesystem) +[![Build status](https://ci.appveyor.com/api/projects/status/y04s4ms7u16trw8e?svg=true)](https://ci.appveyor.com/project/ignacio/luafilesystem) +[![Coverage Status](https://coveralls.io/repos/keplerproject/luafilesystem/badge.png)](https://coveralls.io/r/keplerproject/luafilesystem) + +# LuaFileSystem - File System Library for Lua + +Copyright 2003-2017 Kepler Project + +https://keplerproject.github.io/luafilesystem + +# Description + +LuaFileSystem is a Lua library developed to complement the set of functions +related to file systems offered by the standard Lua distribution. + +LuaFileSystem offers a portable way to access the underlying directory structure and file attributes. +LuaFileSystem is free software and uses the same license as Lua 5.x (MIT). + +# LuaRocks Installation + +``` +luarocks install luafilesystem +``` + +# Documentation + +Please check the documentation at doc/us/ for more information. diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/doc.css b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/doc.css new file mode 100644 index 00000000000..f233ce4f089 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/doc.css @@ -0,0 +1,209 @@ +body { + color: #47555c; + font-size: 16px; + font-family: "Open Sans", sans-serif; + margin: 0; + padding: 0; + background: #eff4ff; +} + +a:link { color: #008fee; } +a:visited { color: #008fee; } +a:hover { color: #22a7ff; } + +h1 { font-size:26px; } +h2 { font-size:24px; } +h3 { font-size:18px; } +h4 { font-size:16px; } + +hr { + height: 1px; + background: #c1cce4; + border: 0px; + margin: 20px 0; +} + +code { + font-family: "Open Sans Mono", "Andale Mono", monospace; +} + +tt { + font-family: "Open Sans Mono", "Andale Mono", monospace; +} + +body, td, th { +} + +textarea, pre, tt { + font-family: "Open Sans Mono", "Andale Mono", monospace; +} + +img { + border-width: 0px; +} + +.example { + background-color: #323744; + color: white; + font-size: 16px; + padding: 16px 24px; + border-radius: 2px; +} + +div.header, div.footer { +} + +#container { +} + +#product { + background-color: white; + padding: 10px; + height: 130px; + border-bottom: solid #d3dbec 1px; +} + +#product big { + font-size: 42px; +} +#product strong { + font-weight: normal; +} + +#product_logo { + float: right; +} + +#product_name { + padding-top: 15px; + padding-left: 30px; + font-size: 42px; + font-weight: normal; +} + +#product_description { + padding-left: 30px; + color: #757779; +} + +#main { + background: #eff4ff; + margin: 0; +} + +#navigation { + width: 100%; + background-color: rgb(44,62,103); + padding: 10px; + margin: 0; +} + +#navigation h1 { + display: none; +} + +#navigation a:hover { + text-decoration: underline; +} + +#navigation ul li a { + color: rgb(136, 208, 255); + font-weight: bold; + text-decoration: none; +} + +#navigation ul li li a { + color: rgb(136, 208, 255); + font-weight: normal; + text-decoration: none; +} + +#navigation ul { + display: inline; + color: white; + padding: 0px; + padding-top: 10px; + padding-bottom: 10px; +} + +#navigation li { + display: inline; + list-style-type: none; + padding-left: 5px; + padding-right: 5px; +} + +#navigation li { + padding: 10px; + padding: 10px; +} + +#navigation li li { +} + +#navigation li:hover a { + color: rgb(166, 238, 255); +} + +#content { + padding: 20px; + width: 800px; + margin-left: auto; + margin-right: auto; +} + +#about { + display: none; +} + +dl.reference { + background-color: white; + padding: 20px; + border: solid #d3dbec 1px; +} + +dl.reference dt { + padding: 5px; + padding-top: 25px; + color: #637bbc; +} + +dl.reference dl dt { + padding-top: 5px; + color: #637383; +} + +dl.reference dd { +} + +@media print { + body { + font: 10pt "Times New Roman", "TimeNR", Times, serif; + } + a { + font-weight:bold; color: #004080; text-decoration: underline; + } + #main { + background-color: #ffffff; border-left: 0px; + } + #container { + margin-left: 2%; margin-right: 2%; background-color: #ffffff; + } + #content { + margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff; + } + #navigation { + display: none; + } + #product_logo { + display: none; + } + #about img { + display: none; + } + .example { + font-family: "Andale Mono", monospace; + font-size: 8pt; + page-break-inside: avoid; + } +} diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html index 746df62b4e5..68756c8b1d4 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html @@ -3,7 +3,7 @@ LuaFileSystem - + @@ -13,7 +13,7 @@
@@ -33,7 +33,6 @@
  • Download
  • History
  • Credits
  • -
  • Contact us
  • Manual @@ -45,10 +44,10 @@
  • Examples
  • -
  • Project +
  • Project
  • License
  • @@ -65,7 +64,7 @@ attributes for each file inside it.

    -require"lfs"
    +local lfs = require"lfs"
     
     function attrdir (path)
         for file in lfs.dir(path) do
    @@ -94,7 +93,6 @@ attrdir (".")
     
     

    Valid XHTML 1.0!

    -

    $Id: examples.html,v 1.8 2007/12/14 15:28:04 carregal Exp $

    diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html index 43edefc5a1b..195ab60e75a 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html @@ -3,7 +3,7 @@ LuaFileSystem - + @@ -13,7 +13,7 @@
    @@ -33,7 +33,6 @@
  • Download
  • History
  • Credits
  • -
  • Contact us
  • Manual @@ -45,10 +44,10 @@
  • Examples
  • -
  • Project +
  • Project
  • License
  • @@ -67,31 +66,70 @@ systems offered by the standard Lua distribution.

    the underlying directory structure and file attributes.

    LuaFileSystem is free software and uses the same -license as Lua 5.1.

    +license as Lua 5.x (MIT).

    Status

    -

    Current version is 1.5.0. It was developed for Lua 5.1.

    +

    Current version is 1.7.0. It works with Lua 5.1, 5.2 and 5.3, and it runs on various +flavors of Unix (including Linux, BSDs, macOS) and Windows.

    Download

    -

    LuaFileSystem source can be downloaded from its -Github -page.

    +

    LuaFileSystem can be installed using LuaRocks: + +

    +$ luarocks install luafilesystem
    +
    + +

    Its source can be found at its Github page.

    History

    +
    Version 1.7.0 [15/Sep/2017]
    +
      +
    • symlinkattributes function now provides 'target' field, containing name of the file that the symlink points to.
    • +
    • attributes, symlinkattributes, touch, mkdir, and rmdir functions now return system-dependent error code as the third value on error.
    • +
    • Fixed detection of closed files for Lua 5.2+ in setmode, lock, and unlock functions.
    • +
    • Fixed various compiler warnings.
    • +
    + +
    Version 1.6.3 [15/Jan/2015]
    +
      +
    • Lua 5.3 support.
    • +
    • Assorted bugfixes.
    • +
    + +
    Version 1.6.2 [??/Oct/2012]
    +
      +
    • Full Lua 5.2 compatibility (with Lua 5.1 fallbacks)
    • +
    + +
    Version 1.6.1 [01/Oct/2012]
    +
      +
    • fix build for Lua 5.2
    • +
    + +
    Version 1.6.0 [26/Sep/2012]
    +
      +
    • getcwd fix for Android
    • +
    • support for Lua 5.2
    • +
    • add lfs.link
    • +
    • other bug fixes
    • +
    +
    Version 1.5.0 [20/Oct/2009]
    +
    • Added explicit next and close methods to second return value of lfs.dir (the directory object), for explicit iteration or explicit closing.
    • Added directory locking via lfs.lock_dir function (see the manual).
    • +
    Version 1.4.2 [03/Feb/2009]
      -
    • fixed bug [#13198] - lfs.attributes(filename, 'size') overflow on files > 2 Gb again (bug report and patch by KUBO Takehiro).
    • -
    • fixed bug [#39794] +
    • fixed bug + lfs.attributes(filename, 'size') overflow on files > 2 Gb again (bug report and patch by KUBO Takehiro).
    • +
    • fixed bug Compile error on Solaris 10 (bug report and patch by Aaron B).
    • fixed compilation problems with Borland C.
    @@ -103,7 +141,7 @@ page.

  • documentation review
  • fixed Windows compilation issues
  • fixed bug in the Windows tests (patch by Shmuel Zeigerman)
  • -
  • fixed bug [#2185] +
  • fixed bug lfs.attributes(filename, 'size') overflow on files > 2 Gb
  • @@ -120,7 +158,7 @@ page.

    -
    Version 1.3.0 [26/Oct/2007]
    +
    Version 1.3.0 [26/Oct/2007]
    • added function @@ -129,14 +167,14 @@ page.

    -
    Version 1.2.1 [08/May/2007]
    +
    Version 1.2.1 [08/May/2007]
    • compatible only with Lua 5.1 (Lua 5.0 support was dropped)
    -
    Version 1.2 [15/Mar/2006]
    +
    Version 1.2 [15/Mar/2006]
    • added optional argument to @@ -147,14 +185,14 @@ page.

    -
    Version 1.1 [30/May/2005]
    +
    Version 1.1 [30/May/2005]
    -
    Version 1.0 [21/Jan/2005]
    +
    Version 1.0 [21/Jan/2005]
    Version 1.0 Beta [10/Nov/2004]
    @@ -165,25 +203,15 @@ page.

    LuaFileSystem was designed by Roberto Ierusalimschy, André Carregal and Tomás Guisasola as part of the -Kepler Project, +Kepler Project, which holds its copyright. LuaFileSystem is currently maintained by Fábio Mascarenhas.

    -

    Contact us

    - -

    For more information please -contact us. -Comments are welcome!

    - -

    You can also reach other Kepler developers and users on the Kepler Project -mailing list.

    -

    Valid XHTML 1.0!

    -

    $Id: index.html,v 1.44 2009/02/04 21:21:33 carregal Exp $

    diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html index 4ecad4bd7bb..4f828cf1467 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html @@ -3,7 +3,7 @@ LuaFileSystem - + @@ -13,7 +13,7 @@
    @@ -33,7 +33,6 @@
  • Download
  • History
  • Credits
  • -
  • Contact us
  • Manual @@ -45,10 +44,10 @@
  • Examples
  • -
  • Project +
  • Project
  • License
  • @@ -69,7 +68,7 @@ software. Its licenses are compatible with GPL. LuaFileSystem is not in the public domain and the -Kepler Project +Kepler Project keep its copyright. The legal details are below.

    @@ -85,7 +84,7 @@ Ierusalimschy, André Carregal and Tomás Guisasola. The implementation is not derived from licensed software.


    -

    Copyright © 2003 Kepler Project.

    +

    Copyright © 2003 - 2017 Kepler Project.

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation @@ -113,7 +112,6 @@ SOFTWARE.

    Valid XHTML 1.0!

    -

    $Id: license.html,v 1.13 2008/02/11 22:42:21 carregal Exp $

    diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html index 1409c404b1a..3555e3db4dd 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html @@ -3,7 +3,7 @@ LuaFileSystem - + @@ -13,7 +13,9 @@
    LuaFileSystem
    File System Library for the Lua Programming Language
    @@ -31,7 +33,6 @@
  • Download
  • History
  • Credits
  • -
  • Contact us
  • Manual @@ -43,10 +44,10 @@
  • Examples
  • -
  • Project +
  • Project
  • License
  • @@ -101,14 +102,15 @@ LuaFileSystem offers the following functions:

    -
    lfs.attributes (filepath [, aname])
    +
    lfs.attributes (filepath [, aname | atable])
    Returns a table with the file attributes corresponding to - filepath (or nil followed by an error message + filepath (or nil followed by an error message and a system-dependent error code in case of error). - If the second optional argument is given, then only the value of the + If the second optional argument is given and is a string, then only the value of the named attribute is returned (this use is equivalent to - lfs.attributes(filepath).aname, but the table is not created + lfs.attributes(filepath)[aname], but the table is not created and only one attribute is retrieved from the O.S.). + if a table is passed as the second argument, it is filled with attributes and returned instead of a new table. The attributes are described as follows; attribute mode is a string, all the others are numbers, and the time related attributes use the same time reference of @@ -152,6 +154,9 @@ LuaFileSystem offers the following functions:
    size
    file size, in bytes
    +
    permissions
    +
    file permissions string
    +
    blocks
    block allocated for file; (Unix only)
    @@ -172,9 +177,9 @@ LuaFileSystem offers the following functions: Returns true in case of success or nil plus an error string. -
    lfs.lock_dir(path, [seconds_stale])
    +
    lfs.lock_dir(path, [seconds_stale])
    Creates a lockfile (called lockfile.lfs) in path if it does not - exist and returns the lock. If the lock already exists checks it + exist and returns the lock. If the lock already exists checks if it's stale, using the second parameter (default for the second parameter is INT_MAX, which in practice means the lock will never be stale. To free the the lock call lock:free().
    @@ -182,7 +187,7 @@ LuaFileSystem offers the following functions: particular, if the lock exists and is not stale it returns the "File exists" message.
    -
    lfs.currentdir ()
    +
    lfs.currentdir ()
    Returns a string with the current working directory or nil plus an error string.
    @@ -206,30 +211,41 @@ LuaFileSystem offers the following functions: Returns true if the operation was successful; in case of error, it returns nil plus an error string. + +
    lfs.link (old, new[, symlink])
    +
    Creates a link. The first argument is the object to link to + and the second is the name of the link. If the optional third + argument is true, the link will by a symbolic link (by default, a + hard link is created). +
    lfs.mkdir (dirname)
    Creates a new directory. The argument is the name of the new directory.
    - Returns true if the operation was successful; - in case of error, it returns nil plus an error string. + Returns true in case of success or nil, an error message and + a system-dependent error code in case of error.
    lfs.rmdir (dirname)
    Removes an existing directory. The argument is the name of the directory.
    - Returns true if the operation was successful; - in case of error, it returns nil plus an error string.
    + Returns true in case of success or nil, an error message and + a system-dependent error code in case of error.
    lfs.setmode (file, mode)
    -
    Sets the writing mode for a file. The mode string can be either binary or text. - Returns the previous mode string for the file. This function is only available in Windows, so you may want to make sure that - lfs.setmode exists before using it. +
    Sets the writing mode for a file. The mode string can be either "binary" or "text". + Returns true followed the previous mode string for the file, or + nil followed by an error string in case of errors. + On non-Windows platforms, where the two modes are identical, + setting the mode has no effect, and the mode is always returned as binary.
    lfs.symlinkattributes (filepath [, aname])
    Identical to lfs.attributes except that it obtains information about the link itself (not the file it refers to). - This function is not available in Windows so you may want to make sure that - lfs.symlinkattributes exists before using it. + It also adds a target field, containing + the file name that the symlink points to. + On Windows this function does not yet support links, and is identical to + lfs.attributes.
    lfs.touch (filepath [, atime [, mtime]])
    @@ -241,8 +257,8 @@ LuaFileSystem offers the following functions: Lua standard function os.time). If the modification time is omitted, the access time provided is used; if both times are omitted, the current time is used.
    - Returns true if the operation was successful; - in case of error, it returns nil plus an error string. + Returns true in case of success or nil, an error message and + a system-dependent error code in case of error.
    lfs.unlock (filehandle[, start[, length]])
    @@ -262,7 +278,6 @@ LuaFileSystem offers the following functions:

    Valid XHTML 1.0!

    -

    $Id: manual.html,v 1.45 2009/06/03 20:53:55 mascarenhas Exp $

    diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c index 2b1b06cf1db..c8122c2ca95 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c @@ -1,25 +1,25 @@ /* ** LuaFileSystem -** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem) +** Copyright Kepler Project 2003 - 2017 (http://keplerproject.github.io/luafilesystem) ** ** File system manipulation library. ** This library offers these functions: -** lfs.attributes (filepath [, attributename]) +** lfs.attributes (filepath [, attributename | attributetable]) ** lfs.chdir (path) ** lfs.currentdir () ** lfs.dir (path) +** lfs.link (old, new[, symlink]) ** lfs.lock (fh, mode) ** lfs.lock_dir (path) ** lfs.mkdir (path) ** lfs.rmdir (path) ** lfs.setmode (filepath, mode) -** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts +** lfs.symlinkattributes (filepath [, attributename]) ** lfs.touch (filepath [, atime [, mtime]]) ** lfs.unlock (fh) -** -** $Id: lfs.c,v 1.61 2009/07/04 02:10:16 mascarenhas Exp $ */ +#ifndef LFS_DO_NOT_USE_LARGE_FILE #ifndef _WIN32 #ifndef _AIX #define _FILE_OFFSET_BITS 64 /* Linux, Solaris and HP-UX */ @@ -27,8 +27,11 @@ #define _LARGE_FILES 1 /* AIX */ #endif #endif +#endif +#ifndef LFS_DO_NOT_USE_LARGE_FILE #define _LARGEFILE64_SOURCE +#endif #include #include @@ -38,93 +41,133 @@ #include #ifdef _WIN32 -#include -#include -#include -#include -#ifdef __BORLANDC__ - #include + #include + #include + #include + #include + #ifdef __BORLANDC__ + #include + #else + #include + #endif + #include + /* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */ + #define LFS_MAXPATHLEN MAX_PATH #else - #include -#endif -#include -#else -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include + #include /* for MAXPATHLEN */ + #define LFS_MAXPATHLEN MAXPATHLEN #endif -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" +#include +#include +#include + #include "lfs.h" -/* Define 'strerror' for systems that do not implement it */ -#ifdef NO_STRERROR -#define strerror(_) "System unable to describe the error" +#define LFS_VERSION "1.7.0" +#define LFS_LIBNAME "lfs" + +#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */ + +#ifndef luaL_optlong +#define luaL_optlong luaL_optinteger #endif -/* Define 'getcwd' for systems that do not implement it */ -#ifdef NO_GETCWD -#define getcwd(p,s) NULL -#define getcwd_error "Function 'getcwd' not provided by system" +#endif + +#if LUA_VERSION_NUM >= 502 +# define new_lib(L, l) (luaL_newlib(L, l)) #else -#define getcwd_error strerror(errno) +# define new_lib(L, l) (lua_newtable(L), luaL_register(L, NULL, l)) +#endif + +/* Define 'strerror' for systems that do not implement it */ +#ifdef NO_STRERROR +#define strerror(_) "System unable to describe the error" #endif -#define DIR_METATABLE "lfs.directory" -#define MAX_DIR_LENGTH 1023 +#define DIR_METATABLE "directory metatable" typedef struct dir_data { - int closed; + int closed; #ifdef _WIN32 - long hFile; - char pattern[MAX_DIR_LENGTH+1]; + intptr_t hFile; + char pattern[MAX_PATH+1]; #else - DIR *dir; + DIR *dir; #endif } dir_data; -#define LOCK_METATABLE "lfs.lock" +#define LOCK_METATABLE "lock metatable" #ifdef _WIN32 #ifdef __BORLANDC__ - #define lfs_setmode(L,file,m) ((void)L, setmode(_fileno(file), m)) + #define lfs_setmode(file, m) (setmode(_fileno(file), m)) #define STAT_STRUCT struct stati64 #else - #define lfs_setmode(L,file,m) ((void)L, _setmode(_fileno(file), m)) + #define lfs_setmode(file, m) (_setmode(_fileno(file), m)) #define STAT_STRUCT struct _stati64 #endif #define STAT_FUNC _stati64 +#define LSTAT_FUNC STAT_FUNC #else -#ifndef _O_TEXT - #define _O_TEXT 0 -#endif -#ifndef _O_BINARY - #define _O_BINARY 0 -#endif -#define lfs_setmode(L,file,m) ((void)((void)file,m), \ - luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1) +#define _O_TEXT 0 +#define _O_BINARY 0 +#define lfs_setmode(file, m) ((void)file, (void)m, 0) #define STAT_STRUCT struct stat #define STAT_FUNC stat #define LSTAT_FUNC lstat #endif +#ifdef _WIN32 + #define lfs_mkdir _mkdir +#else + #define lfs_mkdir(path) (mkdir((path), \ + S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH)) +#endif + +/* +** Utility functions +*/ +static int pusherror(lua_State *L, const char *info) +{ + lua_pushnil(L); + if (info==NULL) + lua_pushstring(L, strerror(errno)); + else + lua_pushfstring(L, "%s: %s", info, strerror(errno)); + lua_pushinteger(L, errno); + return 3; +} + +static int pushresult(lua_State *L, int res, const char *info) { + if (res == -1) { + return pusherror(L, info); + } else { + lua_pushboolean(L, 1); + return 1; + } +} + + /* ** This function changes the working (current) directory */ static int change_dir (lua_State *L) { - const char *path = luaL_checkstring(L, 1); - if (chdir(path)) { - lua_pushnil (L); - lua_pushfstring (L,"Unable to change working directory to '%s'\n%s\n", - path, chdir_error); - return 2; - } else { - lua_pushboolean (L, 1); - return 1; - } + const char *path = luaL_checkstring(L, 1); + if (chdir(path)) { + lua_pushnil (L); + lua_pushfstring (L,"Unable to change working directory to '%s'\n%s\n", + path, chdir_error); + return 2; + } else { + lua_pushboolean (L, 1); + return 1; + } } /* @@ -132,36 +175,59 @@ static int change_dir (lua_State *L) { ** If unable to get the current directory, it returns nil ** and a string describing the error */ -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif - static int get_dir (lua_State *L) { - char path[PATH_MAX]; - if (getcwd((char *)path, PATH_MAX) == NULL) { +#ifdef NO_GETCWD lua_pushnil(L); - lua_pushstring(L, getcwd_error); + lua_pushstring(L, "Function 'getcwd' not provided by system"); return 2; - } - else { - lua_pushstring(L, path); - return 1; - } +#else + char *path = NULL; + /* Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. */ + size_t size = LFS_MAXPATHLEN; /* initial buffer size */ + int result; + while (1) { + path = realloc(path, size); + if (!path) /* failed to allocate */ + return pusherror(L, "get_dir realloc() failed"); + if (getcwd(path, size) != NULL) { + /* success, push the path to the Lua stack */ + lua_pushstring(L, path); + result = 1; + break; + } + if (errno != ERANGE) { /* unexpected error */ + result = pusherror(L, "get_dir getcwd() failed"); + break; + } + /* ERANGE = insufficient buffer capacity, double size and retry */ + size *= 2; + } + free(path); + return result; +#endif } /* ** Check if the given element on the stack is a file and returns it. */ static FILE *check_file (lua_State *L, int idx, const char *funcname) { - FILE **fh = (FILE **)luaL_checkudata (L, idx, "FILE*"); - if (fh == NULL) { - luaL_error (L, "%s: not a file", funcname); - return 0; - } else if (*fh == NULL) { - luaL_error (L, "%s: closed file", funcname); - return 0; - } else - return *fh; +#if LUA_VERSION_NUM == 501 + FILE **fh = (FILE **)luaL_checkudata (L, idx, "FILE*"); + if (*fh == NULL) { + luaL_error (L, "%s: closed file", funcname); + return 0; + } else + return *fh; +#elif LUA_VERSION_NUM >= 502 && LUA_VERSION_NUM <= 503 + luaL_Stream *fh = (luaL_Stream *)luaL_checkudata (L, idx, "FILE*"); + if (fh->closef == 0 || fh->f == NULL) { + luaL_error (L, "%s: closed file", funcname); + return 0; + } else + return fh->f; +#else +#error unsupported Lua version +#endif } @@ -169,50 +235,50 @@ static FILE *check_file (lua_State *L, int idx, const char *funcname) { ** */ static int _file_lock (lua_State *L, FILE *fh, const char *mode, const long start, long len, const char *funcname) { - int code; + int code; #ifdef _WIN32 - /* lkmode valid values are: - LK_LOCK Locks the specified bytes. If the bytes cannot be locked, the program immediately tries again after 1 second. If, after 10 attempts, the bytes cannot be locked, the constant returns an error. - LK_NBLCK Locks the specified bytes. If the bytes cannot be locked, the constant returns an error. - LK_NBRLCK Same as _LK_NBLCK. - LK_RLCK Same as _LK_LOCK. - LK_UNLCK Unlocks the specified bytes, which must have been previously locked. - - Regions should be locked only briefly and should be unlocked before closing a file or exiting the program. - - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__locking.asp - */ - int lkmode; - switch (*mode) { - case 'r': lkmode = LK_NBLCK; break; - case 'w': lkmode = LK_NBLCK; break; - case 'u': lkmode = LK_UNLCK; break; - default : return luaL_error (L, "%s: invalid mode", funcname); - } - if (!len) { - fseek (fh, 0L, SEEK_END); - len = ftell (fh); - } - fseek (fh, start, SEEK_SET); + /* lkmode valid values are: + LK_LOCK Locks the specified bytes. If the bytes cannot be locked, the program immediately tries again after 1 second. If, after 10 attempts, the bytes cannot be locked, the constant returns an error. + LK_NBLCK Locks the specified bytes. If the bytes cannot be locked, the constant returns an error. + LK_NBRLCK Same as _LK_NBLCK. + LK_RLCK Same as _LK_LOCK. + LK_UNLCK Unlocks the specified bytes, which must have been previously locked. + + Regions should be locked only briefly and should be unlocked before closing a file or exiting the program. + + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__locking.asp + */ + int lkmode; + switch (*mode) { + case 'r': lkmode = LK_NBLCK; break; + case 'w': lkmode = LK_NBLCK; break; + case 'u': lkmode = LK_UNLCK; break; + default : return luaL_error (L, "%s: invalid mode", funcname); + } + if (!len) { + fseek (fh, 0L, SEEK_END); + len = ftell (fh); + } + fseek (fh, start, SEEK_SET); #ifdef __BORLANDC__ - code = locking (fileno(fh), lkmode, len); + code = locking (fileno(fh), lkmode, len); #else - code = _locking (fileno(fh), lkmode, len); + code = _locking (fileno(fh), lkmode, len); #endif #else - struct flock f; - switch (*mode) { - case 'w': f.l_type = F_WRLCK; break; - case 'r': f.l_type = F_RDLCK; break; - case 'u': f.l_type = F_UNLCK; break; - default : return luaL_error (L, "%s: invalid mode", funcname); - } - f.l_whence = SEEK_SET; - f.l_start = (off_t)start; - f.l_len = (off_t)len; - code = fcntl (fileno(fh), F_SETLK, &f); + struct flock f; + switch (*mode) { + case 'w': f.l_type = F_WRLCK; break; + case 'r': f.l_type = F_RDLCK; break; + case 'u': f.l_type = F_UNLCK; break; + default : return luaL_error (L, "%s: invalid mode", funcname); + } + f.l_whence = SEEK_SET; + f.l_start = (off_t)start; + f.l_len = (off_t)len; + code = fcntl (fileno(fh), F_SETLK, &f); #endif - return (code != -1); + return (code != -1); } #ifdef _WIN32 @@ -226,19 +292,19 @@ static int lfs_lock_dir(lua_State *L) { const char *lockfile = "/lockfile.lfs"; const char *path = luaL_checklstring(L, 1, &pathl); ln = (char*)malloc(pathl + strlen(lockfile) + 1); - if(!ln) { + if(!ln) { lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2; } strcpy(ln, path); strcat(ln, lockfile); - if((fd = CreateFile(ln, GENERIC_WRITE, 0, NULL, CREATE_NEW, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL)) == INVALID_HANDLE_VALUE) { - int en = GetLastError(); - free(ln); lua_pushnil(L); - if(en == ERROR_FILE_EXISTS || en == ERROR_SHARING_VIOLATION) - lua_pushstring(L, "File exists"); - else - lua_pushstring(L, strerror(en)); - return 2; + if((fd = CreateFile(ln, GENERIC_WRITE, 0, NULL, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL)) == INVALID_HANDLE_VALUE) { + int en = GetLastError(); + free(ln); lua_pushnil(L); + if(en == ERROR_FILE_EXISTS || en == ERROR_SHARING_VIOLATION) + lua_pushstring(L, "File exists"); + else + lua_pushstring(L, strerror(en)); + return 2; } free(ln); lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock)); @@ -248,8 +314,11 @@ static int lfs_lock_dir(lua_State *L) { return 1; } static int lfs_unlock_dir(lua_State *L) { - lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE); - CloseHandle(lock->fd); + lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE); + if(lock->fd != INVALID_HANDLE_VALUE) { + CloseHandle(lock->fd); + lock->fd=INVALID_HANDLE_VALUE; + } return 0; } #else @@ -264,12 +333,12 @@ static int lfs_lock_dir(lua_State *L) { const char *path = luaL_checklstring(L, 1, &pathl); lock = (lfs_Lock*)lua_newuserdata(L, sizeof(lfs_Lock)); ln = (char*)malloc(pathl + strlen(lockfile) + 1); - if(!ln) { + if(!ln) { lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2; } strcpy(ln, path); strcat(ln, lockfile); if(symlink("lock", ln) == -1) { - free(ln); lua_pushnil(L); + free(ln); lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2; } lock->ln = ln; @@ -278,7 +347,7 @@ static int lfs_lock_dir(lua_State *L) { return 1; } static int lfs_unlock_dir(lua_State *L) { - lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE); + lfs_Lock *lock = (lfs_Lock *)luaL_checkudata(L, 1, LOCK_METATABLE); if(lock->ln) { unlink(lock->ln); free(lock->ln); @@ -288,39 +357,26 @@ static int lfs_unlock_dir(lua_State *L) { } #endif -#ifdef _WIN32 static int lfs_g_setmode (lua_State *L, FILE *f, int arg) { - static const int mode[] = {_O_TEXT, _O_BINARY}; - static const char *const modenames[] = {"text", "binary", NULL}; + static const int mode[] = {_O_BINARY, _O_TEXT}; + static const char *const modenames[] = {"binary", "text", NULL}; int op = luaL_checkoption(L, arg, NULL, modenames); - int res = lfs_setmode(L, f, mode[op]); + int res = lfs_setmode(f, mode[op]); if (res != -1) { int i; lua_pushboolean(L, 1); for (i = 0; modenames[i] != NULL; i++) { if (mode[i] == res) { lua_pushstring(L, modenames[i]); - goto exit; + return 2; } } lua_pushnil(L); - exit: return 2; } else { - int en = errno; - lua_pushnil(L); - lua_pushfstring(L, "%s", strerror(en)); - lua_pushinteger(L, en); - return 3; + return pusherror(L, NULL); } } -#else -static int lfs_g_setmode (lua_State *L, FILE *f, int arg) { - lua_pushboolean(L, 0); - lua_pushliteral(L, "setmode not supported on this platform"); - return 2; -} -#endif static int lfs_f_setmode(lua_State *L) { return lfs_g_setmode(L, check_file(L, 1, "setmode"), 2); @@ -334,18 +390,18 @@ static int lfs_f_setmode(lua_State *L) { ** @param #4 Number with length (optional). */ static int file_lock (lua_State *L) { - FILE *fh = check_file (L, 1, "lock"); - const char *mode = luaL_checkstring (L, 2); - const long start = luaL_optlong (L, 3, 0); - long len = luaL_optlong (L, 4, 0); - if (_file_lock (L, fh, mode, start, len, "lock")) { - lua_pushboolean (L, 1); - return 1; - } else { - lua_pushnil (L); - lua_pushfstring (L, "%s", strerror(errno)); - return 2; - } + FILE *fh = check_file (L, 1, "lock"); + const char *mode = luaL_checkstring (L, 2); + const long start = (long) luaL_optinteger (L, 3, 0); + long len = (long) luaL_optinteger (L, 4, 0); + if (_file_lock (L, fh, mode, start, len, "lock")) { + lua_pushboolean (L, 1); + return 1; + } else { + lua_pushnil (L); + lua_pushfstring (L, "%s", strerror(errno)); + return 2; + } } @@ -356,99 +412,107 @@ static int file_lock (lua_State *L) { ** @param #3 Number with length (optional). */ static int file_unlock (lua_State *L) { - FILE *fh = check_file (L, 1, "unlock"); - const long start = luaL_optlong (L, 2, 0); - long len = luaL_optlong (L, 3, 0); - if (_file_lock (L, fh, "u", start, len, "unlock")) { - lua_pushboolean (L, 1); - return 1; - } else { - lua_pushnil (L); - lua_pushfstring (L, "%s", strerror(errno)); - return 2; - } + FILE *fh = check_file (L, 1, "unlock"); + const long start = (long) luaL_optinteger (L, 2, 0); + long len = (long) luaL_optinteger (L, 3, 0); + if (_file_lock (L, fh, "u", start, len, "unlock")) { + lua_pushboolean (L, 1); + return 1; + } else { + lua_pushnil (L); + lua_pushfstring (L, "%s", strerror(errno)); + return 2; + } } -static int make_dir (lua_State *L) { - const char *path = luaL_checkstring (L, 1); - int fail; -#ifdef _WIN32 - fail = _mkdir (path); +/* +** Creates a link. +** @param #1 Object to link to. +** @param #2 Name of link. +** @param #3 True if link is symbolic (optional). +*/ +static int make_link (lua_State *L) { +#ifndef _WIN32 + const char *oldpath = luaL_checkstring(L, 1); + const char *newpath = luaL_checkstring(L, 2); + int res = (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath); + if (res == -1) { + return pusherror(L, NULL); + } else { + lua_pushinteger(L, 0); + return 1; + } #else - fail = mkdir (path, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | - S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH ); + errno = ENOSYS; /* = "Function not implemented" */ + return pushresult(L, -1, "make_link is not supported on Windows"); #endif - if (fail) { - lua_pushnil (L); - lua_pushfstring (L, "%s", strerror(errno)); - return 2; - } - lua_pushboolean (L, 1); - return 1; } + /* -** Removes a directory. +** Creates a directory. ** @param #1 Directory path. */ -static int remove_dir (lua_State *L) { - const char *path = luaL_checkstring (L, 1); - int fail; +static int make_dir (lua_State *L) { + const char *path = luaL_checkstring(L, 1); + return pushresult(L, lfs_mkdir(path), NULL); +} - fail = rmdir (path); - if (fail) { - lua_pushnil (L); - lua_pushfstring (L, "%s", strerror(errno)); - return 2; - } - lua_pushboolean (L, 1); - return 1; +/* +** Removes a directory. +** @param #1 Directory path. +*/ +static int remove_dir (lua_State *L) { + const char *path = luaL_checkstring(L, 1); + return pushresult(L, rmdir(path), NULL); } + /* ** Directory iterator */ static int dir_iter (lua_State *L) { #ifdef _WIN32 - struct _finddata_t c_file; + struct _finddata_t c_file; #else - struct dirent *entry; + struct dirent *entry; #endif - dir_data *d = (dir_data *)luaL_checkudata (L, 1, DIR_METATABLE); - luaL_argcheck (L, !d->closed, 1, "closed directory"); + dir_data *d = (dir_data *)luaL_checkudata (L, 1, DIR_METATABLE); + luaL_argcheck (L, d->closed == 0, 1, "closed directory"); #ifdef _WIN32 - if (d->hFile == 0L) { /* first entry */ - if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) { - lua_pushnil (L); - lua_pushstring (L, strerror (errno)); - return 2; - } else { - lua_pushstring (L, c_file.name); - return 1; - } - } else { /* next entry */ - if (_findnext (d->hFile, &c_file) == -1L) { - /* no more entries => close directory */ - _findclose (d->hFile); - d->closed = 1; - return 0; - } else { - lua_pushstring (L, c_file.name); - return 1; - } - } + if (d->hFile == 0L) { /* first entry */ + if ((d->hFile = _findfirst (d->pattern, &c_file)) == -1L) { + lua_pushnil (L); + lua_pushstring (L, strerror (errno)); + d->closed = 1; + return 2; + } else { + lua_pushstring (L, c_file.name); + return 1; + } + } else { /* next entry */ + if (_findnext (d->hFile, &c_file) == -1L) { + /* no more entries => close directory */ + _findclose (d->hFile); + d->closed = 1; + return 0; + } else { + lua_pushstring (L, c_file.name); + return 1; + } + } #else - if ((entry = readdir (d->dir)) != NULL) { - lua_pushstring (L, entry->d_name); - return 1; - } else { - /* no more entries => close directory */ - closedir (d->dir); - d->closed = 1; - return 0; - } + if ((entry = readdir (d->dir)) != NULL) { + lua_pushstring (L, entry->d_name); + return 1; + } else { + /* no more entries => close directory */ + closedir (d->dir); + d->closed = 1; + return 0; + } #endif } @@ -457,19 +521,18 @@ static int dir_iter (lua_State *L) { ** Closes directory iterators */ static int dir_close (lua_State *L) { - dir_data *d = (dir_data *)lua_touserdata (L, 1); + dir_data *d = (dir_data *)lua_touserdata (L, 1); #ifdef _WIN32 - if (!d->closed && d->hFile) { - _findclose (d->hFile); - d->closed = 1; - } + if (!d->closed && d->hFile) { + _findclose (d->hFile); + } #else - if (!d->closed && d->dir) { - closedir (d->dir); - d->closed = 1; - } + if (!d->closed && d->dir) { + closedir (d->dir); + } #endif - return 0; + d->closed = 1; + return 0; } @@ -477,27 +540,25 @@ static int dir_close (lua_State *L) { ** Factory of directory iterators */ static int dir_iter_factory (lua_State *L) { - const char *path = luaL_checkstring (L, 1); - dir_data *d; - lua_pushcfunction (L, dir_iter); - d = (dir_data *) lua_newuserdata (L, sizeof(dir_data)); - d->closed = 0; + const char *path = luaL_checkstring (L, 1); + dir_data *d; + lua_pushcfunction (L, dir_iter); + d = (dir_data *) lua_newuserdata (L, sizeof(dir_data)); + luaL_getmetatable (L, DIR_METATABLE); + lua_setmetatable (L, -2); + d->closed = 0; #ifdef _WIN32 - d->hFile = 0L; - luaL_getmetatable (L, DIR_METATABLE); - lua_setmetatable (L, -2); - if (strlen(path) > MAX_DIR_LENGTH) - luaL_error (L, "path too long: %s", path); - else - sprintf (d->pattern, "%s/*", path); + d->hFile = 0L; + if (strlen(path) > MAX_PATH-2) + luaL_error (L, "path too long: %s", path); + else + sprintf (d->pattern, "%s/*", path); #else - luaL_getmetatable (L, DIR_METATABLE); - lua_setmetatable (L, -2); - d->dir = opendir (path); - if (d->dir == NULL) - luaL_error (L, "cannot open %s: %s", path, strerror (errno)); + d->dir = opendir (path); + if (d->dir == NULL) + luaL_error (L, "cannot open %s: %s", path, strerror (errno)); #endif - return 2; + return 2; } @@ -505,36 +566,39 @@ static int dir_iter_factory (lua_State *L) { ** Creates directory metatable. */ static int dir_create_meta (lua_State *L) { - luaL_newmetatable (L, DIR_METATABLE); - /* set its __gc field */ - lua_pushstring (L, "__index"); - lua_newtable(L); - lua_pushstring (L, "next"); - lua_pushcfunction (L, dir_iter); - lua_settable(L, -3); - lua_pushstring (L, "close"); - lua_pushcfunction (L, dir_close); - lua_settable(L, -3); - lua_settable (L, -3); - lua_pushstring (L, "__gc"); - lua_pushcfunction (L, dir_close); - lua_settable (L, -3); - return 1; + luaL_newmetatable (L, DIR_METATABLE); + + /* Method table */ + lua_newtable(L); + lua_pushcfunction (L, dir_iter); + lua_setfield(L, -2, "next"); + lua_pushcfunction (L, dir_close); + lua_setfield(L, -2, "close"); + + /* Metamethods */ + lua_setfield(L, -2, "__index"); + lua_pushcfunction (L, dir_close); + lua_setfield (L, -2, "__gc"); + return 1; } + /* ** Creates lock metatable. */ static int lock_create_meta (lua_State *L) { - luaL_newmetatable (L, LOCK_METATABLE); - /* set its __gc field */ - lua_newtable(L); - lua_pushcfunction(L, lfs_unlock_dir); - lua_setfield(L, -2, "free"); - lua_setfield(L, -2, "__index"); - lua_pushcfunction(L, lfs_unlock_dir); - lua_setfield(L, -2, "__gc"); - return 1; + luaL_newmetatable (L, LOCK_METATABLE); + + /* Method table */ + lua_newtable(L); + lua_pushcfunction(L, lfs_unlock_dir); + lua_setfield(L, -2, "free"); + + /* Metamethods */ + lua_setfield(L, -2, "__index"); + lua_pushcfunction(L, lfs_unlock_dir); + lua_setfield(L, -2, "__gc"); + return 1; } @@ -574,104 +638,96 @@ static const char *mode2string (mode_t mode) { else if ( S_ISDIR(mode) ) return "directory"; else if ( S_ISLNK(mode) ) - return "link"; + return "link"; else if ( S_ISSOCK(mode) ) return "socket"; else if ( S_ISFIFO(mode) ) - return "named pipe"; + return "named pipe"; else if ( S_ISCHR(mode) ) - return "char device"; + return "char device"; else if ( S_ISBLK(mode) ) - return "block device"; + return "block device"; else - return "other"; + return "other"; } /* -** Set access time and modification values for file +** Set access time and modification values for a file. +** @param #1 File path. +** @param #2 Access time in seconds, current time is used if missing. +** @param #3 Modification time in seconds, access time is used if missing. */ static int file_utime (lua_State *L) { - const char *file = luaL_checkstring (L, 1); - struct utimbuf utb, *buf; - - if (lua_gettop (L) == 1) /* set to current date/time */ - buf = NULL; - else { - utb.actime = (time_t)luaL_optnumber (L, 2, 0); - utb.modtime = (time_t)luaL_optnumber (L, 3, utb.actime); - buf = &utb; - } - if (utime (file, buf)) { - lua_pushnil (L); - lua_pushfstring (L, "%s", strerror (errno)); - return 2; - } - lua_pushboolean (L, 1); - return 1; + const char *file = luaL_checkstring(L, 1); + struct utimbuf utb, *buf; + + if (lua_gettop (L) == 1) /* set to current date/time */ + buf = NULL; + else { + utb.actime = (time_t) luaL_optnumber(L, 2, 0); + utb.modtime = (time_t) luaL_optinteger(L, 3, utb.actime); + buf = &utb; + } + + return pushresult(L, utime(file, buf), NULL); } /* inode protection mode */ static void push_st_mode (lua_State *L, STAT_STRUCT *info) { - lua_pushstring (L, mode2string (info->st_mode)); + lua_pushstring (L, mode2string (info->st_mode)); } /* device inode resides on */ static void push_st_dev (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_dev); + lua_pushinteger (L, (lua_Integer) info->st_dev); } /* inode's number */ static void push_st_ino (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_ino); + lua_pushinteger (L, (lua_Integer) info->st_ino); } /* number of hard links to the file */ static void push_st_nlink (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_nlink); + lua_pushinteger (L, (lua_Integer)info->st_nlink); } /* user-id of owner */ static void push_st_uid (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_uid); + lua_pushinteger (L, (lua_Integer)info->st_uid); } /* group-id of owner */ static void push_st_gid (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_gid); + lua_pushinteger (L, (lua_Integer)info->st_gid); } /* device type, for special file inode */ static void push_st_rdev (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_rdev); + lua_pushinteger (L, (lua_Integer) info->st_rdev); } /* time of last access */ static void push_st_atime (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, info->st_atime); + lua_pushinteger (L, (lua_Integer) info->st_atime); } /* time of last data modification */ static void push_st_mtime (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, info->st_mtime); + lua_pushinteger (L, (lua_Integer) info->st_mtime); } /* time of last file status change */ static void push_st_ctime (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, info->st_ctime); + lua_pushinteger (L, (lua_Integer) info->st_ctime); } /* file size, in bytes */ static void push_st_size (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_size); + lua_pushinteger (L, (lua_Integer)info->st_size); } #ifndef _WIN32 /* blocks allocated for file */ static void push_st_blocks (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_blocks); + lua_pushinteger (L, (lua_Integer)info->st_blocks); } /* optimal file system I/O blocksize */ static void push_st_blksize (lua_State *L, STAT_STRUCT *info) { - lua_pushnumber (L, (lua_Number)info->st_blksize); + lua_pushinteger (L, (lua_Integer)info->st_blksize); } #endif -static void push_invalid (lua_State *L, STAT_STRUCT *info) { - luaL_error(L, "invalid attribute name"); -#ifndef _WIN32 - info->st_blksize = 0; /* never reached */ -#endif -} /* ** Convert the inode protection mode to a permission list. @@ -679,20 +735,20 @@ static void push_invalid (lua_State *L, STAT_STRUCT *info) { #ifdef _WIN32 static const char *perm2string (unsigned short mode) { - static char perms[10] = "---------\0"; + static char perms[10] = "---------"; int i; - for (i=0;i<9;i++) perms[i]='-'; - if (mode & _S_IREAD) + for (i=0;i<9;i++) perms[i]='-'; + if (mode & _S_IREAD) { perms[0] = 'r'; perms[3] = 'r'; perms[6] = 'r'; } - if (mode & _S_IWRITE) + if (mode & _S_IWRITE) { perms[1] = 'w'; perms[4] = 'w'; perms[7] = 'w'; } - if (mode & _S_IEXEC) + if (mode & _S_IEXEC) { perms[2] = 'x'; perms[5] = 'x'; perms[8] = 'x'; } return perms; } #else static const char *perm2string (mode_t mode) { - static char perms[10] = "---------\0"; + static char perms[10] = "---------"; int i; for (i=0;i<9;i++) perms[i]='-'; if (mode & S_IRUSR) perms[0] = 'r'; @@ -716,68 +772,68 @@ static void push_st_perm (lua_State *L, STAT_STRUCT *info) { typedef void (*_push_function) (lua_State *L, STAT_STRUCT *info); struct _stat_members { - const char *name; - _push_function push; + const char *name; + _push_function push; }; struct _stat_members members[] = { - { "mode", push_st_mode }, - { "dev", push_st_dev }, - { "ino", push_st_ino }, - { "nlink", push_st_nlink }, - { "uid", push_st_uid }, - { "gid", push_st_gid }, - { "rdev", push_st_rdev }, - { "access", push_st_atime }, - { "modification", push_st_mtime }, - { "change", push_st_ctime }, - { "size", push_st_size }, - { "permissions", push_st_perm }, + { "mode", push_st_mode }, + { "dev", push_st_dev }, + { "ino", push_st_ino }, + { "nlink", push_st_nlink }, + { "uid", push_st_uid }, + { "gid", push_st_gid }, + { "rdev", push_st_rdev }, + { "access", push_st_atime }, + { "modification", push_st_mtime }, + { "change", push_st_ctime }, + { "size", push_st_size }, + { "permissions", push_st_perm }, #ifndef _WIN32 - { "blocks", push_st_blocks }, - { "blksize", push_st_blksize }, + { "blocks", push_st_blocks }, + { "blksize", push_st_blksize }, #endif - { NULL, push_invalid } + { NULL, NULL } }; /* ** Get file or symbolic link information */ static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) { - int i; - STAT_STRUCT info; - const char *file = luaL_checkstring (L, 1); - - if (st(file, &info)) { - lua_pushnil (L); - lua_pushfstring (L, "cannot obtain information from file `%s'", file); - return 2; - } - if (lua_isstring (L, 2)) { - int v; - const char *member = lua_tostring (L, 2); - if (strcmp (member, "mode") == 0) v = 0; -#ifndef _WIN32 - else if (strcmp (member, "blocks") == 0) v = 11; - else if (strcmp (member, "blksize") == 0) v = 12; -#endif - else /* look for member */ - for (v = 1; members[v].name; v++) - if (*members[v].name == *member) - break; - /* push member value and return */ - members[v].push (L, &info); - return 1; - } else if (!lua_istable (L, 2)) - /* creates a table if none is given */ - lua_newtable (L); - /* stores all members in table on top of the stack */ - for (i = 0; members[i].name; i++) { - lua_pushstring (L, members[i].name); - members[i].push (L, &info); - lua_rawset (L, -3); - } - return 1; + STAT_STRUCT info; + const char *file = luaL_checkstring (L, 1); + int i; + + if (st(file, &info)) { + lua_pushnil(L); + lua_pushfstring(L, "cannot obtain information from file '%s': %s", file, strerror(errno)); + lua_pushinteger(L, errno); + return 3; + } + if (lua_isstring (L, 2)) { + const char *member = lua_tostring (L, 2); + for (i = 0; members[i].name; i++) { + if (strcmp(members[i].name, member) == 0) { + /* push member value and return */ + members[i].push (L, &info); + return 1; + } + } + /* member not found */ + return luaL_error(L, "invalid attribute name '%s'", member); + } + /* creates a table if none is given, removes extra arguments */ + lua_settop(L, 2); + if (!lua_istable (L, 2)) { + lua_newtable (L); + } + /* stores all members in table on top of the stack */ + for (i = 0; members[i].name; i++) { + lua_pushstring (L, members[i].name); + members[i].push (L, &info); + lua_rawset (L, -3); + } + return 1; } @@ -785,62 +841,101 @@ static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) { ** Get file information using stat. */ static int file_info (lua_State *L) { - return _file_info_ (L, STAT_FUNC); + return _file_info_ (L, STAT_FUNC); } /* -** Get symbolic link information using lstat. +** Push the symlink target to the top of the stack. +** Assumes the file name is at position 1 of the stack. +** Returns 1 if successful (with the target on top of the stack), +** 0 on failure (with stack unchanged, and errno set). */ -#ifndef _WIN32 -static int link_info (lua_State *L) { - return _file_info_ (L, LSTAT_FUNC); -} +static int push_link_target(lua_State *L) { +#ifdef _WIN32 + errno = ENOSYS; + return 0; #else + const char *file = luaL_checkstring(L, 1); + char *target = NULL; + int tsize, size = 256; /* size = initial buffer capacity */ + while (1) { + target = realloc(target, size); + if (!target) /* failed to allocate */ + return 0; + tsize = readlink(file, target, size); + if (tsize < 0) { /* a readlink() error occurred */ + free(target); + return 0; + } + if (tsize < size) + break; + /* possibly truncated readlink() result, double size and retry */ + size *= 2; + } + target[tsize] = '\0'; + lua_pushlstring(L, target, tsize); + free(target); + return 1; +#endif +} + +/* +** Get symbolic link information using lstat. +*/ static int link_info (lua_State *L) { - lua_pushboolean(L, 0); - lua_pushliteral(L, "symlinkattributes not supported on this platform"); - return 2; + int ret; + if (lua_isstring (L, 2) && (strcmp(lua_tostring(L, 2), "target") == 0)) { + int ok = push_link_target(L); + return ok ? 1 : pusherror(L, "could not obtain link target"); + } + ret = _file_info_ (L, LSTAT_FUNC); + if (ret == 1 && lua_type(L, -1) == LUA_TTABLE) { + int ok = push_link_target(L); + if (ok) { + lua_setfield(L, -2, "target"); + } + } + return ret; } -#endif /* ** Assumes the table is on top of the stack. */ static void set_info (lua_State *L) { - lua_pushliteral (L, "_COPYRIGHT"); - lua_pushliteral (L, "Copyright (C) 2003-2009 Kepler Project"); - lua_settable (L, -3); - lua_pushliteral (L, "_DESCRIPTION"); - lua_pushliteral (L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution"); - lua_settable (L, -3); - lua_pushliteral (L, "_VERSION"); - lua_pushliteral (L, "LuaFileSystem 1.5.0"); - lua_settable (L, -3); + lua_pushliteral(L, "Copyright (C) 2003-2017 Kepler Project"); + lua_setfield(L, -2, "_COPYRIGHT"); + lua_pushliteral(L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution"); + lua_setfield(L, -2, "_DESCRIPTION"); + lua_pushliteral(L, "LuaFileSystem " LFS_VERSION); + lua_setfield(L, -2, "_VERSION"); } static const struct luaL_Reg fslib[] = { - {"attributes", file_info}, - {"chdir", change_dir}, - {"currentdir", get_dir}, - {"dir", dir_iter_factory}, - {"lock", file_lock}, - {"mkdir", make_dir}, - {"rmdir", remove_dir}, - {"symlinkattributes", link_info}, - {"setmode", lfs_f_setmode}, - {"touch", file_utime}, - {"unlock", file_unlock}, - {"lock_dir", lfs_lock_dir}, - {NULL, NULL}, + {"attributes", file_info}, + {"chdir", change_dir}, + {"currentdir", get_dir}, + {"dir", dir_iter_factory}, + {"link", make_link}, + {"lock", file_lock}, + {"mkdir", make_dir}, + {"rmdir", remove_dir}, + {"symlinkattributes", link_info}, + {"setmode", lfs_f_setmode}, + {"touch", file_utime}, + {"unlock", file_unlock}, + {"lock_dir", lfs_lock_dir}, + {NULL, NULL}, }; -int luaopen_lfs (lua_State *L) { - dir_create_meta (L); - lock_create_meta (L); - luaL_register (L, "lfs", fslib); - set_info (L); - return 1; +LFS_EXPORT int luaopen_lfs (lua_State *L) { + dir_create_meta (L); + lock_create_meta (L); + new_lib (L, fslib); + lua_pushvalue(L, -1); + lua_setglobal(L, LFS_LIBNAME); + set_info (L); + return 1; } diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def index f79cd298b31..4055ff04b24 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def @@ -1,5 +1,4 @@ LIBRARY lfs.dll -DESCRIPTION "LuaFileSystem" -VERSION 1.4.2 +VERSION 1.7 EXPORTS luaopen_lfs diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h index 4b52780bb3f..458756404ed 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h @@ -1,17 +1,34 @@ /* ** LuaFileSystem -** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem) -** -** $Id: lfs.h,v 1.5 2008/02/19 20:08:23 mascarenhas Exp $ +** Copyright Kepler Project 2003 - 2017 (http://keplerproject.github.io/luafilesystem) */ /* Define 'chdir' for systems that do not implement it */ #ifdef NO_CHDIR -#define chdir(p) (-1) -#define chdir_error "Function 'chdir' not provided by system" + #define chdir(p) (-1) + #define chdir_error "Function 'chdir' not provided by system" #else -#define chdir_error strerror(errno) + #define chdir_error strerror(errno) #endif +#ifdef _WIN32 + #define chdir(p) (_chdir(p)) + #define getcwd(d, s) (_getcwd(d, s)) + #define rmdir(p) (_rmdir(p)) + #define LFS_EXPORT __declspec (dllexport) + #ifndef fileno + #define fileno(f) (_fileno(f)) + #endif +#else + #define LFS_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +LFS_EXPORT int luaopen_lfs (lua_State *L); -int luaopen_lfs (lua_State *L); +#ifdef __cplusplus +} +#endif diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua b/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua index 71110749c06..591ee25974b 100644 --- a/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua +++ b/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua @@ -1,28 +1,31 @@ -#!/usr/local/bin/lua5.1 +#!/usr/bin/env lua5.1 local tmp = "/tmp" -local sep = "/" +local sep = string.match (package.config, "[^\n]+") local upper = ".." -require"lfs" +local lfs = require"lfs" print (lfs._VERSION) +io.write(".") +io.flush() + function attrdir (path) - for file in lfs.dir(path) do - if file ~= "." and file ~= ".." then - local f = path..sep..file - print ("\t=> "..f.." <=") - local attr = lfs.attributes (f) - assert (type(attr) == "table") - if attr.mode == "directory" then - attrdir (f) - else - for name, value in pairs(attr) do - print (name, value) - end - end - end - end + for file in lfs.dir(path) do + if file ~= "." and file ~= ".." then + local f = path..sep..file + print ("\t=> "..f.." <=") + local attr = lfs.attributes (f) + assert (type(attr) == "table") + if attr.mode == "directory" then + attrdir (f) + else + for name, value in pairs(attr) do + print (name, value) + end + end + end + end end -- Checking changing directories @@ -33,6 +36,9 @@ assert (lfs.chdir (reldir), "could not change back to current directory") assert (lfs.currentdir() == current, "error trying to change directories") assert (lfs.chdir ("this couldn't be an actual directory") == nil, "could change to a non-existent directory") +io.write(".") +io.flush() + -- Changing creating and removing directories local tmpdir = current..sep.."lfs_tmp_dir" local tmpfile = tmpdir..sep.."tmp_file" @@ -40,19 +46,25 @@ local tmpfile = tmpdir..sep.."tmp_file" -- that may have resulted from an interrupted test execution and remove it if lfs.chdir (tmpdir) then assert (lfs.chdir (upper), "could not change to upper directory") - assert (os.remove (tmpfile), "could not remove file from previous test") + assert (os.remove (tmpfile), "could not remove file from previous test") assert (lfs.rmdir (tmpdir), "could not remove directory from previous test") end +io.write(".") +io.flush() + -- tries to create a directory assert (lfs.mkdir (tmpdir), "could not make a new directory") local attrib, errmsg = lfs.attributes (tmpdir) if not attrib then - error ("could not get attributes of file `"..tmpdir.."':\n"..errmsg) + error ("could not get attributes of file `"..tmpdir.."':\n"..errmsg) end local f = io.open(tmpfile, "w") f:close() +io.write(".") +io.flush() + -- Change access time local testdate = os.time({ year = 2007, day = 10, month = 2, hour=0}) assert (lfs.touch (tmpfile, testdate)) @@ -60,6 +72,9 @@ local new_att = assert (lfs.attributes (tmpfile)) assert (new_att.access == testdate, "could not set access time") assert (new_att.modification == testdate, "could not set modification time") +io.write(".") +io.flush() + -- Change access and modification time local testdate1 = os.time({ year = 2007, day = 10, month = 2, hour=0}) local testdate2 = os.time({ year = 2007, day = 11, month = 2, hour=0}) @@ -69,48 +84,94 @@ local new_att = assert (lfs.attributes (tmpfile)) assert (new_att.access == testdate2, "could not set access time") assert (new_att.modification == testdate1, "could not set modification time") -local res, err = lfs.symlinkattributes(tmpfile) -if err ~= "symlinkattributes not supported on this platform" then - -- Checking symbolic link information (does not work in Windows) - assert (os.execute ("ln -s "..tmpfile.." _a_link_for_test_")) - assert (lfs.attributes"_a_link_for_test_".mode == "file") - assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") - assert (os.remove"_a_link_for_test_") +io.write(".") +io.flush() + +-- Checking link (does not work on Windows) +if lfs.link (tmpfile, "_a_link_for_test_", true) then + assert (lfs.attributes"_a_link_for_test_".mode == "file") + assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") + assert (lfs.symlinkattributes"_a_link_for_test_".target == tmpfile) + assert (lfs.symlinkattributes("_a_link_for_test_", "target") == tmpfile) + assert (lfs.link (tmpfile, "_a_hard_link_for_test_")) + assert (lfs.attributes (tmpfile, "nlink") == 2) + assert (os.remove"_a_link_for_test_") + assert (os.remove"_a_hard_link_for_test_") end -if lfs.setmode then - -- Checking text/binary modes (works only in Windows) - local f = io.open(tmpfile, "w") - local result, mode = lfs.setmode(f, "binary") - assert((result and mode == "text") or (not result and mode == "setmode not supported on this platform")) - result, mode = lfs.setmode(f, "text") - assert((result and mode == "binary") or (not result and mode == "setmode not supported on this platform")) - f:close() -end - +io.write(".") +io.flush() + +-- Checking text/binary modes (only has an effect in Windows) +local f = io.open(tmpfile, "w") +local result, mode = lfs.setmode(f, "binary") +assert(result) -- on non-Windows platforms, mode is always returned as "binary" +result, mode = lfs.setmode(f, "text") +assert(result and mode == "binary") +f:close() +local ok, err = pcall(lfs.setmode, f, "binary") +assert(not ok, "could setmode on closed file") +assert(err:find("closed file"), "bad error message for setmode on closed file") + +io.write(".") +io.flush() + -- Restore access time to current value assert (lfs.touch (tmpfile, attrib.access, attrib.modification)) new_att = assert (lfs.attributes (tmpfile)) assert (new_att.access == attrib.access) assert (new_att.modification == attrib.modification) +io.write(".") +io.flush() + +-- Check consistency of lfs.attributes values +local attr = lfs.attributes (tmpfile) +for key, value in pairs(attr) do + assert (value == lfs.attributes (tmpfile, key), + "lfs.attributes values not consistent") +end + +-- Check that lfs.attributes accepts a table as second argument +local attr2 = {} +lfs.attributes(tmpfile, attr2) +for key, value in pairs(attr2) do + assert (value == lfs.attributes (tmpfile, key), + "lfs.attributes values with table argument not consistent") +end + +-- Check that extra arguments are ignored +lfs.attributes(tmpfile, attr2, nil) + -- Remove new file and directory assert (os.remove (tmpfile), "could not remove new file") assert (lfs.rmdir (tmpdir), "could not remove new directory") assert (lfs.mkdir (tmpdir..sep.."lfs_tmp_dir") == nil, "could create a directory inside a non-existent one") +io.write(".") +io.flush() + -- Trying to get attributes of a non-existent file -assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file") +local attr_ok, err, errno = lfs.attributes("this couldn't be an actual file") +assert(attr_ok == nil, "could get attributes of a non-existent file") +assert(type(err) == "string", "failed lfs.attributes did not return an error message") +assert(type(errno) == "number", "failed lfs.attributes did not return error code") assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory") +io.write(".") +io.flush() + -- Stressing directory iterator count = 0 for i = 1, 4000 do - for file in lfs.dir (tmp) do - count = count + 1 - end + for file in lfs.dir (tmp) do + count = count + 1 + end end +io.write(".") +io.flush() + -- Stressing directory iterator, explicit version count = 0 for i = 1, 4000 do @@ -123,6 +184,9 @@ for i = 1, 4000 do assert(not pcall(dir.next, dir)) end +io.write(".") +io.flush() + -- directory explicit close local iter, dir = lfs.dir(tmp) dir:close() diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c index d2cf7bea15c..8717fe8e39d 100644 --- a/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c +++ b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c @@ -3327,7 +3327,7 @@ int luaopen_ff(lua_State * L) default_encoding = FindOrMakeEncoding("ISO8859-1"); SaveTablesPref = SaveTablesPref_string; luaL_newmetatable(L, FONT_METATABLE); - luaL_register(L, NULL, fflib_m); + luaL_openlib(L, NULL, fflib_m, 0); /* virtual subfont table */ luaL_newmetatable(L, FONT_SUBFONT_METATABLE); diff --git a/Build/source/texk/web2c/luatexdir/luasocket/LICENSE b/Build/source/texk/web2c/luatexdir/luasocket/LICENSE index 5bd3478897d..b63545107ef 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/LICENSE +++ b/Build/source/texk/web2c/luatexdir/luasocket/LICENSE @@ -1,5 +1,5 @@ -LuaSocket 2.1 license -Copyright © 2004-2012 Diego Nehab +LuaSocket 3.0 license +Copyright © 2004-2013 Diego Nehab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/Build/source/texk/web2c/luatexdir/luasocket/Lua51.props b/Build/source/texk/web2c/luatexdir/luasocket/Lua51.props new file mode 100644 index 00000000000..1bd62565389 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luasocket/Lua51.props @@ -0,0 +1,28 @@ + + + + + ..\build\vc12\bin\lua\5.1\ + ..\build\vc12\bin\lua\5.1\ + ..\build\vc12\include\lua\5.1\ + lua51.lib + + + <_PropertySheetDisplayName>Lua51 + + + + + $(LUALIB_PATH) + + + $(LUABIN_PATH) + + + $(LUAINC_PATH) + + + $(LUALIB) + + + diff --git a/Build/source/texk/web2c/luatexdir/luasocket/Lua52.props b/Build/source/texk/web2c/luatexdir/luasocket/Lua52.props new file mode 100644 index 00000000000..01afcfa7c4b --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luasocket/Lua52.props @@ -0,0 +1,28 @@ + + + + + ..\build\vc12\bin\lua\5.2\ + ..\build\vc12\bin\lua\5.2\ + ..\build\vc12\include\lua\5.2\ + lua52.lib + + + <_PropertySheetDisplayName>Lua52 + + + + + $(LUALIB_PATH) + + + $(LUABIN_PATH) + + + $(LUAINC_PATH) + + + $(LUALIB) + + + diff --git a/Build/source/texk/web2c/luatexdir/luasocket/NEW b/Build/source/texk/web2c/luatexdir/luasocket/NEW index 76b84487037..0bff64c1df3 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/NEW +++ b/Build/source/texk/web2c/luatexdir/luasocket/NEW @@ -1,38 +1,44 @@ What's New -This is just a bug-fix/update release. +Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility. - * Fixed: manual sample of HTTP authentication now uses correct - "authorization" header (Alexandre Ittner); - * Fixed: failure on bind() was destroying the socket (Sam Roberts); - * Fixed: receive() returns immediatelly if prefix can satisfy - bytes requested (M Joonas Pihlaja); - * Fixed: multicast didn't work on Windows, or anywhere - else for that matter (Herbert Leuwer, Adrian Sietsma); - * Fixed: select() now reports an error when called with more - sockets than FD_SETSIZE (Lorenzo Leonini); - * Fixed: manual links to home.html changed to index.html (Robert Hahn); - * Fixed: mime.unb64() would return an empty string on results that started - with a null character (Robert Raschke); - * Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); - * Fixed: calling sleep() with negative numbers could - block forever, wasting CPU. Now it returns immediately (MPB); - * Improved: FTP commands are now sent in upper case to - help buggy servers (Anders Eurenius); - * Improved: known headers now sent in canonic - capitalization to help buggy servers (Joseph Stewart); - * Improved: Clarified tcp:receive() in the manual (MPB); - * Improved: Decent makefiles (LHF). - * Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). - - - Yuri's bug? - Dahlberg - Sam Roberts - Thomas Harning Jr. - Sebastien Perin - remove getn in all files - ltn12.pump.all( - ltn12.source.file(io.open("original.png")), - ltn12.sink.file(io.open("copy.png", "wb")) - ) + * Added: Compatible with Lua 5.2 + - Note that unless you define LUA_COMPAT_MODULE, package + tables will not be exported as globals! + * Added: IPv6 support; + - Socket.connect and socket.bind support IPv6 addresses; + - Getpeername and getsockname support IPv6 addresses, and + return the socket family as a third value; + - URL module updated to support IPv6 host names; + - New socket.tcp6 and socket.udp6 functions; + - New socket.dns.getaddrinfo and socket.dns.getnameinfo functions; + * Added: getoption method; + * Fixed: url.unescape was returning additional values; + * Fixed: mime.qp, mime.unqp, mime.b64, and mime.unb64 could + mistaking their own stack slots for functions arguments; + * Fixed: Receiving zero-length datagram is now possible; + * Improved: Hidden all internal library symbols; + * Improved: Better error messages; + * Improved: Better documentation of socket options. + * Fixed: manual sample of HTTP authentication now uses correct + "authorization" header (Alexandre Ittner); + * Fixed: failure on bind() was destroying the socket (Sam Roberts); + * Fixed: receive() returns immediatelly if prefix can satisfy + bytes requested (M Joonas Pihlaja); + * Fixed: multicast didn't work on Windows, or anywhere + else for that matter (Herbert Leuwer, Adrian Sietsma); + * Fixed: select() now reports an error when called with more + sockets than FD_SETSIZE (Lorenzo Leonini); + * Fixed: manual links to home.html changed to index.html (Robert Hahn); + * Fixed: mime.unb64() would return an empty string on results that started + with a null character (Robert Raschke); + * Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); + * Fixed: calling sleep() with negative numbers could + block forever, wasting CPU. Now it returns immediately (MPB); + * Improved: FTP commands are now sent in upper case to + help buggy servers (Anders Eurenius); + * Improved: known headers now sent in canonic + capitalization to help buggy servers (Joseph Stewart); + * Improved: Clarified tcp:receive() in the manual (MPB); + * Improved: Decent makefiles (LHF). + * Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). diff --git a/Build/source/texk/web2c/luatexdir/luasocket/README b/Build/source/texk/web2c/luatexdir/luasocket/README index e9dc323bfc6..cd8ee59d14f 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/README +++ b/Build/source/texk/web2c/luatexdir/luasocket/README @@ -1,6 +1,11 @@ -This is the LuaSocket 2.1. It has been tested on --[[WinXP--]], Mac OS X, -and --[[Linux--]]. Please use the Lua mailing list to report any bugs -(or "features") you encounter. +This is the LuaSocket 3.0-rc1. It has been tested on Windows 7, Mac OS X, +and Linux. + +Please use the project page at GitHub + + https://github.com/diegonehab/luasocket + +to file bug reports or propose changes. Have fun, Diego Nehab. diff --git a/Build/source/texk/web2c/luatexdir/luasocket/config b/Build/source/texk/web2c/luatexdir/luasocket/config deleted file mode 100644 index 49958ebcbbe..00000000000 --- a/Build/source/texk/web2c/luatexdir/luasocket/config +++ /dev/null @@ -1,60 +0,0 @@ -#------ -# LuaSocket makefile configuration -# - -#------ -# Output file names -# -EXT=so -SOCKET_V=2.0.2 -MIME_V=1.0.2 -SOCKET_SO=socket.$(EXT).$(SOCKET_V) -MIME_SO=mime.$(EXT).$(MIME_V) -UNIX_SO=unix.$(EXT) - -#------ -# Lua includes and libraries -# -#LUAINC=-I/usr/local/include/lua50 -#LUAINC=-I/usr/local/include/lua5.1 -#LUAINC=-Ilua-5.1.1/src - -#------ -# Compat-5.1 directory -# -#COMPAT=compat-5.1r5 - -#------ -# Top of your Lua installation -# Relative paths will be inside the src tree -# -#INSTALL_TOP_SHARE=/usr/local/share/lua/5.0 -#INSTALL_TOP_LIB=/usr/local/lib/lua/5.0 -INSTALL_TOP_SHARE=/usr/local/share/lua/5.1 -INSTALL_TOP_LIB=/usr/local/lib/lua/5.1 - -INSTALL_DATA=cp -INSTALL_EXEC=cp - -#------ -# Compiler and linker settings -# for Mac OS X -# -#CC=gcc -#DEF= -DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN -#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common -#LDFLAGS=-bundle -undefined dynamic_lookup -#LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc - -#------ -# Compiler and linker settings -# for Linux -CC=gcc -DEF=-DLUASOCKET_DEBUG -CFLAGS= $(LUAINC) $(DEF) -pedantic -Wall -O2 -fpic -LDFLAGS=-O -shared -fpic -LD=gcc - -#------ -# End of makefile configuration -# diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html index 3f23a4a93cc..091c88f7838 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html @@ -86,7 +86,6 @@ the FTP module:
    • PASSWORD: default anonymous password. -
    • PORT: default port used for the control connection;
    • TIMEOUT: sets the timeout for all I/O operations;
    • USER: default anonymous user;
    diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html index cd41c0ddb9e..3b7a8b1a26a 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html @@ -112,12 +112,15 @@ the HTTP module:

      -
    • PORT: default port used for connections; -
    • PROXY: default proxy used for connections; +
    • PROXY: default proxy used for connections;
    • TIMEOUT: sets the timeout for all I/O operations;
    • USERAGENT: default user agent reported to server.
    +

    +Note: These constants are global. Changing them will also +change the behavior other code that might be using LuaSocket. +

    diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html index d8ee4a492d2..7d81b411d0c 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html @@ -49,7 +49,7 @@ functionality commonly needed by applications that deal with the Internet. The core support has been implemented so that it is both efficient and simple to use. It is available to any Lua application once it has been properly initialized by the interpreter in use. The code has been tested -and runs well on several Windows and Unix platforms.

    +and runs well on several Windows and UNIX platforms.

    Among the support modules, the most commonly used implement the @@ -78,7 +78,7 @@ LuaSocket.

    -Copyright © 1999-2012 Diego Nehab. All rights reserved.
    +Copyright © 1999-2013 Diego Nehab. All rights reserved.
    Author: Diego Nehab

    @@ -87,16 +87,16 @@ Author: Diego Nehab

    Download

    -LuaSocket version 2.1-rc1 is now available for download! +LuaSocket version 3.0-rc1 is now available for download! It is compatible with Lua 5.1 and 5.2, and has been tested on Windows XP, Linux, and Mac OS X. Chances are it works well on most UNIX distributions and Windows flavors.

    -The library can be downloaded in source code from the -LuaSocket -project page at GitHub. Besides the full C and Lua source code +The current version of the library can be found at +the LuaSocket +project page on GitHub. Besides the full C and Lua source code for the library, the distribution contains several examples, this user's manual and basic test procedures.

    @@ -113,11 +113,12 @@ manual to find out how to properly install the library.

    This marks the first release of LuaSocket that wholeheartedly embraces the open-source development -philosophy. After a long hiatus, Matthew Wild finally -convinced me it was time for a release including IPv6 -and Lua 5.2 support. Special thanks to Sam Roberts, Florian -Zeitz, and Paul Aurich, Liam Devine, and everybody else that -has helped bring this library back to life. +philosophy. After a long hiatus, Matthew Wild finally +convinced me it was time for a release including IPv6 and +Lua 5.2 support. It was more work than we anticipated. +Special thanks to Sam Roberts, Florian Zeitz, and Paul +Aurich, Liam Devine, Alexey Melnichuk, and everybody else +that has helped bring this library back to life.

    @@ -125,12 +126,16 @@ has helped bring this library back to life.

    What's New

    -Main changes for LuaSocket 2.1-rc1 are IPv6 support +Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility.

      -
    • Added: Compatible with Lua 5.2 (using LUA_COMPAT_MODULE); +
    • Added: Compatible with Lua 5.2 +
        +
      • Note that unless you define LUA_COMPAT_MODULE, +package tables will not be exported as globals! +
    • Added: IPv6 support;
      • Socket.connect and socket.bind support IPv6 addresses; @@ -138,7 +143,8 @@ and Lua 5.2 compatibility. IPv6 addresses, and return the socket family as a third value;
      • URL module updated to support IPv6 host names;
      • New socket.tcp6 and socket.udp6 functions; -
      • New socket.dns.getaddrinfo function; +
      • New socket.dns.getaddrinfo and + socket.dns.getnameinfo functions;
    • Added: getoption method;
    • Fixed: url.unescape was returning additional values; @@ -149,6 +155,29 @@ IPv6 addresses, and return the socket family as a third value;
    • Improved: Hidden all internal library symbols;
    • Improved: Better error messages;
    • Improved: Better documentation of socket options. +
    • Fixed: manual sample of HTTP authentication now uses correct + "authorization" header (Alexandre Ittner); +
    • Fixed: failure on bind() was destroying the socket (Sam Roberts); +
    • Fixed: receive() returns immediatelly if prefix can satisfy + bytes requested (M Joonas Pihlaja); +
    • Fixed: multicast didn't work on Windows, or anywhere + else for that matter (Herbert Leuwer, Adrian Sietsma); +
    • Fixed: select() now reports an error when called with more + sockets than FD_SETSIZE (Lorenzo Leonini); +
    • Fixed: manual links to home.html changed to index.html +(Robert Hahn); +
    • Fixed: mime.unb64() would return an empty string on results that started + with a null character (Robert Raschke); +
    • Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); +
    • Fixed: calling sleep() with negative numbers could + block forever, wasting CPU. Now it returns immediately (MPB); +
    • Improved: FTP commands are now sent in upper case to + help buggy servers (Anders Eurenius); +
    • Improved: known headers now sent in canonic + capitalization to help buggy servers (Joseph Stewart); +
    • Improved: Clarified tcp:receive() in the manual (MPB); +
    • Improved: Decent makefiles (LHF). +
    • Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei).
    @@ -176,7 +205,7 @@ still available for those that have compatibility issues.

    Last modified by Diego Nehab on
    -Mon Apr 16 21:58:56 HKT 2012 +Tue Jun 11 18:50:23 HKT 2013

    diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html index 37c309b5d24..28a9fbb5f22 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html @@ -39,12 +39,6 @@ Installation">

    Installation

    -

    LuaSocket 2.1-rc still uses Lua 5.1's package -system. Users that have already made the switch to -Lua 5.2 should leave the default -LUA_COMPAT_MODULE defined when compiling their Lua -distribution for compatibility with LuaSocket.

    -

    Here we describe the standard distribution. If the standard doesn't meet your needs, we refer you to the Lua discussion list, where any question about the package scheme @@ -92,17 +86,17 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the require function to gain access to whatever module you need:

    -Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
    +Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
     > socket = require("socket")
     > print(socket._VERSION)
    ---> LuaSocket 2.1-rc1
    +--> LuaSocket 3.0-rc1
     

    Each module loads their dependencies automatically, so you only need to load the modules you directly depend upon:

    -Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
    +Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
     > http = require("socket.http")
     > print(http.request("http://www.impa.br/~diego/software/luasocket"))
     --> homepage gets dumped to terminal
    @@ -123,7 +117,7 @@ Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
     

    Last modified by Diego Nehab on
    -Mon Apr 16 21:01:42 HKT 2012 +Tue Jun 11 19:06:14 HKT 2013

    diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html index 7e2f49a8c4c..54e66fb6bb0 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html @@ -224,8 +224,8 @@ local ltn12 = require("ltn12") -- copy a file ltn12.pump.all( - ltn12.source.file(io.open("original.png")), - ltn12.sink.file(io.open("copy.png")) + ltn12.source.file(io.open("original.png", "rb")), + ltn12.sink.file(io.open("copy.png", "wb")) )
    @@ -379,8 +379,8 @@ local ltn12 = require("ltn12") -- copy a file ltn12.pump.all( - ltn12.source.file(io.open("original.png")), - ltn12.sink.file(io.open("copy.png")) + ltn12.source.file(io.open("original.png", "rb")), + ltn12.sink.file(io.open("copy.png", "wb")) ) diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.ppt b/Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.ppt new file mode 100644 index 00000000000..e2b7ab4b304 Binary files /dev/null and b/Build/source/texk/web2c/luatexdir/luasocket/doc/lua05.ppt differ diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html index ae136fd85d1..8cb3507aa7b 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html @@ -72,34 +72,6 @@ local mime = require("mime")

    High-level filters

    - - -

    -mime.normalize([marker]) -

    - -

    -Converts most common end-of-line markers to a specific given marker. -

    - -

    -Marker is the new marker. It defaults to CRLF, the canonic -end-of-line marker defined by the MIME standard. -

    - -

    -The function returns a filter that performs the conversion. -

    - -

    -Note: There is no perfect solution to this problem. Different end-of-line -markers are an evil that will probably plague developers forever. -This function, however, will work perfectly for text created with any of -the most common end-of-line markers, i.e. the Mac OS (CR), the Unix (LF), -or the DOS (CRLF) conventions. Even if the data has mixed end-of-line -markers, the function will still work well, although it doesn't -guarantee that the number of empty lines will be correct. -

    @@ -159,6 +131,35 @@ base64 = ltn12.filter.chain( ) + + +

    +mime.normalize([marker]) +

    + +

    +Converts most common end-of-line markers to a specific given marker. +

    + +

    +Marker is the new marker. It defaults to CRLF, the canonic +end-of-line marker defined by the MIME standard. +

    + +

    +The function returns a filter that performs the conversion. +

    + +

    +Note: There is no perfect solution to this problem. Different end-of-line +markers are an evil that will probably plague developers forever. +This function, however, will work perfectly for text created with any of +the most common end-of-line markers, i.e. the Mac OS (CR), the Unix (LF), +or the DOS (CRLF) conventions. Even if the data has mixed end-of-line +markers, the function will still work well, although it doesn't +guarantee that the number of empty lines will be correct. +

    +

    @@ -466,7 +467,7 @@ marker.

    Last modified by Diego Nehab on
    -Thu Apr 20 00:25:44 EDT 2006 +Fri Mar 4 15:19:17 BRT 2016

    diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css index b1dd25d70bb..04e38cfebeb 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css @@ -2,6 +2,7 @@ body { margin-left: 1em; margin-right: 1em; font-family: "Verdana", sans-serif; + background: #ffffff; } tt { diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html index e9bb5eb6fcc..287dc19d900 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html @@ -147,6 +147,7 @@ Support, Manual"> connect, connect4, connect6, +_DATAGRAMSIZE, _DEBUG, dns, gettime, @@ -158,11 +159,14 @@ Support, Manual"> skip, sleep, _SETSIZE, +_SOCKETINVALID, source, tcp, +tcp4, tcp6, try, udp, +udp4, udp6, _VERSION. @@ -183,6 +187,7 @@ Support, Manual"> getpeername, getsockname, getstats, +gettimeout, listen, receive, send, @@ -203,6 +208,7 @@ Support, Manual"> getoption, getpeername, getsockname, +gettimeout, receive, receivefrom, send, diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html index bbbff8047b9..600ec37529f 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html +++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html @@ -114,6 +114,124 @@ the SMTP module:
  • ZONE: default time zone. + + +

    +smtp.message(mesgt) +

    + +

    +Returns a simple +LTN12 source that sends an SMTP message body, possibly multipart (arbitrarily deep). +

    + +

    +The only parameter of the function is a table describing the message. +Mesgt has the following form (notice the recursive structure): +

    + +
    + + +
    +mesgt = {
    +  headers = header-table,
    +  body = LTN12 source or string or +multipart-mesgt
    +}

    +multipart-mesgt = {
    +  [preamble = string,]
    +  [1] = mesgt,
    +  [2] = mesgt,
    +  ...
    +  [n] = mesgt,
    +  [epilogue = string,]
    +}
    +
    +
    + +

    +For a simple message, all that is needed is a set of headers +and the body. The message body can be given as a string +or as a simple +LTN12 +source. For multipart messages, the body is a table that +recursively defines each part as an independent message, plus an optional +preamble and epilogue. +

    + +

    +The function returns a simple +LTN12 +source that produces the +message contents as defined by mesgt, chunk by chunk. +Hopefully, the following +example will make things clear. When in doubt, refer to the appropriate RFC +as listed in the introduction.

    + +
    +-- load the smtp support and its friends
    +local smtp = require("socket.smtp")
    +local mime = require("mime")
    +local ltn12 = require("ltn12")
    +
    +-- creates a source to send a message with two parts. The first part is 
    +-- plain text, the second part is a PNG image, encoded as base64.
    +source = smtp.message{
    +  headers = {
    +     -- Remember that headers are *ignored* by smtp.send. 
    +     from = "Sicrano de Oliveira <sicrano@example.com>",
    +     to = "Fulano da Silva <fulano@example.com>",
    +     subject = "Here is a message with attachments"
    +  },
    +  body = {
    +    preamble = "If your client doesn't understand attachments, \r\n" ..
    +               "it will still display the preamble and the epilogue.\r\n" ..
    +               "Preamble will probably appear even in a MIME enabled client.",
    +    -- first part: no headers means plain text, us-ascii.
    +    -- The mime.eol low-level filter normalizes end-of-line markers.
    +    [1] = { 
    +      body = mime.eol(0, [[
    +        Lines in a message body should always end with CRLF. 
    +        The smtp module will *NOT* perform translation. However, the 
    +        send function *DOES* perform SMTP stuffing, whereas the message
    +        function does *NOT*.
    +      ]])
    +    },
    +    -- second part: headers describe content to be a png image, 
    +    -- sent under the base64 transfer content encoding.
    +    -- notice that nothing happens until the message is actually sent. 
    +    -- small chunks are loaded into memory right before transmission and 
    +    -- translation happens on the fly.
    +    [2] = { 
    +      headers = {
    +        ["content-type"] = 'image/png; name="image.png"',
    +        ["content-disposition"] = 'attachment; filename="image.png"',
    +        ["content-description"] = 'a beautiful image',
    +        ["content-transfer-encoding"] = "BASE64"
    +      },
    +      body = ltn12.source.chain(
    +        ltn12.source.file(io.open("image.png", "rb")),
    +        ltn12.filter.chain(
    +          mime.encode("base64"),
    +          mime.wrap()
    +        )
    +      )
    +    },
    +    epilogue = "This might also show up, but after the attachments"
    +  }
    +}
    +
    +-- finally send it
    +r, e = smtp.send{
    +    from = "<sicrano@example.com>",
    +    rcpt = "<fulano@example.com>",
    +    source = source,
    +}
    +
    + +

    @@ -275,123 +393,6 @@ r, e = smtp.send{ } - - -

    -smtp.message(mesgt) -

    - -

    -Returns a simple -LTN12 source that sends an SMTP message body, possibly multipart (arbitrarily deep). -

    - -

    -The only parameter of the function is a table describing the message. -Mesgt has the following form (notice the recursive structure): -

    - -
    - - -
    -mesgt = {
    -  headers = header-table,
    -  body = LTN12 source or string or -multipart-mesgt
    -}

    -multipart-mesgt = {
    -  [preamble = string,]
    -  [1] = mesgt,
    -  [2] = mesgt,
    -  ...
    -  [n] = mesgt,
    -  [epilogue = string,]
    -}
    -
    -
    - -

    -For a simple message, all that is needed is a set of headers -and the body. The message body can be given as a string -or as a simple -LTN12 -source. For multipart messages, the body is a table that -recursively defines each part as an independent message, plus an optional -preamble and epilogue. -

    - -

    -The function returns a simple -LTN12 -source that produces the -message contents as defined by mesgt, chunk by chunk. -Hopefully, the following -example will make things clear. When in doubt, refer to the appropriate RFC -as listed in the introduction.

    - -
    --- load the smtp support and its friends
    -local smtp = require("socket.smtp")
    -local mime = require("mime")
    -local ltn12 = require("ltn12")
    -
    --- creates a source to send a message with two parts. The first part is 
    --- plain text, the second part is a PNG image, encoded as base64.
    -source = smtp.message{
    -  headers = {
    -     -- Remember that headers are *ignored* by smtp.send. 
    -     from = "Sicrano de Oliveira <sicrano@example.com>",
    -     to = "Fulano da Silva <fulano@example.com>",
    -     subject = "Here is a message with attachments"
    -  },
    -  body = {
    -    preamble = "If your client doesn't understand attachments, \r\n" ..
    -               "it will still display the preamble and the epilogue.\r\n" ..
    -               "Preamble will probably appear even in a MIME enabled client.",
    -    -- first part: no headers means plain text, us-ascii.
    -    -- The mime.eol low-level filter normalizes end-of-line markers.
    -    [1] = { 
    -      body = mime.eol(0, [[
    -        Lines in a message body should always end with CRLF. 
    -        The smtp module will *NOT* perform translation. However, the 
    -        send function *DOES* perform SMTP stuffing, whereas the message
    -        function does *NOT*.
    -      ]])
    -    },
    -    -- second part: headers describe content to be a png image, 
    -    -- sent under the base64 transfer content encoding.
    -    -- notice that nothing happens until the message is actually sent. 
    -    -- small chunks are loaded into memory right before transmission and 
    -    -- translation happens on the fly.
    -    [2] = { 
    -      headers = {
    -        ["content-type"] = 'image/png; name="image.png"',
    -        ["content-disposition"] = 'attachment; filename="image.png"',
    -        ["content-description"] = 'a beautiful image',
    -        ["content-transfer-encoding"] = "BASE64"
    -      },
    -      body = ltn12.source.chain(
    -        ltn12.source.file(io.open("image.png", "rb")),
    -        ltn12.filter.chain(
    -          mime.encode("base64"),
    -          mime.wrap()
    -        )
    -      )
    -    },
    -    epilogue = "This might also show up, but after the attachments"
    -  }
    -}
    -
    --- finally send it
    -r, e = smtp.send{
    -    from = "<sicrano@example.com>",
    -    rcpt = "<fulano@example.com>",
    -    source = source,
    -}
    -
    -