From 0c14fd18747b9f6fbbecb75ba8beef6d449c460a Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Sun, 6 Jan 2019 18:57:01 +0000 Subject: luatex 1.09.2; r-mpost alias of mpost -restricted git-svn-id: svn://tug.org/texlive/trunk@49614 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/ChangeLog | 4 - Build/source/texk/web2c/luatexdir/NEWS | 12 + Build/source/texk/web2c/luatexdir/am/libluatex.am | 43 +- Build/source/texk/web2c/luatexdir/am/luaffi.am | 15 +- Build/source/texk/web2c/luatexdir/am/luamisc.am | 13 +- Build/source/texk/web2c/luatexdir/am/luapplib.am | 25 +- Build/source/texk/web2c/luatexdir/am/luasocket.am | 13 +- Build/source/texk/web2c/luatexdir/am/luatex.am | 53 +- Build/source/texk/web2c/luatexdir/font/dofont.c | 7 +- Build/source/texk/web2c/luatexdir/font/luafont.c | 37 +- .../source/texk/web2c/luatexdir/font/luatexfont.h | 4 +- Build/source/texk/web2c/luatexdir/font/sfnt.c | 5 +- Build/source/texk/web2c/luatexdir/font/tounicode.c | 38 +- Build/source/texk/web2c/luatexdir/font/tt_table.c | 14 +- Build/source/texk/web2c/luatexdir/font/writecff.c | 6 +- Build/source/texk/web2c/luatexdir/font/writefont.c | 94 +- Build/source/texk/web2c/luatexdir/font/writet1.c | 118 +- Build/source/texk/web2c/luatexdir/image/epdf.h | 3 +- Build/source/texk/web2c/luatexdir/image/image.h | 4 + .../source/texk/web2c/luatexdir/image/pdftoepdf.c | 150 +- Build/source/texk/web2c/luatexdir/image/writeimg.c | 131 +- .../source/texk/web2c/luatexdir/lua/lcallbacklib.c | 1 + Build/source/texk/web2c/luatexdir/lua/lfontlib.c | 10 + Build/source/texk/web2c/luatexdir/lua/limglib.c | 69 +- Build/source/texk/web2c/luatexdir/lua/liolibext.c | 41 +- Build/source/texk/web2c/luatexdir/lua/llanglib.c | 24 +- Build/source/texk/web2c/luatexdir/lua/lnodelib.c | 172 +- Build/source/texk/web2c/luatexdir/lua/lpdfelib.c | 137 +- Build/source/texk/web2c/luatexdir/lua/lpdflib.c | 15 + Build/source/texk/web2c/luatexdir/lua/luatex-api.h | 43 + .../source/texk/web2c/luatexdir/lua/luatex-core.c | 984 +- .../texk/web2c/luatexdir/lua/luatex-core.lua | 931 +- .../texk/web2c/luatexdir/luapplib/Makefile.orig | 7 +- .../texk/web2c/luatexdir/luapplib/html/.buildinfo | 4 + .../luatexdir/luapplib/html/_sources/ppapi.rst.txt | 937 ++ .../luapplib/html/_sources/ppcode.rst.txt | 64 + .../luatexdir/luapplib/html/_sources/pplib.rst.txt | 13 + .../luapplib/html/_static/ajax-loader.gif | Bin 0 -> 673 bytes .../luapplib/html/_static/background_b01.png | Bin 0 -> 78 bytes .../luatexdir/luapplib/html/_static/basic.css | 665 ++ .../luatexdir/luapplib/html/_static/bizstyle.css | 490 + .../luatexdir/luapplib/html/_static/bizstyle.js | 41 + .../luapplib/html/_static/comment-bright.png | Bin 0 -> 756 bytes .../luapplib/html/_static/comment-close.png | Bin 0 -> 829 bytes .../luatexdir/luapplib/html/_static/comment.png | Bin 0 -> 641 bytes .../luapplib/html/_static/css3-mediaqueries.js | 1 + .../luapplib/html/_static/css3-mediaqueries_src.js | 1104 ++ .../luatexdir/luapplib/html/_static/doctools.js | 313 + .../luapplib/html/_static/documentation_options.js | 9 + .../luapplib/html/_static/down-pressed.png | Bin 0 -> 222 bytes .../web2c/luatexdir/luapplib/html/_static/down.png | Bin 0 -> 202 bytes .../web2c/luatexdir/luapplib/html/_static/file.png | Bin 0 -> 286 bytes .../luapplib/html/_static/jquery-3.2.1.js | 10253 +++++++++++++++++++ .../luatexdir/luapplib/html/_static/jquery.js | 4 + .../luatexdir/luapplib/html/_static/minus.png | Bin 0 -> 90 bytes .../web2c/luatexdir/luapplib/html/_static/plus.png | Bin 0 -> 90 bytes .../luatexdir/luapplib/html/_static/pygments.css | 69 + .../luatexdir/luapplib/html/_static/searchtools.js | 761 ++ .../luapplib/html/_static/underscore-1.3.1.js | 999 ++ .../luatexdir/luapplib/html/_static/underscore.js | 31 + .../luatexdir/luapplib/html/_static/up-pressed.png | Bin 0 -> 214 bytes .../web2c/luatexdir/luapplib/html/_static/up.png | Bin 0 -> 203 bytes .../luatexdir/luapplib/html/_static/websupport.js | 808 ++ .../web2c/luatexdir/luapplib/html/genindex.html | 83 + .../texk/web2c/luatexdir/luapplib/html/objects.inv | 6 + .../texk/web2c/luatexdir/luapplib/html/ppapi.html | 1028 ++ .../texk/web2c/luatexdir/luapplib/html/ppcode.html | 923 ++ .../texk/web2c/luatexdir/luapplib/html/pplib.html | 140 + .../texk/web2c/luatexdir/luapplib/html/search.html | 94 + .../web2c/luatexdir/luapplib/html/searchindex.js | 1 + Build/source/texk/web2c/luatexdir/luapplib/ppapi.h | 48 +- .../source/texk/web2c/luatexdir/luapplib/ppconf.h | 8 + .../source/texk/web2c/luatexdir/luapplib/ppcrypt.c | 135 +- .../source/texk/web2c/luatexdir/luapplib/ppcrypt.h | 8 +- .../source/texk/web2c/luatexdir/luapplib/ppheap.c | 14 +- Build/source/texk/web2c/luatexdir/luapplib/pplib.h | 1 + .../source/texk/web2c/luatexdir/luapplib/ppload.c | 116 +- .../texk/web2c/luatexdir/luapplib/ppstream.c | 339 +- .../texk/web2c/luatexdir/luapplib/ppstream.h | 1 + .../source/texk/web2c/luatexdir/luapplib/pptest3.c | 98 + .../source/texk/web2c/luatexdir/luapplib/ppxref.c | 34 + .../texk/web2c/luatexdir/luapplib/util/utilarm.h | 10 + .../texk/web2c/luatexdir/luapplib/util/utilfpred.c | 104 +- .../texk/web2c/luatexdir/luapplib/util/utiliof.c | 4 +- .../texk/web2c/luatexdir/luapplib/util/utilsha.c | 53 +- .../texk/web2c/luatexdir/luapplib/zlib/zconf.h | 428 - .../texk/web2c/luatexdir/luapplib/zlib/zlib.h | 1613 --- Build/source/texk/web2c/luatexdir/luatex.c | 4 +- .../texk/web2c/luatexdir/luatex_svnversion.h | 2 +- .../texk/web2c/luatexdir/luatexcallbackids.h | 1 + Build/source/texk/web2c/luatexdir/luazlib/lzlib.c | 9 +- Build/source/texk/web2c/luatexdir/pdf/pdfgen.c | 7 +- Build/source/texk/web2c/luatexdir/pdf/pdfimage.c | 38 +- Build/source/texk/web2c/luatexdir/pdf/pdflistout.c | 7 +- Build/source/texk/web2c/luatexdir/pdf/pdftypes.h | 2 +- Build/source/texk/web2c/luatexdir/tex/mainbody.c | 1 + .../source/texk/web2c/luatexdir/tex/maincontrol.c | 11 +- Build/source/texk/web2c/luatexdir/tex/mlist.c | 79 +- Build/source/texk/web2c/luatexdir/tex/packaging.c | 3 + Build/source/texk/web2c/luatexdir/tex/printing.c | 3 +- Build/source/texk/web2c/luatexdir/tex/texnodes.c | 78 +- Build/source/texk/web2c/luatexdir/tex/texnodes.h | 37 +- Build/source/texk/web2c/luatexdir/utils/utils.c | 5 +- Build/source/texk/web2c/mplibdir/ChangeLog | 9 + Build/source/texk/web2c/mplibdir/mp.w | 29 +- Build/source/texk/web2c/mplibdir/mpmathbinary.w | 2 +- Build/source/texk/web2c/mplibdir/mpmathdecimal.w | 2 +- Build/source/texk/web2c/mplibdir/mpost.w | 4 +- Build/source/texk/web2c/pmpostdir/pmpost.ch | 4 +- 109 files changed, 21526 insertions(+), 3889 deletions(-) create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/.buildinfo create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppapi.rst.txt create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppcode.rst.txt create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_sources/pplib.rst.txt create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/ajax-loader.gif create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/background_b01.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/basic.css create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.css create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-bright.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-close.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries_src.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/doctools.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/documentation_options.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/down-pressed.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/down.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/file.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/jquery-3.2.1.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/jquery.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/minus.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/plus.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/pygments.css create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/searchtools.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/underscore-1.3.1.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/underscore.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/up-pressed.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/up.png create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/websupport.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/genindex.html create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/objects.inv create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/ppapi.html create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/ppcode.html create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/pplib.html create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/search.html create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/searchindex.js create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/pptest3.c create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilarm.h delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/zlib/zconf.h delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/zlib/zlib.h (limited to 'Build/source/texk') diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog index 7219983d41f..62d4ab0491f 100644 --- a/Build/source/texk/web2c/luatexdir/ChangeLog +++ b/Build/source/texk/web2c/luatexdir/ChangeLog @@ -1,7 +1,3 @@ -2018-09-18 Nick Roessler - * fonts/writet1.w (t1_check_unusual_charstring): protect against - buffer overflow. - 2018-08-27 Luigi Scarso * dropped dependency from gmp and mpfr diff --git a/Build/source/texk/web2c/luatexdir/NEWS b/Build/source/texk/web2c/luatexdir/NEWS index 5c044e77e18..dfa8fa8c68d 100644 --- a/Build/source/texk/web2c/luatexdir/NEWS +++ b/Build/source/texk/web2c/luatexdir/NEWS @@ -1,3 +1,15 @@ +============================================================== +LuaTeX 1.09 2018-10-23 +============================================================== + +(1) This is a release that fixed some bugs, and the latest +with lua 5.2. + +(2) luaffi is still incomplete, so very likely there will be +a new release 1.09.1 before the next year. + + + ============================================================== LuaTeX 1.08 2018-08-28 ============================================================== diff --git a/Build/source/texk/web2c/luatexdir/am/libluatex.am b/Build/source/texk/web2c/luatexdir/am/libluatex.am index e3678b64b9e..5f7ae526c6c 100644 --- a/Build/source/texk/web2c/luatexdir/am/libluatex.am +++ b/Build/source/texk/web2c/luatexdir/am/libluatex.am @@ -5,24 +5,29 @@ ## liblua52 ## -LUA_INCLUDES = $(LUA52_INCLUDES) $(LUA52_DEFINES) -LUA_LIBS = $(LUA52_LIBS) -LUA_DEPEND = $(LUA52_DEPEND) +#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) +#LUA_LUA53_INCLUDES = $(LUA53_INCLUDES) $(LUA53_DEFINES) +#LUA_LUA53_LIBS = $(LUA53_LIBS) +#LUA_LUA53_DEPEND = $(LUA53_DEPEND) +LUA_INCLUDES = $(LUA53_INCLUDES) $(LUA53_DEFINES) +LUA_LIBS = $(LUA53_LIBS) +LUA_DEPEND = $(LUA53_DEPEND) + ## libluatex ## -EXTRA_LIBRARIES += libluatex.a liblua53tex.a libluajittex.a +#EXTRA_LIBRARIES += libluatex.a liblua53tex.a libluajittex.a +EXTRA_LIBRARIES += libluatex.a libluajittex.a libluatex_a_DEPENDENCIES = libff.a libluamisc.a -liblua53tex_a_DEPENDENCIES = libff.a liblua53misc.a +#liblua53tex_a_DEPENDENCIES = libff.a liblua53misc.a libluajittex_a_DEPENDENCIES = libff.a libluajitmisc.a libluatex_a_preflags = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) @@ -35,12 +40,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) +#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) +#liblua53tex_a_CXXFLAGS = $(WARNING_CXXFLAGS) libluajittex_a_CXXFLAGS = $(WARNING_CXXFLAGS) dist_libluatex_a_SOURCES = \ @@ -50,13 +55,13 @@ dist_libluatex_a_SOURCES = \ nodist_libluatex_a_SOURCES = \ $(dist_libluatex_sources) \ $(nodist_libluatex_sources) -dist_liblua53tex_a_SOURCES = \ - luatexdir/lua/lstrlibext.c \ - luatexdir/lua/helpers.c \ - luatexdir/lua/texluac.c -nodist_liblua53tex_a_SOURCES = \ - $(dist_libluatex_sources) \ - $(nodist_libluatex_sources) +# dist_liblua53tex_a_SOURCES = \ +# luatexdir/lua/lstrlibext.c \ +# luatexdir/lua/helpers.c \ +# luatexdir/lua/texluac.c +# nodist_liblua53tex_a_SOURCES = \ +# $(dist_libluatex_sources) \ +# $(nodist_libluatex_sources) dist_libluajittex_a_SOURCES = \ luatexdir/lua/lauxlib_bridge.h \ luatexdir/lua/lstrlibext.c \ @@ -67,7 +72,7 @@ nodist_libluajittex_a_SOURCES = \ ## mplib "stub" backends are in mplibstuff.c $(libluatex_a_OBJECTS): libff.a libmplibcore.a libluamisc.a -$(liblua53tex_a_OBJECTS): libff.a libmplibcore.a liblua53misc.a +#$(liblua53tex_a_OBJECTS): libff.a libmplibcore.a liblua53misc.a $(libluajittex_a_OBJECTS): libff.a libmplibcore.a libluajitmisc.a @@ -633,7 +638,7 @@ dist_libluatex_sources += \ synctexdir/synctex.c \ synctexdir/synctex.h -dist_liblua53tex_sources = $(dist_libluatex_sources) +#dist_liblua53tex_sources = $(dist_libluatex_sources) EXTRA_DIST += \ $(dist_libluatex_sources) \ diff --git a/Build/source/texk/web2c/luatexdir/am/luaffi.am b/Build/source/texk/web2c/luatexdir/am/luaffi.am index c927b3df7af..260b7da833f 100644 --- a/Build/source/texk/web2c/luatexdir/am/luaffi.am +++ b/Build/source/texk/web2c/luatexdir/am/luaffi.am @@ -12,25 +12,26 @@ ## -EXTRA_LIBRARIES += libluaffi.a liblua53ffi.a +#EXTRA_LIBRARIES += libluaffi.a liblua53ffi.a +EXTRA_LIBRARIES += libluaffi.a #libluaffi_a_DEPENDENCIES = $(ZLIB_DEPEND) $(libluaffi_a_OBJECTS): $(LUA_DEPEND) -$(liblua53ffi_a_OBJECTS): $(LUA_LUA53_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) +#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) +#liblua53ffi_a_CFLAGS = # $(WARNING_CFLAGS) nodist_libluaffi_a_SOURCES = $(libluaffi_sources) -nodist_liblua53ffi_a_SOURCES = $(libluaffi_sources) +#nodist_liblua53ffi_a_SOURCES = $(libluaffi_sources) libluaffi_sources = \ @@ -44,7 +45,7 @@ libluaffi_sources = \ luatexdir/luaffi/ffi.h \ luatexdir/luaffi/parser.c -liblua53ffi_sources = $(libluaffi_sources) +#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 014b6eb3f0c..9b9915e11b2 100644 --- a/Build/source/texk/web2c/luatexdir/am/luamisc.am +++ b/Build/source/texk/web2c/luatexdir/am/luamisc.am @@ -6,27 +6,28 @@ ## libluamisc (luafilesystem, luamd5, luapeg, luazip, luazlib, ## and slnunicode) -EXTRA_LIBRARIES += libluamisc.a liblua53misc.a libluajitmisc.a +#EXTRA_LIBRARIES += libluamisc.a liblua53misc.a libluajitmisc.a +EXTRA_LIBRARIES += libluamisc.a libluajitmisc.a libluamisc_a_DEPENDENCIES = $(ZZIPLIB_DEPEND) libluasocket.a libluaffi.a libluapplib.a -liblua53misc_a_DEPENDENCIES = $(ZZIPLIB_DEPEND) liblua53socket.a liblua53ffi.a liblua53pplib.a +#liblua53misc_a_DEPENDENCIES = $(ZZIPLIB_DEPEND) liblua53socket.a liblua53ffi.a liblua53pplib.a libluajitmisc_a_DEPENDENCIES = $(ZZIPLIB_DEPEND) libluajitsocket.a libluajitpplib.a $(libluamisc_a_OBJECTS): $(libluamisc_a_DEPENDENCIES) -$(liblua53misc_a_OBJECTS): $(liblua53misc_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) +#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) +#liblua53misc_a_CFLAGS = # $(WARNING_CFLAGS) libluajitmisc_a_CFLAGS = # $(WARNING_CFLAGS) nodist_libluamisc_a_SOURCES = $(libluamisc_sources) -nodist_liblua53misc_a_SOURCES = $(libluamisc_sources) +#nodist_liblua53misc_a_SOURCES = $(libluamisc_sources) nodist_libluajitmisc_a_SOURCES = $(libluamisc_sources) libluamisc_sources = \ diff --git a/Build/source/texk/web2c/luatexdir/am/luapplib.am b/Build/source/texk/web2c/luatexdir/am/luapplib.am index 51306232557..06293da4ddd 100644 --- a/Build/source/texk/web2c/luatexdir/am/luapplib.am +++ b/Build/source/texk/web2c/luatexdir/am/luapplib.am @@ -5,23 +5,23 @@ ## luapplib ## -EXTRA_LIBRARIES += libluapplib.a liblua53pplib.a libluajitpplib.a +#EXTRA_LIBRARIES += libluapplib.a liblua53pplib.a libluajitpplib.a +EXTRA_LIBRARIES += libluapplib.a libluajitpplib.a libluapplib_a_DEPENDENCIES = $(ZLIB_DEPEND) -liblua53pplib_a_DEPENDENCIES = $(ZLIB_DEPEND) +#liblua53pplib_a_DEPENDENCIES = $(ZLIB_DEPEND) libluajitpplib_a_DEPENDENCIES = $(ZLIB_DEPEND) $(libluapplib_a_OBJECTS): $(LUA_DEPEND) -$(liblua53pplib_a_OBJECTS): $(LUA_DEPEND) +#$(liblua53pplib_a_OBJECTS): $(LUA_DEPEND) $(libluajitpplib_a_OBJECTS): $(LUAJIT_DEPEND) -## replace -I../../libs/zlib/include $(ZLIB_INCLUDES) libluapplib_a_CPPFLAGS = \ -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/util $(ZLIB_INCLUDES) $(LUA_INCLUDES) -liblua53pplib_a_CPPFLAGS = \ - -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/util $(ZLIB_INCLUDES) $(LUA_LUA53_INCLUDES) +#liblua53pplib_a_CPPFLAGS = \ +# -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/util $(ZLIB_INCLUDES) $(LUA_LUA53_INCLUDES) libluajitpplib_a_CPPFLAGS = \ -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/util $(ZLIB_INCLUDES) $(LUAJIT_INCLUDES) @@ -30,7 +30,7 @@ libluapplib_a_CFLAGS = # $(WARNING_CFLAGS) libluajitpplib_a_CFLAGS = # $(WARNING_CFLAGS) nodist_libluapplib_a_SOURCES = $(libluapplib_sources) -nodist_liblua53pplib_a_SOURCES = $(libluapplib_sources) +#nodist_liblua53pplib_a_SOURCES = $(libluapplib_sources) nodist_libluajitpplib_a_SOURCES = $(libluapplib_sources) libluapplib_sources = \ @@ -50,8 +50,12 @@ libluapplib_sources = \ luatexdir/luapplib/ppload.h \ luatexdir/luapplib/ppstream.c \ luatexdir/luapplib/ppstream.h \ + luatexdir/luapplib/pptest1.c \ + luatexdir/luapplib/pptest2.c \ + luatexdir/luapplib/pptest3.c \ luatexdir/luapplib/ppxref.c \ luatexdir/luapplib/ppxref.h \ + luatexdir/luapplib/util/utilarm.h \ luatexdir/luapplib/util/utilbasexx.c \ luatexdir/luapplib/util/utilbasexx.h \ luatexdir/luapplib/util/utilcrypt.c \ @@ -76,11 +80,8 @@ libluapplib_sources = \ luatexdir/luapplib/util/utilnumber.h \ luatexdir/luapplib/util/utilplat.h \ luatexdir/luapplib/util/utilsha.c \ - luatexdir/luapplib/util/utilsha.h \ - luatexdir/luapplib/zlib/zconf.h \ - luatexdir/luapplib/zlib/zlib.h + luatexdir/luapplib/util/utilsha.h - -liblua53pplib_sources = $(libluapplib_sources) +#liblua53pplib_sources = $(libluapplib_sources) libluajitpplib_sources = $(libluapplib_sources) diff --git a/Build/source/texk/web2c/luatexdir/am/luasocket.am b/Build/source/texk/web2c/luatexdir/am/luasocket.am index 8f8e1ab44ee..64dd207848a 100644 --- a/Build/source/texk/web2c/luatexdir/am/luasocket.am +++ b/Build/source/texk/web2c/luatexdir/am/luasocket.am @@ -5,21 +5,22 @@ ## luasocket ## -EXTRA_LIBRARIES += libluasocket.a liblua53socket.a libluajitsocket.a +#EXTRA_LIBRARIES += libluasocket.a liblua53socket.a libluajitsocket.a +EXTRA_LIBRARIES += libluasocket.a libluajitsocket.a libluasocket_a_DEPENDENCIES = $(ZLIB_DEPEND) -liblua53socket_a_DEPENDENCIES = $(ZLIB_DEPEND) +#liblua53socket_a_DEPENDENCIES = $(ZLIB_DEPEND) libluajitsocket_a_DEPENDENCIES = $(ZLIB_DEPEND) $(libluasocket_a_OBJECTS): $(LUA_DEPEND) -$(liblua53socket_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) +#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) @@ -28,7 +29,7 @@ libluasocket_a_CFLAGS = # $(WARNING_CFLAGS) libluajitsocket_a_CFLAGS = # $(WARNING_CFLAGS) nodist_libluasocket_a_SOURCES = $(libluasocket_sources) -nodist_liblua53socket_a_SOURCES = $(libluasocket_sources) +#nodist_liblua53socket_a_SOURCES = $(libluasocket_sources) nodist_libluajitsocket_a_SOURCES = $(libluasocket_sources) libluasocket_sources = \ diff --git a/Build/source/texk/web2c/luatexdir/am/luatex.am b/Build/source/texk/web2c/luatexdir/am/luatex.am index 2fb4d64f68a..9d289ab00c6 100644 --- a/Build/source/texk/web2c/luatexdir/am/luatex.am +++ b/Build/source/texk/web2c/luatexdir/am/luatex.am @@ -17,16 +17,16 @@ 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 -endif !WIN32 -endif LUATEX53 +#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 +#endif !WIN32 +#endif LUATEX53 if LUAJITTEX bin_PROGRAMS += luajittex @@ -39,7 +39,8 @@ bin_links += luajittex$(EXEEXT):texluajit luajittex$(EXEEXT):texluajitc endif !WIN32 endif LUAJITTEX -EXTRA_PROGRAMS += luatex luatex53 luajittex +#EXTRA_PROGRAMS += luatex luatex53 luajittex +EXTRA_PROGRAMS += luatex luajittex # Force Automake to use CXXLD for linking #nodist_EXTRA_luatex_SOURCES = dummy.cxx @@ -52,16 +53,16 @@ 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) +#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) +#luatex53_CXXFLAGS = $(WARNING_CXXFLAGS) luajittex_CXXFLAGS = $(WARNING_CXXFLAGS) luatex_LDFLAGS = -export-dynamic -luatex53_LDFLAGS = -export-dynamic +#luatex53_LDFLAGS = -export-dynamic luajittex_LDFLAGS = -export-dynamic $(LUAJIT_LDEXTRA) #luatex_postldadd = libmplibcore.a $(MPFR_LIBS) $(GMP_LIBS) @@ -71,20 +72,20 @@ luatex_postldadd += $(LDADD) libmputil.a libunilib.a libmd5.a $(lua_socketlibs) luatex_LDADD = libluatex.a libff.a libluamisc.a libluasocket.a libluaffi.a libluapplib.a $(LUA_LIBS) $(luatex_postldadd) -luatex53_LDADD = liblua53tex.a libff.a liblua53misc.a liblua53socket.a liblua53ffi.a liblua53pplib.a $(LUA_LUA53_LIBS) $(luatex_postldadd) +#luatex53_LDADD = liblua53tex.a libff.a liblua53misc.a liblua53socket.a liblua53ffi.a liblua53pplib.a $(LUA_LUA53_LIBS) $(luatex_postldadd) luajittex_LDADD = libluajittex.a libff.a libluajitmisc.a libluajitsocket.a libluajitpplib.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 +#luatex53_DEPENDENCIES = $(luatex_depend) liblua53tex.a luajittex_DEPENDENCIES = $(luatex_depend) libluajittex.a $(luatex_OBJECTS): libluatex.a -$(luatex53_OBJECTS): liblua53tex.a +#$(luatex53_OBJECTS): liblua53tex.a $(luajittex_OBJECTS): libluajittex.a nodist_luatex_SOURCES = $(luatex_sources) -nodist_luatex53_SOURCES = $(luatex_sources) +#nodist_luatex53_SOURCES = $(luatex_sources) nodist_luajittex_SOURCES = $(luatex_sources) @@ -101,9 +102,9 @@ 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_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 @@ -130,8 +131,8 @@ 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) +#luatex53_tests = luatexdir/luatex.test luatexdir/luaimage.test +#luatexdir/luatex53.log luatexdir/luaimage53.log: luatex53$(EXEEXT) luajittex_tests = luatexdir/luajittex.test luatexdir/luajitimage.test @@ -142,9 +143,9 @@ EXTRA_DIST += $(luatex_tests) $(luajittex_tests) if LUATEX TESTS += $(luatex_tests) endif LUATEX -if LUATEX53 -TESTS += $(luatex_tests) -endif LUATEX53 +#if LUATEX53 +#TESTS += $(luatex_tests) +#endif LUATEX53 if LUAJITTEX TESTS += $(luajittex_tests) endif LUAJITTEX diff --git a/Build/source/texk/web2c/luatexdir/font/dofont.c b/Build/source/texk/web2c/luatexdir/font/dofont.c index b23368d834f..107bd8341af 100644 --- a/Build/source/texk/web2c/luatexdir/font/dofont.c +++ b/Build/source/texk/web2c/luatexdir/font/dofont.c @@ -86,8 +86,13 @@ static int do_define_font(int f, const char *cnom, scaled s, int natural_dir) The font name has to fit in the dvi file's single byte storage. There is no need to test area, as we are never using it. + + If we have an error in DVI mode we just abort as the DVI file is unuseable + anyway then. */ - res = 0; + if (get_o_mode() == OMODE_DVI) { + formatted_error("backend","font name too long for DVI: %s",font_name(f)); + } } if (res) { if (font_type(f) != virtual_font_type) { diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.c b/Build/source/texk/web2c/luatexdir/font/luafont.c index e64aaffc15d..7cb03521d4e 100644 --- a/Build/source/texk/web2c/luatexdir/font/luafont.c +++ b/Build/source/texk/web2c/luatexdir/font/luafont.c @@ -381,6 +381,41 @@ static void write_lua_parameters(lua_State * L, int f) lua_rawset(L, -3); } +int font_parameters_to_lua(lua_State * L, int f) +{ + int k; + lua_newtable(L); + for (k = 1; k <= font_params(f); k++) { + switch (k) { + case slant_code: + dump_intfield(L,slant,font_param(f, k)); + break; + case space_code: + dump_intfield(L,space,font_param(f, k)); + break; + case space_stretch_code: + dump_intfield(L,space_stretch,font_param(f, k)); + break; + case space_shrink_code: + dump_intfield(L,space_shrink,font_param(f, k)); + break; + case x_height_code: + dump_intfield(L,x_height,font_param(f, k)); + break; + case quad_code: + dump_intfield(L,quad,font_param(f, k)); + break; + case extra_space_code: + dump_intfield(L,extra_space,font_param(f, k)); + break; + default: + lua_pushinteger(L, font_param(f, k)); + lua_rawseti(L, -2, k); + } + } + return 1; +} + static void write_lua_math_parameters(lua_State * L, int f) { int k; @@ -404,8 +439,6 @@ int font_to_lua(lua_State * L, int f) if (font_cache_id(f) > 0) { /*tex Fetch the table from the registry if it was saved there by |font_from_lua|. */ lua_rawgeti(L, LUA_REGISTRYINDEX, font_cache_id(f)); - /*tex Font dimenensions can be changed from \TEX\ code. */ - write_lua_parameters(L, f); return 1; } lua_newtable(L); diff --git a/Build/source/texk/web2c/luatexdir/font/luatexfont.h b/Build/source/texk/web2c/luatexdir/font/luatexfont.h index 7016b88729c..cd199417313 100644 --- a/Build/source/texk/web2c/luatexdir/font/luatexfont.h +++ b/Build/source/texk/web2c/luatexdir/font/luatexfont.h @@ -152,10 +152,12 @@ void register_fd_entry(fd_entry * fd); boolean t1_subset(char *, char *, unsigned char *); char **load_enc_file(char *); -void writet1(PDF, fd_entry *); +void writet1(PDF, fd_entry *, int wide); void t1_free(void); extern int t1_length1, t1_length2, t1_length3; +extern int t1_wide_mode; + /* writetype2.c */ boolean writetype2(PDF, fd_entry *); diff --git a/Build/source/texk/web2c/luatexdir/font/sfnt.c b/Build/source/texk/web2c/luatexdir/font/sfnt.c index c7f4723c407..a58bda09236 100644 --- a/Build/source/texk/web2c/luatexdir/font/sfnt.c +++ b/Build/source/texk/web2c/luatexdir/font/sfnt.c @@ -248,8 +248,9 @@ ULONG sfnt_locate_table(sfnt * sfont, const char *tag) { ULONG offset; offset = sfnt_find_table_pos(sfont, tag); - if (offset == 0) - normal_error("ttf","sfnt table not found"); + if (offset == 0) { + formatted_error("ttf","%s table not found",tag); + } sfnt_seek_set(sfont, (long) offset); return offset; } diff --git a/Build/source/texk/web2c/luatexdir/font/tounicode.c b/Build/source/texk/web2c/luatexdir/font/tounicode.c index f0449aff957..32210600c21 100644 --- a/Build/source/texk/web2c/luatexdir/font/tounicode.c +++ b/Build/source/texk/web2c/luatexdir/font/tounicode.c @@ -287,6 +287,7 @@ static void set_glyph_unicode(char *s, glyph_unicode_entry * gp) } } +/* static void set_cid_glyph_unicode(long index, glyph_unicode_entry * gp, internal_font_number f) { char *s; @@ -295,13 +296,14 @@ static void set_cid_glyph_unicode(long index, glyph_unicode_entry * gp, internal gp->code = UNI_EXTRA_STRING; gp->unicode_seq = xstrdup(s); } else { - /*tex No fall back as we're providing them ourselves. */ + // No fall back as we're providing them ourselves. } } else { - /*tex Fall back. */ + // Fall back gp->code = index; } } +*/ int write_tounicode(PDF pdf, char **glyph_names, char *name) { @@ -470,9 +472,10 @@ int write_cid_tounicode(PDF pdf, fo_entry * fo, internal_font_number f) static int range_size[65537]; static glyph_unicode_entry gtab[65537]; int objnum; - int i, j, k; + int i, j, k, tu; int bfchar_count, bfrange_count, subrange_count; char *buf; + char *s; buf = xmalloc((unsigned) (strlen(fo->fd->fontname) + 8)); sprintf(buf, "%s-%s", (fo->fd->subset_tag != NULL ? fo->fd->subset_tag : "UCS"), fo->fd->fontname); objnum = pdf_create_obj(pdf, obj_type_others, 0); @@ -514,7 +517,36 @@ int write_cid_tounicode(PDF pdf, fo_entry * fo, internal_font_number f) if (quick_char_exists(k, i) && char_used(k, i)) { j = char_index(k, i); if (gtab[j].code == UNI_UNDEF) { + /* set_cid_glyph_unicode(i, >ab[j], f); + */ + tu = 0; + /*tex + First look in the instance (new). Ff this fails + us (context) it will go away or become an option. + */ + if (font_tounicode(k)) { + tu = 1; /*tex no fallback to index */ + if ((s = get_charinfo_tounicode(char_info(k, (int) i))) != NULL) { + gtab[j].code = UNI_EXTRA_STRING; + gtab[j].unicode_seq = xstrdup(s); + } + } + /*tex + Then look in the parent (was default, so one can + still be sparse). + */ + if (k != f && gtab[j].code == UNI_UNDEF && font_tounicode(f)) { + tu = 1; /*tex no fallback to index */ + if ((s = get_charinfo_tounicode(char_info(f, (int) i))) != NULL) { + gtab[j].code = UNI_EXTRA_STRING; + gtab[j].unicode_seq = xstrdup(s); + } + } + if (! tu) { + /*tex No tonunicode so we map onto index. */ + gtab[j].code = i; + } } } } diff --git a/Build/source/texk/web2c/luatexdir/font/tt_table.c b/Build/source/texk/web2c/luatexdir/font/tt_table.c index dfcd4d650cd..eba82728713 100644 --- a/Build/source/texk/web2c/luatexdir/font/tt_table.c +++ b/Build/source/texk/web2c/luatexdir/font/tt_table.c @@ -328,15 +328,23 @@ struct tt_os2__table *tt_read_os2__table(sfnt * sfont) table->sTypoLineGap = sfnt_get_short(sfont); table->usWinAscent = sfnt_get_ushort(sfont); table->usWinDescent = sfnt_get_ushort(sfont); - table->ulCodePageRange1 = sfnt_get_ulong(sfont); - table->ulCodePageRange2 = sfnt_get_ulong(sfont); - if (table->version == 0x0002) { + if (table->version >= 0x0001) { + table->ulCodePageRange1 = sfnt_get_ulong(sfont); + table->ulCodePageRange2 = sfnt_get_ulong(sfont); + } + if (table->version >= 0x0002) { table->sxHeight = sfnt_get_short(sfont); table->sCapHeight = sfnt_get_short(sfont); table->usDefaultChar = sfnt_get_ushort(sfont); table->usBreakChar = sfnt_get_ushort(sfont); table->usMaxContext = sfnt_get_ushort(sfont); } + /* + https://docs.microsoft.com/en-us/typography/opentype/spec/os2 + + There are now 5 versions but we don't read the few additional + fields as we don't use them. Some changes are cosmetical (names). + */ return table; } diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.c b/Build/source/texk/web2c/luatexdir/font/writecff.c index e6570e070c6..2d0b16b085d 100644 --- a/Build/source/texk/web2c/luatexdir/font/writecff.c +++ b/Build/source/texk/web2c/luatexdir/font/writecff.c @@ -2830,7 +2830,7 @@ void write_cff(PDF pdf, cff_font * cffont, fd_entry * fd) The |CIDSet| is a table of bits indexed by cid, bytes with high order bit first, each (set) bit is a (present) CID. */ - if (1) { + if ((! pdf->omit_cidset) && (pdf->major_version == 1)) { int cid; cidset = pdf_create_obj(pdf, obj_type_others, 0); if (cidset != 0) { @@ -2884,7 +2884,7 @@ void write_cff(PDF pdf, cff_font * cffont, fd_entry * fd) cff_add_string(cffont, "Identity"); if (cffont->header_major == 2) { /*tex A crash. */ - } else { + } else if (cffont->private && (cffont->private)[0]) { cff_dict_update(cffont->private[0], cffont); } cff_update_string(cffont); @@ -2969,7 +2969,7 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd) The |CIDSet| table is a table of bits indexed by cid, bytes with high order bit first, each (set) bit is a (present) CID. */ - if (1) { + if ((! pdf->omit_cidset) && (pdf->major_version == 1)) { cidset = pdf_create_obj(pdf, obj_type_others, 0); if (cidset != 0) { size_t l = (last_cid / 8) + 1; diff --git a/Build/source/texk/web2c/luatexdir/font/writefont.c b/Build/source/texk/web2c/luatexdir/font/writefont.c index 5d75ef80cc7..5d902c954a9 100644 --- a/Build/source/texk/web2c/luatexdir/font/writefont.c +++ b/Build/source/texk/web2c/luatexdir/font/writefont.c @@ -23,6 +23,8 @@ with LuaTeX; if not, see . #include "ptexlib.h" #include "lua/luatex-api.h" +int t1_wide_mode = 0 ; + void write_cid_fontdictionary(PDF pdf, fo_entry * fo, internal_font_number f); static void create_cid_fontdictionary(PDF pdf, internal_font_number f); @@ -449,13 +451,17 @@ static void write_fontfile(PDF pdf, fd_entry * fd) fd->fm->type |= F_OTF; fd->fm->type ^= F_TRUETYPE; } } else if (is_type1(fd->fm)) { - writetype1w(pdf, fd); + if (t1_wide_mode) { + writet1(pdf, fd, 1); + } else { + writetype1w(pdf, fd); + } } else { normal_error("fonts","there is a problem writing the font file (1)"); } } else { if (is_type1(fd->fm)) { - writet1(pdf, fd); + writet1(pdf, fd, 0); } else if (is_truetype(fd->fm)) { writettf(pdf, fd); } else if (is_opentype(fd->fm)) { @@ -472,8 +478,16 @@ static void write_fontfile(PDF pdf, fd_entry * fd) pdf_begin_dict(pdf); if (is_cidkeyed(fd->fm)) { /*tex No subtype is used for |TRUETYPE\ based \OPENTYPE\ fonts. */ - if (is_opentype(fd->fm) || is_type1(fd->fm)) { + if (is_opentype(fd->fm)) { pdf_dict_add_name(pdf, "Subtype", "CIDFontType0C"); + } else if (is_type1(fd->fm)) { + if (t1_wide_mode) { + pdf_dict_add_int(pdf, "Length1", (int) t1_length1); + pdf_dict_add_int(pdf, "Length2", (int) t1_length2); + pdf_dict_add_int(pdf, "Length3", (int) t1_length3); + } else { + pdf_dict_add_name(pdf, "Subtype", "CIDFontType0C"); + } } } else if (is_type1(fd->fm)) { pdf_dict_add_int(pdf, "Length1", (int) t1_length1); @@ -553,14 +567,19 @@ static void write_fontdescriptor(PDF pdf, fd_entry * fd) write_fontmetrics(pdf, fd); if (fd->ff_found) { if (is_cidkeyed(fd->fm)) { - if (is_type1(fd->fm)) - pdf_dict_add_ref(pdf, "FontFile3", (int) fd->ff_objnum); - else if (is_truetype(fd->fm)) + if (is_type1(fd->fm)) { + if (t1_wide_mode) { + pdf_dict_add_ref(pdf, "FontFile", (int) fd->ff_objnum); + } else { + pdf_dict_add_ref(pdf, "FontFile3", (int) fd->ff_objnum); + } + } else if (is_truetype(fd->fm)) { pdf_dict_add_ref(pdf, "FontFile2", (int) fd->ff_objnum); - else if (is_opentype(fd->fm)) + } else if (is_opentype(fd->fm)) { pdf_dict_add_ref(pdf, "FontFile3", (int) fd->ff_objnum); - else + } else { normal_error("fonts","there is a problem writing the font file (4)"); + } } else { if (is_subsetted(fd->fm) && is_type1(fd->fm)) { /*tex |/CharSet| is optional; names may appear in any order */ @@ -575,14 +594,15 @@ static void write_fontdescriptor(PDF pdf, fd_entry * fd) pdf_set_space(pdf); } } - if (is_type1(fd->fm)) + if (is_type1(fd->fm)) { pdf_dict_add_ref(pdf, "FontFile", (int) fd->ff_objnum); - else if (is_truetype(fd->fm)) + } else if (is_truetype(fd->fm)) { pdf_dict_add_ref(pdf, "FontFile2", (int) fd->ff_objnum); - else if (is_opentype(fd->fm)) + } else if (is_opentype(fd->fm)) { pdf_dict_add_ref(pdf, "FontFile3", (int) fd->ff_objnum); - else + } else { normal_error("fonts","there is a problem writing the font file (5)"); + } } } if ((! pdf->omit_cidset) && (pdf->major_version == 1) && (cidset != 0) ) { @@ -620,23 +640,26 @@ static void write_fontdictionary(PDF pdf, fo_entry * fo) pdf_begin_obj(pdf, fo->fo_objnum, OBJSTM_ALWAYS); pdf_begin_dict(pdf); pdf_dict_add_name(pdf, "Type", "Font"); - if (is_type1(fo->fm)) + if (is_type1(fo->fm)) { pdf_dict_add_name(pdf, "Subtype", "Type1"); - else if (is_truetype(fo->fm)) + } else if (is_truetype(fo->fm)) { pdf_dict_add_name(pdf, "Subtype", "TrueType"); - else if (is_opentype(fo->fm)) + } else if (is_opentype(fo->fm)) { pdf_dict_add_name(pdf, "Subtype", "Type1"); - else + } else { normal_error("fonts","there is a problem writing the font file (6)"); + } pdf_dict_add_fontname(pdf, "BaseFont", fo->fd); pdf_dict_add_ref(pdf, "FontDescriptor", (int) fo->fd->fd_objnum); pdf_dict_add_int(pdf, "FirstChar", (int) fo->first_char); pdf_dict_add_int(pdf, "LastChar", (int) fo->last_char); pdf_dict_add_ref(pdf, "Widths", (int) fo->cw_objnum); - if ((is_type1(fo->fm) || is_opentype(fo->fm)) && fo->fe != NULL && fo->fe->fe_objnum != 0) + if ((is_type1(fo->fm) || is_opentype(fo->fm)) && fo->fe != NULL && fo->fe->fe_objnum != 0) { pdf_dict_add_ref(pdf, "Encoding", (int) fo->fe->fe_objnum); - if (fo->tounicode_objnum != 0) + } + if (fo->tounicode_objnum != 0) { pdf_dict_add_ref(pdf, "ToUnicode", (int) fo->tounicode_objnum); + } if (pdf_font_attr(fo->tex_font) != get_nullstr() && pdf_font_attr(fo->tex_font) != 0) { pdf_check_space(pdf); pdf_print(pdf, pdf_font_attr(fo->tex_font)); @@ -765,7 +788,6 @@ static int has_ttf_outlines(fm_entry * fm) void do_pdf_font(PDF pdf, internal_font_number f) { - int del_file = 0; fm_entry *fm; /*tex This is not 100\% true: CID is actually needed whenever (and only) there @@ -790,24 +812,6 @@ void do_pdf_font(PDF pdf, internal_font_number f) } else { fm->ps_name = font_fullname(f); } - if (fm->ff_name - && strlen(fm->ff_name) >= 6 - && strstr(fm->ff_name,".dfont") == (fm->ff_name + strlen(fm->ff_name) - 6)) { - /*tex - - In case of a .dfont (an obsolete format), we will extract the - correct ttf here, and adjust |fm->ff_name| to point to the - temporary file. This file will be deleted later. Todo: keep a - nicer name somewhere for the terminal message. - */ - char *s = FindResourceTtfFont(fm->ff_name, fm->ps_name); - if (s != NULL) { - fm->ff_name = s; - del_file = 1; - } else { - formatted_error("font","file '%s' does not contain font '%s'",fm->ff_name, fm->ps_name); - } - } /*tex Needed for the CIDSystemInfo: */ fm->encname = font_encodingname(f); fm->slant = font_slant(f); @@ -844,8 +848,6 @@ void do_pdf_font(PDF pdf, internal_font_number f) } set_cidkeyed(fm); create_cid_fontdictionary(pdf, f); - if (del_file) - unlink(fm->ff_name); } else { /*tex By now |font_map(f)|, if any, should have been set via |pdf_init_font|. */ if ((fm = font_map(f)) == NULL || (fm->ps_name == NULL && fm->ff_name == NULL)) @@ -867,8 +869,7 @@ void do_pdf_font(PDF pdf, internal_font_number f) */ -static int comp_glw_entry(const void *pa, const void *pb, void *p - __attribute__ ((unused))) +static int comp_glw_entry(const void *pa, const void *pb, void *p __attribute__ ((unused))) { unsigned short i, j; i = (unsigned short) (*(const glw_entry *) pa).id; @@ -890,7 +891,6 @@ static void create_cid_fontdescriptor(fo_entry * fo, internal_font_number f) assert(fo->fd->gl_tree != NULL); } - /*tex The values |font_bc()| and |font_ec()| are potentially large character ids, @@ -980,7 +980,6 @@ static void destroy_glw_cid_entry(void *pa, void *pb) xfree(e); } - static void create_cid_fontdictionary(PDF pdf, internal_font_number f) { fm_entry *fm = font_map(f); @@ -1038,8 +1037,15 @@ void write_cid_fontdictionary(PDF pdf, fo_entry * fo, internal_font_number f) pdf_begin_obj(pdf, i, OBJSTM_ALWAYS); pdf_begin_dict(pdf); pdf_dict_add_name(pdf, "Type", "Font"); - if (is_opentype(fo->fm) || is_type1(fo->fm)) { + if (is_opentype(fo->fm)) { pdf_dict_add_name(pdf, "Subtype", "CIDFontType0"); + } else if (is_type1(fo->fm)) { + if (t1_wide_mode) { + pdf_dict_add_name(pdf, "Subtype", "CIDFontType0"); + // pdf_dict_add_name(pdf, "CIDToGIDMap", "Identity"); + } else { + pdf_dict_add_name(pdf, "Subtype", "CIDFontType0"); + } } else { pdf_dict_add_name(pdf, "Subtype", "CIDFontType2"); pdf_dict_add_name(pdf, "CIDToGIDMap", "Identity"); diff --git a/Build/source/texk/web2c/luatexdir/font/writet1.c b/Build/source/texk/web2c/luatexdir/font/writet1.c index d3bf29341c1..33a7cd4442d 100644 --- a/Build/source/texk/web2c/luatexdir/font/writet1.c +++ b/Build/source/texk/web2c/luatexdir/font/writet1.c @@ -1292,9 +1292,10 @@ static void t1_subset_ascii_part(PDF pdf) strncpy((char *) pdf->fb->data + t1_fontname_offset, fd_cur->subset_tag,6); } /*tex Now really all glyphs needed from this font are in the |fd_cur->gl_tree|. */ - if (t1_encoding == ENC_STANDARD) - t1_puts(pdf, "/Encoding StandardEncoding def\n"); - else { + + if (t1_encoding == ENC_STANDARD) { + t1_puts(pdf,"/Encoding StandardEncoding def\n"); + } else { t1_puts(pdf,"/Encoding 256 array\n0 1 255 {1 index exch /.notdef put} for\n"); gl_tree = create_t1_glyph_tree(glyph_names); avl_t_init(&t, fd_cur->gl_tree); @@ -1425,10 +1426,17 @@ static void t1_read_subrs(PDF pdf) } } -#define t1_subr_flush() t1_flush_cs(pdf, true) -#define t1_cs_flush() t1_flush_cs(pdf, false) +/*tex + + For historical reasons we share the funcition but it makes not much sense to + do so as not that much is shared. -static void t1_flush_cs(PDF pdf, boolean is_subr) +*/ + +#define t1_subr_flush(wide) t1_flush_cs(pdf, true, wide) +#define t1_cs_flush(wide) t1_flush_cs(pdf, false, wide) + +static void t1_flush_cs(PDF pdf, boolean is_subr, int wide) { char *p; byte *r, *return_cs = NULL; @@ -1449,7 +1457,11 @@ static void t1_flush_cs(PDF pdf, boolean is_subr) size_pos = cs_size_pos; tab = cs_tab; end_tab = cs_ptr; - count = cs_counter; + if (wide) { + count = cs_ptr - cs_tab + 1; + } else { + count = cs_counter; + } } t1_line_ptr = t1_line_array; for (p = start_line; p - start_line < size_pos;) @@ -1462,50 +1474,63 @@ static void t1_flush_cs(PDF pdf, boolean is_subr) t1_putline(pdf); /*tex For |-Wall|. */ cs_len = 0; - /*tex Create |return_cs| to replace unsused |subr|s. */ + /*tex Create |return_cs| to replace unused |subr|s. */ if (is_subr) { cr = 4330; - cs_len = 0; /*tex At this point we have |t1_lenIV >= 0;| a negative value would be caught in |t1_scan_param|. */ return_cs = xtalloc((unsigned) (t1_lenIV + 1), byte); - for (cs_len = 0, r = return_cs; cs_len < t1_lenIV; cs_len++, r++) + for (cs_len = 0, r = return_cs; cs_len < t1_lenIV; cs_len++, r++) { *r = cencrypt(0x00, &cr); + } *r = cencrypt(CS_RETURN, &cr); cs_len++; } for (ptr = tab; ptr < end_tab; ptr++) { if (ptr->used) { - if (is_subr) - sprintf(t1_line_array, "dup %li %u", (long int) (ptr - tab), - ptr->cslen); - else + if (is_subr) { + sprintf(t1_line_array, "dup %li %u", (long int) (ptr - tab), ptr->cslen); + } else { sprintf(t1_line_array, "/%s %u", ptr->name, ptr->cslen); + } p = strend(t1_line_array); memcpy(p, ptr->data, ptr->len); t1_line_ptr = p + ptr->len; t1_putline(pdf); - } else { - /*tex Replace unsused subr's by |return_cs|. */ - if (is_subr) { - sprintf(t1_line_array, "dup %li %u%s ", (long int) (ptr - tab), - cs_len, cs_token_pair[0]); + } else if (is_subr) { + /*tex Replace unused subr's by |return_cs|. */ + sprintf(t1_line_array, "dup %li %u%s ", (long int) (ptr - tab), cs_len, cs_token_pair[0]); + p = strend(t1_line_array); + memcpy(p, return_cs, cs_len); + t1_line_ptr = p + cs_len; + t1_putline(pdf); + sprintf(t1_line_array, " %s", cs_token_pair[1]); + t1_line_ptr = eol(t1_line_array); + t1_putline(pdf); + } else if (wide) { + if (cs_notdef != NULL) { + sprintf(t1_line_array, "/%s %u", ptr->name, cs_notdef->cslen); p = strend(t1_line_array); - memcpy(p, return_cs, cs_len); - t1_line_ptr = p + cs_len; - t1_putline(pdf); - sprintf(t1_line_array, " %s", cs_token_pair[1]); - t1_line_ptr = eol(t1_line_array); + memcpy(p, cs_notdef->data, cs_notdef->len); + t1_line_ptr = p + cs_notdef->len; t1_putline(pdf); + } else { + /*tex Troubles! */ + } + } + if (ptr->name != notdef) { + if (wide) { + xfree(ptr->data); } } - xfree(ptr->data); - if (is_subr) + if (is_subr) { ptr->valid = false; - if (ptr->name != notdef) + } + if (ptr->name != notdef) { xfree(ptr->name); + } } sprintf(t1_line_array, "%s", line_end); t1_line_ptr = eol(t1_line_array); @@ -1520,15 +1545,16 @@ static void t1_flush_cs(PDF pdf, boolean is_subr) } } xfree(return_cs); + } else if (wide && cs_notdef != NULL) { + xfree(cs_notdef->data); } xfree(tab); xfree(start_line); xfree(line_end); } -static void t1_mark_glyphs(void) +static void t1_mark_glyphs(int wide) { - char *glyph; struct avl_traverser t; cs_entry *ptr; if (t1_synthetic || fd_cur->all_glyphs) { @@ -1547,9 +1573,16 @@ static void t1_mark_glyphs(void) } mark_cs(notdef); avl_t_init(&t, fd_cur->gl_tree); - for (glyph = (char *) avl_t_first(&t, fd_cur->gl_tree); glyph != NULL; - glyph = (char *) avl_t_next(&t)) { - mark_cs(glyph); + if (wide) { + glw_entry *glyph; + for (glyph = (glw_entry *) avl_t_first(&t, fd_cur->gl_tree); glyph != NULL; glyph = (glw_entry *) avl_t_next(&t)) { + mark_cs((cs_tab + (int) glyph->id)->name); + } + } else { + char *glyph; + for (glyph = (char *) avl_t_first(&t, fd_cur->gl_tree); glyph != NULL; glyph = (char *) avl_t_next(&t)) { + mark_cs(glyph); + } } if (subr_tab != NULL) for (subr_max = -1, ptr = subr_tab; ptr - subr_tab < subr_size; ptr++) @@ -1557,7 +1590,6 @@ static void t1_mark_glyphs(void) subr_max = (int) (ptr - subr_tab); } - /*tex When |t1_subset_charstrings| is called, the |t1_line_array| contains @@ -1581,15 +1613,15 @@ static void t1_check_unusual_charstring(void) if (sscanf(p, "%i", &i) != 1) { strcpy(t1_buf_array, t1_line_array); t1_getline(); - alloc_array(t1_buf, strlen(t1_line_array) + strlen(t1_buf_array) + 1, T1_BUF_SIZE); + alloc_array(t1_buf, strlen(t1_line_array) + (t1_buf_array?strlen(t1_buf_array):0) + 1, T1_BUF_SIZE); strcat(t1_buf_array, t1_line_array); - alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE); + alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE); strcpy(t1_line_array, t1_buf_array); t1_line_ptr = eol(t1_line_array); } } -static void t1_subset_charstrings(PDF pdf) +static void t1_subset_charstrings(PDF pdf, int wide) { cs_entry *ptr; t1_check_unusual_charstring(); @@ -1607,16 +1639,16 @@ static void t1_subset_charstrings(PDF pdf) t1_getline(); } cs_dict_end = xstrdup(t1_line_array); - t1_mark_glyphs(); + t1_mark_glyphs(wide); if (subr_tab != NULL) { if (cs_token_pair == NULL) formatted_error("type 1","mismatched subroutine begin/end token pairs"); - t1_subr_flush(); + t1_subr_flush(wide); } for (cs_counter = 0, ptr = cs_tab; ptr < cs_ptr; ptr++) if (ptr->used) cs_counter++; - t1_cs_flush(); + t1_cs_flush(wide); } static void t1_subset_end(PDF pdf) @@ -1656,14 +1688,13 @@ static void t1_subset_end(PDF pdf) get_length3(); } -void writet1(PDF pdf, fd_entry * fd) +void writet1(PDF pdf, fd_entry * fd, int wide) { /*tex |fd_cur| is global inside |writet1.c|. */ fd_cur = fd; assert(fd_cur->fm != NULL); assert(is_type1(fd->fm)); assert(is_included(fd->fm)); - t1_save_offset = 0; if (!is_subsetted(fd_cur->fm)) { /*tex Include entire font. */ @@ -1675,14 +1706,15 @@ void writet1(PDF pdf, fd_entry * fd) return; } /*tex Partial downloading. */ - if (!(fd->ff_found = t1_open_fontfile(filetype_subset))) + if (!(fd->ff_found = t1_open_fontfile(filetype_subset))) { return; + } t1_subset_ascii_part(pdf); t1_start_eexec(pdf); cc_init(); cs_init(); t1_read_subrs(pdf); - t1_subset_charstrings(pdf); + t1_subset_charstrings(pdf,wide); t1_subset_end(pdf); t1_close_font_file(filetype_subset); xfree(t1_buffer); diff --git a/Build/source/texk/web2c/luatexdir/image/epdf.h b/Build/source/texk/web2c/luatexdir/image/epdf.h index 9c32c06b795..d0cd7f79ee0 100644 --- a/Build/source/texk/web2c/luatexdir/image/epdf.h +++ b/Build/source/texk/web2c/luatexdir/image/epdf.h @@ -145,7 +145,8 @@ int luaopen_epdf(lua_State * L); typedef struct InObj InObj; struct InObj { - ppref *ref; /* ref in original PDF */ + /* int version; */ /* old object number in included PDF */ + int objnum; /* old version number in included PDF, we can do without */ int num; /* new object number in output PDF */ InObj *next; /* next entry in list of indirect objects */ } ; diff --git a/Build/source/texk/web2c/luatexdir/image/image.h b/Build/source/texk/web2c/luatexdir/image/image.h index 985f53d06eb..687aa2bdf85 100644 --- a/Build/source/texk/web2c/luatexdir/image/image.h +++ b/Build/source/texk/web2c/luatexdir/image/image.h @@ -129,6 +129,8 @@ typedef struct { int luaref ; boolean keepopen; boolean nolength; + boolean notype; + boolean nobbox; int errorlevel; int pdfmajorversion; int pdfminorversion; @@ -177,7 +179,9 @@ typedef struct { # define img_flags(N) ((N)->flags) # define img_luaref(N) ((N)->luaref) # define img_keepopen(N) ((N)->keepopen) +# define img_nobbox(N) ((N)->nobbox) # define img_nolength(N) ((N)->nolength) +# define img_notype(N) ((N)->notype) # define img_errorlevel(N) ((N)->errorlevel) # define img_pdfmajorversion(N) ((N)->pdfmajorversion) # define img_pdfminorversion(N) ((N)->pdfminorversion) diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c index b29493b073d..664bfef18c9 100644 --- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c +++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c @@ -23,6 +23,11 @@ with LuaTeX; if not, see . #define __STDC_FORMAT_MACROS /* for PRId64 etc. */ #include "image/epdf.h" +#include "luatexcallbackids.h" + +/* to be sorted out, we cannot include */ + +#define xfree(a) do { free(a); a = NULL; } while (0) /* Conflict with pdfgen.h */ @@ -270,31 +275,37 @@ PdfDocument *refMemStreamPdfDocument(char *docstream, unsigned long long streams typedef struct ObjMap ObjMap ; struct ObjMap { - ppref * in; + /* int version; */ /* not really needed */ + int objnum; int out_num; }; static int CompObjMap(const void *pa, const void *pb, void *p) { - const ppref *a = (((const ObjMap *) pa)->in); - const ppref *b = (((const ObjMap *) pb)->in); - if (a->number > b->number) + const ObjMap *a = (((const ObjMap *) pa)); + const ObjMap *b = (((const ObjMap *) pb)); + if (a->objnum > b->objnum) return 1; - else if (a->number < b->number) + else if (a->objnum < b->objnum) return -1; + /* else if (a->version == b->version) return 0; else if (a->version < b->version) return -1; return 1; + */ + return 0; } static ObjMap *findObjMap(PdfDocument * pdf_doc, ppref * in) { ObjMap *obj_map, tmp; - if (pdf_doc->ObjMapTree == NULL) + if (pdf_doc->ObjMapTree == NULL) { return NULL; - tmp.in = in; + } + tmp.objnum = in->number; + /* tmp.version = in->version; */ obj_map = (ObjMap *) avl_find(pdf_doc->ObjMapTree, &tmp); return obj_map; } @@ -302,10 +313,12 @@ static ObjMap *findObjMap(PdfDocument * pdf_doc, ppref * in) static void addObjMap(PdfDocument * pdf_doc, ppref * in, int out_num) { ObjMap *obj_map = NULL; - if (pdf_doc->ObjMapTree == NULL) + if (pdf_doc->ObjMapTree == NULL) { pdf_doc->ObjMapTree = avl_create(CompObjMap, NULL, &avl_xallocator); + } obj_map = (ObjMap*)xmalloc(sizeof(ObjMap)); - obj_map->in = in; + /* obj_map->version = in->version; */ + obj_map->objnum = in->number; obj_map->out_num = out_num; avl_probe(pdf_doc->ObjMapTree, obj_map); } @@ -332,7 +345,8 @@ static int addInObj(PDF pdf, PdfDocument * pdf_doc, ppref * ref) return obj_map->out_num; } n = (InObj*)xmalloc(sizeof(InObj)); - n->ref = ref; + n->objnum = ref->number; + /* n->version = ref->version; */ n->next = NULL; n->num = pdf_create_obj(pdf, obj_type_others, 0); addObjMap(pdf_doc, ref, n->num); @@ -408,7 +422,7 @@ static void copyDict(PDF pdf, PdfDocument * pdf_doc, ppdict *dict) pdf_end_dict(pdf); } -static void copyStreamStream(PDF pdf, ppstream * stream, int decode) +static void copyStreamStream(PDF pdf, ppstream * stream, int decode, int callback_id) { uint8_t *data = NULL; size_t size = 0; @@ -419,7 +433,18 @@ static void copyStreamStream(PDF pdf, ppstream * stream, int decode) } else { data = ppstream_all(stream,&size,decode); if (data != NULL) { - pdf_out_block(pdf, (const char *) data, size); + /*tex We only do this when we recompress in which case we fetch the whole stream. */ + if (callback_id == 1) { + callback_id = callback_defined(process_pdf_image_content_callback); + } + if (callback_id) { + char *result = NULL; + run_callback(callback_id, "S->S",(char *) data,&result); + pdf_out_block(pdf, (const char *) (uint8_t *) result, size); + xfree(result); + } else { + pdf_out_block(pdf, (const char *) data, size); + } } } ppstream_done(stream); @@ -429,38 +454,57 @@ static void copyStream(PDF pdf, PdfDocument * pdf_doc, ppstream * stream) { ppdict *dict = stream->dict; /* bug in: stream_dict(stream) */ if (pdf->compress_level == 0 || pdf->recompress) { - const char *ignoredkeys[] = { - "Filter", "Decode", "Length", "DL", NULL - }; - int i; - int n = dict->size; - pdf_begin_dict(pdf); - for (i=0; itype == PPNAME) { + const char *codecs[] = { + "ASCIIHexDecode", "ASCII85Decode", "RunLengthDecode", + "FlateDecode", "LZWDecode", NULL + }; int k; - for (k = 0; ignoredkeys[k] != NULL; k++) { - if (strcmp(key,ignoredkeys[k]) == 0) { - okay = 0; + const char *val = ppobj_get_name(obj); + for (k = 0; codecs[k] != NULL; k++) { + if (strcmp(val,codecs[k]) == 0) { + known = 1; break; } } - if (okay) { - pdf_add_name(pdf, key); - copyObject(pdf, pdf_doc, ppdict_at(dict,i)); + } + if (known) { + /*tex recompress or keep uncompressed */ + const char *ignoredkeys[] = { + "Filter", "DecodeParms", "Length", "DL", NULL + }; + int i; + pdf_begin_dict(pdf); + for (i=0; isize; ++i) { + const char *key = ppdict_key(dict,i); + int copy = 1; + int k; + for (k = 0; ignoredkeys[k] != NULL; k++) { + if (strcmp(key,ignoredkeys[k]) == 0) { + copy = 0; + break; + } + } + if (copy) { + pdf_add_name(pdf, key); + copyObject(pdf, pdf_doc, ppdict_at(dict,i)); + } } + pdf_dict_add_streaminfo(pdf); + pdf_end_dict(pdf); + pdf_begin_stream(pdf); + copyStreamStream(pdf, stream, 1, 0); + pdf_end_stream(pdf); + return ; } - pdf_dict_add_streaminfo(pdf); - pdf_end_dict(pdf); - pdf_begin_stream(pdf); - copyStreamStream(pdf, stream, 1); - pdf_end_stream(pdf); - } else { - copyDict(pdf, pdf_doc, dict); - pdf_begin_stream(pdf); - copyStreamStream(pdf, stream, 0); - pdf_end_stream(pdf); } + /* copy as-is */ + copyDict(pdf, pdf_doc, dict); + pdf_begin_stream(pdf); + copyStreamStream(pdf, stream, 0, 0); + pdf_end_stream(pdf); } static void copyObject(PDF pdf, PdfDocument * pdf_doc, ppobj * obj) @@ -505,12 +549,16 @@ static void writeRefs(PDF pdf, PdfDocument * pdf_doc) { InObj *r, *n; ppobj * obj; + ppref * ref ; + ppxref * xref = ppdoc_xref (pdf_doc->pdfe); for (r = pdf_doc->inObjList; r != NULL;) { - obj = ppref_obj(r->ref); - if (obj->type == PPSTREAM) + ref = ppxref_find (xref, (ppuint) r->objnum); + obj = ppref_obj(ref); + if (obj->type == PPSTREAM) { pdf_begin_obj(pdf, r->num, OBJSTM_NEVER); - else + } else { pdf_begin_obj(pdf, r->num, 2); + } copyObject(pdf, pdf_doc, obj); pdf_end_obj(pdf); n = r->next; @@ -520,6 +568,7 @@ static void writeRefs(PDF pdf, PdfDocument * pdf_doc) } } + /* get the pagebox coordinates according to the pagebox_spec */ static void somebox(ppdict *page, const char * key, pprect * box) @@ -578,11 +627,6 @@ static ppdict * get_pdf_page_dict(ppdoc *pdfe, int n) return NULL; } -// static ppdict * get_pdf_page_dict(ppdoc *pdfe, int n) -// { -// return ppref_obj(ppdoc_page(pdfe,n))->dict; -// } - void read_pdf_info(image_dict * idict) { PdfDocument *pdf_doc = NULL; @@ -592,7 +636,7 @@ void read_pdf_info(image_dict * idict) ppint rotate = 0; int pdf_major_version_found = 1; int pdf_minor_version_found = 3; - float xsize, ysize, xorig, yorig; + double xsize, ysize, xorig, yorig; if (img_type(idict) == IMG_TYPE_PDF) { pdf_doc = refPdfDocument(img_filepath(idict), FE_FAIL, img_userpassword(idict), img_ownerpassword(idict)); } else if (img_type(idict) == IMG_TYPE_PDFMEMSTREAM) { @@ -851,12 +895,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info) Write the Page contents. */ content = ppdict_rget_obj(pageDict, "Contents"); - if (content->type == PPSTREAM) { + if (content && content->type == PPSTREAM) { if (pdf->compress_level == 0 || pdf->recompress) { pdf_dict_add_streaminfo(pdf); pdf_end_dict(pdf); pdf_begin_stream(pdf); - copyStreamStream(pdf, content->stream,1); /* decompress */ + copyStreamStream(pdf, content->stream, 1, 1); /* decompress */ } else { /* copies compressed stream */ ppstream * stream = content->stream; @@ -878,18 +922,18 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info) } */ } - pdf_end_dict(pdf); + pdf_end_dict(pdf); pdf_begin_stream(pdf); - copyStreamStream(pdf, stream,0); + copyStreamStream(pdf, stream, 0, 0); } else { pdf_dict_add_streaminfo(pdf); pdf_end_dict(pdf); pdf_begin_stream(pdf); - copyStreamStream(pdf, stream,1); + copyStreamStream(pdf, stream, 1, 0); } } pdf_end_stream(pdf); - } else if (content->type == PPARRAY) { + } else if (content && content->type == PPARRAY) { /* listens to compresslevel */ pdf_dict_add_streaminfo(pdf); pdf_end_dict(pdf); @@ -913,7 +957,7 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info) } else { b = 1; } - copyStreamStream(pdf, (ppstream *) o->stream,1); + copyStreamStream(pdf, (ppstream *) o->stream, 1, 0); } } } diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.c b/Build/source/texk/web2c/luatexdir/image/writeimg.c index e3e3f608fea..7fe8444bced 100644 --- a/Build/source/texk/web2c/luatexdir/image/writeimg.c +++ b/Build/source/texk/web2c/luatexdir/image/writeimg.c @@ -541,53 +541,68 @@ scaled_whd scale_img(image_dict * idict, scaled_whd alt_rule, int transform) /*tex natural size corresponding to image resolution */ scaled_whd nat; int default_res; - if ((img_type(idict) == IMG_TYPE_PDF || img_type(idict) == IMG_TYPE_PDFMEMSTREAM - || img_type(idict) == IMG_TYPE_PDFSTREAM) && img_is_bbox(idict)) { - /*tex dimensions from image.bbox */ - x = img_xsize(idict) = img_bbox(idict)[2] - img_bbox(idict)[0]; - y = img_ysize(idict) = img_bbox(idict)[3] - img_bbox(idict)[1]; - img_xorig(idict) = img_bbox(idict)[0]; - img_yorig(idict) = img_bbox(idict)[1]; - } else { - /*tex dimensions, resolutions from image file */ - x = img_xsize(idict); - y = img_ysize(idict); - } - xr = img_xres(idict); - yr = img_yres(idict); - if (x <= 0 || y <= 0 || xr < 0 || yr < 0) - normal_error("pdf backend","invalid image dimensions"); - if (xr > 65535 || yr > 65535) { - xr = 0; - yr = 0; - normal_warning("pdf backend","too large image resolution ignored"); - } - if (((transform - img_rotation(idict)) & 1) == 1) { - tmp = x; - x = y; - y = tmp; - tmp = xr; - xr = yr; - yr = tmp; - } - /*tex always for images */ nat.dp = 0; - if (img_type(idict) == IMG_TYPE_PDF || img_type(idict) == IMG_TYPE_PDFMEMSTREAM - || img_type(idict) == IMG_TYPE_PDFSTREAM) { - nat.wd = x; - nat.ht = y; + nat.wd = 0; + nat.ht = 0; + if (img_nobbox(idict)) { + if (img_is_bbox(idict)) { + x = img_xsize(idict) = img_bbox(idict)[2] - img_bbox(idict)[0]; + y = img_ysize(idict) = img_bbox(idict)[3] - img_bbox(idict)[1]; + img_xorig(idict) = img_bbox(idict)[0]; + img_yorig(idict) = img_bbox(idict)[1]; + nat.wd = x; + nat.ht = y; + } else { + normal_error("pdf backend","use boundingbox to pass dimensions"); + } } else { - default_res = fix_int(pdf_image_resolution, 0, 65535); - if (default_res > 0 && (xr == 0 || yr == 0)) { - xr = default_res; - yr = default_res; + if ((img_type(idict) == IMG_TYPE_PDF || img_type(idict) == IMG_TYPE_PDFMEMSTREAM + || img_type(idict) == IMG_TYPE_PDFSTREAM) && img_is_bbox(idict)) { + /*tex dimensions from image.bbox */ + x = img_xsize(idict) = img_bbox(idict)[2] - img_bbox(idict)[0]; + y = img_ysize(idict) = img_bbox(idict)[3] - img_bbox(idict)[1]; + img_xorig(idict) = img_bbox(idict)[0]; + img_yorig(idict) = img_bbox(idict)[1]; + } else { + /*tex dimensions, resolutions from image file */ + x = img_xsize(idict); + y = img_ysize(idict); + } + xr = img_xres(idict); + yr = img_yres(idict); + if (x <= 0 || y <= 0 || xr < 0 || yr < 0) + normal_error("pdf backend","invalid image dimensions"); + if (xr > 65535 || yr > 65535) { + xr = 0; + yr = 0; + normal_warning("pdf backend","too large image resolution ignored"); + } + if (((transform - img_rotation(idict)) & 1) == 1) { + tmp = x; + x = y; + y = tmp; + tmp = xr; + xr = yr; + yr = tmp; } - if (xr > 0 && yr > 0) { - nat.wd = ext_xn_over_d(one_hundred_inch, x, 100 * xr); - nat.ht = ext_xn_over_d(one_hundred_inch, y, 100 * yr); + /*tex always for images */ + if (img_type(idict) == IMG_TYPE_PDF || img_type(idict) == IMG_TYPE_PDFMEMSTREAM + || img_type(idict) == IMG_TYPE_PDFSTREAM) { + nat.wd = x; + nat.ht = y; } else { - nat.wd = ext_xn_over_d(one_hundred_inch, x, 7200); - nat.ht = ext_xn_over_d(one_hundred_inch, y, 7200); + default_res = fix_int(pdf_image_resolution, 0, 65535); + if (default_res > 0 && (xr == 0 || yr == 0)) { + xr = default_res; + yr = default_res; + } + if (xr > 0 && yr > 0) { + nat.wd = ext_xn_over_d(one_hundred_inch, x, 100 * xr); + nat.ht = ext_xn_over_d(one_hundred_inch, y, 100 * yr); + } else { + nat.wd = ext_xn_over_d(one_hundred_inch, x, 7200); + nat.ht = ext_xn_over_d(one_hundred_inch, y, 7200); + } } } return tex_scale(nat, alt_rule); @@ -642,26 +657,32 @@ void pdf_write_image(PDF pdf, int n) void check_pdfstream_dict(image_dict * idict) { - if (!img_is_bbox(idict)) + if (!img_is_bbox(idict) && !img_nobbox(idict)) { normal_error("pdf backend","image.stream: no bbox given"); - if (img_state(idict) < DICT_FILESCANNED) + } + if (img_state(idict) < DICT_FILESCANNED) { img_state(idict) = DICT_FILESCANNED; + } } void write_pdfstream(PDF pdf, image_dict * idict) { pdf_begin_obj(pdf, img_objnum(idict), OBJSTM_NEVER); pdf_begin_dict(pdf); - pdf_dict_add_name(pdf, "Type", "XObject"); - pdf_dict_add_name(pdf, "Subtype", "Form"); - pdf_dict_add_int(pdf, "FormType", 1); - pdf_add_name(pdf, "BBox"); - pdf_begin_array(pdf); - pdf_add_real(pdf, sp2bp(img_bbox(idict)[0])); - pdf_add_real(pdf, sp2bp(img_bbox(idict)[1])); - pdf_add_real(pdf, sp2bp(img_bbox(idict)[2])); - pdf_add_real(pdf, sp2bp(img_bbox(idict)[3])); - pdf_end_array(pdf); + if (!img_notype(idict)) { + pdf_dict_add_name(pdf, "Type", "XObject"); + pdf_dict_add_name(pdf, "Subtype", "Form"); + pdf_dict_add_int(pdf, "FormType", 1); + } + if (!img_nobbox(idict)) { + pdf_add_name(pdf, "BBox"); + pdf_begin_array(pdf); + pdf_add_real(pdf, sp2bp(img_bbox(idict)[0])); + pdf_add_real(pdf, sp2bp(img_bbox(idict)[1])); + pdf_add_real(pdf, sp2bp(img_bbox(idict)[2])); + pdf_add_real(pdf, sp2bp(img_bbox(idict)[3])); + pdf_end_array(pdf); + } if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0) { pdf_printf(pdf, "\n%s\n", img_attr(idict)); } diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c index 32cf6630223..f0297ae8f51 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c @@ -83,6 +83,7 @@ static const char *const callbacknames[] = { "new_graf", "page_objnum_provider", "make_extensible", + "process_pdf_image_content", NULL }; diff --git a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c index 2592ffba683..b3ac2aa536e 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c @@ -257,6 +257,15 @@ static int getfont(lua_State * L) return 1; } +static int getparameters(lua_State * L) +{ + int i = luaL_checkinteger(L, -1); + if (i && is_valid_font(i)) { + return font_parameters_to_lua(L,i); + } + return 0; +} + static int getfontid(lua_State * L) { if (lua_type(L, 1) == LUA_TSTRING) { @@ -284,6 +293,7 @@ static const struct luaL_Reg fontlib[] = { {"max", tex_max_font}, {"each", tex_each_font}, {"getfont", getfont}, + {"getparameters", getparameters}, {"setfont", setfont}, {"addcharacters", addcharacters}, {"setexpansion", setexpansion}, diff --git a/Build/source/texk/web2c/luatexdir/lua/limglib.c b/Build/source/texk/web2c/luatexdir/lua/limglib.c index ce2b4b7b538..76c96bfb316 100644 --- a/Build/source/texk/web2c/luatexdir/lua/limglib.c +++ b/Build/source/texk/web2c/luatexdir/lua/limglib.c @@ -35,6 +35,7 @@ const char *img_types[] = { "jbig2", "stream", "memstream", + "rawstream", NULL }; @@ -119,7 +120,7 @@ static void read_scale_img(image * a) luaL_error(Luas, "the image scaler needs a valid image"); } else { ad = img_dict(a); - if (a == NULL) { + if (ad == NULL) { luaL_error(Luas, "the image scaler needs a valid dictionary"); } else { if (img_state(ad) == DICT_NEW) { @@ -386,6 +387,10 @@ static int m_img_get(lua_State * L) lua_pushboolean(L, img_keepopen(d)); } else if (lua_key_eq(s,nolength)) { lua_pushboolean(L, img_nolength(d)); + } else if (lua_key_eq(s,notype)) { + lua_pushboolean(L, img_notype(d)); + } else if (lua_key_eq(s,nobbox)) { + lua_pushboolean(L, img_nobbox(d)); } else if (lua_key_eq(s,filepath)) { if (img_filepath(d) == NULL || strlen(img_filepath(d)) == 0) { lua_pushnil(L); @@ -536,7 +541,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) } else if (t == LUA_TSTRING) { img_width(a) = dimen_to_number(L, lua_tostring(L, -1)); } else { - luaL_error(L, "image.width needs integer or nil value or dimension string"); + luaL_error(L, "img.width needs integer or nil value or dimension string"); } } else if (lua_key_eq(s,height)) { if (t == LUA_TNIL) { @@ -546,7 +551,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) } else if (t == LUA_TSTRING) { img_height(a) = dimen_to_number(L, lua_tostring(L, -1)); } else { - luaL_error(L, "image.height needs integer or nil value or dimension string"); + luaL_error(L, "img.height needs integer or nil value or dimension string"); } } else if (lua_key_eq(s,depth)) { if (t == LUA_TNIL) { @@ -556,72 +561,72 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) } else if (t == LUA_TSTRING) { img_depth(a) = dimen_to_number(L, lua_tostring(L, -1)); } else { - luaL_error(L, "image.depth needs integer or nil value or dimension string"); + luaL_error(L, "img.depth needs integer or nil value or dimension string"); } } else if (lua_key_eq(s,transform)) { if (t == LUA_TNUMBER) { img_transform(a) = (int) lua_tointeger(L, -1); } else { - luaL_error(L, "image.transform needs integer value"); + luaL_error(L, "img.transform needs integer value"); } } else if (lua_key_eq(s,filename)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.filename is now read-only"); + luaL_error(L, "img.filename is now read-only"); } else if (img_type(d) == IMG_TYPE_PDFSTREAM) { /* just ignore */ } else if (t == LUA_TSTRING) { xfree(img_filename(d)); img_filename(d) = xstrdup(lua_tostring(L, -1)); } else { - luaL_error(L, "image.filename needs string value"); + luaL_error(L, "img.filename needs string value"); } } else if (lua_key_eq(s,visiblefilename)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.visiblefilename is now read-only"); + luaL_error(L, "img.visiblefilename is now read-only"); } else if (img_type(d) == IMG_TYPE_PDFSTREAM) { img_visiblefilename(d) = NULL; } else if (t == LUA_TSTRING) { xfree(img_visiblefilename(d)); img_visiblefilename(d) = xstrdup(lua_tostring(L, -1)); } else { - luaL_error(L, "image.visiblefilename needs string value"); + luaL_error(L, "img.visiblefilename needs string value"); } } else if (lua_key_eq(s,userpassword)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.userpassword is now read-only"); + luaL_error(L, "img.userpassword is now read-only"); } else if (img_type(d) == IMG_TYPE_PDFSTREAM) { img_userpassword(d) = NULL; } else if (t == LUA_TSTRING) { xfree(img_userpassword(d)); img_userpassword(d) = xstrdup(lua_tostring(L, -1)); } else { - luaL_error(L, "image.userpassword needs string value"); + luaL_error(L, "img.userpassword needs string value"); } } else if (lua_key_eq(s,ownerpassword)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.ownerpassword is now read-only"); + luaL_error(L, "img.ownerpassword is now read-only"); } else if (img_type(d) == IMG_TYPE_PDFSTREAM) { img_ownerpassword(d) = NULL; } else if (t == LUA_TSTRING) { xfree(img_ownerpassword(d)); img_ownerpassword(d) = xstrdup(lua_tostring(L, -1)); } else { - luaL_error(L, "image.ownerpassword needs string value"); + luaL_error(L, "img.ownerpassword needs string value"); } } else if (lua_key_eq(s,attr)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.attr is now read-only"); + luaL_error(L, "img.attr is now read-only"); } else if (t == LUA_TSTRING) { xfree(img_attr(d)); img_attr(d) = xstrdup(lua_tostring(L, -1)); } else if (t == LUA_TNIL) { xfree(img_attr(d)); } else { - luaL_error(L, "image.attr needs string or nil value"); + luaL_error(L, "img.attr needs string or nil value"); } } else if (lua_key_eq(s,page)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.page is now read-only"); + luaL_error(L, "img.page is now read-only"); } else if (t == LUA_TSTRING) { xfree(img_pagename(d)); img_pagename(d) = xstrdup(lua_tostring(L, -1)); @@ -630,21 +635,21 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) img_pagenum(d) = (int) lua_tointeger(L, -1); xfree(img_pagename(d)); } else { - luaL_error(L, "image.page needs integer or string value"); + luaL_error(L, "img.page needs integer or string value"); } } else if (lua_key_eq(s,colorspace)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.colorspace is now read-only"); + luaL_error(L, "img.colorspace is now read-only"); } else if (t == LUA_TNIL) { img_colorspace(d) = 0; } else if (t == LUA_TNUMBER) { img_colorspace(d) = (int) lua_tointeger(L, -1); } else { - luaL_error(L, "image.colorspace needs integer or nil value"); + luaL_error(L, "img.colorspace needs integer or nil value"); } } else if (lua_key_eq(s,pagebox)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.pagebox is now read-only"); + luaL_error(L, "img.pagebox is now read-only"); } else if (t == LUA_TNIL) { img_pagebox(d) = PDF_BOX_SPEC_MEDIA; } else if (t == LUA_TNUMBER) { @@ -667,25 +672,29 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) } } } else { - luaL_error(L, "image.pagebox needs string, number or nil value"); + luaL_error(L, "img.pagebox needs string, number or nil value"); } } else if (lua_key_eq(s,keepopen)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.keepopen is now read-only"); + luaL_error(L, "img.keepopen is now read-only"); } else if (t != LUA_TBOOLEAN) { - luaL_error(L, "image.bbox needs boolean value"); + luaL_error(L, "img.bbox needs boolean value"); } else { img_keepopen(d) = lua_toboolean(L, -1); } } else if (lua_key_eq(s,nolength)) { img_nolength(d) = lua_toboolean(L, -1); + } else if (lua_key_eq(s,notype)) { + img_notype(d) = lua_toboolean(L, -1); + } else if (lua_key_eq(s,nobbox)) { + img_nobbox(d) = lua_toboolean(L, -1); } else if (lua_key_eq(s,bbox)) { if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.bbox is now read-only"); + luaL_error(L, "img.bbox is now read-only"); } else if (t != LUA_TTABLE) { - luaL_error(L, "image.bbox needs table value"); + luaL_error(L, "img.bbox needs table value"); } else if (lua_rawlen(L, -1) != 4) { - luaL_error(L, "image.bbox table must have exactly 4 elements"); + luaL_error(L, "img.bbox table must have exactly 4 elements"); } else { for (i = 1; i <= 4; i++) { /* v k t ... */ lua_pushinteger(L, i); /* idx v k t ... */ @@ -696,7 +705,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) } else if (t == LUA_TSTRING) { img_bbox(d)[i - 1] = dimen_to_number(L, lua_tostring(L, -1)); } else { - luaL_error(L, "image.bbox table needs integer value or dimension string elements"); + luaL_error(L, "img.bbox table needs integer value or dimension string elements"); } lua_pop(L, 1); /* v k t ... */ } @@ -704,9 +713,9 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) } } else if (lua_key_eq(s,stream)) { if (img_filename(d) != NULL) { - luaL_error(L, "image.stream can't be used with image.filename"); + luaL_error(L, "img.stream can't be used with image.filename"); } else if (img_state(d) >= DICT_FILESCANNED) { - luaL_error(L, "image.stream is now read-only"); + luaL_error(L, "img.stream is now read-only"); } else { size_t size = 0; const char *stream = lua_tolstring(L, -1, &size); @@ -720,7 +729,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) img_type(d) = IMG_TYPE_PDFSTREAM; } } else { - luaL_error(L, "image.%s can not be set", s); + luaL_error(L, "img.%s can not be set", s); } } diff --git a/Build/source/texk/web2c/luatexdir/lua/liolibext.c b/Build/source/texk/web2c/luatexdir/lua/liolibext.c index 71b9b41d12c..87bddbc887e 100644 --- a/Build/source/texk/web2c/luatexdir/lua/liolibext.c +++ b/Build/source/texk/web2c/luatexdir/lua/liolibext.c @@ -629,16 +629,18 @@ static int readintegertable_s(lua_State *L) { return 1; } +/* from ff */ + static int readfixed2(lua_State *L) { FILE *f = tofile(L); int a = getc(f); int b = getc(f); - if (b == EOF) + if (b == EOF) { lua_pushnil(L); - else if (a >= 0x80) - lua_pushinteger(L, (a - 0x100) + b/0x100); - else - lua_pushinteger(L, (a ) + b/0x100); + } else { + int n = 0x100 * a + b; + lua_pushnumber(L,(double) ((n>>8) + ((n&0xff)/256.0))); + } return 1; } @@ -651,10 +653,8 @@ static int readfixed2_s(lua_State *L) { } else { int a = uchar(s[p++]); int b = uchar(s[p]); - if (a >= 0x80) - lua_pushinteger(L, (a - 0x100) + b/0x100); - else - lua_pushinteger(L, (a ) + b/0x100); + int n = 0x100 * a + b; + lua_pushnumber(L,(double) ((n>>8) + ((n&0xff)/256.0))); } return 1; } @@ -665,15 +665,12 @@ static int readfixed4(lua_State *L) { int b = getc(f); int c = getc(f); int d = getc(f); - if (d == EOF) + if (d == EOF) { lua_pushnil(L); - else if (a >= 0x80) - lua_pushnumber(L, (0x100 * a + b - 0x10000) + (0x100 * c + d)/0x10000); - else - lua_pushnumber(L, (0x100 * a + b ) + (0x100 * c + d)/0x10000); - /* from ff */ - /* int n = 0x1000000 * a + 0x10000 * b + 0x100 * c + d; */ - /* lua_pushnumber(L,(real) (n>>16) + ((n&0xffff)/65536.0)); */ + } else { + int n = 0x1000000 * a + 0x10000 * b + 0x100 * c + d; + lua_pushnumber(L,(double) ((n>>16) + ((n&0xffff)/65536.0))); + } return 1; } @@ -688,10 +685,8 @@ static int readfixed4_s(lua_State *L) { int b = uchar(s[p++]); int c = uchar(s[p++]); int d = uchar(s[p]); - if (a >= 0x80) - lua_pushnumber(L, (0x100 * a + b - 0x10000) + (0x100 * c + d)/0x10000); - else - lua_pushnumber(L, (0x100 * a + b ) + (0x100 * c + d)/0x10000); + int n = 0x1000000 * a + 0x10000 * b + 0x100 * c + d; + lua_pushnumber(L,(double) ((n>>16) + ((n&0xffff)/65536.0))); } return 1; } @@ -705,7 +700,7 @@ static int read2dot14(lua_State *L) { } else { int n = 0x100 * a + b; /* from ff */ - lua_pushnumber(L,(real) ((n<<16)>>(16+14)) + ((n&0x3fff)/16384.0)); + lua_pushnumber(L,(double) (((n<<16)>>(16+14)) + ((n&0x3fff)/16384.0))); } return 1; } @@ -720,7 +715,7 @@ static int read2dot14_s(lua_State *L) { int a = uchar(s[p++]); int b = uchar(s[p]); int n = 0x100 * a + b; - lua_pushnumber(L,(real) ((n<<16)>>(16+14)) + ((n&0x3fff)/16384.0)); + lua_pushnumber(L,(double) (((n<<16)>>(16+14)) + ((n&0x3fff)/16384.0))); } return 1; } diff --git a/Build/source/texk/web2c/luatexdir/lua/llanglib.c b/Build/source/texk/web2c/luatexdir/lua/llanglib.c index 5855f33fc68..8f4e35f46e2 100644 --- a/Build/source/texk/web2c/luatexdir/lua/llanglib.c +++ b/Build/source/texk/web2c/luatexdir/lua/llanglib.c @@ -242,20 +242,22 @@ static int do_lang_clean(lua_State * L) static int do_lang_hyphenate(lua_State * L) { - halfword *h, *t, tt; - h = check_isnode(L, 1); + halfword t = null; + halfword h = *check_isnode(L, 1); if (lua_isuserdata(L, 2)) { - t = check_isnode(L, 2); - tt = *t; - lua_pop(L, 1); - } else { - tt = *h; - while (vlink(tt) != null) - tt = vlink(tt); + t = *check_isnode(L, 2); + } + if (t == null) { + t = h; + while (vlink(t) != null) { + t = vlink(t); + } } - hnj_hyphenation(*h, tt); + hnj_hyphenation(h, t); + lua_nodelib_push_fast(L, h); + lua_nodelib_push_fast(L, t); lua_pushboolean(L, 1); - return 1; + return 3; } static const struct luaL_Reg langlib_d[] = { diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c index d8732df7605..dd794827646 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c @@ -817,7 +817,7 @@ static int lua_nodelib_direct_setlang(lua_State * L) static int lua_nodelib_direct_getattributelist(lua_State * L) { halfword n = lua_tointeger(L, 1); - if ((n) && nodetype_has_attributes(type(n))) { + if ((n) && nodetype_has_attributes(type(n)) && node_attr(n) != null) { lua_pushinteger(L, node_attr(n)); } else { lua_pushnil(L); @@ -998,12 +998,10 @@ static int lua_nodelib_direct_getkern(lua_State * L) if (n) { halfword t = type(n); if (t == kern_node) { + lua_pushnumber(L, width(n)); if (lua_toboolean(L,2)) { - lua_pushnumber(L, (1+ex_kern(n)/1000) * width(n)); lua_pushinteger(L, ex_kern(n)); return 2; - } else { - lua_pushinteger(L, width(n)); } } else if (t == margin_kern_node) { lua_pushinteger(L, width(n)); @@ -1141,25 +1139,38 @@ static int lua_nodelib_direct_setdirection(lua_State * L) static int lua_nodelib_direct_getoffsets(lua_State * L) { halfword n = lua_tointeger(L, 1); - if ((n) && (type(n) == glyph_node)) { - lua_pushinteger(L, x_displace(n)); - lua_pushinteger(L, y_displace(n)); - return 2; - } else { - lua_pushnil(L); + if (n) { + if (type(n) == glyph_node) { + lua_pushinteger(L, x_displace(n)); + lua_pushinteger(L, y_displace(n)); + return 2; + } else if (type(n) == rule_node) { + lua_pushinteger(L, rule_left(n)); + lua_pushinteger(L, rule_right(n)); + return 2; + } } - return 1; + return 0; } static int lua_nodelib_direct_setoffsets(lua_State * L) { halfword n = lua_tointeger(L, 1); - if ((n) && (type(n) == glyph_node)) { - if ((lua_type(L, 2) == LUA_TNUMBER)) { - x_displace(n) = (halfword) lua_roundnumber(L, 2); - } - if ((lua_type(L, 3) == LUA_TNUMBER)) { - y_displace(n) = (halfword) lua_roundnumber(L, 3); + if (n) { + if (type(n) == glyph_node) { + if (lua_type(L, 2) == LUA_TNUMBER) { + x_displace(n) = (halfword) lua_roundnumber(L, 2); + } + if (lua_type(L, 3) == LUA_TNUMBER) { + y_displace(n) = (halfword) lua_roundnumber(L, 3); + } + } else if (type(n) == rule_node) { + if (lua_type(L, 2) == LUA_TNUMBER) { + rule_left(n) = (halfword) lua_roundnumber(L, 2); + } + if (lua_type(L, 3) == LUA_TNUMBER) { + rule_right(n) = (halfword) lua_roundnumber(L, 3); + } } } return 0; @@ -1244,20 +1255,20 @@ static int lua_nodelib_direct_setdisc(lua_State * L) /* node.direct.getwhd */ /* node.direct.setwhd */ -#define push_list_whd(n) do { \ +# define push_list_whd(n) do { \ lua_pushinteger(L, width(n)); \ lua_pushinteger(L, height(n)); \ lua_pushinteger(L, depth(n)); \ } while (0) -#define push_char_whd(n) do { \ +# define push_char_whd(n) do { \ lua_pushinteger(L, char_width(font(n),character(n))); \ lua_pushinteger(L, char_height(font(n),character(n))); \ lua_pushinteger(L, char_depth(font(n),character(n))); \ } while (0) -#define push_char_ehd(n) do { \ - lua_pushnumber(L, (1+ex_glyph(n)/1000) * char_width(font(n),character(n))); \ +# define push_char_ehd(n) do { \ + lua_pushinteger(L, char_width(font(n),character(n))); \ lua_pushinteger(L, char_height(font(n),character(n))); \ lua_pushinteger(L, char_depth(font(n),character(n))); \ lua_pushinteger(L, ex_glyph(n)); \ @@ -1634,10 +1645,20 @@ static int lua_nodelib_direct_setleader(lua_State * L) write_tokens(n) = nodelib_gettoks(L, i); \ } while (0) -#define get_write_direct_value(L,n) do { \ +#define xget_write_direct_value(L,n) do { \ tokenlist_to_lua(L, write_tokens(n)); \ } while (0) +#define get_write_direct_value(L,n) do { \ + int l; \ + char *s; \ + expand_macros_in_tokenlist(n); \ + s = tokenlist_to_cstring(def_ref, 1, &l); \ + lua_pushlstring(L, s, (size_t) l); \ + free(s); \ + flush_list(def_ref); \ +} while (0) + #define set_pdf_setmatrix_direct_value(L,n,i) do { \ pdf_setmatrix_data(n) = nodelib_gettoks(L, i); \ } while (0) @@ -2484,9 +2505,15 @@ static int lua_nodelib_append(lua_State * L) for (i = 1; i <= j; i++) { n = *check_isnode(L, i); tail_append(n); + if (nodetype_has_attributes(type(n)) && node_attr(n) == null) { + build_attribute_list(n); + } while (vlink(n) != null) { n = vlink(n); tail_append(n); + if (nodetype_has_attributes(type(n)) && node_attr(n) == null) { + build_attribute_list(n); + } } } return 0; @@ -2504,9 +2531,15 @@ static int lua_nodelib_direct_append(lua_State * L) if (n != null) { m = n ; tail_append(m); + if (nodetype_has_attributes(type(n)) && node_attr(n) == null) { + build_attribute_list(n); + } while (vlink(m) != null) { m = vlink(m); tail_append(m); + if (nodetype_has_attributes(type(n)) && node_attr(n) == null) { + build_attribute_list(n); + } } } } @@ -3573,22 +3606,18 @@ static int lua_nodelib_direct_getwidth(lua_State * L) if (t == hlist_node || t == vlist_node || t == rule_node) { lua_pushinteger(L,width(n)); } else if (t == glyph_node) { + lua_pushnumber(L, char_width(font(n),character(n))); if (lua_toboolean(L,2)) { - lua_pushnumber(L, (1+ex_glyph(n)/1000) * char_width(font(n),character(n))); lua_pushinteger(L, ex_glyph(n)); return 2; - } else { - lua_pushinteger(L, char_width(font(n),character(n))); } } else if (t == glue_node || t == glue_spec_node || t == math_node || t == ins_node) { lua_pushinteger(L,width(n)); } else if (t == kern_node) { + lua_pushinteger(L, width(n)); if (lua_toboolean(L,2)) { - lua_pushnumber(L, (1+ex_kern(n)/1000) * width(n)); lua_pushinteger(L, ex_kern(n)); return 2; - } else { - lua_pushinteger(L, width(n)); } } else if (t == margin_kern_node) { lua_pushinteger(L,width(n)); @@ -4695,7 +4724,7 @@ static int lua_nodelib_fast_getfield(lua_State * L) } else if (lua_key_eq(s, depth)) { lua_pushinteger(L, depth(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, box_dir(n)); + lua_push_direction(L, box_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, box_dir(n)); } else if (lua_key_eq(s, shift)) { @@ -4774,7 +4803,7 @@ static int lua_nodelib_fast_getfield(lua_State * L) } else if (lua_key_eq(s, right)) { lua_pushinteger(L,rule_right(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, rule_dir(n)); + lua_push_direction(L, rule_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, rule_dir(n)); } else if (lua_key_eq(s, index)) { @@ -4786,7 +4815,7 @@ static int lua_nodelib_fast_getfield(lua_State * L) } } else if (t == dir_node) { if (lua_key_eq(s, direction)) { - lua_pushinteger(L, dir_dir(n)); + lua_push_direction(L, dir_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_text(L, dir_dir(n),subtype(n)); } else if (lua_key_eq(s, level)) { @@ -4802,7 +4831,7 @@ static int lua_nodelib_fast_getfield(lua_State * L) } else if (lua_key_eq(s, pen_broken)) { lua_pushinteger(L, local_pen_broken(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, local_par_dir(n)); + lua_push_direction(L, local_par_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, local_par_dir(n)); } else if (lua_key_eq(s, box_left)) { @@ -5105,7 +5134,7 @@ static int lua_nodelib_fast_getfield(lua_State * L) } else if (lua_key_eq(s, depth)) { lua_pushinteger(L, depth(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, box_dir(n)); + lua_push_direction(L, box_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, box_dir(n)); } else if (lua_key_eq(s, shrink)) { @@ -5450,7 +5479,7 @@ static int lua_nodelib_direct_getfield(lua_State * L) } else if (lua_key_eq(s, depth)) { lua_pushinteger(L, depth(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, box_dir(n)); + lua_push_direction(L, box_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, box_dir(n)); } else if (lua_key_eq(s, shift)) { @@ -5519,7 +5548,7 @@ static int lua_nodelib_direct_getfield(lua_State * L) } else if (lua_key_eq(s, right)) { lua_pushinteger(L,rule_right(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, rule_dir(n)); + lua_push_direction(L, rule_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, rule_dir(n)); } else if (lua_key_eq(s, index)) { @@ -5531,7 +5560,7 @@ static int lua_nodelib_direct_getfield(lua_State * L) } } else if (t == dir_node) { if (lua_key_eq(s, direction)) { - lua_pushinteger(L, dir_dir(n)); + lua_push_direction(L, dir_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_text(L, dir_dir(n), subtype(n)); } else if (lua_key_eq(s, level)) { @@ -5547,7 +5576,7 @@ static int lua_nodelib_direct_getfield(lua_State * L) } else if (lua_key_eq(s, pen_broken)) { lua_pushinteger(L, local_pen_broken(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, local_par_dir(n)); + lua_push_direction(L, local_par_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, local_par_dir(n)); } else if (lua_key_eq(s, box_left)) { @@ -5791,7 +5820,7 @@ static int lua_nodelib_direct_getfield(lua_State * L) } else if (lua_key_eq(s, depth)) { lua_pushinteger(L, depth(n)); } else if (lua_key_eq(s, direction)) { - lua_pushinteger(L, box_dir(n)); + lua_push_direction(L, box_dir(n)); } else if (lua_key_eq(s, dir)) { lua_push_dir_par(L, box_dir(n)); } else if (lua_key_eq(s, shrink)) { @@ -6045,6 +6074,51 @@ static int font_tex_direct_kerning(lua_State * L) return 3; } +/*tex + It's more consistent to have it here (so we will alias in lang later). Todo: + if no glyph then quit. +*/ + +static int lang_tex_hyphenating(lua_State * L) +{ + halfword t = null; + halfword h = *check_isnode(L, 1); + if (lua_isuserdata(L, 2)) { + t = *check_isnode(L, 2); + } + if (t == null) { + t = h; + while (vlink(t) != null) { + t = vlink(t); + } + } + hnj_hyphenation(h, t); + lua_nodelib_push_fast(L, h); + lua_nodelib_push_fast(L, t); + lua_pushboolean(L, 1); + return 3; +} + +static int lang_tex_direct_hyphenating(lua_State * L) +{ + halfword t = null; + halfword h = lua_tointeger(L, 1); + if (lua_type(L,1) != LUA_TNUMBER) { + t = lua_tointeger(L, 2); + } + if (t == null) { + t = h; + while (vlink(t) != null) { + t = vlink(t); + } + } + hnj_hyphenation(h, t); + lua_pushinteger(L, h); + lua_pushinteger(L, t); + lua_pushboolean(L, 1); + return 3; +} + /* node.protect_glyphs (returns also boolean because that signals callback) */ /* node.unprotect_glyphs (returns also boolean because that signals callback) */ @@ -8356,9 +8430,9 @@ static int lua_nodelib_effective_glue(lua_State * L) if ((glue == NULL) || (type(*glue) != glue_node)) { lua_pushnil(L) ; } else { - double w = width(*glue) ; parent = lua_touserdata(L, 2); if ((parent != NULL) && ((type(*parent) == hlist_node) || (type(*parent) == vlist_node))) { + double w = width(*glue) ; if ((int) glue_sign(*parent) == 1) { if (stretch_order(*glue) == glue_order(*parent)) { w += stretch(*glue) * (double) glue_set(*parent); @@ -8368,8 +8442,14 @@ static int lua_nodelib_effective_glue(lua_State * L) w -= shrink(*glue) * (double) glue_set(*parent); } } + if (lua_toboolean(L,3)) { + lua_pushinteger(L,round(w)); + } else { + lua_pushnumber(L,w); + } + } else { + lua_pushinteger(L,width(*glue)); } - lua_pushinteger(L,round(w)); } return 1; } @@ -8380,9 +8460,9 @@ static int lua_nodelib_direct_effective_glue(lua_State * L) if ((glue == null) || (type(glue) != glue_node)) { lua_pushnil(L) ; } else { - double w = (double) width(glue) ; halfword parent = lua_tointeger(L, 2); if ((parent != null) && ((type(parent) == hlist_node) || (type(parent) == vlist_node))) { + double w = (double) width(glue) ; if ((int)glue_sign(parent) == 1) { if (stretch_order(glue) == glue_order(parent)) { w += stretch(glue) * (double) glue_set(parent); @@ -8392,8 +8472,14 @@ static int lua_nodelib_direct_effective_glue(lua_State * L) w -= shrink(glue) * (double) glue_set(parent); } } + if (lua_toboolean(L,3)) { + lua_pushinteger(L,round(w)); + } else { + lua_pushnumber(L,w); + } + } else { + lua_pushinteger(L,width(glue)); } - lua_pushnumber(L,round(w)); } return 1; } @@ -8812,6 +8898,7 @@ static const struct luaL_Reg direct_nodelib_f[] = { {"is_glyph", lua_nodelib_direct_is_glyph}, {"uses_font", lua_nodelib_direct_uses_font}, {"hpack", lua_nodelib_direct_hpack}, + {"hyphenating", lang_tex_direct_hyphenating}, /* {"id", lua_nodelib_id}, */ /* no node argument */ {"insert_after", lua_nodelib_direct_insert_after}, {"insert_before", lua_nodelib_direct_insert_before}, @@ -8942,6 +9029,7 @@ static const struct luaL_Reg nodelib_f[] = { {"is_glyph", lua_nodelib_is_glyph}, {"uses_font", lua_nodelib_uses_font}, {"hpack", lua_nodelib_hpack}, + {"hyphenating", lang_tex_hyphenating}, {"id", lua_nodelib_id}, {"insert_after", lua_nodelib_insert_after}, {"insert_before", lua_nodelib_insert_before}, diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c b/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c index 31fad9f632d..dc09d347aad 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c @@ -1,11 +1,30 @@ +/* loslibext.c + + This file is part of LuaTeX. + + LuaTeX is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + + LuaTeX is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + details. + + You should have received a copy of the GNU General Public License along with + LuaTeX; if not, see . + +*/ + /*tex - This file will host the encapsulated \PDF\ support code used for inclusion - and access from \LUA. + This file hosts the encapsulated \PDF\ support code used for inclusion and + access from \LUA. */ -#include "ptexlib.h" +# include "ptexlib.h" /*tex @@ -13,34 +32,34 @@ */ -#undef lpdfelib_orig_input -#undef lpdfelib_orig_output +# undef lpdfelib_orig_input +# undef lpdfelib_orig_output -#ifdef input -#define lpdfelib_orig_input input -#undef input -#endif +# ifdef input +# define lpdfelib_orig_input input +# undef input +# endif -#ifdef output -#define lpdfelib_orig_output output -#undef output -#endif +# ifdef output +# define lpdfelib_orig_output output +# undef output +# endif -#include "luapplib/pplib.h" +# include "luapplib/pplib.h" -#include "image/epdf.h" +# include "image/epdf.h" -#ifdef lpdfelib_orig_input -#define input lpdfelib_orig_input -#undef lpdfelib_orig_input -#endif +# ifdef lpdfelib_orig_input +# define input lpdfelib_orig_input +# undef lpdfelib_orig_input +# endif -#ifdef lpdfelib_orig_output -#define output lpdfelib_orig_output -#undef lpdfelib_orig_output -#endif +# ifdef lpdfelib_orig_output +# define output lpdfelib_orig_output +# undef lpdfelib_orig_output +# endif -#include "lua/luatex-api.h" +# include "lua/luatex-api.h" /*tex @@ -50,11 +69,11 @@ */ -#define PDFE_METATABLE "luatex.pdfe" -#define PDFE_METATABLE_DICTIONARY "luatex.pdfe.dictionary" -#define PDFE_METATABLE_ARRAY "luatex.pdfe.array" -#define PDFE_METATABLE_STREAM "luatex.pdfe.stream" -#define PDFE_METATABLE_REFERENCE "luatex.pdfe.reference" +# define PDFE_METATABLE "luatex.pdfe" +# define PDFE_METATABLE_DICTIONARY "luatex.pdfe.dictionary" +# define PDFE_METATABLE_ARRAY "luatex.pdfe.array" +# define PDFE_METATABLE_STREAM "luatex.pdfe.stream" +# define PDFE_METATABLE_REFERENCE "luatex.pdfe.reference" typedef struct { ppdoc *document; @@ -67,23 +86,22 @@ typedef struct { typedef struct { ppdict *dictionary; - ppref *ref; } pdfe_dictionary; typedef struct { pparray *array; - ppref *ref; } pdfe_array; typedef struct { ppstream *stream; - ppref *ref; int decode; int open; } pdfe_stream; typedef struct { - ppref *reference; + /* ppref *reference; */ + ppxref *xref; + int onum; } pdfe_reference; /*tex @@ -194,7 +212,7 @@ static pdfe_reference *check_isreference(lua_State * L, int n) */ -#define check_type(field,meta,name) do { \ +# define check_type(field,meta,name) do { \ lua_get_metatablelua(luatex_##meta); \ if (lua_rawequal(L, -1, -2)) { \ lua_pushstring(L,name); \ @@ -223,7 +241,7 @@ static int pdfelib_type(lua_State * L) */ -#define define_to_string(field,what) \ +# define define_to_string(field,what) \ static int pdfelib_tostring_##field(lua_State * L) { \ pdfe_##field *p = check_is##field(L, 1); \ if (p != NULL) { \ @@ -236,9 +254,17 @@ static int pdfelib_tostring_##field(lua_State * L) { \ define_to_string(document, "pdfe") define_to_string(dictionary,"pdfe.dictionary") define_to_string(array, "pdfe.array") -define_to_string(reference, "pdfe.reference") define_to_string(stream, "pdfe.stream") +static int pdfelib_tostring_reference(lua_State * L) { \ + pdfe_reference *p = check_isreference(L, 1); \ + if (p != NULL) { \ + lua_pushfstring(L, "", p->onum); \ + return 1; \ + } \ + return 0; \ +} + /*tex The pushers look rather similar. We have two variants, one that just pushes @@ -246,7 +272,7 @@ define_to_string(stream, "pdfe.stream") */ -#define pdfe_push_dictionary do { \ +# define pdfe_push_dictionary do { \ pdfe_dictionary *d = (pdfe_dictionary *)lua_newuserdata(L, sizeof(pdfe_dictionary)); \ luaL_getmetatable(L, PDFE_METATABLE_DICTIONARY); \ lua_setmetatable(L, -2); \ @@ -272,7 +298,7 @@ static int pushdictionaryonly(lua_State * L, ppdict *dictionary) return 0; } -#define pdfe_push_array do { \ +# define pdfe_push_array do { \ pdfe_array *a = (pdfe_array *)lua_newuserdata(L, sizeof(pdfe_array)); \ luaL_getmetatable(L, PDFE_METATABLE_ARRAY); \ lua_setmetatable(L, -2); \ @@ -298,7 +324,7 @@ static int pusharrayonly(lua_State * L, pparray * array) return 0; } -#define pdfe_push_stream do { \ +# define pdfe_push_stream do { \ pdfe_stream *s = (pdfe_stream *)lua_newuserdata(L, sizeof(pdfe_stream)); \ luaL_getmetatable(L, PDFE_METATABLE_STREAM); \ lua_setmetatable(L, -2); \ @@ -331,11 +357,12 @@ static int pushstreamonly(lua_State * L, ppstream * stream) return 0; } -#define pdfe_push_reference do { \ +# define pdfe_push_reference do { \ pdfe_reference *r = (pdfe_reference *)lua_newuserdata(L, sizeof(pdfe_reference)); \ luaL_getmetatable(L, PDFE_METATABLE_REFERENCE); \ lua_setmetatable(L, -2); \ - r->reference = reference; \ + r->xref = reference->xref; \ + r->onum = reference->number; \ } while (0) static int pushreference(lua_State * L, ppref * reference) @@ -709,9 +736,11 @@ static int pdfelib_readwholestream(lua_State * L) Alternatively streams can be fetched stepwise: + \starttyping okay = openstream(streamobject,[decode]) string, n = readfromstream(streamobject) closestream(streamobject) + \stoptyping */ @@ -1130,7 +1159,7 @@ static int pdfelib_getfromreference(lua_State * L) { pdfe_reference *r = check_isreference(L, 1); if (r != NULL) { - ppobj *o = ppref_obj(r->reference); + ppobj *o = ppref_obj(ppxref_find(r->xref, (ppuint) r->onum)); lua_pushinteger(L,o->type); return 1 + pushvalue(L,o); } @@ -1158,7 +1187,7 @@ static int pdfelib_getfromreference(lua_State * L) */ -#define pdfelib_get_value_check_1 do { \ +# define pdfelib_get_value_check_1 do { \ if (p == NULL) { \ if (t == LUA_TSTRING) { \ normal_warning("pdfe lib","lua expected"); \ @@ -1173,7 +1202,7 @@ static int pdfelib_getfromreference(lua_State * L) } \ } while (0) -#define pdfelib_get_value_check_2 \ +# define pdfelib_get_value_check_2 \ normal_warning("pdfe lib","second argument should be integer or string"); /*tex @@ -1183,7 +1212,11 @@ static int pdfelib_getfromreference(lua_State * L) */ -#define pdfelib_get_value_direct(get_d,get_a) do { \ +# define pdfelib_get_indirect_o(p) \ + ppref *r = ppxref_find(((pdfe_reference *) p)->xref, (ppuint) (((pdfe_reference *) p)->onum)); \ + ppobj *o = ppref_obj(r); \ + +# define pdfelib_get_value_direct(get_d,get_a) do { \ int t = lua_type(L,2); \ void *p = lua_touserdata(L, 1); \ pdfelib_get_value_check_1; \ @@ -1196,7 +1229,7 @@ static int pdfelib_getfromreference(lua_State * L) lua_pop(L,1); \ lua_get_metatablelua(luatex_pdfe_reference); \ if (lua_rawequal(L, -1, -2)) { \ - ppobj * o = ppref_obj((ppref *) (((pdfe_reference *) p)->reference)); \ + pdfelib_get_indirect_o(p); \ if (o != NULL && o->type == PPDICT) { \ value = get_d((ppdict *)o->dict, key); \ } \ @@ -1211,7 +1244,7 @@ static int pdfelib_getfromreference(lua_State * L) lua_pop(L,1); \ lua_get_metatablelua(luatex_pdfe_reference); \ if (lua_rawequal(L, -1, -2)) { \ - ppobj * o = ppref_obj((ppref *) (((pdfe_reference *) p)->reference)); \ + pdfelib_get_indirect_o(p); \ if (o != NULL && o->type == PPARRAY) { \ value = get_a((pparray *) o->array, index); \ } \ @@ -1229,7 +1262,7 @@ static int pdfelib_getfromreference(lua_State * L) */ -#define pdfelib_get_value_indirect(get_d,get_a) do { \ +# define pdfelib_get_value_indirect(get_d,get_a) do { \ int t = lua_type(L,2); \ void *p = lua_touserdata(L, 1); \ pdfelib_get_value_check_1; \ @@ -1242,7 +1275,7 @@ static int pdfelib_getfromreference(lua_State * L) lua_pop(L,1); \ lua_get_metatablelua(luatex_pdfe_reference); \ if (lua_rawequal(L, -1, -2)) { \ - ppobj * o = ppref_obj((ppref *) (((pdfe_reference *) p)->reference)); \ + pdfelib_get_indirect_o(p); \ if (o != NULL && o->type == PPDICT) \ okay = get_d(o->dict, key, &value); \ } \ @@ -1256,7 +1289,7 @@ static int pdfelib_getfromreference(lua_State * L) lua_pop(L,1); \ lua_get_metatablelua(luatex_pdfe_reference); \ if (lua_rawequal(L, -1, -2)) { \ - ppobj * o = ppref_obj((ppref *) (((pdfe_reference *) p)->reference)); \ + pdfelib_get_indirect_o(p); \ if (o != NULL && o->type == PPARRAY) \ okay = get_a(o->array, index, &value); \ } \ @@ -1523,8 +1556,8 @@ static int pdfelib_stream_size(lua_State * L) /*tex - We now initialize the main interface. We might aa few more - informational helpers but this is it. + We now initialize the main interface. We might add few more informational + helpers but this is it. */ diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c index d8e051f3fd0..669fa1f2fbc 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c @@ -1242,6 +1242,19 @@ static int getpdfnofobjects(lua_State * L) return 2; } +/*tex + + The following option is not official and needs testing anyway. It's a + prelude a followup where the dependencies are limited. + +*/ + +static int settypeonewidemode(lua_State * L) +{ + t1_wide_mode = lua_tointeger(L,1); + return 0; +} + /*tex For normal output see |pdflistout.c|: */ static const struct luaL_Reg pdflib[] = { @@ -1342,6 +1355,8 @@ static const struct luaL_Reg pdflib[] = { { "fontobjnum", getpdffontobjnum }, { "fontsize", getpdffontsize }, { "xformname", getpdfxformname }, + /* experimental */ + { "settypeonewidemode", settypeonewidemode}, /* sentinel */ {NULL, NULL} }; diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h index 399dccb04f2..c662e76b983 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h @@ -133,6 +133,7 @@ extern int luaopen_stats(lua_State * L); extern int luaopen_font(lua_State * L); extern int luaopen_vf(lua_State * L); +extern int font_parameters_to_lua(lua_State * L, int f); extern int font_to_lua(lua_State * L, int f); extern int font_from_lua(lua_State * L, int f); /* return is boolean */ extern int characters_from_lua(lua_State * L, int f); /* return is boolean */ @@ -661,11 +662,15 @@ make_lua_key(def_font);\ make_lua_key(def_lua_call);\ make_lua_key(degree);\ make_lua_key(delim);\ +make_lua_key(delimiter);\ +make_lua_key(hdelimiter);\ +make_lua_key(vdelimiter);\ make_lua_key(delim_num);\ make_lua_key(delimptr);\ make_lua_key(delta);\ make_lua_key(demerits);\ make_lua_key(denom);\ +make_lua_key(denominator);\ make_lua_key(depth);\ make_lua_key(designsize);\ make_lua_key(dest_id);\ @@ -714,6 +719,8 @@ make_lua_key(extdef_math_code);\ make_lua_key(extend);\ make_lua_key(extender);\ make_lua_key(extensible);\ +make_lua_key(hextensible);\ +make_lua_key(vextensible);\ make_lua_key(extension);\ make_lua_key(extra_space);\ make_lua_key(fam);\ @@ -863,6 +870,7 @@ make_lua_key(marginkern);\ make_lua_key(mark);\ make_lua_key(math);\ make_lua_key(math_accent);\ +make_lua_key(mathchar);\ make_lua_key(math_char);\ make_lua_key(math_char_num);\ make_lua_key(math_choice);\ @@ -905,7 +913,9 @@ make_lua_key(new_graf);\ make_lua_key(new_window);\ make_lua_key(next);\ make_lua_key(no);\ +make_lua_key(nobbox);\ make_lua_key(nolength);\ +make_lua_key(notype);\ make_lua_key(no_align);\ make_lua_key(no_expand);\ make_lua_key(no_super_sub_script);\ @@ -924,11 +934,13 @@ make_lua_key(normal);\ make_lua_key(novrule);\ make_lua_key(nucleus);\ make_lua_key(num);\ +make_lua_key(numerator);\ make_lua_key(number);\ make_lua_key(objcompression);\ make_lua_key(objnum);\ make_lua_key(oldmath);\ make_lua_key(omit);\ +make_lua_key(limits);\ make_lua_key(opdisplaylimits);\ make_lua_key(open);\ make_lua_key(oplimits);\ @@ -944,6 +956,7 @@ make_lua_key(outer_call);\ make_lua_key(outline);\ make_lua_key(output);\ make_lua_key(over);\ +make_lua_key(overdelimiter);\ make_lua_key(overlay_accent);\ make_lua_key(ownerpassword);\ make_lua_key(page);\ @@ -1046,6 +1059,7 @@ make_lua_key(rule);\ make_lua_key(save_pos);\ make_lua_key(scale);\ make_lua_key(script);\ +make_lua_key(scripts);\ make_lua_key(scriptscript);\ make_lua_key(second);\ make_lua_key(semi_simple);\ @@ -1155,6 +1169,7 @@ make_lua_key(un_hbox);\ make_lua_key(un_vbox);\ make_lua_key(undefined_cs);\ make_lua_key(under);\ +make_lua_key(underdelimiter);\ make_lua_key(unhyphenated);\ make_lua_key(units_per_em);\ make_lua_key(unknown);\ @@ -1351,11 +1366,15 @@ init_lua_key(def_font);\ init_lua_key(def_lua_call);\ init_lua_key(degree);\ init_lua_key(delim);\ +init_lua_key(delimiter);\ +init_lua_key(hdelimiter);\ +init_lua_key(vdelimiter);\ init_lua_key(delim_num);\ init_lua_key(delimptr);\ init_lua_key(delta);\ init_lua_key(demerits);\ init_lua_key(denom);\ +init_lua_key(denominator);\ init_lua_key(depth);\ init_lua_key(designsize);\ init_lua_key(dest_id);\ @@ -1403,6 +1422,8 @@ init_lua_key(extdef_math_code);\ init_lua_key(extend);\ init_lua_key(extender);\ init_lua_key(extensible);\ +init_lua_key(hextensible);\ +init_lua_key(vextensible);\ init_lua_key(extension);\ init_lua_key(extra_space);\ init_lua_key(fam);\ @@ -1552,6 +1573,7 @@ init_lua_key(marginkern);\ init_lua_key(mark);\ init_lua_key(math);\ init_lua_key(math_accent);\ +init_lua_key(mathchar);\ init_lua_key(math_char);\ init_lua_key(math_char_num);\ init_lua_key(math_choice);\ @@ -1590,7 +1612,9 @@ init_lua_key(new_graf);\ init_lua_key(new_window);\ init_lua_key(next);\ init_lua_key(no);\ +init_lua_key(nobbox);\ init_lua_key(nolength);\ +init_lua_key(notype);\ init_lua_key(no_align);\ init_lua_key(no_expand);\ init_lua_key(no_super_sub_script);\ @@ -1607,11 +1631,13 @@ init_lua_key(normal);\ init_lua_key(novrule);\ init_lua_key(nucleus);\ init_lua_key(num);\ +init_lua_key(numerator);\ init_lua_key(number);\ init_lua_key(objcompression);\ init_lua_key(objnum);\ init_lua_key(oldmath);\ init_lua_key(omit);\ +init_lua_key(limits);\ init_lua_key(opdisplaylimits);\ init_lua_key(open);\ init_lua_key(oplimits);\ @@ -1627,6 +1653,7 @@ init_lua_key(outer_call);\ init_lua_key(outline);\ init_lua_key(output);\ init_lua_key(over);\ +init_lua_key(overdelimiter);\ init_lua_key(overlay_accent);\ init_lua_key(ownerpassword);\ init_lua_key(page);\ @@ -1723,6 +1750,7 @@ init_lua_key(rule);\ init_lua_key(save_pos);\ init_lua_key(scale);\ init_lua_key(script);\ +init_lua_key(scripts);\ init_lua_key(scriptscript);\ init_lua_key(second);\ init_lua_key(semi_simple);\ @@ -1831,6 +1859,7 @@ init_lua_key(un_hbox);\ init_lua_key(un_vbox);\ init_lua_key(undefined_cs);\ init_lua_key(under);\ +init_lua_key(underdelimiter);\ init_lua_key(unhyphenated);\ init_lua_key(units_per_em);\ init_lua_key(unknown);\ @@ -2090,11 +2119,15 @@ use_lua_key(def_font); use_lua_key(def_lua_call); use_lua_key(degree); use_lua_key(delim); +use_lua_key(delimiter); +use_lua_key(hdelimiter); +use_lua_key(vdelimiter); use_lua_key(delim_num); use_lua_key(delimptr); use_lua_key(delta); use_lua_key(demerits); use_lua_key(denom); +use_lua_key(denominator); use_lua_key(depth); use_lua_key(designsize); use_lua_key(dest_id); @@ -2143,6 +2176,8 @@ use_lua_key(extdef_math_code); use_lua_key(extend); use_lua_key(extender); use_lua_key(extensible); +use_lua_key(hextensible); +use_lua_key(vextensible); use_lua_key(extension); use_lua_key(extra_space); use_lua_key(fam); @@ -2292,6 +2327,7 @@ use_lua_key(marginkern); use_lua_key(mark); use_lua_key(math); use_lua_key(math_accent); +use_lua_key(mathchar); use_lua_key(math_char); use_lua_key(math_char_num); use_lua_key(math_choice); @@ -2334,7 +2370,9 @@ use_lua_key(new_graf); use_lua_key(new_window); use_lua_key(next); use_lua_key(no); +use_lua_key(nobbox); use_lua_key(nolength); +use_lua_key(notype); use_lua_key(no_align); use_lua_key(no_expand); use_lua_key(no_super_sub_script); @@ -2353,11 +2391,13 @@ use_lua_key(normal); use_lua_key(novrule); use_lua_key(nucleus); use_lua_key(num); +use_lua_key(numerator); use_lua_key(number); use_lua_key(objcompression); use_lua_key(objnum); use_lua_key(oldmath); use_lua_key(omit); +use_lua_key(limits); use_lua_key(opdisplaylimits); use_lua_key(open); use_lua_key(oplimits); @@ -2373,6 +2413,7 @@ use_lua_key(outer_call); use_lua_key(outline); use_lua_key(output); use_lua_key(over); +use_lua_key(overdelimiter); use_lua_key(overlay_accent); use_lua_key(ownerpassword); use_lua_key(page); @@ -2475,6 +2516,7 @@ use_lua_key(rule); use_lua_key(save_pos); use_lua_key(scale); use_lua_key(script); +use_lua_key(scripts); use_lua_key(scriptscript); use_lua_key(second); use_lua_key(semi_simple); @@ -2584,6 +2626,7 @@ use_lua_key(un_hbox); use_lua_key(un_vbox); use_lua_key(undefined_cs); use_lua_key(under); +use_lua_key(underdelimiter); use_lua_key(unhyphenated); use_lua_key(units_per_em); use_lua_key(unknown); diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-core.c b/Build/source/texk/web2c/luatexdir/lua/luatex-core.c index 5cb58af6513..386023d970b 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-core.c +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-core.c @@ -129,507 +129,509 @@ int load_luatex_core_lua (lua_State * L) 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, 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, 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, + 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, 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, 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, + 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, 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, + 0x6e, 0x28, 0x29, 0x0a, 0x2d, 0x2d, 0x20, 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, 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, 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, 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, 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, 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, + 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x20, 0x3d, + 0x20, 0x6e, 0x69, 0x6c, 0x20, 0x20, 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, 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, + 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, - 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, 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, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, - 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x68, 0x65, 0x78, 0x61, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, - 0x20, 0x20, 0x20, 0x20, 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, + 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, 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, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, + 0x68, 0x65, 0x78, 0x61, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 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, 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, 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, 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, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x29, - 0x29, 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, 0x69, 0x66, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x6d, 0x64, 0x35, 0x2e, 0x73, 0x75, 0x6d, 0x48, 0x45, 0x58, 0x41, 0x20, 0x74, 0x68, - 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 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, 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, 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, 0x20, 0x20, 0x20, 0x20, 0x65, - 0x6e, 0x64, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, - 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, + 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, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x29, 0x29, 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, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6d, 0x64, 0x35, 0x2e, + 0x73, 0x75, 0x6d, 0x48, 0x45, 0x58, 0x41, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, + 0x20, 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, 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, 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, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x29, 0x29, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 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, 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, + 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, 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, 0x64, 0x6f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x73, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x20, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x79, 0x6d, 0x6c, 0x69, - 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x0a, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6e, - 0x6f, 0x77, 0x20, 0x62, 0x65, 0x20, 0x64, 0x6f, 0x6e, 0x65, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, - 0x20, 0x6c, 0x66, 0x73, 0x20, 0x28, 0x77, 0x61, 0x73, 0x20, 0x64, 0x65, 0x61, 0x64, 0x20, 0x73, - 0x6c, 0x6f, 0x77, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, - 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x66, 0x69, - 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x66, - 0x69, 0x6c, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, 0x3d, 0x20, - 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, - 0x6d, 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x20, - 0x3d, 0x3d, 0x20, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x20, 0x3d, - 0x3d, 0x20, 0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 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, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x64, - 0x69, 0x72, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x64, - 0x69, 0x72, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, 0x3d, 0x20, 0x6c, - 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, - 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x20, 0x3d, - 0x3d, 0x20, 0x22, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x22, 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, 0x2d, 0x2d, 0x20, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, - 0x65, 0x20, 0x73, 0x6f, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, - 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x6b, 0x70, 0x73, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, - 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x72, - 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, - 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 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, 0x64, 0x6f, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, + 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x79, 0x6d, + 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x20, 0x3d, + 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x20, 0x74, + 0x68, 0x65, 0x73, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x62, 0x65, 0x20, + 0x64, 0x6f, 0x6e, 0x65, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x66, 0x73, 0x20, 0x28, + 0x77, 0x61, 0x73, 0x20, 0x64, 0x65, 0x61, 0x64, 0x20, 0x73, 0x6c, 0x6f, 0x77, 0x20, 0x62, 0x65, + 0x66, 0x6f, 0x72, 0x65, 0x29, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, + 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, + 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x66, 0x69, 0x6c, 0x65, 0x28, 0x6e, 0x61, + 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x6d, 0x6f, + 0x64, 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x66, 0x69, + 0x6c, 0x65, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x6c, 0x69, 0x6e, + 0x6b, 0x22, 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, 0x69, 0x66, 0x20, 0x6e, + 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x64, 0x69, 0x72, 0x20, 0x74, 0x68, 0x65, + 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x69, 0x73, 0x64, 0x69, 0x72, 0x28, 0x6e, 0x61, 0x6d, + 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x20, 0x3d, 0x20, 0x6c, 0x66, 0x73, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x64, + 0x65, 0x22, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x64, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x22, 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, 0x2d, 0x2d, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, - 0x20, 0x61, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, - 0x20, 0x73, 0x6f, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, - 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x6b, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, - 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, - 0x69, 0x6e, 0x6b, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x79, 0x6d, - 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, - 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x29, 0x20, 0x6f, 0x72, - 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, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, - 0x2d, 0x20, 0x73, 0x6f, 0x20, 0x66, 0x61, 0x72, 0x0a, 0x0a, 0x00 + 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x68, + 0x61, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f, 0x72, 0x74, + 0x20, 0x6f, 0x66, 0x20, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, + 0x20, 0x6b, 0x70, 0x73, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, + 0x74, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x61, 0x6d, + 0x65, 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, 0x2d, 0x2d, 0x20, 0x6e, 0x6f, + 0x77, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x2e, 0x2e, + 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x66, + 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x6c, 0x66, 0x73, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x6b, 0x28, 0x6e, 0x61, + 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x79, 0x6d, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x22, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x29, 0x20, 0x6f, 0x72, 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, 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 f2d55fd99b3..5ed425a9910 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-core.lua +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-core.lua @@ -1,465 +1,466 @@ --- luatex-core security and io overloads ........... - --- if not modules then modules = { } end modules ['luatex-core'] = { --- version = 1.080, --- comment = 'companion to luatex', --- author = 'Hans Hagen & Luigi Scarso', --- copyright = 'LuaTeX Development Team', --- } - -LUATEXCOREVERSION = 1.080 -- we reflect the luatex version where changes happened - --- 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. - --- We test for functions already being defined so that we don't overload ones that --- are provided in the startup script. - -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 - - if not md5.sumhexa then - function md5.sumhexa(k) - return (gsub(sum(k), ".", function(c) - return format("%02x",byte(c)) - end)) - end - end - - if not md5.sumHEXA then - function md5.sumHEXA(k) - return (gsub(sum(k), ".", function(c) - return format("%02X",byte(c)) - end)) - 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 - -do - - local lfsattributes = lfs.attributes - local symlinkattributes = lfs.symlinkattributes - - -- these can now be done using lfs (was dead slow before) - - if not lfs.isfile then - function lfs.isfile(name) - local m = lfsattributes(name,"mode") - return m == "file" or m == "link" - end - end - - if not lfs.isdir then - function lfs.isdir(name) - local m = lfsattributes(name,"mode") - return m == "directory" - end - end - - -- shortnames have also be sort of dropped from kpse - - if not lfs.shortname then - function lfs.shortname(name) - return name - end - end - - -- now there is a target field, so ... - - if not lfs.readlink then - function lfs.readlink(name) - return symlinkattributes(name,"target") or nil - end - 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 +-- luatex-core security and io overloads ........... + +-- if not modules then modules = { } end modules ['luatex-core'] = { +-- version = 1.080, +-- comment = 'companion to luatex', +-- author = 'Hans Hagen & Luigi Scarso', +-- copyright = 'LuaTeX Development Team', +-- } + +LUATEXCOREVERSION = 1.080 -- we reflect the luatex version where changes happened + +-- 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. + +-- We test for functions already being defined so that we don't overload ones that +-- are provided in the startup script. + +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 not 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 + + debug = nil + 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 + + if not md5.sumhexa then + function md5.sumhexa(k) + return (gsub(sum(k), ".", function(c) + return format("%02x",byte(c)) + end)) + end + end + + if not md5.sumHEXA then + function md5.sumHEXA(k) + return (gsub(sum(k), ".", function(c) + return format("%02X",byte(c)) + end)) + 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 + +do + + local lfsattributes = lfs.attributes + local symlinkattributes = lfs.symlinkattributes + + -- these can now be done using lfs (was dead slow before) + + if not lfs.isfile then + function lfs.isfile(name) + local m = lfsattributes(name,"mode") + return m == "file" or m == "link" + end + end + + if not lfs.isdir then + function lfs.isdir(name) + local m = lfsattributes(name,"mode") + return m == "directory" + end + end + + -- shortnames have also be sort of dropped from kpse + + if not lfs.shortname then + function lfs.shortname(name) + return name + end + end + + -- now there is a target field, so ... + + if not lfs.readlink then + function lfs.readlink(name) + return symlinkattributes(name,"target") or nil + end + 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/luapplib/Makefile.orig b/Build/source/texk/web2c/luatexdir/luapplib/Makefile.orig index c6c1a73dd63..823c68f6bb9 100644 --- a/Build/source/texk/web2c/luatexdir/luapplib/Makefile.orig +++ b/Build/source/texk/web2c/luatexdir/luapplib/Makefile.orig @@ -49,12 +49,13 @@ PPSTATICDEPS=$(FLATELIB) # test programm PPTEST1=$(OUTDIR)/pptest1$(EXEEXT) PPTEST2=$(OUTDIR)/pptest2$(EXEEXT) +PPTEST3=$(OUTDIR)/pptest3$(EXEEXT) # includes INC=-I $(UTILSDIR) AUX=-I $(FLATEDIR) -default: md $(PPSTATICLIB) $(PPTEST1) $(PPTEST2) +default: md $(PPSTATICLIB) $(PPTEST1) $(PPTEST2) $(PPTEST3) md: @[ -d $(OUTDIR) ] || mkdir -p $(OUTDIR) @@ -80,5 +81,9 @@ $(PPTEST2): $(PPSTATICLIB) pptest2.c $(CC) $(CFLAGS) $(STATICCOPTS) -o $(OUTDIR)/pptest2$(OBJEXT) -c pptest2.c $(CC) -static-libgcc $(CFLAGS) -o $(PPTEST2) $(OUTDIR)/pptest2$(OBJEXT) $(PPSTATICLIB) $(PPSTATICDEPS) $(LIBS) +$(PPTEST3): $(PPSTATICLIB) pptest3.c + $(CC) $(CFLAGS) $(STATICCOPTS) -I util -o $(OUTDIR)/pptest3$(OBJEXT) -c pptest3.c + $(CC) -static-libgcc $(CFLAGS) -o $(PPTEST3) $(OUTDIR)/pptest3$(OBJEXT) $(PPSTATICLIB) $(PPSTATICDEPS) $(LIBS) + clean: rm -f $(OUTDIR)/*$(OBJEXT) $(OUTDIR)/*.a $(OUTDIR)/*$(EXEEXT) diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/.buildinfo b/Build/source/texk/web2c/luatexdir/luapplib/html/.buildinfo new file mode 100644 index 00000000000..13665a90458 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 96901ec9cd68906e4f139a0be4b45fcc +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppapi.rst.txt b/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppapi.rst.txt new file mode 100644 index 00000000000..83a5b0fc370 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppapi.rst.txt @@ -0,0 +1,937 @@ + +``pplib`` +========= + +``pplib`` is a library for raw PDF access. It parses PDF documents and provides an interface to access document structures in C. + +C-API +===== + +Types +----- + +``pplib`` defines several C-types to represent PDF types: + +- ``ppint`` - signed integer (``int64_t``) +- ``ppnum`` - real number (double) +- ``ppname`` - PDF name +- ``ppstring`` - PDF string +- ``pparray`` - PDF array +- ``ppdict`` - PDF dict +- ``ppstream`` - PDF stream +- ``ppref`` - PDF indirect reference +- ``ppobj`` - a container of all above + +Among ``ppint`` and ``ppnum``, we also use ``ppuint`` - unsigned integer (machine word, alias to ``size_t``). + +Other API types: + +- ``ppdoc`` - PDF document +- ``ppxref`` - cross-references table +- ``ppcontext`` - ... later +- ``pprect`` - rectangle +- ``ppmatrix`` - matrix + +Integer, number, name and string are treated as simple types. +Names and strings are actually C-structures, but exposed to API as typedefs to ``const char *``. +Other types (array, dict, stream, reference, object container, xref, PDF) are C-structures, +and you operate it their pointers. So when you declare a simple type variable you say:: + + ppuint u; + ppnum n; + ppname name; + ppstring string; + ... + +And when you declare a compound type you operate on pointers:: + + ppobj *obj; + pparray *array; + ppdict *dict; + ppstream *stream; + ppref *ref; + ppdoc *pdf; + +Some of those C-types are defined in library header ``ppapi.h`` (complete types). Some others are incomplete +(eg. you can't say ``sizeof(ppdoc)`` or ``sizeof(ppxref)``). This is to avoid unnecesary dependencies in +the header. [At some points it's not clear to me what to hide and what to expose, will see.] The library itself +uses ``pplib.h`` but for auxilary applications including a standalone ``ppapi.h`` header should be enough. + +``pplib`` was designed having **read-only** PDF access in mind. Even if some structure is completelly exposed, +so that you can directly access its members, you should treat them as read-only. I don't make them ``const`` because +then all variable declarations would need to be ``const``, which is annoying, and I'd need some trickery in the library +internals to unconst. Besides, nothing is really const for C type casts. + +Object +------ + +A common container for all elementary PDF object types is ``ppobj`` structure. ``ppobj`` has a type identifier +(integer) and union of values:: + + struct ppobj { + ppobjtp type; + union { + ppint integer; + ppnum number; + ppname name; + ppstring string; + pparray *array; + ppdict *dict; + ppstream *stream; + ppref *ref; + void *any; + }; + }; + +Object type is one of constants (enum):: + + PPNONE + PPNULL + PPBOOL + PPINT + PPNUM + PPNAME + PPSTRING + PPARRAY + PPDICT + PPSTREAM + PPREF + +The type determines the structure member you're allowed to access:: + + ppobj *obj; + ... + switch (obj->type) + { + case PPNONE: // shouldn't actually happen, indicates some failure + break; + case PPNULL: // valid PDF null object, no value + break; + case PPBOOL: // do something with obj->integer (ppint), value 0 or 1 + break; + case PPINT: // do something with obj->integer (ppint) + break; + case PPNUM: // do something with obj->number (ppnum) + break; + case PPNAME: // do something with obj->name (ppname) + break; + case PPSTRING: // do something with obj->string (ppstring) + break; + case PPARRAY: // do something with obj->array (pparray *) + break; + case PPDICT: // do something with obj->dict (ppdict *) + break; + case PPSTREAM: // do something with obj->stream (ppstream *) + break; + case PPREF: // do something with obj->ref (ppref *) + break; + } + +More often then not you know exactly what type of object value is expected, in which case +you may use one of the following macros:: + + // returns 1 if o->type is PPNULL + int ppobj_get_null(o) \ + + // if o->type is PPBOOL, sets int v to 0 or 1 and returns 1, 0 otherwise + int ppobj_get_bool(o, v) + + // if o->type is PPINT, sets ppint v and returns 1, 0 otherwise + int ppobj_get_int(o, v) + + // if o->type is PPINT and >= 0, sets ppuint v and returns 1, 0 otherwise + int ppobj_get_uint(o, v) + + // if o->type is PPNUM or PPINT, sets ppnum v and returns 1, 0 otherwise + int ppobj_get_num(o, v) + + // if o->type is PPNAME returns the name, NULL otherwise + ppname ppobj_get_name(o) + + // if o->type is PPSTRING returns the string, NULL otherwise + ppstring ppobj_get_string(o) + + // if o->type is PPARRAY returns the array, NULL otherwise + pparray * ppobj_get_array(o) + + // if o->type is PPDICT returns the dict, NULL otherwise + ppdict * ppobj_get_dict(o) + + // if o->type is PPSTREAM returns the stream, NULL otherwise + ppstream * ppobj_get_stream(o) + + // if o->type is PPREF returns the reference, NULL otherwise + ppref * ppobj_get_ref(o) + +Note the coercion from integer to real number, but not reverse. In practise, whenever you expect a real number, +you should also handle integer (eg. '1' used instead of '1.0'). + +It is a common case that the object is given as an indirect reference, but what you actually +want is not the reference, but the object referred by it. Here is a helper for it:: + + // if o->type is PPREF, returns what the reference points, otherwise returns o + ppobj * ppobj_rget_obj(o) + +Also every ``ppobj_get_*`` macro has ``ppobj_rget_*`` counterpart that makes a check +for the expected type, but if the object is PPREF, it jumps to the target object. +So for example ``ppobj_rget_dict(obj)`` will return dict if ``obj`` is of type PPDICT +or if it is of type PPREF and ``obj->ref`` hosts an object of type PPDICT. + +Names +----- + +PDF names are represented as ``ppname``. +I find it convenient to have ``ppname`` type pretending ``const char *``. This allows to use ``ppname`` +in all C-style string functions like ``printf("%s", name)``. + +Be aware, however, that ``ppname`` is actually a C-structure. It is perfectly ok to cast ``ppname`` to ``const char *``:: + + ppname name; + ... + (const char *)name; + +But reverse is forbidden:: + + const char *cstr = "cstring"; + ... + (ppname)cstr; // expect segmentation fault soon + +For convenient use in C, names are ``'\0'`` terminated. But to get the length of name better always use +``ppname_size()`` macro. ``ppname`` object knows its size, don't use ``strlen()``:: + + size_t ppname_size(ppname name); // macro, returns length of name in bytes + +In current implementation names are not hashed anyhow, so name-to-name comparison is not smarter than ``memcmp()``. +Use macros:: + + int ppname_is(ppname name, "literal"); // to compare ppname with C-literal string + int ppname_eq(ppname name, ppname other); // to compare ppname with a different name + +If you'll use ``pplib`` to parse contents streams, you may need to distinguish names from operators +(more precisely executable names). Names in PDF are preceeded by '/', executable names aren't. In both +cases PDF parser will produce ``ppname`` but can be distingushed with:: + + int ppname_exec(ppname name); // returns non-zero if name is executable + +Names are kept in their raw form, with possible PDF specific escapes (in text below we call it **encoded** form). +Leading '/' is omitted, though. One may need a decoded name, with no PDF escapes. +A pair of functions provides a simple interface to switch between those two forms:: + + ppname ppname_decoded (ppname name); // returns decoded (unescaped) form of the name + ppname ppname_encoded (ppname name); // returns encoded (escaped) form of the name + +In pretty most cases PDF names contains only letters (no special characters, no escapes), so decoded and encoded forms are identical. +In that case both functions simply return the argument. It is ok to call ``ppname_decoded()`` on already decoded form +and ``ppname_encoded()`` on already encoded form. Both forms are produced by PDF objects parser, so accessing ``ppname`` alter ego +in whatever direction needs no extra decoding or allocation costs. + +String +------ + +PDF strings have the same internal construction as names, so most of names description above applies to strings as well. +``ppstring`` is a typedef of ``const char *``, roughly ``'\0'`` terminiated C-string. To get the size of the string:: + + size_t ppstring_size(ppstring string); // macro, returns the length of the string in bytes + +Strings are provided in their raw form, preserving PDF specific escapes, but with no +``()`` or ``<>`` delims. To distinguish plain strings from hex strings:: + + int ppstring_hex(ppstring string); // macro, returns non zero if hex string + +Or if you prefer:: + + switch (ppstring_type(string)) + { + case PPSTRING_PLAIN: // literal string, surrounded by ``(`` and ``)`` in PDF + break; + case PPSTRING_BASE16: // hex string, surrounded by ``<`` and ``>`` in PDF + break; + case PPSTRING_BASE85: // base85 string surrounded by ``<~`` and ``~>`` in PDF + break; + } + +The last is actually Postscript specific, not used in PDF, but I think it might appear in contents streams... +No matter how the string is given in PDF (plain or hex), here are two functions to +switch between encoded and decoded strings forms:: + + ppstring ppstring_decoded (ppstring string); // returns decoded string possibly with PDF escapes + ppstring ppstring_encoded (ppstring string); // returns encoded string with no PDF escapes + +For hex strings, encoded form contains hex digits, while decoded form contains arbitrary bytes (the result of hex decoding). +Plain strings usually contains printable ASCII characters, but they might contain any binary data. +As with names, objects parser produces both forms. The raw form with PDF escapes (or raw hex form) is considered the main one. +Eg. when you access ``obj->string`` you always get the encoded form. At any moment you can switch to its alter ego. + +No matter if the string is plain or hex, if its first two bytes (decoded) are UTF16 BOM, the string +is considered unicode. ``ppstring`` object *knows* it is unicode or not:: + + switch (ppstring_utf(string)) + { + case PPSTRING_UTF16LE: // unicode string, utf16le + break; + case PPSTRING_UTF16BE: // unicode string, utf16be + break; + default: // no unicode + } + +Or simply:: + + if (ppstring_utf(string) != 0) { + // handle unicode string + } + +If the string is unicode, BOM remains the part of the string -- ``pplib`` parser does not strip it. +Unicode or not, encoded or decoded, strings are always C-arrays of bytes and ``ppstring_size()`` +always returns the size in bytes. + +Array +----- + +PDF arrays are represented as ``pparray`` type, which is C-array of ``ppobj`` structures. +To get the size:: + + size_t pparray_size(pparray *array) // macro, returns the number of array items + +To get ``ppobj *`` at a given index:: + + ppobj * pparray_at(array, index) // macro, returns ppobj * (no index check) + ppobj * pparray_get(array, index) // macro, returns ppobj * or NULL (with index check) + ppobj * pparray_get_obj (pparray *array, size_t index); // function equiv to pparray_get() + +Iterating over array elements:: + + pparray *array; + size_t index, size; + ppobj *obj; + for (size = pparray_size(array), pparray_first(array, index, obj); index < size; pparray_next(index, obj)) + { + // do something with index and obj + } + +There is no magic first/next macros, just iteration over pointers. One could also use something like:: + + for (index = 0, size = array->size; index < size; ++index) + { + obj = pparray_at(array, index); + // do something with index and obj + } + +When getting values from array and expecting a result of known type, use one of the following:: + + int pparray_get_bool (pparray *array, size_t index, int *v); // get boolean value + int pparray_get_int (pparray *array, size_t index, ppint *v); // get ppint value + int pparray_get_uint (pparray *array, size_t index, ppuint *v); // get ppuint value + int pparray_get_num (pparray *array, size_t index, ppnum *v); // get ppnum value + ppname pparray_get_name (pparray *array, size_t index); // get ppname value + ppstring pparray_get_string (pparray *array, size_t index); // get ppstring value + pparray * pparray_get_array (pparray *array, size_t index); // get pparray * value + ppdict * pparray_get_dict (pparray *array, size_t index); // get ppdict * value + ppref * pparray_get_ref (pparray *array, size_t index); // get ppref * value + +As with ``ppobj_get_*`` suite, numeric types getters set the value of a given type and returns 1, if the type matches. +Otherwise sets nothing and returns 0. Other getters return the value if the type matches, or NULL. + +Every function from ``pparray_get_*`` suite have its ``pparray_rget_*`` counterpart that +that dereferences indirect objects (as explained for ``ppobj_rget_*`` getters). Note that +there is no ``pparray_get_stream()`` function, as streams in PDF are always indirect. +To get the stream from array use:: + + ppstream * pparray_rget_stream (pparray *array, size_t index); + +Dict +---- + +PDF dicts are represented as ``ppdict`` structure, which is C-array of ``ppobj`` with parallel +C-array of ``ppname`` pointers. To get the size of a dict:: + + size_t ppdict_size(ppdict *dict) // macro, returns the number of key-val pairs + +To get the value at a given index (integer):: + + ppobj * ppdict_at(ppdict *dict, index) // macro, no index check + +To get the name (key) at a given index:: + + ppname ppdict_key(ppdict *dict, index) // macro, no index check + +To iterate over dict key-val pairs:: + + ppdict *dict; + ppname *pkey; + ppobj *obj; + + for (ppdict_first(dict, pkey, obj); *pkey != NULL; ppdict_next(pkey, obj)) + { + // do something with *pkey and obj + } + +There is no magic in first/next macros, just iteration through keys and values lists pointers. +For convenient iteration, a list of keys is terminated with NULL, so in the code above ``*pkey != NULL`` +is used as the loop condition. One may also iterate via indices:: + + ppdict *dict; + size_t index, size; + ppname key; + ppobj *obj; + for (index = 0, size = ppdict_size(dict); index < size; ++index) + { + key = ppdict_key(dict, index); + obj = ppdict_at(dict, index); + // do something with key and obj + } + +To get the object associated with a given name, use one of the following:: + + ppobj * ppdict_get_obj (ppdict *dict, const char *name); + int ppdict_get_bool (ppdict *dict, const char *name, int *v); + int ppdict_get_int (ppdict *dict, const char *name, ppint *v); + int ppdict_get_uint (ppdict *dict, const char *name, ppuint *v); + int ppdict_get_num (ppdict *dict, const char *name, ppnum *v); + ppname ppdict_get_name (ppdict *dict, const char *name); + ppstring ppdict_get_string (ppdict *dict, const char *name); + pparray * ppdict_get_array (ppdict *dict, const char *name); + ppdict * ppdict_get_dict (ppdict *dict, const char *name); + ppref * ppdict_get_ref (ppdict *dict, const char *name); + +Note that all getters accepts ``const char *`` as key, so it is ok to say:: + + ppdict_rget_dict(dict, "Resources"); + +as well as:: + + ppdic_rget_dict(dict, name); // ppname name + +Every ``ppdict_get_*`` getter has ``ppdict_rget_*`` counterpart that dereferences +indirect objects if necessary. Note that there is no ``ppdict_get_stream()`` function, +but there is:: + + ppstream * ppdict_rget_stream (ppdict *dict, const char *name); + +So far dicts comes with no names mapping, so by-name dict accessors perform a linear search +through the keys list. PDF dicts are usually small, so it is fast enough. +Building names lookup for every dict in PDF makes no sense I think, as ``pplib`` applications +will query just several dicts I guess.. However, some apps may extensively query +resources, which may refer to hundreds of objects (eg. images). So some mapping for dicts +is still considered. + +Stream +------ + +PDF streams are represented as ``ppstream`` objects. To get the stream dict:: + + ppdict * ppstream_dict(ppstream *stream) // macro + +To read the stream data:: + + uint8_t * ppstream_first (ppstream *stream, size_t *size, int decode); + uint8_t * ppstream_next (ppstream *stream, size_t *size); + void ppstream_done (ppstream *stream); + +Both ``first` and ``next`` functions return a chunk of stream data and sets the ``size`` of the chunk. +``decode`` parameter tell the reader to decompress the stream (1) or return raw (0). A call to ``ppstream_next()`` +must be preceeded by ``ppstream_first()``. Once you're done with the stream, you have to call ``ppstream_done()``, +no matter if the stream has been read to the end or not. The stream data iterator in use:: + + uint8_t *data; + size_t size; + ppstream *stream; + int decode = 1; // 1 - get decompressed, 0 - get raw + + for (data = ppstream_first(stream, &size, decode); data != NULL; data = ppstream_next(stream, &size)) + { + // do something with data and its size + } + ppstream_done(stream); + +Every subsequent iterator call invalidates the previous reader output, so you have to utilize the returned chunk +of data just after you ot that. So the following is wrong:: + + data1 = ppstream_first(stream, &size, 1); + data2 = ppstream_next(stream, &size); + data3 = ppstream_next(stream, &size); + some_output(data1, size); + some_output(data2, size); + +The reader calls usually return the same pointer to internal buffer, just filled with a different data. +``pplib`` allocates reasonably large buffer and fills that buffer on subsequent calls to the reader. + +If the source stream has no compression, using both ``decode == 1`` and ``decode == 0`` should give the same result. +You can check if the stream is actually compressed with:: + + ppstream_compressed(stream) // macro, returns non zero if /Filter is present + +It might be necessary to load the entire stream data at once:: + + uint8_t * ppstream_all (ppstream *stream, size_t *size, int decode); + +If the initial buffer size is insufficient, it grows until the entire stream data is loaded. You must call +``ppstream_done(stream)`` after using returned data. + +``ppstream_done()`` doesn't invalidate the stream object, it just closes its internal reader. +The stream itself remains a valid object (eg. one can read it again if necessary), +but the reader buffer is released. It is actually not freed but kept for future the reuse with that on some other stream, +but you still need to mark it ready for reuse to avoid allocating a separate buffer for every stream you're going to read. + +Stream data readers will return ``NULL`` if you haven't close the previous reader process with ``ppstream_done()``. All below is wrong:: + + data1 = ppstream_all(stream, &size, 1); + data2 = ppstream_all(stream, &size, 1); // data2 == NULL + // or + data1 = ppstream_first(stream, &size, 1); + data2 = ppstream_first(stream, &size, 1); // data2 == NULL + // or + data1 = ppstream_first(stream, &size, 1); + data2 = ppstream_all(stream, &size, 1); // data2 == NULL + +To avoid unnecessary dependencies, ``pplib`` does not support image filters (``/DCT``, ``/JPX``, ``/JBIG``, ``/CCITT``). +But it is ok to read the stream with ``decode`` set to 1 on such streams. ``pplib`` assumes that the image is the +final/target stream form and just returns it as-is. Eg. in the case of JPEG (``/DCT`` filtered) image both calls should +give the same results:: + + ppstream_all(jpegstream, &jpegsize, 0); // don't decode, return what's there + ppstream_all(jpegstream, &jpegsize, 1); // decode but found image filter, effectively the same + +A bit more about streams memory. As mentioned, ``pplib`` allocates buffers for stream readers. After ``ppstream_done()``, +the stream no longer *owns* the buffer space. But the buffer may remain allocated, to be reused with future readers. +``pplib`` keeps a pool of several buffers. This means, that when you use stream readers, ``pplib`` eats +some memory (1MB or so) that is not freed, even if no streams are used. And even if you free all objects. +If you suffer from this, you can optionally use a pair of functions:: + + void ppstream_init_buffers (void); + void ppstream_free_buffers (void); + +The first initializes buffers pool, unless done so far. Currently ``pplib`` cares of it before opening every stream reader, +so it is not obligatory. The second frees a pool of buffers. The intended use is to call ``ppstream_init_buffers()`` once +as kind of library initializer and to call ``ppstream_free_buffers()`` once, as the library finalizer. + +Filters +------- + +In version v1.00 (20190916) ``ppstream`` API has been extended with filters information. +``ppstream`` knows its filter(s) and keps it as ``stream->filter``:: + + // ppstream *stream; + ppstream_filter *info = &stream->filter; + +``ppstream_filter`` is the following structure:: + + typedef struct { + ppstreamtp *filters; // c-array of filter identifiers (enum integers) + ppdict **params; // c-array of ppdict pointers + size_t count; // number of filters, length of the arrays (typically 1) + } ppstream_filter; + +If ``count > 0`` then ``filters`` member is not NULL. Filters array keeps integer constants:: + + PPSTREAM_BASE16 /* /ASCIIHexDecode */ + PPSTREAM_BASE85 /* /ASCII85Decode */ + PPSTREAM_RUNLENGTH /* /RunLengthDecode */ + PPSTREAM_FLATE /* /FlateDecode */ + PPSTREAM_LZW /* /LZWDecode */ + PPSTREAM_CCITT /* /CCITTFaxDecode */ + PPSTREAM_DCT /* /DCTDecode */ + PPSTREAM_JBIG2 /* /JBIG2Decode */ + PPSTREAM_JPX /* /JPXDecode */ + PPSTREAM_CRYPT /* /Crypt */ + +Params array keeps corresponding filter parameters (``/DecodeParms``) if present. ``params`` member is not NULL +if ``count > 0`` and the stream dict has ``/DecodeParms`` entry. Even if ``params`` is there, +for every N-th filter, ``params[N]`` may be NULL (corresponding to PDF ``null``). + +``stream->filter`` keeps the source stream filter information, which may not correspond to the result of stream readers +(``ppstream_first()``, ``ppstream_next()``, ``ppstream_all()``). The get the filters info relevant to the result from readers:: + + void ppstream_filter_info (ppstream *stream, ppstream_filter *info, int decode); + +The function fills ``ppstream_filter`` structure according to the expected result from stream readers (example 3 shows +how to use it to reconstruct ``/Filter`` and ``/DecodeParms`` when copying the stream to some other PDF). + +To convert filter identifier (``ppstreamtp``) to a corresponding PDF filter name:: + + const char * ppstream_filter_name[]; + +To covert ``ppname`` to filter identifier:: + + int ppstream_filter_type (ppname filtername, ppstreamtp *filtertype); + // returns 1 and sets filtertype if filtername is the proper filter name + +Additional information about the stream can be fetched from macros:: + + ppstream_compressed(stream) /* stream->flags & (PPSTREAM_FILTER|PPSTREAM_IMAGE) */ + ppstream_filtered(stream) /* stream->flags & PPSTREAM_FILTER */ + ppstream_image(stream) /* stream->flags * PPSTREAM_IMAGE */ + +``stream->flags`` is a binary sum of the following:: + + PPSTREAM_FILTER /* set iff the stream filters list has one of: BASE16, BASE85, RUNLENGTH, FLATE, LZW */ + PPSTREAM_IMAGE /* set iff the stream filters list has one of: CCITT, DCT, JBIG2, JPX */ + PPSTREAM_ENCRYPTED /* set iff the stream is encrypted */ + PPSTREAM_ENCRYPTED_OWN /* set iff the stream has own CRYPT filter */ + +Note that ``PPSTREAM_COMPRESSED`` is not there any longer, use ``ppstream_compressed()`` instead. +And there is some more, see ``ppapi.h``. + +Ref +--- + +Indirect objects are represented as ``ppref`` structure. To get the object that the +reference refers to:: + + ppobj * ppref_obj(ppref *ref) // macro + +``ppref`` structure also keeps the reference number and version, a pointer to cross reference table it belongs +to and others, but I guess you won't need anything but the referenced object. ``pplib`` parser resolves references +on-fly. So if there is a dict with indirect objects:: + + << + /Type /Page + /Resources 123 0 R + ... + >> + +the parser will produce ``ppdict`` with ``Resources`` key pointing the proper ``ppref *`` value. +If you need more, access ``ppref`` members:: + + struct ppref { + ppobj object; // target object + ppuint number, version; // identifiers + size_t offset; // file offset (useless for you, may be zero for compressed objects) + ppuint length; // the length of the original object data + ppxref *xref; // cross reference table it belongs to + }; + + +XRef +---- + +Cross reference table is exposed as ``ppxref`` (incomplete type, you can only oprate on its pointer). +To get top document xref:: + + ppxref * ppdoc_xref (ppdoc *pdf); + +To get previous (older) xref:: + + ppxref * ppxref_prev (ppxref *xref); + +To find an object of a given refnumber:: + + ppref * ppxref_find (ppxref *xref, ppuint refnumber); + +[Note: since pplib v0.98 in case of documents with incremental update, ``ppxref_find()`` returns +the newest available version of a given object rather than the object in a given body.] + +PDF +--- + +PDF document is represented as ``ppdoc`` structure (incomplete type, you can only operate on its pointer). +To load a document from file:: + + ppdoc * ppdoc_load (const char *filename); + +To load a document from memory data:: + + ppdoc * ppdoc_mem (const void *data, size_t size); + +The data is assumed to be a buffer allocated with ``malloc`` - it is freed when destroying ``ppdoc``. + +Both loaders returns ``NULL`` on failure. + +To free ``ppdoc`` and all objects it refers to:: + + void ppdoc_free (ppdoc *pdf); + +So far we haven't mention about any explicit object reclaimers. There are no dedicated ``free`` functions +for other objects. You don't allocate or free objects yourself. ``ppdoc`` object is an owner of all +beings it refers to. It also means that every object described so far is alive as long as the containing +``ppdoc`` is alive. + +To access main PDF dicts:: + + ppdict * ppdoc_trailer(ppdoc *pdf); // returns top xref trailer dict + ppdict * ppdoc_catalog(ppdoc *pdf); // returns catalog referred from the trailer + ppdict * ppdoc_info(ppdoc *pdf); // returns info dict referred from the trailer + +To get the PDF version:: + + const char * ppdoc_version_string (ppdoc *pdf); // version string + int ppdoc_version_number (ppdoc *pdf, int *minor); // minor and major numbers + +To get the file size of the source PDF document:: + + size_t ppdoc_file_size (ppdoc *pdf); + +To get the number of objects in all xrefs:: + + ppuint ppdoc_objects (ppdoc *pdf); + +To get the approx usage of memory:: + + size_t ppdoc_memory (ppdoc *pdf, size_t *waste); + +Encryption +---------- + +``pplib`` handles encrypted (password protected) documents. If a document is encrypted, most of strings and streams are ciphered. +In that form they are unreadable and rather useless, you can't even rewrite such strings/streams as-is to a different PDF output. +It is a common practise to *protect* documents with an empty password. Such documents remain readable in Acrobat (just opens them without prompting +for a password), but some features (eg. printing) may restricted by the application. + +When ``pplib`` detects encryption, it follows Acrobat approach and first tries an empty password. If it succeeds, ``pplib`` proceeeds normally, providing +an access to decrypted strings and streams, as if they weren't ciphered. If the document is protected with non-empty password, ``pplib`` gives +a way to provide a password and proceed. Until you provide a password, ``ppdoc`` object returned by ``ppdoc_load()`` function has all object wntries +set to ``null``. + +After loading a document you should check encryption status with:: + + ppcrypt_status ppdoc_crypt_status (ppdoc *pdf); + +``ppcrypt_status`` (integer) may have the following values: + + ``PPCRYPT_NONE`` - no encryption, go ahead + ``PPCRYPT_DONE`` - encryption present but password succeeded, go ahead + ``PPCRYPT_PASS`` - encryption present, need non-empty password + ``PPCRYPT_FAIL`` - invalid or unsupported encryption (eg. undocumented in pdf spec) + +If a password is needed, you can provide one with:: + + ppcrypt_status ppdoc_crypt_pass (ppdoc *pdf, const void *userpass, size_t userpasslength, + const void *ownerpass, size_t ownerpasslength); + +Well, yes, there are actually two passwords in encrypted documents. Relation between them is obscure to me, but enough +to know that having one of them is enough to decrypt the document. If you know the password, you probably mean +``userpass``, in which case you should put ``NULL`` as ``ownerpass``. The function returns ``PPCRYPT_DONE`` if the password +succeeds and the previous status otherwise. Your custom loader function may look like that:: + + ppdoc *pdf; + pdf = ppdoc_load("file.pdf"); + if (pdf == NULL) + return NULL; + switch (ppdoc_crypt_status(pdf)) + { + case PPCRYPT_NONE: + case PPCRYPT_DONE: + return pdf; + case PPCRYPT_PASS: + if (ppdoc_crypt_pass(pdf, "dummy", 5, NULL, 0) == PPCRYPT_DONE || + ppdoc_crypt_pass(pdf, NULL, 0, "dummy", 5) == PPCRYPT_DONE) + return pdf; + printf("sorry, password needed\n"); + ppdoc_free(pdf); + return NULL; + case PPCRYPT_FAIL: + printf("sorry, encryption failed\n"); + ppdoc_free(pdf); + return NULL; + } + +[If you get ``PPCRYPT_FAIL`` it might mean *I failed*, so treat as a bug.] + +If you'd like to know what permissions are given/restricted to encrypted document:: + + ppint ppdoc_permissions (ppdoc *pdf); + +Returned value can be queried with the following binary flags (you can verify with Acrobat *File -> Properties -> Security* tab):: + + PPDOC_ALLOW_PRINT // printing + PPDOC_ALLOW_MODIFY // filling form fields, signing, creating template pages + PPDOC_ALLOW_COPY // copying, copying for accessibility + PPDOC_ALLOW_ANNOTS // filling form fields, copying, signing + PPDOC_ALLOW_EXTRACT // contents copying for accessibility + PPDOC_ALLOW_ASSEMBLY // (no effect) + PPDOC_ALLOW_PRINT_HIRES // (no effect) + +``pplib`` does absolutelly nothing with permissions, it cares only to decrypt the document. As mentioned, encryption applies to strings +and streams. ``pplib`` decrypt strings when parsing document objects, so the result you get is *normal* (not ciphered). +Streams are decrypted whenever you access them. Even if you ask for a raw stream data, you'll get a raw (compressed) stream, but decrypted. +So except the check to ``ppdoc_crypt_status()``, you shouldn't bother about encryption. + +In encrypted documents most of streams are encrypted. To check if a given stream is encrypted:: + + ppstream_encrypted(stream) // macro, returns non-zero if encrypted + +Encryption is independent from compression, don't confuse with ``ppstream_compressed()`` + +Pages +----- + +Several helpers to deal with pages. To get the number of pages:: + + ppuint ppdoc_page_count (ppdoc *pdf); + +To access the root pages tree node:: + + ppref * ppdoc_pages(ppdoc *pdf); + +To get the page reference at a given index:: + + ppref * ppdoc_page (ppdoc *pdf, ppuint index); + +``index`` is a page number. First page has number 1. For index out of bounds ``ppdoc_page()`` returns NULL. +Iterating over pages using index from 1 to ``ppdoc_page_count()`` and calling ``ppdoc_page()`` on each iteration +would be suboptimal. Here is a dedicted iterator for this:: + + ppref * ppdoc_first_page (ppdoc *pdf); + ppref * ppdoc_next_page (ppdoc *pdf); + +The iterator in use:: + + ppdoc *pdf; + ppref *ref; + ppdict *dict; + int pageno; + + pdf = ppdoc_load("file.pdf"); + for (ref = ppdoc_first_page(pdf), pageno = 1; ref != NULL; ref = ppdoc_next_page(pdf), ++pageno) + { + dict = ppref_obj(obj)->dict; // take for granted it is a dict + // do something with the page dict + } + +Functions related to pages return ``ppref *`` ensured to contain dict object, so you don't need sanity +type checks here. + +Contents +-------- + +PDF page contents can be given as a stream or array of streams. Here is a convenience iterator over page +contents streams:: + + ppstream * ppcontents_first (ppdict *dict); + ppstream * ppcontents_next (ppdict *dict, ppstream *stream); + +A complete example of contents stream parser use is given below (example 2). +But before we get there, we need to introduce ``ppcontext`` object. Conceptually, +``ppcontext`` is an owner (memory handler) of objects created on demand (beyond the ``ppdoc``). +So far used only with contents stream parser, which might produce quite some data that we want +to release just after used. To create a new context:: + + pcontext * ppcontext_new (void); + +It initializes a new context and its internal memory heap, taking about 64kB on start. After that, +the context is ready to produce objects (contents parsing functions below). Once objects produced +from a given context are no longer needed:: + + void ppcontext_done (ppcontext *context); + +It restores the context to its initial state, as after ``ppcontext_new()``. It means that the context +is ready to produce another bunch of beings (in the example below, all objects from the next page contents). +Once the context is not needed anymore:: + + void ppcontext_free (ppcontext *context); + +Now, contents stream parser functions take the context as an argument. Iterator form of contents stream parser +that allows to process the contents operator by operator:: + + ppobj * ppcontents_first_op (ppcontext *context, ppstream *stream, size_t *psize, ppname *pname); + ppobj * ppcontents_next_op (ppcontext *context, ppstream *stream, size_t *psize, ppname *pname); + +Returned ``ppobj *`` is a pointer to operands list. ``*psize`` is the number of operands on stack. +The operator itself is stored as ``*pname``. + +To parse the entire contents stream at once with no stop at every operator:: + + ppobj * ppcontents_parse (ppcontext *context, ppstream *stream, size_t *psize); + +Returns probably quite long list of all parsed objects (operands and operatos) in one piece. +The number of objects is stored to ``*psize``. + +[Contents may contain so called inline images, that breaks a simple scheme of operands / operator syntax:: + + BI ID EI + +Contents parser treats this genuine triplet as a single piece, producing two operands (dict and string) +followed by ``EI`` operator name.] + +Boxes +----- + +Boxes (rectangles) in PDF are roughly 4-number arrays, but with a special intent. +``pplib`` provides a basic interface for these special arrays:: + + typedef struct { + ppnum lx, ly, rx, ry; + } pprect; + +This type is used only by helper functions - PDF parser is not aware of the rectangle type. +To convert ``pparray`` to ``pprect``:: + + pprect * pparray_to_rect (pparray *array, pprect *rect); // returns rect or NULL + +In example:: + + pprect rect; + if (pparray_to_rect(array, &rect) != NULL) + ; // do something with rect + +To get some image bounding box:: + + pprect * ppdict_get_rect (ppdict *dict, const char *name, pprect *rect); + // eg. ppdict_get_rect(imagedict, "BBox", &rect) + +To get some page box:: + + pprect * ppdict_get_box (ppdict *dict, const char *name, pprect *rect); + // eg. ppdict_get_box(pagedict, "MediaBox", &rect) + +The later not only checks the pagedict, but also goes through parent page nodes. + +Transforms +---------- + +Transformations are given as 6-number arrays, but with a special intent. +``pplib`` provides a basic interface for these special arrays:: + + typedef struct { + ppnum xx, xy, yx, yy, x, y; + } ppmatrix; + +This type is used only by helper functions - PDF parser is not aware of the matrix type. +To convert ``pparray`` to ``ppmatrix``:: + + ppmatrix * pparray_to_matrix (pparray *array, ppmatrix *matrix); + +In example:: + + ppmatrix matrix; + if (pparray_to_matrix(array, &matrix) != NULL) + ; // do something with matrix + +To get the matrix from dict:: + + ppmatrix * ppdict_get_matrix (ppdict *dict, const char *name, ppmatrix *matrix); + // eg. ppdict_get_matrix(imagedict, "Matrix", &matrix) + +Errors handling +--------------- + +``pplib`` is not verbose, but might happen that it needs to log some error message, eg. when parsing +of some PDF boject fails due to invalid offsets. By default, ``pplib`` prints the message to stdout, eg.:: + + invalid 123 0 R object at offset 123123 + +To replace the default logger, you can provide your own:: + + void pplog_callback (pplogger_callback logger, void *alien); + +``pplogger_callback`` is a function:: + + void your_callback (const char *message, void *alien); + +In example, to redirect messages to stderr you may define a function:: + + void your_callback (const char *message, void *alien) + { + fprintf((FILE *)alien, "\nooops: %s\n", message); + } + +Then set the callback somewhere before loading documents:: + + pplog_callback(your_callback, stderr); + +(example 2 uses that). + +To set the default log messages prefix, eg. ``pplib:``, use:: + + int pplog_prefix (const char *prefix) + +Default is empty. The function succeeds if provided prefix is reasonably short (less then 32 bytes). diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppcode.rst.txt b/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppcode.rst.txt new file mode 100644 index 00000000000..06f5659c6b0 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppcode.rst.txt @@ -0,0 +1,64 @@ +Examples +======== + +Example 1 +--------- + +.. literalinclude:: ../pptest1.c + +Example 2 +--------- + +.. literalinclude:: ../pptest2.c + +Example 3 +--------- + +.. literalinclude:: ../pptest3.c + +ppapi.h +------- + +.. literalinclude:: ../ppapi.h + + +Changes +======= + +v0.97 +----- +First release integrated with luatex sources, plus portability changes from Luigi. + +v0.98 +----- +Changed references resolving in case of incremental updates; tech notes ppxref_find() in ppxref.c. + +v0.99 +----- +Fixed streams handling; null characters should NOT be gobbled after "stream" keyword + +v1.00 +----- +Fixed streams handling (Luigi); object streams updated before other streams +Revised streams handling, ppstream API extended + +v1.01 +----- +Fixed names handling (thanks Hans); digits after '#' weren't skipped + +v1.02 +----- +Fixed page finder (thanks Luigi) + +v1.03 +----- +Fixed TIFF predictor (thanks folks) + +v1.04 +----- +Fixed TIFF predictor for ARM + +TODO +==== +- external streams (egzotic) + diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/pplib.rst.txt b/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/pplib.rst.txt new file mode 100644 index 00000000000..9cf1e996bb2 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_sources/pplib.rst.txt @@ -0,0 +1,13 @@ +.. pplib documentation master file, created by + sphinx-quickstart on Thu Jun 07 14:23:51 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +pplib +===== + +.. toctree:: + :maxdepth: 2 + + ppapi + ppcode diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/ajax-loader.gif b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/ajax-loader.gif new file mode 100644 index 00000000000..61faf8cab23 Binary files /dev/null and b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/ajax-loader.gif differ diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/background_b01.png b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/background_b01.png new file mode 100644 index 00000000000..353f26dde08 Binary files /dev/null and b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/background_b01.png differ diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/basic.css b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/basic.css new file mode 100644 index 00000000000..19ced1057ae --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/basic.css @@ -0,0 +1,665 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 450px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +div.code-block-caption { + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +div.code-block-caption + div > div.highlight > pre { + margin-top: 0; +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + padding: 1em 1em 0; +} + +div.literal-block-wrapper div.highlight { + margin: 0; +} + +code.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +code.descclassname { + background-color: transparent; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: relative; + left: 0px; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.css b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.css new file mode 100644 index 00000000000..0464a74e637 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.css @@ -0,0 +1,490 @@ +/* + * bizstyle.css_t + * ~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- business style theme. + * + * :copyright: Copyright 2011-2014 by Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', + 'Verdana', sans-serif; + font-size: 14px; + letter-spacing: -0.01em; + line-height: 150%; + text-align: center; + background-color: white; + background-image: url(background_b01.png); + color: black; + padding: 0; + border-right: 1px solid #336699; + border-left: 1px solid #336699; + + margin: 0px 40px 0px 40px; +} + +div.document { + background-color: white; + text-align: left; + background-repeat: repeat-x; + + -moz-box-shadow: 2px 2px 5px #000; + -webkit-box-shadow: 2px 2px 5px #000; +} + +div.bodywrapper { + margin: 0 0 0 240px; + border-left: 1px solid #ccc; +} + +div.body { + margin: 0; + padding: 0.5em 20px 20px 20px; +} + +div.related { + font-size: 1em; + + -moz-box-shadow: 2px 2px 5px #000; + -webkit-box-shadow: 2px 2px 5px #000; +} + +div.related ul { + background-color: #336699; + height: 100%; + overflow: hidden; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +div.related ul li { + color: white; + margin: 0; + padding: 0; + height: 2em; + float: left; +} + +div.related ul li.right { + float: right; + margin-right: 5px; +} + +div.related ul li a { + margin: 0; + padding: 0 5px 0 5px; + line-height: 1.75em; + color: #fff; +} + +div.related ul li a:hover { + color: #fff; + text-decoration: underline; +} + +div.sphinxsidebarwrapper { + padding: 0; +} + +div.sphinxsidebar { + margin: 0; + padding: 0.5em 12px 12px 12px; + width: 210px; + font-size: 1em; + text-align: left; +} + +div.sphinxsidebar h3, div.sphinxsidebar h4 { + margin: 1em 0 0.5em 0; + font-size: 1em; + padding: 0.1em 0 0.1em 0.5em; + color: white; + border: 1px solid #336699; + background-color: #336699; +} + +div.sphinxsidebar h3 a { + color: white; +} + +div.sphinxsidebar ul { + padding-left: 1.5em; + margin-top: 7px; + padding: 0; + line-height: 130%; +} + +div.sphinxsidebar ul ul { + margin-left: 20px; +} + +div.sphinxsidebar input { + border: 1px solid #336699; +} + +div.footer { + background-color: white; + color: #336699; + padding: 3px 8px 3px 0; + clear: both; + font-size: 0.8em; + text-align: right; + border-bottom: 1px solid #336699; + + -moz-box-shadow: 2px 2px 5px #000; + -webkit-box-shadow: 2px 2px 5px #000; +} + +div.footer a { + color: #336699; + text-decoration: underline; +} + +/* -- body styles ----------------------------------------------------------- */ + +p { + margin: 0.8em 0 0.5em 0; +} + +a { + color: #336699; + text-decoration: none; +} + +a:hover { + color: #336699; + text-decoration: underline; +} + +div.body a { + text-decoration: underline; +} + +h1, h2, h3 { + color: #336699; +} + +h1 { + margin: 0; + padding: 0.7em 0 0.3em 0; + font-size: 1.5em; +} + +h2 { + margin: 1.3em 0 0.2em 0; + font-size: 1.35em; + padding-bottom: .5em; + border-bottom: 1px solid #336699; +} + +h3 { + margin: 1em 0 -0.3em 0; + font-size: 1.2em; + padding-bottom: .3em; + border-bottom: 1px solid #CCCCCC; +} + +div.body h1 a, div.body h2 a, div.body h3 a, +div.body h4 a, div.body h5 a, div.body h6 a { + color: black!important; +} + +h1 a.anchor, h2 a.anchor, h3 a.anchor, +h4 a.anchor, h5 a.anchor, h6 a.anchor { + display: none; + margin: 0 0 0 0.3em; + padding: 0 0.2em 0 0.2em; + color: #aaa!important; +} + +h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, +h5:hover a.anchor, h6:hover a.anchor { + display: inline; +} + +h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, +h5 a.anchor:hover, h6 a.anchor:hover { + color: #777; + background-color: #eee; +} + +a.headerlink { + color: #c60f0f!important; + font-size: 1em; + margin-left: 6px; + padding: 0 4px 0 4px; + text-decoration: none!important; +} + +a.headerlink:hover { + background-color: #ccc; + color: white!important; +} + +cite, code, tt { + font-family: 'Consolas', 'Deja Vu Sans Mono', + 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.01em; +} + +code { + background-color: #F2F2F2; + border-bottom: 1px solid #ddd; + color: #333; +} + +code.descname, code.descclassname, code.xref { + border: 0; +} + +hr { + border: 1px solid #abc; + margin: 2em; +} + +a code { + border: 0; + color: #CA7900; +} + +a code:hover { + color: #2491CF; +} + +pre { + background-color: transparent !important; + font-family: 'Consolas', 'Deja Vu Sans Mono', + 'Bitstream Vera Sans Mono', monospace; + font-size: 0.95em; + letter-spacing: 0.015em; + line-height: 120%; + padding: 0.5em; + border-right: 5px solid #ccc; + border-left: 5px solid #ccc; +} + +pre a { + color: inherit; + text-decoration: underline; +} + +td.linenos pre { + padding: 0.5em 0; +} + +div.quotebar { + background-color: #f8f8f8; + max-width: 250px; + float: right; + padding: 2px 7px; + border: 1px solid #ccc; +} + +div.topic { + background-color: #f8f8f8; +} + +table { + border-collapse: collapse; + margin: 0 -0.5em 0 -0.5em; +} + +table td, table th { + padding: 0.2em 0.5em 0.2em 0.5em; +} + +div.admonition { + font-size: 0.9em; + margin: 1em 0 1em 0; + border: 3px solid #cccccc; + background-color: #f7f7f7; + padding: 0; +} + +div.admonition p { + margin: 0.5em 1em 0.5em 1em; + padding: 0; +} + +div.admonition li p { + margin-left: 0; +} + +div.admonition pre, div.warning pre { + margin: 0; +} + +div.highlight { + margin: 0.4em 1em; +} + +div.admonition p.admonition-title { + margin: 0; + padding: 0.1em 0 0.1em 0.5em; + color: white; + border-bottom: 3px solid #cccccc; + font-weight: bold; + background-color: #165e83; +} + +div.danger { border: 3px solid #f0908d; background-color: #f0cfa0; } +div.error { border: 3px solid #f0908d; background-color: #ede4cd; } +div.warning { border: 3px solid #f8b862; background-color: #f0cfa0; } +div.caution { border: 3px solid #f8b862; background-color: #ede4cd; } +div.attention { border: 3px solid #f8b862; background-color: #f3f3f3; } +div.important { border: 3px solid #f0cfa0; background-color: #ede4cd; } +div.note { border: 3px solid #f0cfa0; background-color: #f3f3f3; } +div.hint { border: 3px solid #bed2c3; background-color: #f3f3f3; } +div.tip { border: 3px solid #bed2c3; background-color: #f3f3f3; } + +div.danger p.admonition-title, div.error p.admonition-title { + background-color: #b7282e; + border-bottom: 3px solid #f0908d; +} + +div.caution p.admonition-title, +div.warning p.admonition-title, +div.attention p.admonition-title { + background-color: #f19072; + border-bottom: 3px solid #f8b862; +} + +div.note p.admonition-title, div.important p.admonition-title { + background-color: #f8b862; + border-bottom: 3px solid #f0cfa0; +} + +div.hint p.admonition-title, div.tip p.admonition-title { + background-color: #7ebea5; + border-bottom: 3px solid #bed2c3; +} + +div.admonition ul, div.admonition ol, +div.warning ul, div.warning ol { + margin: 0.1em 0.5em 0.5em 3em; + padding: 0; +} + +div.versioninfo { + margin: 1em 0 0 0; + border: 1px solid #ccc; + background-color: #DDEAF0; + padding: 8px; + line-height: 1.3em; + font-size: 0.9em; +} + +.viewcode-back { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', + 'Verdana', sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +p.versionchanged span.versionmodified { + font-size: 0.9em; + margin-right: 0.2em; + padding: 0.1em; + background-color: #DCE6A0; +} + +/* -- table styles ---------------------------------------------------------- */ + +table.docutils { + margin: 1em 0; + padding: 0; + border: 1px solid white; + background-color: #f7f7f7; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 1px solid white; + border-bottom: 1px solid white; +} + +table.docutils td p { + margin-top: 0; + margin-bottom: 0.3em; +} + +table.field-list td, table.field-list th { + border: 0 !important; + word-break: break-word; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + color: white; + text-align: left; + padding-right: 5px; + background-color: #82A0BE; +} + +div.literal-block-wrapper div.code-block-caption { + background-color: #EEE; + border-style: solid; + border-color: #CCC; + border-width: 1px 5px; +} + +/* WIDE DESKTOP STYLE */ +@media only screen and (min-width: 1176px) { +body { + margin: 0 40px 0 40px; +} +} + +/* TABLET STYLE */ +@media only screen and (min-width: 768px) and (max-width: 991px) { +body { + margin: 0 40px 0 40px; +} +} + +/* MOBILE LAYOUT (PORTRAIT/320px) */ +@media only screen and (max-width: 767px) { +body { + margin: 0; +} +div.bodywrapper { + margin: 0; + width: 100%; + border: none; +} +div.sphinxsidebar { + display: none; +} +} + +/* MOBILE LAYOUT (LANDSCAPE/480px) */ +@media only screen and (min-width: 480px) and (max-width: 767px) { +body { + margin: 0 20px 0 20px; +} +} + +/* RETINA OVERRIDES */ +@media +only screen and (-webkit-min-device-pixel-ratio: 2), +only screen and (min-device-pixel-ratio: 2) { +} + +/* -- end ------------------------------------------------------------------- */ \ No newline at end of file diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.js b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.js new file mode 100644 index 00000000000..6614fe388d1 --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.js @@ -0,0 +1,41 @@ +// +// bizstyle.js +// ~~~~~~~~~~~ +// +// Sphinx javascript -- for bizstyle theme. +// +// This theme was created by referring to 'sphinxdoc' +// +// :copyright: Copyright 2012-2014 by Sphinx team, see AUTHORS. +// :license: BSD, see LICENSE for details. +// +$(document).ready(function(){ + if (navigator.userAgent.indexOf('iPhone') > 0 || + navigator.userAgent.indexOf('Android') > 0) { + $("li.nav-item-0 a").text("Top"); + } + + $("div.related:first ul li:not(.right) a").slice(1).each(function(i, item){ + if (item.text.length > 20) { + var tmpstr = item.text + $(item).attr("title", tmpstr); + $(item).text(tmpstr.substr(0, 17) + "..."); + } + }); + $("div.related:last ul li:not(.right) a").slice(1).each(function(i, item){ + if (item.text.length > 20) { + var tmpstr = item.text + $(item).attr("title", tmpstr); + $(item).text(tmpstr.substr(0, 17) + "..."); + } + }); +}); + +$(window).resize(function(){ + if ($(window).width() <= 776) { + $("li.nav-item-0 a").text("Top"); + } + else { + $("li.nav-item-0 a").text("pplib 0.1 documentation"); + } +}); \ No newline at end of file diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-bright.png b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-bright.png new file mode 100644 index 00000000000..15e27edb12a Binary files /dev/null and b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-bright.png differ diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-close.png b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-close.png new file mode 100644 index 00000000000..4d91bcf57de Binary files /dev/null and b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-close.png differ diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment.png b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment.png new file mode 100644 index 00000000000..dfbc0cbd512 Binary files /dev/null and b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment.png differ diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries.js b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries.js new file mode 100644 index 00000000000..59735f59dcb --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries.js @@ -0,0 +1 @@ +if(typeof Object.create!=="function"){Object.create=function(e){function t(){}t.prototype=e;return new t}}var ua={toString:function(){return navigator.userAgent},test:function(e){return this.toString().toLowerCase().indexOf(e.toLowerCase())>-1}};ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];ua.webkit=ua.test("webkit");ua.gecko=ua.test("gecko")&&!ua.webkit;ua.opera=ua.test("opera");ua.ie=ua.test("msie")&&!ua.opera;ua.ie6=ua.ie&&document.compatMode&&typeof document.documentElement.style.maxHeight==="undefined";ua.ie7=ua.ie&&document.documentElement&&typeof document.documentElement.style.maxHeight!=="undefined"&&typeof XDomainRequest==="undefined";ua.ie8=ua.ie&&typeof XDomainRequest!=="undefined";var domReady=function(){var e=[];var t=function(){if(!arguments.callee.done){arguments.callee.done=true;for(var t=0;t=200&&r.status<300||r.status===304||navigator.userAgent.indexOf("Safari")>-1&&typeof r.status==="undefined"){t(r.responseText)}else{n()}document.documentElement.style.cursor="";r=null}};r.send("")};var l=function(t){t=t.replace(e.REDUNDANT_COMPONENTS,"");t=t.replace(e.REDUNDANT_WHITESPACE,"$1");t=t.replace(e.WHITESPACE_IN_PARENTHESES,"($1)");t=t.replace(e.MORE_WHITESPACE," ");t=t.replace(e.FINAL_SEMICOLONS,"}");return t};var c={stylesheet:function(t){var n={};var r=[],i=[],s=[],o=[];var u=t.cssHelperText;var a=t.getAttribute("media");if(a){var f=a.toLowerCase().split(",")}else{var f=["all"]}for(var l=0;l-1&&a.href&&a.href.length!==0&&!a.disabled){r[r.length]=a}}if(r.length>0){var c=0;var d=function(){c++;if(c===r.length){i()}};var v=function(t){var n=t.href;f(n,function(r){r=l(r).replace(e.RELATIVE_URLS,"url("+n.substring(0,n.lastIndexOf("/"))+"/$1)");t.cssHelperText=r;d()},d)};for(u=0;u0){r.setAttribute("media",t.join(","))}document.getElementsByTagName("head")[0].appendChild(r);if(r.styleSheet){r.styleSheet.cssText=e}else{r.appendChild(document.createTextNode(e))}r.addedWithCssHelper=true;if(typeof n==="undefined"||n===true){cssHelper.parsed(function(t){var n=p(r,e);for(var i in n){if(n.hasOwnProperty(i)){g(i,n[i])}}a("newStyleParsed",r)})}else{r.parsingDisallowed=true}return r},removeStyle:function(e){return e.parentNode.removeChild(e)},parsed:function(e){if(n){s(e)}else{if(typeof t!=="undefined"){if(typeof e==="function"){e(t)}}else{s(e);d()}}},stylesheets:function(e){cssHelper.parsed(function(t){e(m.stylesheets||y("stylesheets"))})},mediaQueryLists:function(e){cssHelper.parsed(function(t){e(m.mediaQueryLists||y("mediaQueryLists"))})},rules:function(e){cssHelper.parsed(function(t){e(m.rules||y("rules"))})},selectors:function(e){cssHelper.parsed(function(t){e(m.selectors||y("selectors"))})},declarations:function(e){cssHelper.parsed(function(t){e(m.declarations||y("declarations"))})},properties:function(e){cssHelper.parsed(function(t){e(m.properties||y("properties"))})},broadcast:a,addListener:function(e,t){if(typeof t==="function"){if(!u[e]){u[e]={listeners:[]}}u[e].listeners[u[e].listeners.length]=t}},removeListener:function(e,t){if(typeof t==="function"&&u[e]){var n=u[e].listeners;for(var r=0;r=a||s&&l0}}else if("device-height"===e.substring(r-13,r)){c=screen.height;if(t!==null){if(u==="length"){return i&&c>=a||s&&c0}}else if("width"===e.substring(r-5,r)){l=document.documentElement.clientWidth||document.body.clientWidth;if(t!==null){if(u==="length"){return i&&l>=a||s&&l0}}else if("height"===e.substring(r-6,r)){c=document.documentElement.clientHeight||document.body.clientHeight;if(t!==null){if(u==="length"){return i&&c>=a||s&&c0}}else if("device-aspect-ratio"===e.substring(r-19,r)){return u==="aspect-ratio"&&screen.width*a[1]===screen.height*a[0]}else if("color-index"===e.substring(r-11,r)){var h=Math.pow(2,screen.colorDepth);if(t!==null){if(u==="absolute"){return i&&h>=a||s&&h0}}else if("color"===e.substring(r-5,r)){var p=screen.colorDepth;if(t!==null){if(u==="absolute"){return i&&p>=a||s&&p0}}else if("resolution"===e.substring(r-10,r)){var d;if(f==="dpcm"){d=o("1cm")}else{d=o("1in")}if(t!==null){if(u==="resolution"){return i&&d>=a||s&&d0}}else{return false}};var a=function(e){var t=e.getValid();var n=e.getExpressions();var r=n.length;if(r>0){for(var i=0;i0){u=false;for(var f=0;f0){l[c++]=","}l[c++]=h}}if(l.length>0){r[r.length]=cssHelper.addStyle("@media "+l.join("")+"{"+e.getCssText()+"}",t,false)}};var l=function(e,t){for(var n=0;n0}}var o=[],u=[];for(var f in i){if(i.hasOwnProperty(f)){o[o.length]=f;if(i[f]){u[u.length]=f}if(f==="all"){n=true}}}if(u.length>0){r[r.length]=cssHelper.addStyle(e.getCssText(),u,false)}var c=e.getMediaQueryLists();if(n){l(c)}else{l(c,o)}};var h=function(e){for(var t=0;td||Math.abs(s-t)>d){e=n;t=s;clearTimeout(r);r=setTimeout(function(){if(!i()){p()}else{cssHelper.broadcast("cssMediaQueriesTested")}},500)}};window.onresize=function(){var e=window.onresize||function(){};return function(){e();s()}}()};var m=document.documentElement;m.style.marginLeft="-32767px";setTimeout(function(){m.style.marginLeft=""},5e3);return function(){if(!i()){cssHelper.addListener("newStyleParsed",function(e){c(e.cssHelperParsed.stylesheet)});cssHelper.addListener("cssMediaQueriesTested",function(){if(ua.ie){m.style.width="1px"}setTimeout(function(){m.style.width="";m.style.marginLeft=""},0);cssHelper.removeListener("cssMediaQueriesTested",arguments.callee)});s();p()}else{m.style.marginLeft=""}v()}}());try{document.execCommand("BackgroundImageCache",false,true)}catch(e){} diff --git a/Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries_src.js b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries_src.js new file mode 100644 index 00000000000..f21dd4949aa --- /dev/null +++ b/Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries_src.js @@ -0,0 +1,1104 @@ +/* +css3-mediaqueries.js - CSS Helper and CSS3 Media Queries Enabler + +author: Wouter van der Graaf +version: 1.0 (20110330) +license: MIT +website: http://code.google.com/p/css3-mediaqueries-js/ + +W3C spec: http://www.w3.org/TR/css3-mediaqueries/ + +Note: use of embedded