From 1eb99bf05849e3108129d32eaacaa40c9e266c4b Mon Sep 17 00:00:00 2001
From: Luigi Scarso
Date: Sat, 15 Feb 2020 12:45:08 +0000
Subject: sync with luatex rev. 7287
git-svn-id: svn://tug.org/texlive/trunk@53789 c570f23f-e606-0410-a88d-b1316a301751
---
Build/source/texk/web2c/luatexdir/ChangeLog | 39 +
Build/source/texk/web2c/luatexdir/am/libluatex.am | 10 +-
Build/source/texk/web2c/luatexdir/am/luapplib.am | 107 +-
Build/source/texk/web2c/luatexdir/am/luatex.am | 4 +-
Build/source/texk/web2c/luatexdir/font/luafont.c | 213 +-
.../source/texk/web2c/luatexdir/font/luatexfont.h | 4 +-
.../luatexdir/font/pdfglyphtounicode-luatex.c | 106 +
.../luatexdir/font/pdfglyphtounicode-pdftex.c | 126 +
.../luatexdir/font/pdfglyphtounicode-readme.txt | 10 +
Build/source/texk/web2c/luatexdir/font/texfont.h | 1 -
Build/source/texk/web2c/luatexdir/font/vfpacket.c | 3 +
Build/source/texk/web2c/luatexdir/image/epdf.h | 3 +-
.../source/texk/web2c/luatexdir/image/pdftoepdf.c | 39 +-
Build/source/texk/web2c/luatexdir/image/writeimg.h | 2 +-
.../source/texk/web2c/luatexdir/lua/lcallbacklib.c | 14 +
.../texk/web2c/luatexdir/lua/lepdflib.cc.orig | 2939 ++++++
Build/source/texk/web2c/luatexdir/lua/lfontlib.c | 16 +-
.../source/texk/web2c/luatexdir/lua/lnewtokenlib.c | 9 +-
Build/source/texk/web2c/luatexdir/lua/lpdfelib.c | 44 +-
.../texk/web2c/luatexdir/lua/lpdfscannerlib.c | 2 +-
Build/source/texk/web2c/luatexdir/lua/luainit.c | 2 +
Build/source/texk/web2c/luatexdir/lua/luatex-api.h | 2 +-
.../texk/web2c/luatexdir/luaharfbuzz/README-win.md | 53 -
.../texk/web2c/luatexdir/luaharfbuzz/README.md | 19 +-
.../texk/web2c/luatexdir/luaharfbuzz/config.ld | 2 +-
.../luaharfbuzz/docs/examples/core_types.lua.html | 2 +-
.../docs/examples/custom_callbacks.lua.html | 85 -
.../docs/examples/harfbuzz_setup.lua.html | 231 -
.../docs/examples/ot_font_loader.lua.html | 139 -
.../docs/examples/package_path_searcher.lua.html | 104 -
.../web2c/luatexdir/luaharfbuzz/docs/index.html | 12 +-
.../fonts/TwitterColorEmoji-SVGinOT.ttf | Bin 0 -> 4232 bytes
.../luaharfbuzz/luaharfbuzz-1.0.0-1.rockspec | 51 -
.../luaharfbuzz/luaharfbuzz-1.1.0-1.rockspec | 46 +
.../luaharfbuzz/luaharfbuzz-scm-1.rockspec | 5 +-
.../luatexdir/luaharfbuzz/spec/buffer_spec.lua | 55 +
.../luatexdir/luaharfbuzz/spec/harfbuzz_spec.lua | 42 +-
.../luatexdir/luaharfbuzz/src/harfbuzz.luadoc | 10 +-
.../luatexdir/luaharfbuzz/src/luaharfbuzz/buffer.c | 116 +-
.../luatexdir/luaharfbuzz/src/luaharfbuzz/face.c | 27 +
.../luaharfbuzz/src/luaharfbuzz/feature.c | 69 +
.../luatexdir/luaharfbuzz/src/luaharfbuzz/font.c | 2 +-
.../luaharfbuzz/src/luaharfbuzz/luaharfbuzz.c | 28 +-
.../luatexdir/luaharfbuzz/status/full_api.txt | 142 +-
Build/source/texk/web2c/luatexdir/luamd5/md5lib.c | 10 +-
Build/source/texk/web2c/luatexdir/luapeg/lpeg.c | 2 +-
.../texk/web2c/luatexdir/luapplib/.gitattributes | 10 +
.../texk/web2c/luatexdir/luapplib/.gitignore | 8 +
.../texk/web2c/luatexdir/luapplib/.gitmodules | 3 +
.../texk/web2c/luatexdir/luapplib/.travis.yml | 20 +
.../texk/web2c/luatexdir/luapplib/CMakeLists.txt | 6 +
.../texk/web2c/luatexdir/luapplib/Makefile.orig | 89 -
.../source/texk/web2c/luatexdir/luapplib/README.md | 9 +
.../web2c/luatexdir/luapplib/azure-pipelines.yml | 36 +
.../texk/web2c/luatexdir/luapplib/doc/Makefile | 20 +
.../doc/_build/doctrees/environment.pickle | Bin 0 -> 32928 bytes
.../luapplib/doc/_build/doctrees/ppapi-1.x.doctree | Bin 0 -> 167607 bytes
.../luapplib/doc/_build/doctrees/ppapi-2.x.doctree | Bin 0 -> 167117 bytes
.../luapplib/doc/_build/doctrees/ppapi.doctree | Bin 0 -> 165058 bytes
.../luapplib/doc/_build/doctrees/ppcode.doctree | Bin 0 -> 64496 bytes
.../luapplib/doc/_build/doctrees/pplib.doctree | Bin 0 -> 3371 bytes
.../luapplib/doc/_build/doctrees/ppnew.doctree | Bin 0 -> 25753 bytes
.../luatexdir/luapplib/doc/_build/html/.buildinfo | 4 +
.../doc/_build/html/_sources/ppapi-1.x.rst.txt | 937 ++
.../doc/_build/html/_sources/ppapi-2.x.rst.txt | 937 ++
.../doc/_build/html/_sources/ppapi.rst.txt | 937 ++
.../doc/_build/html/_sources/ppcode.rst.txt | 101 +
.../doc/_build/html/_sources/pplib.rst.txt | 15 +
.../doc/_build/html/_sources/ppnew.rst.txt | 103 +
.../doc/_build/html/_static/ajax-loader.gif | Bin 0 -> 673 bytes
.../doc/_build/html/_static/background_b01.png | Bin 0 -> 78 bytes
.../luapplib/doc/_build/html/_static/basic.css | 676 ++
.../luapplib/doc/_build/html/_static/bizstyle.css | 490 +
.../luapplib/doc/_build/html/_static/bizstyle.js | 41 +
.../doc/_build/html/_static/comment-bright.png | Bin 0 -> 756 bytes
.../doc/_build/html/_static/comment-close.png | Bin 0 -> 829 bytes
.../luapplib/doc/_build/html/_static/comment.png | Bin 0 -> 641 bytes
.../doc/_build/html/_static/css3-mediaqueries.js | 1 +
.../_build/html/_static/css3-mediaqueries_src.js | 1104 ++
.../luapplib/doc/_build/html/_static/doctools.js | 315 +
.../_build/html/_static/documentation_options.js | 10 +
.../doc/_build/html/_static/down-pressed.png | Bin 0 -> 222 bytes
.../luapplib/doc/_build/html/_static/down.png | Bin 0 -> 202 bytes
.../luapplib/doc/_build/html/_static/file.png | Bin 0 -> 286 bytes
.../doc/_build/html/_static/jquery-3.2.1.js | 10253 +++++++++++++++++++
.../luapplib/doc/_build/html/_static/jquery.js | 4 +
.../doc/_build/html/_static/language_data.js | 297 +
.../luapplib/doc/_build/html/_static/minus.png | Bin 0 -> 90 bytes
.../luapplib/doc/_build/html/_static/plus.png | Bin 0 -> 90 bytes
.../luapplib/doc/_build/html/_static/pygments.css | 69 +
.../doc/_build/html/_static/searchtools.js | 481 +
.../doc/_build/html/_static/underscore-1.3.1.js | 999 ++
.../luapplib/doc/_build/html/_static/underscore.js | 31 +
.../doc/_build/html/_static/up-pressed.png | Bin 0 -> 214 bytes
.../luapplib/doc/_build/html/_static/up.png | Bin 0 -> 203 bytes
.../luapplib/doc/_build/html/_static/websupport.js | 808 ++
.../luapplib/doc/_build/html/genindex.html | 85 +
.../luatexdir/luapplib/doc/_build/html/objects.inv | 6 +
.../luapplib/doc/_build/html/ppapi-1.x.html | 1030 ++
.../luapplib/doc/_build/html/ppapi-2.x.html | 1031 ++
.../luatexdir/luapplib/doc/_build/html/ppapi.html | 1030 ++
.../luatexdir/luapplib/doc/_build/html/ppcode.html | 996 ++
.../luatexdir/luapplib/doc/_build/html/pplib.html | 176 +
.../luatexdir/luapplib/doc/_build/html/ppnew.html | 209 +
.../luatexdir/luapplib/doc/_build/html/search.html | 97 +
.../luapplib/doc/_build/html/searchindex.js | 1 +
.../texk/web2c/luatexdir/luapplib/doc/conf.py | 156 +
.../texk/web2c/luatexdir/luapplib/doc/make.bat | 36 +
.../web2c/luatexdir/luapplib/doc/ppapi-1.x.rst | 937 ++
.../web2c/luatexdir/luapplib/doc/ppapi-2.x.rst | 937 ++
.../texk/web2c/luatexdir/luapplib/doc/ppcode.rst | 101 +
.../texk/web2c/luatexdir/luapplib/doc/pplib.rst | 15 +
.../texk/web2c/luatexdir/luapplib/doc/ppnew.rst | 103 +
.../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 673 -> 0 bytes
.../luapplib/html/_static/background_b01.png | Bin 78 -> 0 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 756 -> 0 bytes
.../luapplib/html/_static/comment-close.png | Bin 829 -> 0 bytes
.../luatexdir/luapplib/html/_static/comment.png | Bin 641 -> 0 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 222 -> 0 bytes
.../web2c/luatexdir/luapplib/html/_static/down.png | Bin 202 -> 0 bytes
.../web2c/luatexdir/luapplib/html/_static/file.png | Bin 286 -> 0 bytes
.../luapplib/html/_static/jquery-3.2.1.js | 10253 -------------------
.../luatexdir/luapplib/html/_static/jquery.js | 4 -
.../luatexdir/luapplib/html/_static/minus.png | Bin 90 -> 0 bytes
.../web2c/luatexdir/luapplib/html/_static/plus.png | Bin 90 -> 0 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 214 -> 0 bytes
.../web2c/luatexdir/luapplib/html/_static/up.png | Bin 203 -> 0 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 | 419 -
.../source/texk/web2c/luatexdir/luapplib/pparray.c | 146 -
.../source/texk/web2c/luatexdir/luapplib/pparray.h | 7 -
.../source/texk/web2c/luatexdir/luapplib/ppconf.h | 86 -
.../source/texk/web2c/luatexdir/luapplib/ppcrypt.c | 519 -
.../texk/web2c/luatexdir/luapplib/ppcrypt.c.orig | 628 --
.../source/texk/web2c/luatexdir/luapplib/ppcrypt.h | 67 -
.../source/texk/web2c/luatexdir/luapplib/ppdict.c | 163 -
.../source/texk/web2c/luatexdir/luapplib/ppdict.h | 7 -
.../texk/web2c/luatexdir/luapplib/ppfilter.h | 10 -
.../source/texk/web2c/luatexdir/luapplib/ppheap.c | 435 -
.../source/texk/web2c/luatexdir/luapplib/ppheap.h | 29 -
Build/source/texk/web2c/luatexdir/luapplib/pplib.h | 23 -
.../source/texk/web2c/luatexdir/luapplib/ppload.c | 2753 -----
.../source/texk/web2c/luatexdir/luapplib/ppload.h | 54 -
.../texk/web2c/luatexdir/luapplib/ppstream.c | 489 -
.../texk/web2c/luatexdir/luapplib/ppstream.h | 10 -
.../source/texk/web2c/luatexdir/luapplib/pptest1.c | 86 -
.../source/texk/web2c/luatexdir/luapplib/pptest2.c | 139 -
.../source/texk/web2c/luatexdir/luapplib/pptest3.c | 98 -
.../source/texk/web2c/luatexdir/luapplib/ppxref.c | 196 -
.../source/texk/web2c/luatexdir/luapplib/ppxref.h | 35 -
.../web2c/luatexdir/luapplib/src/CMakeLists.txt | 151 +
.../texk/web2c/luatexdir/luapplib/src/Makefile | 99 +
.../texk/web2c/luatexdir/luapplib/src/Makefile.vc | 98 +
.../texk/web2c/luatexdir/luapplib/src/ppapi.h | 404 +
.../texk/web2c/luatexdir/luapplib/src/pparray.c | 145 +
.../texk/web2c/luatexdir/luapplib/src/pparray.h | 7 +
.../texk/web2c/luatexdir/luapplib/src/ppconf.h | 76 +
.../texk/web2c/luatexdir/luapplib/src/ppcrypt.c | 525 +
.../texk/web2c/luatexdir/luapplib/src/ppcrypt.h | 67 +
.../texk/web2c/luatexdir/luapplib/src/ppdict.c | 166 +
.../texk/web2c/luatexdir/luapplib/src/ppdict.h | 7 +
.../texk/web2c/luatexdir/luapplib/src/ppfilter.h | 10 +
.../texk/web2c/luatexdir/luapplib/src/ppheap.c | 40 +
.../texk/web2c/luatexdir/luapplib/src/ppheap.h | 46 +
.../texk/web2c/luatexdir/luapplib/src/pplib.h | 22 +
.../texk/web2c/luatexdir/luapplib/src/ppload.c | 2769 +++++
.../texk/web2c/luatexdir/luapplib/src/ppload.h | 58 +
.../texk/web2c/luatexdir/luapplib/src/ppstream.c | 491 +
.../texk/web2c/luatexdir/luapplib/src/ppstream.h | 10 +
.../texk/web2c/luatexdir/luapplib/src/pptest1.c | 104 +
.../texk/web2c/luatexdir/luapplib/src/pptest2.c | 138 +
.../texk/web2c/luatexdir/luapplib/src/pptest3.c | 123 +
.../texk/web2c/luatexdir/luapplib/src/ppxref.c | 215 +
.../texk/web2c/luatexdir/luapplib/src/ppxref.h | 35 +
.../web2c/luatexdir/luapplib/src/util/README.md | 8 +
.../web2c/luatexdir/luapplib/src/util/utilbasexx.c | 1742 ++++
.../web2c/luatexdir/luapplib/src/util/utilbasexx.h | 111 +
.../web2c/luatexdir/luapplib/src/util/utilcrypt.c | 1190 +++
.../web2c/luatexdir/luapplib/src/util/utilcrypt.h | 90 +
.../luatexdir/luapplib/src/util/utilcryptdef.h | 32 +
.../web2c/luatexdir/luapplib/src/util/utildecl.h | 28 +
.../web2c/luatexdir/luapplib/src/util/utilflate.c | 322 +
.../web2c/luatexdir/luapplib/src/util/utilflate.h | 21 +
.../web2c/luatexdir/luapplib/src/util/utilfpred.c | 778 ++
.../web2c/luatexdir/luapplib/src/util/utilfpred.h | 23 +
.../web2c/luatexdir/luapplib/src/util/utiliof.c | 2993 ++++++
.../web2c/luatexdir/luapplib/src/util/utiliof.h | 673 ++
.../web2c/luatexdir/luapplib/src/util/utillog.c | 60 +
.../web2c/luatexdir/luapplib/src/util/utillog.h | 10 +
.../web2c/luatexdir/luapplib/src/util/utillzw.c | 705 ++
.../web2c/luatexdir/luapplib/src/util/utillzw.h | 30 +
.../web2c/luatexdir/luapplib/src/util/utilmd5.c | 447 +
.../web2c/luatexdir/luapplib/src/util/utilmd5.h | 49 +
.../web2c/luatexdir/luapplib/src/util/utilmem.c | 67 +
.../web2c/luatexdir/luapplib/src/util/utilmem.h | 16 +
.../luatexdir/luapplib/src/util/utilmemallc.h | 561 +
.../luatexdir/luapplib/src/util/utilmemallh.h | 26 +
.../luatexdir/luapplib/src/util/utilmemheap.c | 994 ++
.../luatexdir/luapplib/src/util/utilmemheap.h | 179 +
.../luatexdir/luapplib/src/util/utilmemheapiof.c | 192 +
.../luatexdir/luapplib/src/util/utilmemheapiof.h | 18 +
.../luatexdir/luapplib/src/util/utilmeminfo.c | 38 +
.../luatexdir/luapplib/src/util/utilmeminfo.h | 9 +
.../web2c/luatexdir/luapplib/src/util/utilnumber.c | 1177 +++
.../web2c/luatexdir/luapplib/src/util/utilnumber.h | 428 +
.../web2c/luatexdir/luapplib/src/util/utilplat.h | 31 +
.../web2c/luatexdir/luapplib/src/util/utilsha.c | 1065 ++
.../web2c/luatexdir/luapplib/src/util/utilsha.h | 79 +
.../texk/web2c/luatexdir/luapplib/util/utilarm.h | 10 -
.../web2c/luatexdir/luapplib/util/utilbasexx.c | 2108 ----
.../web2c/luatexdir/luapplib/util/utilbasexx.h | 133 -
.../texk/web2c/luatexdir/luapplib/util/utilcrypt.c | 1191 ---
.../texk/web2c/luatexdir/luapplib/util/utilcrypt.h | 90 -
.../web2c/luatexdir/luapplib/util/utilcryptdef.h | 30 -
.../texk/web2c/luatexdir/luapplib/util/utildecl.h | 28 -
.../texk/web2c/luatexdir/luapplib/util/utilflate.c | 319 -
.../texk/web2c/luatexdir/luapplib/util/utilflate.h | 21 -
.../texk/web2c/luatexdir/luapplib/util/utilfpred.c | 772 --
.../texk/web2c/luatexdir/luapplib/util/utilfpred.h | 23 -
.../texk/web2c/luatexdir/luapplib/util/utiliof.c | 2951 ------
.../texk/web2c/luatexdir/luapplib/util/utiliof.h | 669 --
.../texk/web2c/luatexdir/luapplib/util/utillog.c | 60 -
.../texk/web2c/luatexdir/luapplib/util/utillog.h | 10 -
.../texk/web2c/luatexdir/luapplib/util/utillzw.c | 701 --
.../texk/web2c/luatexdir/luapplib/util/utillzw.h | 30 -
.../texk/web2c/luatexdir/luapplib/util/utilmd5.c | 413 -
.../web2c/luatexdir/luapplib/util/utilmd5.c.orig | 413 -
.../texk/web2c/luatexdir/luapplib/util/utilmd5.h | 115 -
.../web2c/luatexdir/luapplib/util/utilmd5.h.orig | 115 -
.../texk/web2c/luatexdir/luapplib/util/utilmem.c | 68 -
.../texk/web2c/luatexdir/luapplib/util/utilmem.h | 59 -
.../web2c/luatexdir/luapplib/util/utilnumber.c | 1325 ---
.../web2c/luatexdir/luapplib/util/utilnumber.h | 354 -
.../texk/web2c/luatexdir/luapplib/util/utilplat.h | 23 -
.../texk/web2c/luatexdir/luapplib/util/utilsha.c | 1287 ---
.../texk/web2c/luatexdir/luapplib/util/utilsha.h | 134 -
Build/source/texk/web2c/luatexdir/luatex.c | 6 +-
.../texk/web2c/luatexdir/luatex_svnversion.h | 2 +-
Build/source/texk/web2c/luatexdir/pdf/pdftables.c | 1 -
Build/source/texk/web2c/luatexdir/pdf/pdftables.h | 2 +-
Build/source/texk/web2c/luatexdir/tex/filename.c | 4 +
Build/source/texk/web2c/luatexdir/tex/linebreak.c | 17 +-
.../source/texk/web2c/luatexdir/tex/maincontrol.c | 2 -
.../texk/web2c/luatexdir/tex/postlinebreak.c | 2 +
Build/source/texk/web2c/luatexdir/tex/texmath.c | 6 +-
Build/source/texk/web2c/luatexdir/tex/texnodes.c | 3 +-
Build/source/texk/web2c/luatexdir/tex/textoken.c | 2 +-
269 files changed, 49802 insertions(+), 39642 deletions(-)
create mode 100644 Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-luatex.c
create mode 100644 Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-pdftex.c
create mode 100644 Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-readme.txt
create mode 100644 Build/source/texk/web2c/luatexdir/lua/lepdflib.cc.orig
delete mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/README-win.md
delete mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/custom_callbacks.lua.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/harfbuzz_setup.lua.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/ot_font_loader.lua.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/package_path_searcher.lua.html
create mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/fonts/TwitterColorEmoji-SVGinOT.ttf
delete mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/luaharfbuzz-1.0.0-1.rockspec
create mode 100644 Build/source/texk/web2c/luatexdir/luaharfbuzz/luaharfbuzz-1.1.0-1.rockspec
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/.gitattributes
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/.gitignore
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/.gitmodules
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/.travis.yml
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/CMakeLists.txt
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/Makefile.orig
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/README.md
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/azure-pipelines.yml
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/Makefile
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/doctrees/environment.pickle
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/doctrees/ppapi-1.x.doctree
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/doctrees/ppapi-2.x.doctree
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/doctrees/ppapi.doctree
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/doctrees/ppcode.doctree
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/doctrees/pplib.doctree
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/doctrees/ppnew.doctree
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/.buildinfo
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_sources/ppapi-1.x.rst.txt
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_sources/ppapi-2.x.rst.txt
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_sources/ppapi.rst.txt
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_sources/ppcode.rst.txt
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_sources/pplib.rst.txt
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_sources/ppnew.rst.txt
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/ajax-loader.gif
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/background_b01.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/basic.css
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/bizstyle.css
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/bizstyle.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/comment-bright.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/comment-close.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/comment.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/css3-mediaqueries.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/css3-mediaqueries_src.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/doctools.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/documentation_options.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/down-pressed.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/down.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/file.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/jquery-3.2.1.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/jquery.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/language_data.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/minus.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/plus.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/pygments.css
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/searchtools.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/underscore-1.3.1.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/underscore.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/up-pressed.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/up.png
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/_static/websupport.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/genindex.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/objects.inv
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/ppapi-1.x.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/ppapi-2.x.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/ppapi.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/ppcode.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/pplib.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/ppnew.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/search.html
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/_build/html/searchindex.js
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/conf.py
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/make.bat
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/ppapi-1.x.rst
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/ppapi-2.x.rst
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/ppcode.rst
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/pplib.rst
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/doc/ppnew.rst
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/.buildinfo
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppapi.rst.txt
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_sources/ppcode.rst.txt
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_sources/pplib.rst.txt
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/ajax-loader.gif
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/background_b01.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/basic.css
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.css
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/bizstyle.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-bright.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment-close.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/comment.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/css3-mediaqueries_src.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/doctools.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/documentation_options.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/down-pressed.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/down.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/file.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/jquery-3.2.1.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/jquery.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/minus.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/plus.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/pygments.css
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/searchtools.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/underscore-1.3.1.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/underscore.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/up-pressed.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/up.png
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/_static/websupport.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/genindex.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/objects.inv
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/ppapi.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/ppcode.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/pplib.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/search.html
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/html/searchindex.js
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppapi.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/pparray.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/pparray.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppconf.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppcrypt.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppcrypt.c.orig
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppcrypt.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppdict.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppdict.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppfilter.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppheap.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppheap.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/pplib.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppload.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppload.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppstream.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppstream.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/pptest1.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/pptest2.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/pptest3.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppxref.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/ppxref.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/CMakeLists.txt
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/Makefile
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/Makefile.vc
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppapi.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/pparray.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/pparray.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppconf.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppcrypt.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppcrypt.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppdict.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppdict.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppfilter.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppheap.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppheap.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/pplib.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppload.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppload.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppstream.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppstream.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/pptest1.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/pptest2.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/pptest3.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppxref.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/ppxref.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/README.md
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilbasexx.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilbasexx.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilcrypt.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilcrypt.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilcryptdef.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utildecl.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilflate.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilflate.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilfpred.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilfpred.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utiliof.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utiliof.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utillog.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utillog.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utillzw.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utillzw.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmd5.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmd5.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmem.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmem.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallc.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemallh.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemheap.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemheap.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemheapiof.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmemheapiof.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmeminfo.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilmeminfo.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilnumber.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilnumber.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilplat.h
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilsha.c
create mode 100644 Build/source/texk/web2c/luatexdir/luapplib/src/util/utilsha.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilarm.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilbasexx.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilbasexx.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilcrypt.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilcrypt.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilcryptdef.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utildecl.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilflate.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilflate.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilfpred.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilfpred.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utiliof.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utiliof.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utillog.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utillog.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utillzw.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utillzw.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilmd5.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilmd5.c.orig
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilmd5.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilmd5.h.orig
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilmem.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilmem.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilnumber.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilnumber.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilplat.h
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilsha.c
delete mode 100644 Build/source/texk/web2c/luatexdir/luapplib/util/utilsha.h
(limited to 'Build/source/texk/web2c/luatexdir')
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 9f32ba3a1d4..33b871083ab 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,42 @@
+2020-02-12 Luigi Scarso
+ * restore state for \input delimited with {}
+
+
+2020-02-11 Luigi Scarso
+ * patches for -fno-common (thanks to D. Seifert of Gentoo team)
+
+
+2020-01-25 Luigi Scarso
+ * sync with upstream pplib
+ * sync with upstream luaharfbuzz
+
+
+2020-01-11 Luigi Scarso
+ * shape fix (HH)
+
+2020-01-03 Luigi Scarso
+ * luatex 1.12.0: updated to pplib 2.0
+
+2020-01-02 Luigi Scarso
+ * better separation between luatex and luahbtex at build time
+
+
+2019-12-31 Luigi Scarso
+ * scaled virtual font (HH)
+
+
+2019-12-19 Luigi Scarso
+ * fixed inclusion of pdf files with a invalid pageDict (exit, don't load it)
+
+
+2019-12-11 Luigi Scarso
+ * add catcode table check to set_macro (HH)
+
+
+2019-12-05 Luigi Scarso
+ * two fixes for lua user nodes (error report of Sigitas Tolusis )
+
+
2019-11-08 Luigi Scarso
* record a few more files (in kpse enabled mode) (HH)
* better recorder code in wrapped lua
diff --git a/Build/source/texk/web2c/luatexdir/am/libluatex.am b/Build/source/texk/web2c/luatexdir/am/libluatex.am
index 8302c311143..f3ba0d4f0ec 100644
--- a/Build/source/texk/web2c/luatexdir/am/libluatex.am
+++ b/Build/source/texk/web2c/luatexdir/am/libluatex.am
@@ -17,18 +17,14 @@ LUA_DEPEND = $(LUA53_DEPEND)
##
EXTRA_LIBRARIES += libluatex.a libluajittex.a libluatexspecific.a libluajittexspecific.a libluahbtexspecific.a libluajithbtexspecific.a
-
-## it's not true that luatex depends on libluaharfbuzz.a
-## but for the moment we keep it
-##
-libluatex_a_DEPENDENCIES = libff.a libluamisc.a libluaharfbuzz.a
-libluajittex_a_DEPENDENCIES = libff.a libluajitmisc.a libluajitharfbuzz.a
+libluatex_a_DEPENDENCIES = libff.a libluamisc.a
+libluajittex_a_DEPENDENCIES = libff.a libluajitmisc.a
libluatex_a_preflags = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(HARFBUZZ_INCLUDES)
libluatex_a_preflags += -I$(srcdir)/libmd5
libluatex_a_preflags += -DpdfTeX -I$(srcdir)/luatexdir
libluatex_a_preflags += -I$(srcdir)/luatexdir/unilib
-libluatex_a_preflags += -I$(srcdir)/luatexdir/luapplib/util
+libluatex_a_preflags += -I$(srcdir)/luatexdir/luapplib/src/util
libluatex_a_preflags += -I$(srcdir)/luatexdir/luafontloader/fontforge/inc
libluatex_a_preflags += -DLUA_FF_LIB=1 -I$(srcdir)/luatexdir/luafontloader/fontforge/fontforge
libluatex_a_preflags += -DSYNCTEX_ENGINE_H='' -I$(srcdir)/synctexdir
diff --git a/Build/source/texk/web2c/luatexdir/am/luapplib.am b/Build/source/texk/web2c/luatexdir/am/luapplib.am
index 06293da4ddd..7cca34c2049 100644
--- a/Build/source/texk/web2c/luatexdir/am/luapplib.am
+++ b/Build/source/texk/web2c/luatexdir/am/luapplib.am
@@ -18,13 +18,13 @@ $(libluajitpplib_a_OBJECTS): $(LUAJIT_DEPEND)
libluapplib_a_CPPFLAGS = \
- -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/util $(ZLIB_INCLUDES) $(LUA_INCLUDES)
+ -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/src -I$(top_srcdir)/luatexdir/luapplib/src/util $(ZLIB_INCLUDES) $(LUA_INCLUDES)
#liblua53pplib_a_CPPFLAGS = \
-# -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/util $(ZLIB_INCLUDES) $(LUA_LUA53_INCLUDES)
+# -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/src -I$(top_srcdir)/luatexdir/luapplib/src/util $(ZLIB_INCLUDES) $(LUA_LUA53_INCLUDES)
libluajitpplib_a_CPPFLAGS = \
- -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/util $(ZLIB_INCLUDES) $(LUAJIT_INCLUDES)
+ -I$(top_srcdir)/luatexdir/luapplib -I$(top_srcdir)/luatexdir/luapplib/src -I$(top_srcdir)/luatexdir/luapplib/src/util $(ZLIB_INCLUDES) $(LUAJIT_INCLUDES)
libluapplib_a_CFLAGS = # $(WARNING_CFLAGS)
libluajitpplib_a_CFLAGS = # $(WARNING_CFLAGS)
@@ -34,53 +34,60 @@ nodist_libluapplib_a_SOURCES = $(libluapplib_sources)
nodist_libluajitpplib_a_SOURCES = $(libluapplib_sources)
libluapplib_sources = \
- luatexdir/luapplib/ppapi.h \
- luatexdir/luapplib/pparray.c \
- luatexdir/luapplib/pparray.h \
- luatexdir/luapplib/ppconf.h \
- luatexdir/luapplib/ppcrypt.c \
- luatexdir/luapplib/ppcrypt.h \
- luatexdir/luapplib/ppdict.c \
- luatexdir/luapplib/ppdict.h \
- luatexdir/luapplib/ppfilter.h \
- luatexdir/luapplib/ppheap.c \
- luatexdir/luapplib/ppheap.h \
- luatexdir/luapplib/pplib.h \
- luatexdir/luapplib/ppload.c \
- 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 \
- luatexdir/luapplib/util/utilcrypt.h \
- luatexdir/luapplib/util/utilcryptdef.h \
- luatexdir/luapplib/util/utildecl.h \
- luatexdir/luapplib/util/utilflate.c \
- luatexdir/luapplib/util/utilflate.h \
- luatexdir/luapplib/util/utilfpred.c \
- luatexdir/luapplib/util/utilfpred.h \
- luatexdir/luapplib/util/utiliof.c \
- luatexdir/luapplib/util/utiliof.h \
- luatexdir/luapplib/util/utillog.c \
- luatexdir/luapplib/util/utillog.h \
- luatexdir/luapplib/util/utillzw.c \
- luatexdir/luapplib/util/utillzw.h \
- luatexdir/luapplib/util/utilmd5.c \
- luatexdir/luapplib/util/utilmd5.h \
- luatexdir/luapplib/util/utilmem.c \
- luatexdir/luapplib/util/utilmem.h \
- luatexdir/luapplib/util/utilnumber.c \
- luatexdir/luapplib/util/utilnumber.h \
- luatexdir/luapplib/util/utilplat.h \
- luatexdir/luapplib/util/utilsha.c \
- luatexdir/luapplib/util/utilsha.h
+ luatexdir/luapplib/src/ppapi.h \
+ luatexdir/luapplib/src/pparray.c \
+ luatexdir/luapplib/src/pparray.h \
+ luatexdir/luapplib/src/ppconf.h \
+ luatexdir/luapplib/src/ppcrypt.c \
+ luatexdir/luapplib/src/ppcrypt.h \
+ luatexdir/luapplib/src/ppdict.c \
+ luatexdir/luapplib/src/ppdict.h \
+ luatexdir/luapplib/src/ppfilter.h \
+ luatexdir/luapplib/src/ppheap.c \
+ luatexdir/luapplib/src/ppheap.h \
+ luatexdir/luapplib/src/pplib.h \
+ luatexdir/luapplib/src/ppload.c \
+ luatexdir/luapplib/src/ppload.h \
+ luatexdir/luapplib/src/ppstream.c \
+ luatexdir/luapplib/src/ppstream.h \
+ luatexdir/luapplib/src/pptest1.c \
+ luatexdir/luapplib/src/pptest2.c \
+ luatexdir/luapplib/src/pptest3.c \
+ luatexdir/luapplib/src/ppxref.c \
+ luatexdir/luapplib/src/ppxref.h \
+ luatexdir/luapplib/src/util/utilbasexx.c \
+ luatexdir/luapplib/src/util/utilbasexx.h \
+ luatexdir/luapplib/src/util/utilcrypt.c \
+ luatexdir/luapplib/src/util/utilcrypt.h \
+ luatexdir/luapplib/src/util/utilcryptdef.h \
+ luatexdir/luapplib/src/util/utildecl.h \
+ luatexdir/luapplib/src/util/utilflate.c \
+ luatexdir/luapplib/src/util/utilflate.h \
+ luatexdir/luapplib/src/util/utilfpred.c \
+ luatexdir/luapplib/src/util/utilfpred.h \
+ luatexdir/luapplib/src/util/utiliof.c \
+ luatexdir/luapplib/src/util/utiliof.h \
+ luatexdir/luapplib/src/util/utillog.c \
+ luatexdir/luapplib/src/util/utillog.h \
+ luatexdir/luapplib/src/util/utillzw.c \
+ luatexdir/luapplib/src/util/utillzw.h \
+ luatexdir/luapplib/src/util/utilmd5.c \
+ luatexdir/luapplib/src/util/utilmd5.h \
+ luatexdir/luapplib/src/util/utilmem.c \
+ luatexdir/luapplib/src/util/utilmem.h \
+ luatexdir/luapplib/src/util/utilmemallc.h \
+ luatexdir/luapplib/src/util/utilmemallh.h \
+ luatexdir/luapplib/src/util/utilmemheap.c \
+ luatexdir/luapplib/src/util/utilmemheap.h \
+ luatexdir/luapplib/src/util/utilmemheapiof.c \
+ luatexdir/luapplib/src/util/utilmemheapiof.h \
+ luatexdir/luapplib/src/util/utilmeminfo.c \
+ luatexdir/luapplib/src/util/utilmeminfo.h \
+ luatexdir/luapplib/src/util/utilnumber.c \
+ luatexdir/luapplib/src/util/utilnumber.h \
+ luatexdir/luapplib/src/util/utilplat.h \
+ luatexdir/luapplib/src/util/utilsha.c \
+ luatexdir/luapplib/src/util/utilsha.h
#liblua53pplib_sources = $(libluapplib_sources)
diff --git a/Build/source/texk/web2c/luatexdir/am/luatex.am b/Build/source/texk/web2c/luatexdir/am/luatex.am
index 9643a7ec8be..ab48c047c06 100644
--- a/Build/source/texk/web2c/luatexdir/am/luatex.am
+++ b/Build/source/texk/web2c/luatexdir/am/luatex.am
@@ -113,8 +113,8 @@ luatex_DEPENDENCIES = $(luatex_depend) libluatex.a libluatexspecific.a
luajittex_DEPENDENCIES = $(luatex_depend) libluajittex.a libluajittexspecific.a
luahbtex_depend = $(proglib) $(KPATHSEA_DEPEND) $(LIBPNG_DEPEND) libmputil.a libmd5.a
-luahbtex_DEPENDENCIES = $(luahbtex_depend) libluatex.a libluahbtexspecific.a
-luajithbtex_DEPENDENCIES = $(luatex_depend) libluajittex.a libluajithbtexspecific.a
+luahbtex_DEPENDENCIES = $(luahbtex_depend) libluatex.a libluahbtexspecific.a libluaharfbuzz.a
+luajithbtex_DEPENDENCIES = $(luatex_depend) libluajittex.a libluajithbtexspecific.a libluajitharfbuzz.a
diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.c b/Build/source/texk/web2c/luatexdir/font/luafont.c
index 14efbf8a794..dd0c6856495 100644
--- a/Build/source/texk/web2c/luatexdir/font/luafont.c
+++ b/Build/source/texk/web2c/luatexdir/font/luafont.c
@@ -169,6 +169,207 @@ static void dump_math_kerns(lua_State * L, charinfo * co, int l, int id)
}
}
+#define set_packet_number(fw) { \
+ fw = *(vfp++); \
+ fw = fw * 256 + *(vfp++); \
+ fw = fw * 256 + *(vfp++); \
+ fw = fw * 256 + *(vfp++); \
+}
+
+#define set_packet_scaled(fw) { \
+ fw = *(vfp++); \
+ if (fw > 127) { \
+ fw = fw - 256; \
+ } \
+ fw = fw * 256 + *(vfp++); \
+ fw = fw * 256 + *(vfp++); \
+ fw = fw * 256 + *(vfp++); \
+}
+
+static void font_commands_to_lua(lua_State * L, internal_font_number f, charinfo * co)
+{
+ eight_bits *vfp = get_charinfo_packets(co);
+ if (vfp != NULL) {
+ int cmd;
+ int i = 1;
+ lua_push_string_by_name(L,commands);
+ lua_newtable(L);
+ while ((cmd = *(vfp++)) != packet_end_code) {
+ switch (cmd) {
+ case packet_font_code:
+ {
+ halfword f ;
+ set_packet_number(f);
+ lua_createtable(L, 2, 0);
+ lua_push_string_by_name(L,font);
+ lua_rawseti(L, -2, 1);
+ lua_pushinteger(L, f);
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_push_code:
+ {
+ lua_createtable(L, 1, 0);
+ lua_push_string_by_name(L,push);
+ lua_rawseti(L, -2, 1);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_pop_code:
+ {
+ lua_createtable(L, 1, 0);
+ lua_push_string_by_name(L,pop);
+ lua_rawseti(L, -2, 1);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_char_code:
+ {
+ halfword c ;
+ set_packet_number(c);
+ lua_createtable(L, 2, 0);
+ lua_push_string_by_name(L,char);
+ lua_rawseti(L, -2, 1);
+ lua_pushinteger(L, c);
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_rule_code:
+ {
+ halfword h, w ;
+ set_packet_scaled(h);
+ set_packet_scaled(w);
+ lua_createtable(L, 3, 0);
+ lua_push_string_by_name(L,rule);
+ lua_rawseti(L, -2, 1);
+ lua_pushinteger(L, h);
+ lua_rawseti(L, -2, 2);
+ lua_pushinteger(L, w);
+ lua_rawseti(L, -2, 3);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_right_code:
+ {
+ halfword r ;
+ set_packet_scaled(r);
+ lua_createtable(L, 1, 0);
+ lua_push_string_by_name(L,right);
+ lua_rawseti(L, -2, 1);
+ lua_pushinteger(L, r);
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_down_code:
+ {
+ halfword d ;
+ set_packet_scaled(d);
+ lua_createtable(L, 1, 0);
+ lua_push_string_by_name(L,down);
+ lua_rawseti(L, -2, 1);
+ lua_pushinteger(L, d);
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_pdf_code:
+ {
+ halfword m, l;
+ set_packet_number(m);
+ set_packet_number(l);
+ lua_createtable(L, 3, 0);
+ lua_push_string_by_name(L,pdf);
+ lua_rawseti(L, -2, 1);
+ lua_pushinteger(L, m);
+ lua_rawseti(L, -2, 2);
+ lua_pushstring(L,"");
+ lua_rawseti(L, -2, 3);
+ lua_rawseti(L, -2, i++);
+ vfp += l;
+ }
+ break;
+ case packet_pdf_mode:
+ {
+ halfword m;
+ set_packet_number(m);
+ lua_createtable(L, 2, 0);
+ lua_push_string_by_name(L,mode);
+ lua_rawseti(L, -2, 1);
+ lua_pushinteger(L, m);
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_special_code:
+ {
+ halfword l;
+ set_packet_number(l);
+ lua_createtable(L, 2, 0);
+ lua_push_string_by_name(L,special);
+ lua_rawseti(L, -2, 1);
+ lua_pushstring(L,"");
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ vfp += l;
+ }
+ break;
+ case packet_lua_code:
+ {
+ halfword n;
+ set_packet_number(n);
+ lua_createtable(L, 2, 0);
+ lua_push_string_by_name(L,lua);
+ lua_rawseti(L, -2, 1);
+ lua_pushstring(L,"");
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_image_code:
+ {
+ halfword n;
+ set_packet_number(n);
+ lua_createtable(L, 2, 0);
+ lua_push_string_by_name(L,image);
+ lua_rawseti(L, -2, 1);
+ lua_pushstring(L,"");
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_node_code:
+ {
+ halfword n;
+ set_packet_number(n);
+ lua_createtable(L, 2, 0);
+ lua_push_string_by_name(L,node);
+ lua_rawseti(L, -2, 1);
+ lua_pushstring(L,"");
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_nop_code:
+ {
+ lua_createtable(L, 1, 0);
+ lua_push_string_by_name(L,nop);
+ lua_rawseti(L, -2, 1);
+ lua_rawseti(L, -2, i++);
+ }
+ break;
+ case packet_scale_code:
+ break;
+ default:
+ break;
+ }
+ }
+ lua_rawset(L, -3);
+ }
+}
+
static void font_char_to_lua(lua_State * L, internal_font_number f, charinfo * co)
{
liginfo *l;
@@ -343,6 +544,7 @@ static void font_char_to_lua(lua_State * L, internal_font_number f, charinfo * c
else
lua_pop(L, 2);
}
+ font_commands_to_lua(L,f,co);
}
static void write_lua_parameters(lua_State * L, int f)
@@ -432,11 +634,11 @@ static void write_lua_math_parameters(lua_State * L, int f)
lua_rawset(L, -3);
}
-int font_to_lua(lua_State * L, int f)
+int font_to_lua(lua_State * L, int f, int usecache)
{
int k;
charinfo *co;
- if (font_cache_id(f) > 0) {
+ if (usecache && 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));
return 1;
@@ -523,13 +725,6 @@ int font_to_lua(lua_State * L, int f)
}
}
lua_rawset(L, -3);
- if (font_cache_id(f) == 0) {
- /*tex Renew the cache. */
- int r;
- lua_pushvalue(L, -1);
- r = luaL_ref(L, LUA_REGISTRYINDEX);
- set_font_cache_id(f, r);
- }
return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/luatexfont.h b/Build/source/texk/web2c/luatexdir/font/luatexfont.h
index cd199417313..5eb6a5bd94e 100644
--- a/Build/source/texk/web2c/luatexdir/font/luatexfont.h
+++ b/Build/source/texk/web2c/luatexdir/font/luatexfont.h
@@ -128,8 +128,8 @@ int write_tounicode(PDF, char **, char *);
void replace_packet_fonts(internal_font_number f, int *old_fontid, int *new_fontid, int count);
int *packet_local_fonts(internal_font_number f, int *num);
-int packet_cur_s; /* current |do_vf_packet()| recursion level */
-int packet_stack_ptr; /* pointer into |packet_stack| */
+extern int packet_cur_s; /* current |do_vf_packet()| recursion level */
+extern int packet_stack_ptr; /* pointer into |packet_stack| */
vf_struct *new_vfstruct(void);
/* writecff.c */
diff --git a/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-luatex.c b/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-luatex.c
new file mode 100644
index 00000000000..58a4e7caabf
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-luatex.c
@@ -0,0 +1,106 @@
+static void set_glyph_unicode(char *s, glyph_unicode_entry * gp)
+{
+ char buf[SMALL_BUF_SIZE], buf2[SMALL_BUF_SIZE], *p;
+ long code;
+ boolean last_component;
+ glyph_unicode_entry tmp, *ptmp;
+ /*tex Skip dummy entries. */
+ if (s == NULL || s == notdef)
+ return;
+ /*tex Strip everything after the first dot. */
+ p = strchr(s, '.');
+ if (p != NULL) {
+ *buf = 0;
+ strncat(buf, s, (size_t) (p - s));
+ s = buf;
+ }
+ if (strlen(s) == 0)
+ return;
+ /*tex Check for case of multiple components separated by |_|. */
+ p = strchr(s, '_');
+ if (p != NULL) {
+ assert(strlen(s) < sizeof(buf));
+ if (s != buf) {
+ strcpy(buf, s);
+ p = strchr(buf, '_');
+ s = buf;
+ }
+ *buf2 = 0;
+ last_component = false;
+ for (;;) {
+ *p = 0;
+ tmp.code = UNI_UNDEF;
+ set_glyph_unicode(s, &tmp);
+ switch (tmp.code) {
+ case UNI_UNDEF:
+ /*tex Not found, do nothing. */
+ break;
+ case UNI_STRING:
+ /*tex |s| matched an entry with string value in the database. */
+ assert(tmp.unicode_seq != NULL);
+ assert(strlen(buf2) + strlen(tmp.unicode_seq) < sizeof(buf2));
+ strcat(buf2, tmp.unicode_seq);
+ break;
+ case UNI_EXTRA_STRING:
+ /*tex |s| is a multiple value of form "uniXXXX" */
+ assert(strlen(buf2) + strlen(tmp.unicode_seq) < sizeof(buf2));
+ strcat(buf2, tmp.unicode_seq);
+ xfree(tmp.unicode_seq);
+ break;
+ default:
+ /*tex
+ |s| matched an entry with numeric value in the database, or a
+ value derived from |uXXXX|.
+ */
+ assert(tmp.code >= 0);
+ strcat(buf2, utf16be_str(tmp.code));
+ }
+ if (last_component)
+ break;
+ s = p + 1;
+ p = strchr(s, '_');
+ if (p == NULL) {
+ p = strend(s);
+ last_component = true;
+ }
+ }
+ gp->code = UNI_EXTRA_STRING;
+ gp->unicode_seq = xstrdup(buf2);
+ return;
+ }
+ /*tex Lookup glyph name in the database. */
+ tmp.name = s;
+ tmp.code = UNI_UNDEF;
+ ptmp = (glyph_unicode_entry *) avl_find(glyph_unicode_tree, &tmp);
+ if (ptmp != NULL) {
+ gp->code = ptmp->code;
+ gp->unicode_seq = ptmp->unicode_seq;
+ return;
+ }
+ /*tex Check for case of |uniXXXX|, multiple 4-hex-digit values allowed. */
+ if (str_prefix(s, "uni")) {
+ p = s + strlen("uni");
+ code = check_unicode_value(p, true);
+ if (code != UNI_UNDEF) {
+ if (strlen(p) == 4) {
+ /*tex Single value: */
+ gp->code = code;
+ } else {
+ /*tex Multiple value: */
+ gp->code = UNI_EXTRA_STRING;
+ gp->unicode_seq = xstrdup(p);
+ }
+ }
+ /*tex Since the last case cannot happen: */
+ return;
+ }
+ /*tex Check for case of |uXXXX|, a single value up to 6 hex digits. */
+ if (str_prefix(s, "u")) {
+ p = s + strlen("u");
+ code = check_unicode_value(p, false);
+ if (code != UNI_UNDEF) {
+ assert(code >= 0);
+ gp->code = code;
+ }
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-pdftex.c b/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-pdftex.c
new file mode 100644
index 00000000000..b89a770e078
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-pdftex.c
@@ -0,0 +1,126 @@
+static void set_glyph_unicode(const char *s, const char* tfmname,
+ glyph_unicode_entry *gp)
+{
+ char buf[SMALL_BUF_SIZE], buf2[SMALL_BUF_SIZE], *p;
+ const char *p2; /* p2 points in s; p above points in writable copies */
+ long code;
+ boolean last_component;
+ glyph_unicode_entry tmp, *ptmp;
+ /*tex Skip dummy entries. */
+ if (s == NULL || s == notdef)
+ return;
+ /*tex Strip everything after the first dot. */
+ p = strchr(s, '.');
+ if (p != NULL) {
+ *buf = 0;
+ strncat(buf, s, p - s);
+ s = buf;
+ }
+ if (strlen(s) == 0)
+ return;
+ /*tex Check for case of multiple components separated by |_|. */
+ p = strchr(s, '_');
+ if (p != NULL) {
+ assert(strlen(s) < sizeof(buf));
+ if (s != buf) {
+ strcpy(buf, s);
+ p = strchr(buf, '_');
+ s = buf;
+ }
+ *buf2 = 0;
+ last_component = false;
+ for (;;) {
+ *p = 0;
+ tmp.code = UNI_UNDEF;
+ set_glyph_unicode(s, tfmname, &tmp);
+ switch (tmp.code) {
+ case UNI_UNDEF:
+ /*tex Not found, do nothing. */
+ break;
+ case UNI_STRING:
+ /*tex |s| matched an entry with string value in the database. */
+ assert(tmp.unicode_seq != NULL);
+ assert(strlen(buf2) + strlen(tmp.unicode_seq) < sizeof(buf2));
+ strcat(buf2, tmp.unicode_seq);
+ break;
+ case UNI_EXTRA_STRING:
+ /*tex |s| is a multiple value of form "uniXXXX" */
+ assert(strlen(buf2) + strlen(tmp.unicode_seq) < sizeof(buf2));
+ strcat(buf2, tmp.unicode_seq);
+ xfree(tmp.unicode_seq);
+ break;
+ default:
+ /*tex
+ |s| matched an entry with numeric value in the database, or a
+ value derived from |uXXXX|.
+ */
+ assert(tmp.code >= 0);
+ strcat(buf2, utf16be_str(tmp.code));
+ }
+ if (last_component)
+ break;
+ s = p + 1;
+ p = strchr(s, '_');
+ if (p == NULL) {
+ p = strend(s);
+ last_component = true;
+ }
+ }
+ gp->code = UNI_EXTRA_STRING;
+ gp->unicode_seq = xstrdup(buf2);
+ return;
+ }
+
+ /* Glyph name search strategy: first look up the glyph name in the
+ tfm's namespace, failing that look it up in the main database. */
+ /* Note: buf may alias s in the code below, but s and buf2 are
+ guaranteed to be distinct because the code changing buf2 above
+ always returns before reaching the code below. */
+
+ /* lookup for glyph name in the tfm's namespace */
+ snprintf(buf2, SMALL_BUF_SIZE, "tfm:%s/%s", tfmname, s);
+ tmp.name = buf2;
+ tmp.code = UNI_UNDEF;
+ ptmp = (glyph_unicode_entry *) avl_find(glyph_unicode_tree, &tmp);
+ if (ptmp != NULL) {
+ gp->code = ptmp->code;
+ gp->unicode_seq = ptmp->unicode_seq;
+ return;
+ }
+
+ /* lookup for glyph name in the main database */
+ snprintf(buf2, SMALL_BUF_SIZE, "%s", s);
+ tmp.name = buf2;
+ tmp.code = UNI_UNDEF;
+ ptmp = (glyph_unicode_entry *) avl_find(glyph_unicode_tree, &tmp);
+ if (ptmp != NULL) {
+ gp->code = ptmp->code;
+ gp->unicode_seq = ptmp->unicode_seq;
+ return;
+ }
+
+ /*tex Check for case of |uniXXXX|, multiple 4-hex-digit values allowed. */
+ if (str_prefix(s, "uni")) {
+ p2 = s + strlen("uni");
+ code = check_unicode_value(p2, true);
+ if (code != UNI_UNDEF) {
+ if (strlen(p2) == 4) /* single value */
+ gp->code = code;
+ else { /* multiple value */
+ gp->code = UNI_EXTRA_STRING;
+ gp->unicode_seq = xstrdup(p2);
+ }
+ }
+ /*tex Since the last case cannot happen: */
+ return;
+ }
+ /*tex Check for case of |uXXXX|, a single value up to 6 hex digits. */
+ if (str_prefix(s, "u")) {
+ p2 = s + strlen("u");
+ code = check_unicode_value(p2, false);
+ if (code != UNI_UNDEF) {
+ assert(code >= 0);
+ gp->code = code;
+ }
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-readme.txt b/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-readme.txt
new file mode 100644
index 00000000000..947495ae000
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/font/pdfglyphtounicode-readme.txt
@@ -0,0 +1,10 @@
+In pdftex there is are some more heuristics going on when determining the
+tounicode mapping:
+
+- more lookups using periods
+- a prefix tfm:cmr10/foo -> bar mapping
+
+Because in luatex one can have a callback that just loads the tfm and then
+decorates it with tounicodes we don't do this in luatex.
+
+HH
diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.h b/Build/source/texk/web2c/luatexdir/font/texfont.h
index 7c27d09565c..7b07bffa7d7 100644
--- a/Build/source/texk/web2c/luatexdir/font/texfont.h
+++ b/Build/source/texk/web2c/luatexdir/font/texfont.h
@@ -329,7 +329,6 @@ boolean cmp_font_area(int, str_number);
# define font_streamprovider(a) font_tables[a]->_font_streamprovider
# define set_font_streamprovider(a,b) font_streamprovider(a) = b
-
# define font_oldmath(a) font_tables[a]->_font_oldmath
# define set_font_oldmath(a,b) font_oldmath(a) = b
diff --git a/Build/source/texk/web2c/luatexdir/font/vfpacket.c b/Build/source/texk/web2c/luatexdir/font/vfpacket.c
index 41132c54a6d..ab90eca5eea 100644
--- a/Build/source/texk/web2c/luatexdir/font/vfpacket.c
+++ b/Build/source/texk/web2c/luatexdir/font/vfpacket.c
@@ -29,6 +29,9 @@ with LuaTeX; if not, see .
*/
+int packet_cur_s;
+int packet_stack_ptr;
+
#define packet_number(fw) { \
fw = *(vfp++); \
fw = fw * 256 + *(vfp++); \
diff --git a/Build/source/texk/web2c/luatexdir/image/epdf.h b/Build/source/texk/web2c/luatexdir/image/epdf.h
index fa66eeb4d23..e002b0b5c7c 100644
--- a/Build/source/texk/web2c/luatexdir/image/epdf.h
+++ b/Build/source/texk/web2c/luatexdir/image/epdf.h
@@ -70,7 +70,8 @@ typedef enum { FE_FAIL, FE_RETURN_NULL } file_error_mode;
# include "lua.h"
# include "lauxlib.h"
-# include "luapplib/pplib.h"
+# include "luapplib/src/pplib.h"
+
/* pdfgen.w */
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
index 547d0f67cac..a43f1dac4cc 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
@@ -187,6 +187,9 @@ PdfDocument *refPdfDocument(const char *file_path, file_error_mode fe, const cha
}
}
if (pdfe != NULL) {
+ if (ppdoc_crypt_status(pdfe) < 0 && userpassword==NULL) {
+ formatted_error("pdf inclusion","the pdf file '%s' is encrypted, passwords wrong",file_path);
+ }
if (ppdoc_crypt_status(pdfe) < 0) {
ppdoc_crypt_pass(pdfe,userpassword,strlen(userpassword),NULL,0);
}
@@ -250,7 +253,7 @@ PdfDocument *refMemStreamPdfDocument(char *docstream, unsigned long long streams
free(checksum);
}
if (pdf_doc->pdfe == NULL) {
- pdfe = ppdoc_mem(docstream, streamsize);
+ pdfe = ppdoc_mem(docstream, (size_t) streamsize);
pdf_doc->pc++;
if (pdfe == NULL) {
normal_error("pdf inclusion","reading pdf Stream failed");
@@ -367,24 +370,24 @@ static int addInObj(PDF pdf, PdfDocument * pdf_doc, ppref * ref)
static void copyObject(PDF, PdfDocument *, ppobj *);
-static void copyString(PDF pdf, ppstring str)
+static void copyString(PDF pdf, ppstring *str)
{
pdf_check_space(pdf);
- switch (ppstring_type((void *)(str))) {
+ switch (ppstring_type(str)) {
case PPSTRING_PLAIN:
pdf_out(pdf, '(');
- pdf_out_block(pdf, (const char *) str, ppstring_size((void *)(str)));
+ pdf_out_block(pdf, ppstring_data(str), ppstring_size(str));
pdf_out(pdf, ')');
break;
case PPSTRING_BASE16:
pdf_out(pdf, '<');
- pdf_out_block(pdf, (const char *) str, ppstring_size((void *)(str)));
+ pdf_out_block(pdf, ppstring_data(str), ppstring_size(str));
pdf_out(pdf, '>');
break;
case PPSTRING_BASE85:
pdf_out(pdf, '<');
pdf_out(pdf, '~');
- pdf_out_block(pdf, (const char *) str, ppstring_size((void *)(str)));
+ pdf_out_block(pdf, ppstring_data(str), ppstring_size(str));
pdf_out(pdf, '~');
pdf_out(pdf, '>');
break;
@@ -392,12 +395,10 @@ static void copyString(PDF pdf, ppstring str)
pdf_set_space(pdf);
}
-/*
static void copyName(PDF pdf, ppname *name)
{
- pdf_add_name(pdf, (const char *) name);
+ pdf_add_name(pdf, ppname_data(name));
}
-*/
static void copyArray(PDF pdf, PdfDocument * pdf_doc, pparray * array)
{
@@ -416,7 +417,8 @@ static void copyDict(PDF pdf, PdfDocument * pdf_doc, ppdict *dict)
int n = dict->size;
pdf_begin_dict(pdf);
for (i=0; iname),codecs[k]) == 0) {
known = 1;
break;
}
@@ -478,17 +479,17 @@ static void copyStream(PDF pdf, PdfDocument * pdf_doc, ppstream * stream)
int i;
pdf_begin_dict(pdf);
for (i=0; isize; ++i) {
- const char *key = ppdict_key(dict,i);
+ ppname *key = ppdict_key(dict,i);
int copy = 1;
int k;
for (k = 0; ignoredkeys[k] != NULL; k++) {
- if (strcmp(key,ignoredkeys[k]) == 0) {
+ if (strcmp(ppname_data(key),ignoredkeys[k]) == 0) {
copy = 0;
break;
}
}
if (copy) {
- pdf_add_name(pdf, key);
+ pdf_add_name(pdf, ppname_data(key));
copyObject(pdf, pdf_doc, ppdict_at(dict,i));
}
}
@@ -523,7 +524,7 @@ static void copyObject(PDF pdf, PdfDocument * pdf_doc, ppobj * obj)
pdf_add_real(pdf,obj->number); /* ppobj_get_num_value(obj) */
break;
case PPNAME:
- pdf_add_name(pdf, (const char *) obj->name); /* ppobj_get_name(obj) */
+ copyName(pdf, obj->name);
break;
case PPSTRING:
copyString(pdf, obj->string); /* ppobj_get_string(obj) */
@@ -690,6 +691,9 @@ void read_pdf_info(image_dict * idict)
get the required page
*/
pageDict = get_pdf_page_dict(pdfe,img_pagenum(idict));
+ if (pageDict==NULL) {
+ formatted_error("pdf inclusion","unable to retrive dictionary for page '%i'",(int) img_pagenum(idict));
+ }
/*
get the pagebox coordinates (media, crop,...) to use
*/
@@ -802,6 +806,9 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
}
pdfe = pdf_doc->pdfe;
pageDict = get_pdf_page_dict(pdfe,img_pagenum(idict));
+ if (pageDict==NULL) {
+ formatted_error("pdf inclusion","unable to retrive dictionary for page '%i'",(int) img_pagenum(idict));
+ }
/*
write the Page header
*/
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.h b/Build/source/texk/web2c/luatexdir/image/writeimg.h
index dc86648e217..96771decd35 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.h
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.h
@@ -26,7 +26,7 @@
# include "pdf/pdfpage.h"
typedef image_dict *idict_entry;
-idict_entry *idict_array;
+extern idict_entry *idict_array;
void new_img_pdfstream_struct(image_dict *);
image *new_image(void);
diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
index 5654bc71410..4e0defd1059 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
@@ -84,6 +84,7 @@ static const char *const callbacknames[] = {
"page_order_index",
"make_extensible",
"process_pdf_image_content",
+ "provide_charproc_data",
NULL
};
@@ -195,6 +196,7 @@ void get_saved_lua_string(int r, const char *name, char **target)
#define CALLBACK_BOOLEAN 'b'
#define CALLBACK_INTEGER 'd'
+#define CALLBACK_FLOAT 'f'
#define CALLBACK_LINE 'l'
#define CALLBACK_STRNUMBER 's'
#define CALLBACK_STRING 'S'
@@ -302,6 +304,9 @@ int do_run_callback(int special, const char *values, va_list vl)
case CALLBACK_INTEGER: /* int */
lua_pushinteger(Luas, va_arg(vl, int));
break;
+ case CALLBACK_FLOAT: /* double */
+ lua_pushnumber(Luas, va_arg(vl, double));
+ break;
case CALLBACK_STRNUMBER: /* TeX string */
s = makeclstring(va_arg(vl, int), &len);
lua_pushlstring(Luas, s, len);
@@ -361,6 +366,7 @@ int do_run_callback(int special, const char *values, va_list vl)
nres = -nres;
while (*values) {
int b, t;
+ double d;
halfword p;
t = lua_type(Luas, nres);
switch (*values++) {
@@ -383,6 +389,14 @@ int do_run_callback(int special, const char *values, va_list vl)
b = lua_tointeger(Luas, nres);
*va_arg(vl, int *) = b;
break;
+ case CALLBACK_FLOAT:
+ if (t != LUA_TNUMBER) {
+ fprintf(stderr, "callback should return a number, not: %s\n", lua_typename(Luas, t));
+ goto EXIT;
+ }
+ d = lua_tonumber(Luas, nres);
+ *va_arg(vl, double *) = d;
+ break;
case CALLBACK_LINE: /* TeX line ... happens frequently when we have a plug-in */
if (t == LUA_TNIL) {
bufloc = 0;
diff --git a/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc.orig b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc.orig
new file mode 100644
index 00000000000..ec5c90e8e00
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/lua/lepdflib.cc.orig
@@ -0,0 +1,2939 @@
+/* lepdflib.cc
+
+ Copyright 2009-2015 Taco Hoekwater
+ Copyright 2009-2013 Hartmut Henkel
+
+ 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 . */
+
+
+#include "image/epdf.h"
+
+/*
+ Patches for the new poppler 0.59 from:
+
+ https://www.mail-archive.com/arch-commits@archlinux.org/msg357548.html
+
+ with some modifications to comply the poppler API.
+*/
+
+/* define DEBUG */
+
+/* objects allocated by poppler may not be deleted in the lepdflib */
+
+typedef enum { ALLOC_POPPLER, ALLOC_LEPDF } alloctype;
+
+typedef struct {
+ void *d;
+ alloctype atype; // was it allocated by poppler or the lepdflib.cc?
+ PdfDocument *pd; // reference to PdfDocument, or NULL
+ unsigned long pc; // counter to detect PDFDoc change
+} udstruct;
+
+static const char *ErrorCodeNames[] = {
+ "None", "OpenFile", "BadCatalog",
+ "Damaged", "Encrypted", "HighlightFile", "BadPrinter", "Printing",
+ "Permission", "BadPageNum", "FileIO",
+ NULL
+};
+
+#define M_Annot "epdf.Annot" /* ls-hh: epdf.* gives better protection in registry */
+#define M_Annots "epdf.Annots"
+#define M_Array "epdf.Array"
+#define M_Catalog "epdf.Catalog"
+#define M_Dict "epdf.Dict"
+#define M_EmbFile "epdf.EmbFile"
+#define M_FileSpec "epdf.FileSpec"
+#define M_GooString "epdf.GooString"
+#define M_LinkDest "epdf.LinkDest"
+#define M_Link "epdf.Link"
+#define M_Links "epdf.Links"
+#define M_Object "epdf.Object"
+#define M_Page "epdf.Page"
+#define M_PDFDoc "epdf.PDFDoc"
+#define M_PDFRectangle "epdf.PDFRectangle"
+#define M_Ref "epdf.Ref"
+#define M_Stream "epdf.Stream"
+#define M_StructElement "epdf.StructElement"
+#define M_Attribute "epdf.Attribute"
+#define M_TextSpan "epdf.TextSpan"
+#define M_StructTreeRoot "epdf.StructTreeRoot"
+#define M_XRefEntry "epdf.XRefEntry"
+#define M_XRef "epdf.XRef"
+
+#define new_poppler_userdata(type) \
+static udstruct *new_##type##_userdata(lua_State * L) \
+{ \
+ udstruct *a; \
+ a = (udstruct *) lua_newuserdata(L, sizeof(udstruct)); /* udstruct ... */ \
+ a->atype = ALLOC_POPPLER; \
+ luaL_getmetatable(L, M_##type); /* m udstruct ... */ \
+ lua_setmetatable(L, -2); /* udstruct ... */ \
+ return a; \
+}
+
+new_poppler_userdata(PDFDoc);
+new_poppler_userdata(Annot);
+new_poppler_userdata(Array);
+new_poppler_userdata(Catalog);
+new_poppler_userdata(Dict);
+new_poppler_userdata(EmbFile);
+new_poppler_userdata(FileSpec);
+new_poppler_userdata(LinkDest);
+new_poppler_userdata(Links);
+new_poppler_userdata(Object);
+new_poppler_userdata(Page);
+new_poppler_userdata(PDFRectangle);
+new_poppler_userdata(Ref);
+new_poppler_userdata(Stream);
+new_poppler_userdata(StructElement);
+new_poppler_userdata(Attribute);
+new_poppler_userdata(TextSpan);
+new_poppler_userdata(StructTreeRoot);
+new_poppler_userdata(XRef);
+
+/* These two can go away as we don't change the document. */
+
+static void pdfdoc_changed_error(lua_State * L)
+{
+ luaL_error(L, "PDFDoc changed or gone");
+}
+
+static void pdfdoc_differs_error(lua_State * L)
+{
+ luaL_error(L, "PDFDoc differs between arguments");
+}
+
+static int l_open_PDFDoc(lua_State * L)
+{
+ const char *file_path;
+ udstruct *uout;
+ PdfDocument *d;
+ file_path = luaL_checkstring(L, 1); // path
+ d = refPdfDocument(file_path, FE_RETURN_NULL);
+ if (d == NULL)
+ lua_pushnil(L);
+ else {
+ if (!(globalParams)) // globalParams could be already created
+ globalParams = new GlobalParams();
+ uout = new_PDFDoc_userdata(L);
+ uout->d = d;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = d->pc;
+ uout->pd = d;
+ }
+ return 1;
+}
+
+static int l_open_MemStreamPDFDoc(lua_State * L)
+{
+ const char *docstream = NULL;
+ char *docstream_usr = NULL ;
+ const char *file_id;
+ unsigned long long stream_size;
+ udstruct *uout;
+ PdfDocument *d;
+ switch (lua_type(L, 1)) {
+ case LUA_TSTRING:
+ docstream = luaL_checkstring(L, 1); // stream as Lua string
+ break;
+ case LUA_TLIGHTUSERDATA:
+ docstream = (const char *) lua_touserdata(L, 1); // stream as sequence of bytes
+ break;
+ default:
+ luaL_error(L, "bad argument: string or lightuserdata expected");
+ }
+ if (docstream==NULL)
+ luaL_error(L, "bad document");
+ stream_size = (unsigned long long) luaL_checkint(L, 2);// size of the stream
+ file_id = luaL_checkstring(L, 3); // a symbolic name for this stream, mandatory
+ if (file_id == NULL)
+ luaL_error(L, "PDFDoc has an invalid id");
+ if (strlen(file_id) >STREAM_FILE_ID_LEN ) // a limit to the length of the string
+ luaL_error(L, "PDFDoc has a too long id");
+ docstream_usr = (char *)gmalloc((unsigned) (stream_size + 1));
+ if (!docstream_usr)
+ luaL_error(L, "no room for PDFDoc");
+ memcpy(docstream_usr, docstream, (stream_size + 1));
+ docstream_usr[stream_size]='\0';
+ d = refMemStreamPdfDocument(docstream_usr, stream_size, file_id);
+ if (d == NULL) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ lua_pushnil(L);
+ } else if (d->file_path == NULL ) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ lua_pushnil(L);
+ }
+ else {
+ if (!(globalParams)) // globalParams could be already created
+ globalParams = new GlobalParams();
+ uout = new_PDFDoc_userdata(L);
+ uout->d = d;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = d->pc;
+ uout->pd = d;
+ lua_pushstring(L,d->file_path);
+ lua_pushstring(L,STREAM_URI);
+ }
+ return 3; // stream, stream_id, stream_uri
+}
+
+#define ATTRIBUTE_TYPE_ENTRY(name) \
+ lua_pushstring(L, #name); \
+ lua_pushinteger(L, Attribute::name); \
+ lua_settable(L,-3)
+
+
+#define OBJECT_TYPE(name) \
+ lua_pushstring(L, #name); \
+ lua_pushinteger(L, (int)name); \
+ lua_settable(L,-3)
+
+
+#define STRUCTELEMENT_TYPE_ENTRY(name) \
+ lua_pushstring(L, #name); \
+ lua_pushinteger(L, StructElement::name); \
+ lua_settable(L,-3)
+
+
+static int l_Attribute_Type(lua_State * L) {
+ lua_createtable (L, 0, 42);
+ ATTRIBUTE_TYPE_ENTRY(BBox);
+ ATTRIBUTE_TYPE_ENTRY(BackgroundColor);
+ ATTRIBUTE_TYPE_ENTRY(BorderColor);
+ ATTRIBUTE_TYPE_ENTRY(BorderThickness);
+ ATTRIBUTE_TYPE_ENTRY(Color);
+ ATTRIBUTE_TYPE_ENTRY(ColumnGap);
+ ATTRIBUTE_TYPE_ENTRY(ColumnWidths);
+ ATTRIBUTE_TYPE_ENTRY(Desc);
+ ATTRIBUTE_TYPE_ENTRY(Role);
+ ATTRIBUTE_TYPE_ENTRY(TextDecorationColor);
+ ATTRIBUTE_TYPE_ENTRY(TextDecorationThickness);
+ ATTRIBUTE_TYPE_ENTRY(BaselineShift);
+ ATTRIBUTE_TYPE_ENTRY(BlockAlign);
+ ATTRIBUTE_TYPE_ENTRY(BorderStyle);
+ ATTRIBUTE_TYPE_ENTRY(ColSpan);
+ ATTRIBUTE_TYPE_ENTRY(ColumnCount);
+ ATTRIBUTE_TYPE_ENTRY(EndIndent);
+ ATTRIBUTE_TYPE_ENTRY(GlyphOrientationVertical);
+ ATTRIBUTE_TYPE_ENTRY(Headers);
+ ATTRIBUTE_TYPE_ENTRY(Height);
+ ATTRIBUTE_TYPE_ENTRY(InlineAlign);
+ ATTRIBUTE_TYPE_ENTRY(LineHeight);
+ ATTRIBUTE_TYPE_ENTRY(ListNumbering);
+ ATTRIBUTE_TYPE_ENTRY(Padding);
+ ATTRIBUTE_TYPE_ENTRY(Placement);
+ ATTRIBUTE_TYPE_ENTRY(RowSpan);
+ ATTRIBUTE_TYPE_ENTRY(RubyAlign);
+ ATTRIBUTE_TYPE_ENTRY(RubyPosition);
+ ATTRIBUTE_TYPE_ENTRY(Scope);
+ ATTRIBUTE_TYPE_ENTRY(SpaceAfter);
+ ATTRIBUTE_TYPE_ENTRY(SpaceBefore);
+ ATTRIBUTE_TYPE_ENTRY(StartIndent);
+ ATTRIBUTE_TYPE_ENTRY(Summary);
+ ATTRIBUTE_TYPE_ENTRY(TBorderStyle);
+ ATTRIBUTE_TYPE_ENTRY(TPadding);
+ ATTRIBUTE_TYPE_ENTRY(TextAlign);
+ ATTRIBUTE_TYPE_ENTRY(TextDecorationType);
+ ATTRIBUTE_TYPE_ENTRY(TextIndent);
+ ATTRIBUTE_TYPE_ENTRY(Width);
+ ATTRIBUTE_TYPE_ENTRY(WritingMode);
+ ATTRIBUTE_TYPE_ENTRY(Unknown);
+ ATTRIBUTE_TYPE_ENTRY(checked);
+ return 1;
+}
+
+static int l_Object_Type(lua_State * L) {
+ lua_createtable(L,0,16);/*nr of ObjType values*/ ;
+ OBJECT_TYPE(objBool);
+ OBJECT_TYPE(objInt);
+ OBJECT_TYPE(objReal);
+ OBJECT_TYPE(objString);
+ OBJECT_TYPE(objName);
+ OBJECT_TYPE(objNull);
+ OBJECT_TYPE(objArray);
+ OBJECT_TYPE(objDict);
+ OBJECT_TYPE(objStream);
+ OBJECT_TYPE(objRef);
+ OBJECT_TYPE(objCmd);
+ OBJECT_TYPE(objError);
+ OBJECT_TYPE(objEOF);
+ OBJECT_TYPE(objNone);
+ OBJECT_TYPE(objInt64);
+ OBJECT_TYPE(objDead);
+ return 1;
+}
+
+static int l_StructElement_Type(lua_State * L) {
+ lua_createtable (L, 0, 50);
+ STRUCTELEMENT_TYPE_ENTRY(Document);
+ STRUCTELEMENT_TYPE_ENTRY(Part);
+ STRUCTELEMENT_TYPE_ENTRY(Art);
+ STRUCTELEMENT_TYPE_ENTRY(Sect);
+ STRUCTELEMENT_TYPE_ENTRY(Div);
+ STRUCTELEMENT_TYPE_ENTRY(BlockQuote);
+ STRUCTELEMENT_TYPE_ENTRY(Caption);
+ STRUCTELEMENT_TYPE_ENTRY(NonStruct);
+ STRUCTELEMENT_TYPE_ENTRY(Index);
+ STRUCTELEMENT_TYPE_ENTRY(Private);
+ STRUCTELEMENT_TYPE_ENTRY(Span);
+ STRUCTELEMENT_TYPE_ENTRY(Quote);
+ STRUCTELEMENT_TYPE_ENTRY(Note);
+ STRUCTELEMENT_TYPE_ENTRY(Reference);
+ STRUCTELEMENT_TYPE_ENTRY(BibEntry);
+ STRUCTELEMENT_TYPE_ENTRY(Code);
+ STRUCTELEMENT_TYPE_ENTRY(Link);
+ STRUCTELEMENT_TYPE_ENTRY(Annot);
+ STRUCTELEMENT_TYPE_ENTRY(Ruby);
+ STRUCTELEMENT_TYPE_ENTRY(RB);
+ STRUCTELEMENT_TYPE_ENTRY(RT);
+ STRUCTELEMENT_TYPE_ENTRY(RP);
+ STRUCTELEMENT_TYPE_ENTRY(Warichu);
+ STRUCTELEMENT_TYPE_ENTRY(WT);
+ STRUCTELEMENT_TYPE_ENTRY(WP);
+ STRUCTELEMENT_TYPE_ENTRY(P);
+ STRUCTELEMENT_TYPE_ENTRY(H);
+ STRUCTELEMENT_TYPE_ENTRY(H1);
+ STRUCTELEMENT_TYPE_ENTRY(H2);
+ STRUCTELEMENT_TYPE_ENTRY(H3);
+ STRUCTELEMENT_TYPE_ENTRY(H4);
+ STRUCTELEMENT_TYPE_ENTRY(H5);
+ STRUCTELEMENT_TYPE_ENTRY(H6);
+ STRUCTELEMENT_TYPE_ENTRY(L);
+ STRUCTELEMENT_TYPE_ENTRY(LI);
+ STRUCTELEMENT_TYPE_ENTRY(Lbl);
+ STRUCTELEMENT_TYPE_ENTRY(LBody);
+ STRUCTELEMENT_TYPE_ENTRY(Table);
+ STRUCTELEMENT_TYPE_ENTRY(TR);
+ STRUCTELEMENT_TYPE_ENTRY(TH);
+ STRUCTELEMENT_TYPE_ENTRY(TD);
+ STRUCTELEMENT_TYPE_ENTRY(THead);
+ STRUCTELEMENT_TYPE_ENTRY(TFoot);
+ STRUCTELEMENT_TYPE_ENTRY(TBody);
+ STRUCTELEMENT_TYPE_ENTRY(Figure);
+ STRUCTELEMENT_TYPE_ENTRY(Formula);
+ STRUCTELEMENT_TYPE_ENTRY(Form);
+ STRUCTELEMENT_TYPE_ENTRY(TOC);
+ STRUCTELEMENT_TYPE_ENTRY(TOCI);
+ lua_pushstring(L, "Unknown");
+ lua_pushinteger(L, 0);
+ lua_settable(L,-3);
+ return 1;
+}
+
+static int l_AttributeOwner_Type(lua_State * L) {
+ lua_createtable (L, 0, 12);
+ lua_pushstring(L, "XML-1.00"); lua_pushinteger(L, Attribute::XML_1_00); lua_settable(L,-3);
+ lua_pushstring(L, "HTML-3.20"); lua_pushinteger(L, Attribute::HTML_3_20); lua_settable(L,-3);
+ lua_pushstring(L, "HTML-4.01"); lua_pushinteger(L, Attribute::HTML_4_01); lua_settable(L,-3);
+ lua_pushstring(L, "OEB-1.00"); lua_pushinteger(L, Attribute::OEB_1_00); lua_settable(L,-3);
+ lua_pushstring(L, "RTF-1.05"); lua_pushinteger(L, Attribute::RTF_1_05); lua_settable(L,-3);
+ lua_pushstring(L, "CSS-1.00"); lua_pushinteger(L, Attribute::CSS_1_00); lua_settable(L,-3);
+ lua_pushstring(L, "CSS-2.00"); lua_pushinteger(L, Attribute::CSS_2_00); lua_settable(L,-3);
+ lua_pushstring(L, "Layout"); lua_pushinteger(L, Attribute::Layout); lua_settable(L,-3);
+ lua_pushstring(L, "PrintField"); lua_pushinteger(L, Attribute::PrintField); lua_settable(L,-3);
+ lua_pushstring(L, "Table"); lua_pushinteger(L, Attribute::Table); lua_settable(L,-3);
+ lua_pushstring(L, "List"); lua_pushinteger(L, Attribute::List); lua_settable(L,-3);
+ lua_pushstring(L, "UserProperties"); lua_pushinteger(L, Attribute::UserProperties);lua_settable(L,-3);
+ return 1;
+}
+
+static const struct luaL_Reg epdflib_f[] = {
+ {"open", l_open_PDFDoc},
+ {"openMemStream", l_open_MemStreamPDFDoc},
+ {"StructElement_Type", l_StructElement_Type},
+ {"Attribute_Type", l_Attribute_Type},
+ {"AttributeOwner_Type",l_AttributeOwner_Type},
+ {"Object_Type", l_Object_Type},
+ {NULL, NULL}
+};
+
+#define m_poppler_get_poppler(in, out, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ out *o; \
+ udstruct *uin, *uout; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ o = ((in *) uin->d)->function(); \
+ if (o != NULL) { \
+ uout = new_##out##_userdata(L); \
+ uout->d = o; \
+ uout->pc = uin->pc; \
+ uout->pd = uin->pd; \
+ } else \
+ lua_pushnil(L); \
+ return 1; \
+}
+
+#define m_poppler_get_BOOL(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ if (((in *) uin->d)->function()) \
+ lua_pushboolean(L, 1); \
+ else \
+ lua_pushboolean(L, 0); \
+ return 1; \
+}
+
+#define m_poppler_get_INT(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ int i; \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ i = (int) ((in *) uin->d)->function(); \
+ lua_pushinteger(L, i); \
+ return 1; \
+}
+
+
+#define m_poppler_get_GUINT(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ unsigned int i; \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ i = (unsigned int) ((in *) uin->d)->function(); \
+ lua_pushinteger(L, i); \
+ return 1; \
+}
+
+#define m_poppler_get_UINT(in, function) \
+m_poppler_get_GUINT(in, function)
+
+
+
+#define m_poppler_get_DOUBLE(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ double d; \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ d = (double) ((in *) uin->d)->function(); \
+ lua_pushnumber(L, d); /* float */ \
+ return 1; \
+}
+
+#define m_poppler_get_GOOSTRING(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ GooString *gs; \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ gs = ((in *) uin->d)->function(); \
+ if (gs != NULL) \
+ lua_pushlstring(L, gs->getCString(), gs->getLength()); \
+ else \
+ lua_pushnil(L); \
+ return 1; \
+}
+
+#define m_poppler_get_OBJECT(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ udstruct *uin, *uout; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ uout = new_Object_userdata(L); \
+ uout->d = new Object(); \
+ *((Object *)uout->d) = ((in *) uin->d)->function(); \
+ uout->atype = ALLOC_LEPDF; \
+ uout->pc = uin->pc; \
+ uout->pd = uin->pd; \
+ return 1; \
+}
+
+#define m_poppler_do(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ ((in *) uin->d)->function(); \
+ return 0; \
+}
+
+#define m_poppler__tostring(type) \
+static int m_##type##__tostring(lua_State * L) \
+{ \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##type); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ lua_pushfstring(L, "%s: %p", #type, (type *) uin->d); \
+ return 1; \
+}
+
+#define m_poppler_check_string(in, function) \
+static int m_##in##_##function(lua_State * L) \
+{ \
+ const char *s; \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ s = luaL_checkstring(L, 2); \
+ if (((in *) uin->d)->function(s)) \
+ lua_pushboolean(L, 1); \
+ else \
+ lua_pushboolean(L, 0); \
+ return 1; \
+}
+
+/* Annot */
+
+m_poppler_get_BOOL(Annot, isOk);
+
+static int m_Annot_match(lua_State * L)
+{
+ udstruct *uin, *uref;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Annot);
+ uref = (udstruct *) luaL_checkudata(L, 2, M_Ref);
+ if (uin->pd != NULL && uref->pd != NULL && uin->pd != uref->pd)
+ pdfdoc_differs_error(L);
+ if ((uin->pd != NULL && uin->pd->pc != uin->pc)
+ || (uref->pd != NULL && uref->pd->pc != uref->pc))
+ pdfdoc_changed_error(L);
+ lua_pushboolean(L, ((Annot *) uin->d)->match((Ref *) uref->d));
+ return 1;
+}
+
+m_poppler__tostring(Annot);
+
+static int m_Annot__gc(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Annot);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+#ifdef DEBUG
+ printf("\n===== Annot GC ===== uin=<%p>\n", uin);
+#endif
+ if (uin->atype == ALLOC_LEPDF)
+#if 1 /* def HAVE_ANNOTDECREFCNT */
+ ((Annot *) uin->d)->decRefCnt();
+#else
+ delete(Annot *) uin->d;
+#endif
+ return 0;
+}
+
+static const struct luaL_Reg Annot_m[] = {
+ {"isOk", m_Annot_isOk},
+ {"match", m_Annot_match},
+ {"__tostring", m_Annot__tostring},
+ {"__gc", m_Annot__gc},
+ {NULL, NULL}
+};
+
+/* Annots */
+
+m_poppler_get_INT(Annots, getNumAnnots);
+
+static int m_Annots_getAnnot(lua_State * L)
+{
+ int i, annots;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Annots);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ annots = ((Annots *) uin->d)->getNumAnnots();
+ if (i > 0 && i <= annots) {
+ uout = new_Annot_userdata(L);
+ uout->d = ((Annots *) uin->d)->getAnnot(i);
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler__tostring(Annots);
+
+static const struct luaL_Reg Annots_m[] = {
+ {"getNumAnnots", m_Annots_getNumAnnots},
+ {"getAnnot", m_Annots_getAnnot},
+ {"__tostring", m_Annots__tostring},
+ {NULL, NULL}
+};
+
+/* Array */
+
+m_poppler_get_INT(Array, getLength);
+
+static int m_Array_get(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Array);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Array *) uin->d)->getLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Array *) uin->d)->get(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Array_getNF(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Array);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Array *) uin->d)->getLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Array_getString(lua_State * L)
+{
+ GooString *gs;
+ int i, len;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Array);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Array *) uin->d)->getLength();
+ if (i > 0 && i <= len) {
+ gs = new GooString();
+ if (((Array *) uin->d)->getString(i - 1, gs))
+ lua_pushlstring(L, gs->getCString(), gs->getLength());
+ else
+ lua_pushnil(L);
+ delete gs;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler__tostring(Array);
+
+static const struct luaL_Reg Array_m[] = {
+ {"getLength", m_Array_getLength},
+ {"get", m_Array_get},
+ {"getNF", m_Array_getNF},
+ {"getString", m_Array_getString},
+ {"__tostring", m_Array__tostring},
+ {NULL, NULL}
+};
+
+/* Catalog */
+
+m_poppler_get_BOOL(Catalog, isOk);
+m_poppler_get_INT(Catalog, getNumPages);
+
+static int m_Catalog_getPage(lua_State * L)
+{
+ int i, pages;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ pages = ((Catalog *) uin->d)->getNumPages();
+ if (i > 0 && i <= pages) {
+ uout = new_Page_userdata(L);
+ uout->d = ((Catalog *) uin->d)->getPage(i);
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Catalog_getPageRef(lua_State * L)
+{
+ int i, pages;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ pages = ((Catalog *) uin->d)->getNumPages();
+ if (i > 0 && i <= pages) {
+ uout = new_Ref_userdata(L);
+ uout->d = (Ref *) gmalloc(sizeof(Ref));
+ ((Ref *) uout->d)->num = ((Catalog *) uin->d)->getPageRef(i)->num;
+ ((Ref *) uout->d)->gen = ((Catalog *) uin->d)->getPageRef(i)->gen;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler_get_GOOSTRING(Catalog, getBaseURI);
+m_poppler_get_GOOSTRING(Catalog, readMetadata);
+m_poppler_get_poppler(Catalog, StructTreeRoot, getStructTreeRoot);
+
+static int m_Catalog_findPage(lua_State * L)
+{
+ int num, gen, i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ num = luaL_checkint(L, 2);
+ gen = luaL_checkint(L, 3);
+ i = ((Catalog *) uin->d)->findPage(num, gen);
+ if (i > 0)
+ lua_pushinteger(L, i);
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Catalog_findDest(lua_State * L)
+{
+ GooString *name;
+ LinkDest *dest;
+ const char *s;
+ size_t len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checklstring(L, 2, &len);
+ name = new GooString(s, len);
+ dest = ((Catalog *) uin->d)->findDest(name);
+ if (dest != NULL) {
+ uout = new_LinkDest_userdata(L);
+ uout->d = dest;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ delete name;
+ return 1;
+}
+
+m_poppler_get_poppler(Catalog, Object, getDests);
+m_poppler_get_INT(Catalog, numEmbeddedFiles);
+
+static int m_Catalog_embeddedFile(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Catalog *) uin->d)->numEmbeddedFiles();
+ if (i > 0 && i <= len) {
+ uout = new_FileSpec_userdata(L);
+ uout->d = ((Catalog *) uin->d)->embeddedFile(i - 1);
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler_get_INT(Catalog, numJS);
+
+static int m_Catalog_getJS(lua_State * L)
+{
+ GooString *gs;
+ int i, len;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Catalog *) uin->d)->numJS();
+ if (i > 0 && i <= len) {
+ gs = ((Catalog *) uin->d)->getJS(i - 1);
+ if (gs != NULL)
+ lua_pushlstring(L, gs->getCString(), gs->getLength());
+ else
+ lua_pushnil(L);
+ delete gs;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler_get_poppler(Catalog, Object, getOutline);
+m_poppler_get_poppler(Catalog, Object, getAcroForm);
+
+m_poppler__tostring(Catalog);
+
+static const struct luaL_Reg Catalog_m[] = {
+ {"isOk", m_Catalog_isOk},
+ {"getNumPages", m_Catalog_getNumPages},
+ {"getPage", m_Catalog_getPage},
+ {"getPageRef", m_Catalog_getPageRef},
+ {"getBaseURI", m_Catalog_getBaseURI},
+ {"readMetadata", m_Catalog_readMetadata},
+ {"getStructTreeRoot", m_Catalog_getStructTreeRoot},
+ {"findPage", m_Catalog_findPage},
+ {"findDest", m_Catalog_findDest},
+ {"getDests", m_Catalog_getDests},
+ {"numEmbeddedFiles", m_Catalog_numEmbeddedFiles},
+ {"embeddedFile", m_Catalog_embeddedFile},
+ {"numJS", m_Catalog_numJS},
+ {"getJS", m_Catalog_getJS},
+ {"getOutline", m_Catalog_getOutline},
+ {"getAcroForm", m_Catalog_getAcroForm},
+ {"__tostring", m_Catalog__tostring},
+ {NULL, NULL}
+};
+
+/* Dict */
+
+m_poppler_get_INT(Dict, getLength);
+
+m_poppler_check_string(Dict, is);
+
+static int m_Dict_lookup(lua_State * L)
+{
+ const char *s;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Dict *) uin->d)->lookup(s);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+static int m_Dict_lookupNF(lua_State * L)
+{
+ const char *s;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+static int m_Dict_lookupInt(lua_State * L)
+{
+ const char *s1, *s2;
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s1 = luaL_checkstring(L, 2);
+ s2 = luaL_checkstring(L, 3);
+ if (((Dict *) uin->d)->lookupInt(s1, s2, &i))
+ lua_pushinteger(L, i);
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Dict_getKey(lua_State * L)
+{
+ int i, len;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Dict *) uin->d)->getLength();
+ if (i > 0 && i <= len)
+ lua_pushstring(L, ((Dict *) uin->d)->getKey(i - 1));
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Dict_getVal(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Dict *) uin->d)->getLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Dict *) uin->d)->getVal(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Dict_getValNF(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ len = ((Dict *) uin->d)->getLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler_check_string(Dict, hasKey);
+
+m_poppler__tostring(Dict);
+
+static const struct luaL_Reg Dict_m[] = {
+ {"getLength", m_Dict_getLength},
+ {"is", m_Dict_is},
+ {"lookup", m_Dict_lookup},
+ {"lookupNF", m_Dict_lookupNF},
+ {"lookupInt", m_Dict_lookupInt},
+ {"getKey", m_Dict_getKey},
+ {"getVal", m_Dict_getVal},
+ {"getValNF", m_Dict_getValNF},
+ {"hasKey", m_Dict_hasKey},
+ {"__tostring", m_Dict__tostring},
+ {NULL, NULL}
+};
+
+/* EmbFile */
+
+m_poppler_get_INT(EmbFile, size);
+m_poppler_get_GOOSTRING(EmbFile, modDate);
+m_poppler_get_GOOSTRING(EmbFile, createDate);
+m_poppler_get_GOOSTRING(EmbFile, checksum);
+m_poppler_get_GOOSTRING(EmbFile, mimeType);
+
+m_poppler_get_BOOL(EmbFile, isOk);
+
+static int m_EmbFile_save(lua_State * L)
+{
+ const char *s;
+ size_t len;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_EmbFile);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checklstring(L, 2, &len);
+ if (((EmbFile *) uin->d)->save(s))
+ lua_pushboolean(L, 1);
+ else
+ lua_pushboolean(L, 0);
+ return 1;
+}
+
+m_poppler__tostring(EmbFile);
+
+static const struct luaL_Reg EmbFile_m[] = {
+ {"size", m_EmbFile_size},
+ {"modDate", m_EmbFile_modDate},
+ {"createDate", m_EmbFile_createDate},
+ {"checksum", m_EmbFile_checksum},
+ {"mimeType", m_EmbFile_mimeType},
+ {"isOk", m_EmbFile_isOk},
+ {"save", m_EmbFile_save},
+ {"__tostring", m_EmbFile__tostring},
+ {NULL, NULL}
+};
+
+/* FileSpec */
+
+m_poppler_get_BOOL(FileSpec, isOk);
+m_poppler_get_GOOSTRING(FileSpec, getFileName);
+m_poppler_get_GOOSTRING(FileSpec, getFileNameForPlatform);
+m_poppler_get_GOOSTRING(FileSpec, getDescription);
+
+static int m_FileSpec_getEmbeddedFile(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_FileSpec);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ uout = new_EmbFile_userdata(L);
+ uout->d = ((FileSpec *) uin->d)->getEmbeddedFile();
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+m_poppler__tostring(FileSpec);
+
+static const struct luaL_Reg FileSpec_m[] = {
+ {"isOk", m_FileSpec_isOk},
+ {"getFileName", m_FileSpec_getFileName},
+ {"getFileNameForPlatform", m_FileSpec_getFileNameForPlatform},
+ {"getDescription", m_FileSpec_getDescription},
+ {"getEmbeddedFile", m_FileSpec_getEmbeddedFile},
+ {"__tostring", m_FileSpec__tostring},
+ {NULL, NULL}
+};
+
+/* GooString */
+
+static int m_GooString__tostring(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_GooString);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ lua_pushlstring(L, ((GooString *) uin->d)->getCString(),
+ ((GooString *) uin->d)->getLength());
+ return 1;
+}
+
+static const struct luaL_Reg GooString_m[] = {
+ {"__tostring", m_GooString__tostring},
+ {NULL, NULL}
+};
+
+/* LinkDest */
+
+static const char *LinkDestKindNames[] = {
+ "XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", "FitBV",
+ NULL
+};
+
+m_poppler_get_BOOL(LinkDest, isOk);
+
+static int m_LinkDest_getKind(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_LinkDest);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = (int) ((LinkDest *) uin->d)->getKind();
+ lua_pushinteger(L, i);
+ return 1;
+}
+
+static int m_LinkDest_getKindName(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_LinkDest);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = (int) ((LinkDest *) uin->d)->getKind();
+ lua_pushstring(L, LinkDestKindNames[i]);
+ return 1;
+}
+
+m_poppler_get_BOOL(LinkDest, isPageRef);
+m_poppler_get_INT(LinkDest, getPageNum);
+
+static int m_LinkDest_getPageRef(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_LinkDest);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ uout = new_Ref_userdata(L);
+ uout->d = (Ref *) gmalloc(sizeof(Ref));
+ ((Ref *) uout->d)->num = ((LinkDest *) uin->d)->getPageRef().num;
+ ((Ref *) uout->d)->gen = ((LinkDest *) uin->d)->getPageRef().gen;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+m_poppler_get_DOUBLE(LinkDest, getLeft);
+m_poppler_get_DOUBLE(LinkDest, getBottom);
+m_poppler_get_DOUBLE(LinkDest, getRight);
+m_poppler_get_DOUBLE(LinkDest, getTop);
+m_poppler_get_DOUBLE(LinkDest, getZoom);
+m_poppler_get_BOOL(LinkDest, getChangeLeft);
+m_poppler_get_BOOL(LinkDest, getChangeTop);
+m_poppler_get_BOOL(LinkDest, getChangeZoom);
+
+m_poppler__tostring(LinkDest);
+
+static const struct luaL_Reg LinkDest_m[] = {
+ {"isOk", m_LinkDest_isOk},
+ {"getKind", m_LinkDest_getKind},
+ {"getKindName", m_LinkDest_getKindName}, // not poppler
+ {"isPageRef", m_LinkDest_isPageRef},
+ {"getPageNum", m_LinkDest_getPageNum},
+ {"getPageRef", m_LinkDest_getPageRef},
+ {"getLeft", m_LinkDest_getLeft},
+ {"getBottom", m_LinkDest_getBottom},
+ {"getRight", m_LinkDest_getRight},
+ {"getTop", m_LinkDest_getTop},
+ {"getZoom", m_LinkDest_getZoom},
+ {"getChangeLeft", m_LinkDest_getChangeLeft},
+ {"getChangeTop", m_LinkDest_getChangeTop},
+ {"getChangeZoom", m_LinkDest_getChangeZoom},
+ {"__tostring", m_LinkDest__tostring},
+ {NULL, NULL}
+};
+
+/* Links */
+
+m_poppler_get_INT(Links, getNumLinks);
+
+m_poppler__tostring(Links);
+
+static const struct luaL_Reg Links_m[] = {
+ {"getNumLinks", m_Links_getNumLinks},
+ {"__tostring", m_Links__tostring},
+ {NULL, NULL}
+};
+
+/* Object */
+
+#ifdef HAVE_OBJECT_INITCMD_CONST_CHARP
+#define CHARP_CAST
+#else
+/*
+ Must cast arg of Object::initCmd, Object::isStream, and Object::streamIs
+ from 'const char *' to 'char *', although they are not modified.
+*/
+#define CHARP_CAST (char *)
+#endif
+
+/* Special type checking. */
+
+#define m_Object_isType_(function, cast) \
+static int m_Object_##function(lua_State * L) \
+{ \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ if (lua_gettop(L) >= 2) { \
+ if (lua_isstring(L, 2) \
+ && ((Object *) uin->d)->function(cast lua_tostring(L, 2))) \
+ lua_pushboolean(L, 1); \
+ else \
+ lua_pushboolean(L, 0); \
+ } else { \
+ if (((Object *) uin->d)->function()) \
+ lua_pushboolean(L, 1); \
+ else \
+ lua_pushboolean(L, 0); \
+ } \
+ return 1; \
+}
+
+#define m_Object_isType(function) m_Object_isType_(function, )
+#define m_Object_isType_nonconst(function) m_Object_isType_(function, CHARP_CAST)
+
+static int m_Object_fetch(lua_State * L)
+{
+ udstruct *uin, *uxref, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ uxref = (udstruct *) luaL_checkudata(L, 2, M_XRef);
+ if (uin->pd != NULL && uxref->pd != NULL && uin->pd != uxref->pd)
+ pdfdoc_differs_error(L);
+ if ((uin->pd != NULL && uin->pd->pc != uin->pc)
+ || (uxref->pd != NULL && uxref->pd->pc != uxref->pc))
+ pdfdoc_changed_error(L);
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Object *) uin->d)->fetch((XRef *) uxref->d);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+static int m_Object_getType(lua_State * L)
+{
+ ObjType t;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ t = ((Object *) uin->d)->getType();
+ lua_pushinteger(L, (int) t);
+ return 1;
+}
+
+static int m_Object_getTypeName(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ lua_pushstring(L, ((Object *) uin->d)->getTypeName());
+ return 1;
+}
+
+m_poppler_get_BOOL(Object, isBool);
+m_poppler_get_BOOL(Object, isInt);
+m_poppler_get_BOOL(Object, isReal);
+m_poppler_get_BOOL(Object, isNum);
+m_poppler_get_BOOL(Object, isString);
+m_Object_isType(isName);
+m_poppler_get_BOOL(Object, isNull);
+m_poppler_get_BOOL(Object, isArray);
+m_Object_isType(isDict);
+m_Object_isType_nonconst(isStream);
+m_poppler_get_BOOL(Object, isRef);
+m_Object_isType(isCmd);
+m_poppler_get_BOOL(Object, isError);
+m_poppler_get_BOOL(Object, isEOF);
+m_poppler_get_BOOL(Object, isNone);
+
+static int m_Object_getBool(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isBool()) {
+ if (((Object *) uin->d)->getBool())
+ lua_pushboolean(L, 1);
+ else
+ lua_pushboolean(L, 0);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getInt(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isInt())
+ lua_pushinteger(L, ((Object *) uin->d)->getInt());
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getReal(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isReal())
+ lua_pushnumber(L, ((Object *) uin->d)->getReal()); /* float */
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getNum(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isInt())
+ lua_pushinteger(L, ((Object *) uin->d)->getInt());
+ else if (((Object *) uin->d)->isReal())
+ lua_pushinteger(L, ((Object *) uin->d)->getReal());
+ else if (((Object *) uin->d)->isNum()) /* redundant */
+ lua_pushnumber(L, ((Object *) uin->d)->getNum()); /* integer or float */
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getString(lua_State * L)
+{
+ GooString *gs;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isString()) {
+ gs = ((Object *) uin->d)->getString();
+ lua_pushlstring(L, gs->getCString(), gs->getLength());
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getName(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isName())
+ lua_pushstring(L, ((Object *) uin->d)->getName());
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getArray(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isArray()) {
+ uout = new_Array_userdata(L);
+ uout->d = ((Object *) uin->d)->getArray();
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getDict(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isDict()) {
+ uout = new_Dict_userdata(L);
+ uout->d = ((Object *) uin->d)->getDict();
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getStream(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isStream()) {
+ uout = new_Stream_userdata(L);
+ uout->d = ((Object *) uin->d)->getStream();
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getRef(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isRef()) {
+ uout = new_Ref_userdata(L);
+ uout->d = (Ref *) gmalloc(sizeof(Ref));
+ ((Ref *) uout->d)->num = ((Object *) uin->d)->getRef().num;
+ ((Ref *) uout->d)->gen = ((Object *) uin->d)->getRef().gen;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getRefNum(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isRef()) {
+ i = ((Object *) uin->d)->getRef().num;
+ lua_pushinteger(L, i);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getRefGen(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isRef()) {
+ i = ((Object *) uin->d)->getRef().gen;
+ lua_pushinteger(L, i);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_getCmd(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isCmd())
+ lua_pushstring(L, ((Object *) uin->d)->getCmd());
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_arrayGetLength(lua_State * L)
+{
+ int len;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isArray()) {
+ len = ((Object *) uin->d)->arrayGetLength();
+ lua_pushinteger(L, len);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_arrayGet(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ if (((Object *) uin->d)->isArray()) {
+ len = ((Object *) uin->d)->arrayGetLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Object *) uin->d)->arrayGet(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_arrayGetNF(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ if (((Object *) uin->d)->isArray()) {
+ len = ((Object *) uin->d)->arrayGetLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_dictGetLength(lua_State * L)
+{
+ int len;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isDict()) {
+ len = ((Object *) uin->d)->dictGetLength();
+ lua_pushinteger(L, len);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_dictLookup(lua_State * L)
+{
+ const char *s;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ if (((Object *) uin->d)->isDict()) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Object *) uin->d)->dictLookup(s);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_dictLookupNF(lua_State * L)
+{
+ const char *s;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ if (((Object *) uin->d)->isDict()) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_dictGetKey(lua_State * L)
+{
+ int i, len;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ if (((Object *) uin->d)->isDict()) {
+ len = ((Object *) uin->d)->dictGetLength();
+ if (i > 0 && i <= len)
+ lua_pushstring(L, ((Object *) uin->d)->dictGetKey(i - 1));
+ else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_dictGetVal(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ if (((Object *) uin->d)->isDict()) {
+ len = ((Object *) uin->d)->dictGetLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Object *) uin->d)->dictGetVal(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_dictGetValNF(lua_State * L)
+{
+ int i, len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ if (((Object *) uin->d)->isDict()) {
+ len = ((Object *) uin->d)->dictGetLength();
+ if (i > 0 && i <= len) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_streamIs(lua_State * L)
+{
+ const char *s;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ if (((Object *) uin->d)->isStream()) {
+ if (((Object *) uin->d)->streamIs(CHARP_CAST s))
+ lua_pushboolean(L, 1);
+ else
+ lua_pushboolean(L, 0);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_streamReset(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isStream())
+ ((Object *) uin->d)->streamReset();
+ return 0;
+}
+
+static int m_Object_streamGetChar(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isStream()) {
+ i = ((Object *) uin->d)->streamGetChar();
+ lua_pushinteger(L, i);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_streamLookChar(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isStream()) {
+ i = ((Object *) uin->d)->streamLookChar();
+ lua_pushinteger(L, i);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_streamGetPos(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isStream()) {
+ i = (int) ((Object *) uin->d)->streamGetPos();
+ lua_pushinteger(L, i);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object_streamSetPos(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ if (((Object *) uin->d)->isStream())
+ ((Object *) uin->d)->streamSetPos(i);
+ return 0;
+}
+
+static int m_Object_streamGetDict(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((Object *) uin->d)->isStream()) {
+ uout = new_Dict_userdata(L);
+ uout->d = ((Object *) uin->d)->streamGetDict();
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_Object__gc(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+#ifdef DEBUG
+ printf("\n===== Object GC ===== uin=<%p>\n", uin);
+#endif
+ if (uin->atype == ALLOC_LEPDF) {
+ /* free() seems to collide with the lua gc */
+ /* */
+ /* ((Object *) uin->d)->free(); */
+ /* */
+ delete(Object *) uin->d;
+ }
+ return 0;
+}
+
+m_poppler__tostring(Object);
+
+static const struct luaL_Reg Object_m[] = {
+ {"fetch", m_Object_fetch},
+ {"getType", m_Object_getType},
+ {"getTypeName", m_Object_getTypeName},
+ {"isBool", m_Object_isBool},
+ {"isInt", m_Object_isInt},
+ {"isReal", m_Object_isReal},
+ {"isNum", m_Object_isNum},
+ {"isString", m_Object_isString},
+ {"isName", m_Object_isName},
+ {"isNull", m_Object_isNull},
+ {"isArray", m_Object_isArray},
+ {"isDict", m_Object_isDict},
+ {"isStream", m_Object_isStream},
+ {"isRef", m_Object_isRef},
+ {"isCmd", m_Object_isCmd},
+ {"isError", m_Object_isError},
+ {"isEOF", m_Object_isEOF},
+ {"isNone", m_Object_isNone},
+ {"getBool", m_Object_getBool},
+ {"getInt", m_Object_getInt},
+ {"getReal", m_Object_getReal},
+ {"getNum", m_Object_getNum},
+ {"getString", m_Object_getString},
+ {"getName", m_Object_getName},
+ {"getArray", m_Object_getArray},
+ {"getDict", m_Object_getDict},
+ {"getStream", m_Object_getStream},
+ {"getRef", m_Object_getRef},
+ {"getRefNum", m_Object_getRefNum},
+ {"getRefGen", m_Object_getRefGen},
+ {"getCmd", m_Object_getCmd},
+ {"arrayGetLength", m_Object_arrayGetLength},
+ {"arrayGet", m_Object_arrayGet},
+ {"arrayGetNF", m_Object_arrayGetNF},
+ {"dictGetLength", m_Object_dictGetLength},
+ {"dictLookup", m_Object_dictLookup},
+ {"dictLookupNF", m_Object_dictLookupNF},
+ {"dictGetKey", m_Object_dictGetKey},
+ {"dictGetVal", m_Object_dictGetVal},
+ {"dictGetValNF", m_Object_dictGetValNF},
+ {"streamIs", m_Object_streamIs},
+ {"streamReset", m_Object_streamReset},
+ {"streamGetChar", m_Object_streamGetChar},
+ {"streamLookChar", m_Object_streamLookChar},
+ {"streamGetPos", m_Object_streamGetPos},
+ {"streamSetPos", m_Object_streamSetPos},
+ {"streamGetDict", m_Object_streamGetDict},
+ {"__tostring", m_Object__tostring},
+ {"__gc", m_Object__gc},
+ {NULL, NULL}
+};
+
+/* Page */
+
+m_poppler_get_BOOL(Page, isOk);
+m_poppler_get_INT(Page, getNum);
+m_poppler_get_poppler(Page, PDFRectangle, getMediaBox);
+m_poppler_get_poppler(Page, PDFRectangle, getCropBox);
+m_poppler_get_BOOL(Page, isCropped);
+m_poppler_get_DOUBLE(Page, getMediaWidth);
+m_poppler_get_DOUBLE(Page, getMediaHeight);
+m_poppler_get_DOUBLE(Page, getCropWidth);
+m_poppler_get_DOUBLE(Page, getCropHeight);
+m_poppler_get_poppler(Page, PDFRectangle, getBleedBox);
+m_poppler_get_poppler(Page, PDFRectangle, getTrimBox);
+m_poppler_get_poppler(Page, PDFRectangle, getArtBox);
+m_poppler_get_INT(Page, getRotate);
+m_poppler_get_GOOSTRING(Page, getLastModified);
+m_poppler_get_poppler(Page, Dict, getBoxColorInfo);
+m_poppler_get_poppler(Page, Dict, getGroup);
+m_poppler_get_poppler(Page, Stream, getMetadata);
+m_poppler_get_poppler(Page, Dict, getPieceInfo);
+m_poppler_get_poppler(Page, Dict, getSeparationInfo);
+m_poppler_get_poppler(Page, Dict, getResourceDict);
+m_poppler_get_OBJECT(Page, getAnnotsObject);
+
+m_poppler_get_OBJECT(Page, getContents);
+
+m_poppler__tostring(Page);
+
+static const struct luaL_Reg Page_m[] = {
+ {"isOk", m_Page_isOk},
+ {"getNum", m_Page_getNum},
+ {"getMediaBox", m_Page_getMediaBox},
+ {"getCropBox", m_Page_getCropBox},
+ {"isCropped", m_Page_isCropped},
+ {"getMediaWidth", m_Page_getMediaWidth},
+ {"getMediaHeight", m_Page_getMediaHeight},
+ {"getCropWidth", m_Page_getCropWidth},
+ {"getCropHeight", m_Page_getCropHeight},
+ {"getBleedBox", m_Page_getBleedBox},
+ {"getTrimBox", m_Page_getTrimBox},
+ {"getArtBox", m_Page_getArtBox},
+ {"getRotate", m_Page_getRotate},
+ {"getLastModified", m_Page_getLastModified},
+ {"getBoxColorInfo", m_Page_getBoxColorInfo},
+ {"getGroup", m_Page_getGroup},
+ {"getMetadata", m_Page_getMetadata},
+ {"getPieceInfo", m_Page_getPieceInfo},
+ {"getSeparationInfo", m_Page_getSeparationInfo},
+ {"getResourceDict", m_Page_getResourceDict},
+ {"getAnnotsObject", m_Page_getAnnotsObject},
+ {"getContents", m_Page_getContents},
+ {"__tostring", m_Page__tostring},
+ {NULL, NULL}
+};
+
+/* PDFDoc */
+
+#define m_PDFDoc_BOOL(function) \
+static int m_PDFDoc_##function(lua_State * L) \
+{ \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ if (((PdfDocument *) uin->d)->doc->function()) \
+ lua_pushboolean(L, 1); \
+ else \
+ lua_pushboolean(L, 0); \
+ return 1; \
+}
+
+#define m_PDFDoc_INT(function) \
+static int m_PDFDoc_##function(lua_State * L) \
+{ \
+ int i; \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ i = ((PdfDocument *) uin->d)->doc->function(); \
+ lua_pushinteger(L, i); \
+ return 1; \
+}
+
+m_PDFDoc_BOOL(isOk);
+m_PDFDoc_INT(getErrorCode);
+
+static int m_PDFDoc_getFileName(lua_State * L)
+{
+ GooString *gs;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ gs = ((PdfDocument *) uin->d)->doc->getFileName();
+ if (gs != NULL)
+ lua_pushlstring(L, gs->getCString(), gs->getLength());
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFDoc_getErrorCodeName(lua_State * L)
+{
+ int i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = ((PdfDocument *) uin->d)->doc->getErrorCode();
+ lua_pushstring(L, ErrorCodeNames[i]);
+ return 1;
+}
+
+static int m_PDFDoc_getXRef(lua_State * L)
+{
+ XRef *xref;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ xref = ((PdfDocument *) uin->d)->doc->getXRef();
+ if (xref->isOk()) {
+ uout = new_XRef_userdata(L);
+ uout->d = xref;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFDoc_getCatalog(lua_State * L)
+{
+ Catalog *cat;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ cat = ((PdfDocument *) uin->d)->doc->getCatalog();
+ if (cat->isOk()) {
+ uout = new_Catalog_userdata(L);
+ uout->d = cat;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+#define m_PDFDoc_PAGEDIMEN(function) \
+static int m_PDFDoc_##function(lua_State * L) \
+{ \
+ int i, pages; \
+ double d; \
+ udstruct *uin; \
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc); \
+ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
+ pdfdoc_changed_error(L); \
+ i = luaL_checkint(L, 2); \
+ pages = ((PdfDocument *) uin->d)->doc->getNumPages(); \
+ if (i > 0 && i <= pages) { \
+ d = (double) ((PdfDocument *) uin->d)->doc->function(i); \
+ lua_pushnumber(L, d); /* float */ \
+ } else \
+ lua_pushnil(L); \
+ return 1; \
+}
+
+m_PDFDoc_PAGEDIMEN(getPageMediaWidth);
+m_PDFDoc_PAGEDIMEN(getPageMediaHeight);
+m_PDFDoc_PAGEDIMEN(getPageCropWidth);
+m_PDFDoc_PAGEDIMEN(getPageCropHeight);
+m_PDFDoc_INT(getNumPages);
+
+static int m_PDFDoc_readMetadata(lua_State * L)
+{
+ GooString *gs;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
+ gs = ((PdfDocument *) uin->d)->doc->readMetadata();
+ if (gs != NULL)
+ lua_pushlstring(L, gs->getCString(), gs->getLength());
+ else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFDoc_getStructTreeRoot(lua_State * L)
+{
+ StructTreeRoot *obj;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
+ obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
+ uout = new_StructTreeRoot_userdata(L);
+ uout->d = obj;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFDoc_findPage(lua_State * L)
+{
+ int num, gen, i;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ num = luaL_checkint(L, 2);
+ gen = luaL_checkint(L, 3);
+ if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
+ i = ((PdfDocument *) uin->d)->doc->findPage(num, gen);
+ if (i > 0)
+ lua_pushinteger(L, i);
+ else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFDoc_getLinks(lua_State * L)
+{
+ int i, pages;
+ Links *links;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+ pages = ((PdfDocument *) uin->d)->doc->getNumPages();
+ if (i > 0 && i <= pages) {
+ links = ((PdfDocument *) uin->d)->doc->getLinks(i);
+ if (links != NULL) {
+ uout = new_Links_userdata(L);
+ uout->d = links;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFDoc_findDest(lua_State * L)
+{
+ GooString *name;
+ LinkDest *dest;
+ const char *s;
+ size_t len;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checklstring(L, 2, &len);
+ name = new GooString(s, len);
+ if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
+ dest = ((PdfDocument *) uin->d)->doc->findDest(name);
+ if (dest != NULL) {
+ uout = new_LinkDest_userdata(L);
+ uout->d = dest;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ delete name;
+ return 1;
+}
+
+m_PDFDoc_BOOL(isEncrypted);
+m_PDFDoc_BOOL(okToPrint);
+m_PDFDoc_BOOL(okToChange);
+m_PDFDoc_BOOL(okToCopy);
+m_PDFDoc_BOOL(okToAddNotes);
+m_PDFDoc_BOOL(isLinearized);
+
+static int m_PDFDoc_getDocInfo(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((PdfDocument *) uin->d)->doc->getDocInfo();
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFDoc_getDocInfoNF(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) {
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((PdfDocument *) uin->d)->doc->getDocInfoNF();
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_PDFDoc_INT(getPDFMajorVersion);
+m_PDFDoc_INT(getPDFMinorVersion);
+
+m_poppler__tostring(PDFDoc);
+
+static int m_PDFDoc__gc(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+#ifdef DEBUG
+ printf("\n===== PDFDoc GC ===== file_path=<%s>\n",
+ ((PdfDocument *) uin->d)->file_path);
+#endif
+ assert(uin->atype == ALLOC_LEPDF);
+ unrefPdfDocument(((PdfDocument *) uin->d)->file_path);
+ return 0;
+}
+
+static const struct luaL_Reg PDFDoc_m[] = {
+ {"isOk", m_PDFDoc_isOk},
+ {"getErrorCode", m_PDFDoc_getErrorCode},
+ {"getErrorCodeName", m_PDFDoc_getErrorCodeName}, // not poppler
+ {"getFileName", m_PDFDoc_getFileName},
+ {"getXRef", m_PDFDoc_getXRef},
+ {"getCatalog", m_PDFDoc_getCatalog},
+ {"getPageMediaWidth", m_PDFDoc_getPageMediaWidth},
+ {"getPageMediaHeight", m_PDFDoc_getPageMediaHeight},
+ {"getPageCropWidth", m_PDFDoc_getPageCropWidth},
+ {"getPageCropHeight", m_PDFDoc_getPageCropHeight},
+ {"getNumPages", m_PDFDoc_getNumPages},
+ {"readMetadata", m_PDFDoc_readMetadata},
+ {"getStructTreeRoot", m_PDFDoc_getStructTreeRoot},
+ {"findPage", m_PDFDoc_findPage},
+ {"getLinks", m_PDFDoc_getLinks},
+ {"findDest", m_PDFDoc_findDest},
+ {"isEncrypted", m_PDFDoc_isEncrypted},
+ {"okToPrint", m_PDFDoc_okToPrint},
+ {"okToChange", m_PDFDoc_okToChange},
+ {"okToCopy", m_PDFDoc_okToCopy},
+ {"okToAddNotes", m_PDFDoc_okToAddNotes},
+ {"isLinearized", m_PDFDoc_isLinearized},
+ {"getDocInfo", m_PDFDoc_getDocInfo},
+ {"getDocInfoNF", m_PDFDoc_getDocInfoNF},
+ {"getPDFMajorVersion", m_PDFDoc_getPDFMajorVersion},
+ {"getPDFMinorVersion", m_PDFDoc_getPDFMinorVersion},
+ {"__tostring", m_PDFDoc__tostring},
+ {"__gc", m_PDFDoc__gc},
+ {NULL, NULL}
+};
+
+/* PDFRectangle */
+
+m_poppler_get_BOOL(PDFRectangle, isValid);
+
+m_poppler__tostring(PDFRectangle);
+
+static int m_PDFRectangle__index(lua_State * L)
+{
+ const char *s;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFRectangle);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ if (strlen(s) == 2) {
+ if (s[0] == 'x') {
+ if (s[1] == '1')
+ lua_pushnumber(L, ((PDFRectangle *) uin->d)->x1); /* float */
+ else if (s[1] == '2')
+ lua_pushnumber(L, ((PDFRectangle *) uin->d)->x2); /* float */
+ else
+ lua_pushnil(L);
+ } else if (s[0] == 'y') {
+ if (s[1] == '1')
+ lua_pushnumber(L, ((PDFRectangle *) uin->d)->y1); /* float */
+ else if (s[1] == '2')
+ lua_pushnumber(L, ((PDFRectangle *) uin->d)->y2); /* float */
+ else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_PDFRectangle__newindex(lua_State * L)
+{
+ double d;
+ const char *s;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFRectangle);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ d = luaL_checknumber(L, 3);
+ if (strlen(s) == 2) {
+ if (s[0] == 'x') {
+ if (s[1] == '1')
+ ((PDFRectangle *) uin->d)->x1 = d;
+ else if (s[1] == '2')
+ ((PDFRectangle *) uin->d)->x2 = d;
+ else
+ luaL_error(L, "wrong PDFRectangle coordinate (%s)", s);
+ } else if (s[0] == 'y') {
+ if (s[1] == '1')
+ ((PDFRectangle *) uin->d)->y1 = d;
+ else if (s[1] == '2')
+ ((PDFRectangle *) uin->d)->y2 = d;
+ } else
+ luaL_error(L, "wrong PDFRectangle coordinate (%s)", s);
+ } else
+ luaL_error(L, "wrong PDFRectangle coordinate (%s)", s);
+ return 0;
+}
+
+static int m_PDFRectangle__gc(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFRectangle);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+#ifdef DEBUG
+ printf("\n===== PDFRectangle GC ===== uin=<%p>\n", uin);
+#endif
+ if (uin->atype == ALLOC_LEPDF)
+ delete(PDFRectangle *) uin->d;
+ return 0;
+}
+
+static const struct luaL_Reg PDFRectangle_m[] = {
+ {"isValid", m_PDFRectangle_isValid},
+ {"__index", m_PDFRectangle__index},
+ {"__newindex", m_PDFRectangle__newindex},
+ {"__tostring", m_PDFRectangle__tostring},
+ {"__gc", m_PDFRectangle__gc},
+ {NULL, NULL}
+};
+
+/* Ref */
+
+static int m_Ref__index(lua_State * L)
+{
+ const char *s;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Ref);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ s = luaL_checkstring(L, 2);
+ if (strcmp(s, "num") == 0)
+ lua_pushinteger(L, ((Ref *) uin->d)->num);
+ else if (strcmp(s, "gen") == 0)
+ lua_pushinteger(L, ((Ref *) uin->d)->gen);
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler__tostring(Ref);
+
+static int m_Ref__gc(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Ref);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+#ifdef DEBUG
+ printf("\n===== Ref GC ===== uin=<%p>\n", uin);
+#endif
+ if (uin->atype == ALLOC_LEPDF && ((Ref *) uin->d) != NULL)
+ gfree(((Ref *) uin->d));
+ return 0;
+}
+
+static const struct luaL_Reg Ref_m[] = {
+ {"__index", m_Ref__index},
+ {"__tostring", m_Ref__tostring},
+ {"__gc", m_Ref__gc},
+ {NULL, NULL}
+};
+
+/* Stream */
+
+static const char *StreamKindNames[] = {
+ "File", "ASCIIHex", "ASCII85", "LZW", "RunLength", "CCITTFax", "DCT",
+ "Flate", "JBIG2", "JPX", "Weird",
+ NULL
+};
+
+m_poppler_get_INT(Stream, getKind);
+
+static int m_Stream_getKindName(lua_State * L)
+{
+ StreamKind t;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Stream);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ t = ((Stream *) uin->d)->getKind();
+ lua_pushstring(L, StreamKindNames[t]);
+ return 1;
+}
+
+m_poppler_do(Stream, reset);
+m_poppler_do(Stream, close);
+m_poppler_get_INT(Stream, getChar);
+m_poppler_get_INT(Stream, lookChar);
+m_poppler_get_INT(Stream, getRawChar);
+m_poppler_get_INT(Stream, getUnfilteredChar);
+m_poppler_do(Stream, unfilteredReset);
+m_poppler_get_INT(Stream, getPos);
+m_poppler_get_BOOL(Stream, isBinary);
+m_poppler_get_poppler(Stream, Stream, getUndecodedStream);
+m_poppler_get_poppler(Stream, Dict, getDict);
+
+m_poppler__tostring(Stream);
+
+static const struct luaL_Reg Stream_m[] = {
+ {"getKind", m_Stream_getKind},
+ {"getKindName", m_Stream_getKindName}, // not poppler
+ {"reset", m_Stream_reset},
+ {"close", m_Stream_close},
+ {"getUndecodedStream", m_Stream_getUndecodedStream},
+ {"getChar", m_Stream_getChar},
+ {"lookChar", m_Stream_lookChar},
+ {"getRawChar", m_Stream_getRawChar},
+ {"getUnfilteredChar", m_Stream_getUnfilteredChar},
+ {"unfilteredReset", m_Stream_unfilteredReset},
+ {"getPos", m_Stream_getPos},
+ {"isBinary", m_Stream_isBinary},
+ {"getUndecodedStream", m_Stream_getUndecodedStream},
+ {"getDict", m_Stream_getDict},
+ {"__tostring", m_Stream__tostring},
+ {NULL, NULL}
+};
+
+/* TextSpan */
+
+m_poppler_get_GOOSTRING(TextSpan, getText);
+m_poppler__tostring(TextSpan);
+
+static const struct luaL_Reg TextSpan_m[] = {
+ {"getText", m_TextSpan_getText},
+ {"__tostring", m_TextSpan__tostring},
+ {NULL, NULL}
+};
+
+/* Attribute */
+
+m_poppler_get_BOOL(Attribute,isOk);
+m_poppler_get_INT(Attribute,getType);
+m_poppler_get_INT(Attribute,getOwner);
+m_poppler_get_GOOSTRING(Attribute,getName);
+
+static int m_Attribute_getTypeName(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ lua_pushstring(L, ((Attribute *) uin->d)->getTypeName());
+ return 1;
+}
+
+static int m_Attribute_getOwnerName(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ lua_pushstring(L, ((Attribute *) uin->d)->getOwnerName());
+ return 1;
+}
+
+static int m_Attribute_getValue(lua_State * L)
+{
+ udstruct *uin, *uout;
+ Object *origin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ origin = (Object *) (((Attribute *) uin->d)->getValue());
+ *((Object *) uout->d) = origin->copy();
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+static int m_Attribute_getDefaultValue(lua_State * L)
+{
+ Attribute::Type t;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ t = (Attribute::Type) luaL_checkint(L, 2);
+ uout = new_Object_userdata(L);
+ uout->d = ((Attribute *)uin->d)->getDefaultValue(t) ;
+ //uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+m_poppler_get_GUINT(Attribute,getRevision);
+
+m_poppler_get_BOOL(Attribute, isHidden);
+
+static int m_Attribute_getFormattedValue(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ lua_pushstring(L, ((Attribute *) uin->d)->getFormattedValue());
+ return 1;
+}
+
+static int m_Attribute__gc(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+#ifdef DEBUG
+ printf("\n===== Attribute GC ===== uin=<%p>\n", uin);
+#endif
+ if (uin->atype == ALLOC_LEPDF) {
+ delete(Attribute *) uin->d;
+ }
+ return 0;
+}
+
+m_poppler__tostring(Attribute);
+
+
+static const struct luaL_Reg Attribute_m[] = {
+ {"isOk",m_Attribute_isOk},
+ {"getType",m_Attribute_getType},
+ {"getOwner",m_Attribute_getOwner},
+ {"getTypeName",m_Attribute_getTypeName},
+ {"getOwnerName",m_Attribute_getOwnerName},
+ {"getValue",m_Attribute_getValue},
+ {"getDefaultValue",m_Attribute_getDefaultValue},
+ {"getName",m_Attribute_getName},
+ {"getRevision",m_Attribute_getRevision},
+ {"isHidden",m_Attribute_isHidden},
+ {"getFormattedValue",m_Attribute_getFormattedValue},
+ {"__gc", m_Attribute__gc},
+ {"__tostring", m_Attribute__tostring},
+ {NULL, NULL}
+};
+
+/* StructElement */
+
+m_poppler_get_INT(StructElement,getType);
+m_poppler_get_BOOL(StructElement,isOk);
+m_poppler_get_BOOL(StructElement,isBlock);
+m_poppler_get_BOOL(StructElement,isInline);
+m_poppler_get_BOOL(StructElement,isGrouping);
+m_poppler_get_BOOL(StructElement,isContent);
+m_poppler_get_BOOL(StructElement,isObjectRef);
+m_poppler_get_BOOL(StructElement,hasPageRef);
+m_poppler_get_INT(StructElement,getMCID);
+m_poppler_get_INT(StructElement, getNumChildren);
+
+m_poppler_get_GUINT(StructElement,getRevision);
+m_poppler_get_UINT(StructElement,getNumAttributes);
+
+m_poppler_get_GOOSTRING(StructElement, getID);
+m_poppler_get_GOOSTRING(StructElement, getLanguage);
+m_poppler_get_GOOSTRING(StructElement, getTitle);
+m_poppler_get_GOOSTRING(StructElement, getExpandedAbbr);
+m_poppler_get_GOOSTRING(StructElement, getAltText);
+m_poppler_get_GOOSTRING(StructElement, getActualText);
+
+m_poppler_get_poppler(StructElement, StructTreeRoot, getStructTreeRoot);
+m_poppler__tostring(StructElement);
+
+static int m_StructElement_getObjectRef(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ uout = new_Ref_userdata(L);
+ uout->d = (Ref *) gmalloc(sizeof(Ref));
+ ((Ref *) uout->d)->num = ((StructElement *) uin->d)->getObjectRef().num;
+ ((Ref *) uout->d)->gen = ((StructElement *) uin->d)->getObjectRef().gen;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+static int m_StructElement_getParentRef(lua_State * L)
+{
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ uout = new_Ref_userdata(L);
+ uout->d = (Ref *) gmalloc(sizeof(Ref));
+ ((Ref *) uout->d)->num = ((StructElement *) uin->d)->getParentRef().num;
+ ((Ref *) uout->d)->gen = ((StructElement *) uin->d)->getParentRef().gen;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+/*
+ Not exactly as the header:
+
+ Ref = StructElement:getPageRef()
+
+ Ref is false if the C++ function return false
+
+*/
+
+static int m_StructElement_getPageRef(lua_State * L)
+{
+ GBool b;
+ Ref *r;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ r = (Ref *) gmalloc(sizeof(Ref));
+ b = ((StructElement *) uin->d)->getPageRef( *r );
+ if (b) {
+ uout = new_Ref_userdata(L);
+ uout->d = r ;
+ /* uout->atype = ALLOC_LEPDF; */
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushboolean(L,0);
+ return 1;
+}
+
+static int m_StructElement_getTypeName(lua_State * L)
+{
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ lua_pushstring(L, ((StructElement *) uin->d)->getTypeName());
+ return 1;
+}
+
+static int m_StructElement_getText(lua_State * L)
+{
+ GBool i;
+ GooString *gs;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = (GBool) lua_toboolean(L, 2);
+ gs = ((StructElement *) uin->d)->getText(i);
+ if (gs != NULL)
+ lua_pushlstring(L, gs->getCString(), gs->getLength());
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_StructElement_getChild(lua_State * L)
+{
+ StructElement *c;
+ int i;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = (int) luaL_checkint(L, 2);
+ c = ((StructElement *) uin->d)->getChild(i-1);
+ if (c != NULL) {
+ uout = new_StructElement_userdata(L);
+ uout->d = c ;
+ /* uout->atype = ALLOC_LEPDF; */
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ }
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_StructElement_getAttribute(lua_State * L)
+{
+ Attribute *a;
+ int i;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = (int) luaL_checkint(L, 2);
+ a = ((StructElement *) uin->d)->getAttribute(i-1);
+ if (a != NULL) {
+ uout = new_Attribute_userdata(L);
+ uout->d = a ;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ }
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_StructElement_findAttribute(lua_State * L)
+{
+ Attribute::Type t;
+ Attribute::Owner o;
+ GBool g;
+ udstruct *uin, *uout;
+ const Attribute *a;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ t = (Attribute::Type) luaL_checkint(L,1);
+ o = (Attribute::Owner) luaL_checkint(L,2);
+ g = (GBool) lua_toboolean(L, 3);
+ a = ((StructElement *) uin->d)->findAttribute(t,g,o);
+
+ if (a!=NULL){
+ uout = new_Attribute_userdata(L);
+ uout->d = new Attribute(a->getType(),a->getValue());
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+/* This returns a lua table */
+
+static int m_StructElement_getTextSpans(lua_State * L)
+{
+ int i ;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+
+ if ((((StructElement *) uin->d)->getTextSpans()).size()>0) {
+ lua_createtable (L,
+ (int) (((StructElement *) uin->d)->getTextSpans()).size(),
+ 0);
+ for(i=0;i<(int) (((StructElement *) uin->d)->getTextSpans()).size(); i++){
+ uout = new_TextSpan_userdata(L);
+ uout->d = new TextSpan( (((StructElement *) uin->d)->getTextSpans())[i] );
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ lua_rawseti(L,-2,i+1);
+ }
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static const struct luaL_Reg StructElement_m[] = {
+ {"getTypeName", m_StructElement_getTypeName},
+ {"getType",m_StructElement_getType},
+ {"isOk",m_StructElement_isOk},
+ {"isBlock",m_StructElement_isBlock},
+ {"isInline",m_StructElement_isInline},
+ {"isGrouping",m_StructElement_isGrouping},
+ {"isContent",m_StructElement_isContent},
+ {"isObjectRef",m_StructElement_isObjectRef},
+ {"getMCID",m_StructElement_getMCID},
+ {"getObjectRef",m_StructElement_getObjectRef},
+ {"getParentRef",m_StructElement_getParentRef},
+ {"hasPageRef",m_StructElement_hasPageRef},
+ {"getPageRef",m_StructElement_getPageRef},
+ {"getStructTreeRoot",m_StructElement_getStructTreeRoot},
+ {"getID",m_StructElement_getID},
+ {"getLanguage",m_StructElement_getLanguage},
+ {"getRevision",m_StructElement_getRevision},
+ {"getTitle",m_StructElement_getTitle},
+ {"getExpandedAbbr",m_StructElement_getExpandedAbbr},
+ {"getNumChildren",m_StructElement_getNumChildren},
+ {"getChild",m_StructElement_getChild},
+ {"getNumAttributes",m_StructElement_getNumAttributes},
+ {"getAttribute",m_StructElement_getAttribute},
+ {"findAttribute",m_StructElement_findAttribute},
+ {"getAltText",m_StructElement_getAltText},
+ {"getActualText",m_StructElement_getActualText},
+ {"getText",m_StructElement_getText},
+ {"getTextSpans",m_StructElement_getTextSpans},
+ {"__tostring", m_StructElement__tostring},
+ {NULL, NULL}
+};
+
+/* StructTreeRoot */
+
+m_poppler_get_INT(StructTreeRoot, getNumChildren);
+m_poppler_get_poppler(StructTreeRoot, PDFDoc, getDoc);
+m_poppler_get_poppler(StructTreeRoot, Dict, getRoleMap);
+m_poppler_get_poppler(StructTreeRoot, Dict, getClassMap);
+m_poppler__tostring(StructTreeRoot);
+
+static int m_StructTreeRoot_getChild(lua_State * L)
+{
+ unsigned int i;
+ udstruct *uin, *uout;
+ StructElement *child ;
+ StructTreeRoot *root ;
+
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructTreeRoot);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = (unsigned) luaL_checkint(L, 2);
+ root = (StructTreeRoot *) uin->d;
+ if (i-1 < root->getNumChildren() ){
+ child = root->getChild(i-1);
+ uout = new_StructElement_userdata(L);
+ uout->d = child;
+ /* uout->atype = ALLOC_LEPDF; */
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static int m_StructTreeRoot_findParentElement(lua_State * L)
+{
+ unsigned int i;
+ udstruct *uin, *uout;
+ const StructElement *parent ;
+ StructTreeRoot *root ;
+
+ uin = (udstruct *) luaL_checkudata(L, 1, M_StructTreeRoot);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = (unsigned) luaL_checkint(L, 2);
+ root = (StructTreeRoot *) uin->d;
+ parent = root->findParentElement(i-1);
+ if (parent != NULL) {
+ uout = new_StructElement_userdata(L);
+ /* see https://isocpp.org/wiki/faq/const-correctness#aliasing-and-const */
+ uout->d = (StructElement *) parent;
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ } else
+ lua_pushnil(L);
+ return 1;
+}
+
+static const struct luaL_Reg StructTreeRoot_m[] = {
+ {"getDoc",m_StructTreeRoot_getDoc},
+ {"getRoleMap",m_StructTreeRoot_getRoleMap},
+ {"getClassMap",m_StructTreeRoot_getClassMap},
+ {"getNumChildren",m_StructTreeRoot_getNumChildren},
+ {"getChild",m_StructTreeRoot_getChild},
+ {"findParentElement",m_StructTreeRoot_findParentElement},
+ {"__tostring", m_StructTreeRoot__tostring},
+ {NULL, NULL}
+};
+
+/* XRef */
+
+m_poppler_get_BOOL(XRef, isOk);
+m_poppler_get_INT(XRef, getErrorCode);
+m_poppler_get_BOOL(XRef, isEncrypted);
+m_poppler_get_BOOL(XRef, okToPrint);
+m_poppler_get_BOOL(XRef, okToPrintHighRes);
+m_poppler_get_BOOL(XRef, okToChange);
+m_poppler_get_BOOL(XRef, okToCopy);
+m_poppler_get_BOOL(XRef, okToAddNotes);
+m_poppler_get_BOOL(XRef, okToFillForm);
+m_poppler_get_BOOL(XRef, okToAccessibility);
+m_poppler_get_BOOL(XRef, okToAssemble);
+m_poppler_get_OBJECT(XRef, getCatalog);
+
+static int m_XRef_fetch(lua_State * L)
+{
+ int num, gen;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_XRef);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ num = luaL_checkint(L, 2);
+ gen = luaL_checkint(L, 3);
+ uout = new_Object_userdata(L);
+ uout->d = new Object();
+ *((Object *) uout->d) = ((XRef *) uin->d)->fetch(num, gen);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uin->pc;
+ uout->pd = uin->pd;
+ return 1;
+}
+
+m_poppler_get_OBJECT(XRef, getDocInfo);
+m_poppler_get_OBJECT(XRef, getDocInfoNF);
+m_poppler_get_INT(XRef, getNumObjects);
+m_poppler_get_INT(XRef, getRootNum);
+m_poppler_get_INT(XRef, getRootGen);
+
+static int m_XRef_getNumEntry(lua_State * L)
+{
+ int i, offset;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_XRef);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ offset = luaL_checkint(L, 2);
+ i = ((XRef *) uin->d)->getNumEntry(offset);
+ if (i >= 0)
+ lua_pushinteger(L, i);
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+m_poppler_get_poppler(XRef, Object, getTrailerDict);
+
+m_poppler__tostring(XRef);
+
+static const struct luaL_Reg XRef_m[] = {
+ {"isOk", m_XRef_isOk},
+ {"getErrorCode", m_XRef_getErrorCode},
+ {"isEncrypted", m_XRef_isEncrypted},
+ {"okToPrint", m_XRef_okToPrint},
+ {"okToPrintHighRes", m_XRef_okToPrintHighRes},
+ {"okToChange", m_XRef_okToChange},
+ {"okToCopy", m_XRef_okToCopy},
+ {"okToAddNotes", m_XRef_okToAddNotes},
+ {"okToFillForm", m_XRef_okToFillForm},
+ {"okToAccessibility", m_XRef_okToAccessibility},
+ {"okToAssemble", m_XRef_okToAssemble},
+ {"getCatalog", m_XRef_getCatalog},
+ {"fetch", m_XRef_fetch},
+ {"getDocInfo", m_XRef_getDocInfo},
+ {"getDocInfoNF", m_XRef_getDocInfoNF},
+ {"getNumObjects", m_XRef_getNumObjects},
+ {"getRootNum", m_XRef_getRootNum},
+ {"getRootGen", m_XRef_getRootGen},
+ {"getNumEntry", m_XRef_getNumEntry},
+ {"getTrailerDict", m_XRef_getTrailerDict},
+ {"__tostring", m_XRef__tostring},
+ {NULL, NULL}
+};
+
+/* XRefEntry */
+
+m_poppler__tostring(XRefEntry);
+
+static const struct luaL_Reg XRefEntry_m[] = {
+ {"__tostring", m_XRefEntry__tostring},
+ {NULL, NULL}
+};
+
+/* Done */
+
+#ifdef LuajitTeX
+#define setfuncs_meta(type) \
+ luaL_newmetatable(L, M_##type); \
+ lua_pushvalue(L, -1); \
+ lua_setfield(L, -2, "__index"); \
+ lua_pushstring(L, "no user access"); \
+ lua_setfield(L, -2, "__metatable"); \
+ luaL_openlib(L, NULL, type##_m, 0)
+#else
+#define setfuncs_meta(type) \
+ luaL_newmetatable(L, M_##type); \
+ lua_pushvalue(L, -1); \
+ lua_setfield(L, -2, "__index"); \
+ lua_pushstring(L, "no user access"); \
+ lua_setfield(L, -2, "__metatable"); \
+ luaL_setfuncs(L, type##_m, 0)
+#endif
+
+int luaopen_epdf(lua_State * L)
+{
+ setfuncs_meta(Annot);
+ setfuncs_meta(Annots);
+ setfuncs_meta(Array);
+ setfuncs_meta(Catalog);
+ setfuncs_meta(Dict);
+ setfuncs_meta(EmbFile);
+ setfuncs_meta(FileSpec);
+ setfuncs_meta(GooString);
+ setfuncs_meta(LinkDest);
+ setfuncs_meta(Links);
+ setfuncs_meta(Object);
+ setfuncs_meta(Page);
+ setfuncs_meta(PDFDoc);
+ setfuncs_meta(PDFRectangle);
+ setfuncs_meta(Ref);
+ setfuncs_meta(Stream);
+ setfuncs_meta(Attribute);
+ setfuncs_meta(StructElement);
+ setfuncs_meta(StructTreeRoot);
+ setfuncs_meta(TextSpan);
+ setfuncs_meta(XRef);
+ setfuncs_meta(XRefEntry);
+ luaL_openlib(L, "epdf", epdflib_f, 0);
+ return 1;
+}
diff --git a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
index b3ac2aa536e..92d60a80c7d 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
@@ -44,7 +44,7 @@ static int font_read_tfm(lua_State * L)
if (strlen(cnom)) {
internal_font_number f = get_fontid();
if (read_tfm_info(f, cnom, s)) {
- int k = font_to_lua(L, f);
+ int k = font_to_lua(L, f, 0);
delete_font(f);
return k;
} else {
@@ -118,7 +118,7 @@ static int tex_each_font_next(lua_State * L)
return 1;
} else {
lua_pushinteger(L, i);
- if (!font_to_lua(L, i))
+ if (!font_to_lua(L, i, 1))
lua_pushnil(L);
return 2;
}
@@ -251,7 +251,16 @@ static int nextfontid(lua_State * L)
static int getfont(lua_State * L)
{
int i = luaL_checkinteger(L, -1);
- if (i && is_valid_font(i) && font_to_lua(L, i))
+ if (i && is_valid_font(i) && font_to_lua(L, i, 1))
+ return 1;
+ lua_pushnil(L);
+ return 1;
+}
+
+static int getcopy(lua_State * L)
+{
+ int i = luaL_checkinteger(L, -1);
+ if (i && is_valid_font(i) && font_to_lua(L, i, 0))
return 1;
lua_pushnil(L);
return 1;
@@ -293,6 +302,7 @@ static const struct luaL_Reg fontlib[] = {
{"max", tex_max_font},
{"each", tex_each_font},
{"getfont", getfont},
+ {"getcopy", getcopy},
{"getparameters", getparameters},
{"setfont", setfont},
{"addcharacters", addcharacters},
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
index a50ea2f20d9..d1ef55ad188 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
@@ -1164,6 +1164,9 @@ static int set_macro(lua_State * L)
if (n == 1)
return 0;
ct = (int) lua_tointeger(L, 1);
+ if (!valid_catcode_table(ct)) {
+ ct = cat_code_table_par;
+ }
name = lua_tolstring(L, 2, &lname);
if (n > 2)
str = lua_tolstring(L, 3, &lstr);
@@ -1224,10 +1227,14 @@ static int set_macro(lua_State * L)
str += _s ;
break ;
} else {
+ if (_lname == 0) {
+ _lname = _lname + _s ;
+ str += _s ;
+ }
break ;
}
}
- if (_s > 0) {
+ if (_lname > 0) {
/* we have a potential \cs */
_cs = string_lookup(_name, _lname);
if (_cs == undefined_control_sequence) {
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c b/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c
index 455ed9b0479..5b1093a28a5 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdfelib.c
@@ -45,7 +45,7 @@
# undef output
# endif
-# include "luapplib/pplib.h"
+# include "luapplib/src/pplib.h"
# include "image/epdf.h"
@@ -422,12 +422,15 @@ static int pushvalue(lua_State * L, ppobj *object)
return 1;
break;
case PPNAME:
- lua_pushstring(L, (const char *) ppname_decoded(object->name));
- return 1;
+ {
+ ppname * n = ppname_decoded(object->name) ;
+ lua_pushlstring(L, ppname_data(n), ppname_size(n));
+ return 1;
+ }
break;
case PPSTRING:
- lua_pushlstring(L,(const char *) object->string, ppstring_size((void *)object->string));
- lua_pushboolean(L, ppstring_hex((void *)object->string));
+ lua_pushlstring(L, ppstring_data(object->string), ppstring_size(object->string));
+ lua_pushboolean(L, ppstring_hex(object->string));
return 2;
break;
case PPARRAY:
@@ -527,8 +530,8 @@ static int pdfelib_getfromdictionary(lua_State * L)
if (index < d->dictionary->size) {
ppobj *object = ppdict_at(d->dictionary,index);
if (object != NULL) {
- ppname key = ppdict_key(d->dictionary,index);
- lua_pushstring(L,(const char *) key);
+ ppname * key = ppname_decoded(ppdict_key(d->dictionary,index));
+ lua_pushlstring(L, ppname_data(key), ppname_size(key));
lua_pushinteger(L,(int) object->type);
return 2 + pushvalue(L,object);
}
@@ -555,8 +558,8 @@ static int pdfelib_getfromstream(lua_State * L)
if (index < d->size) {
ppobj *object = ppdict_at(d,index);
if (object != NULL) {
- ppname key = ppdict_key(d,index);
- lua_pushstring(L,(const char *) key);
+ ppname * key = ppname_decoded(ppdict_key(d,index));
+ lua_pushlstring(L, ppname_data(key), ppname_size(key));
lua_pushinteger(L,(int) object->type);
return 2 + pushvalue(L,object);
}
@@ -656,8 +659,8 @@ static int pdfelib_dictionarytotable(lua_State * L)
for (i=0;idictionary->size;i++) {
ppobj *object = ppdict_at(d->dictionary,i);
if (object != NULL) {
- ppname key = ppdict_key(d->dictionary,i);
- lua_pushstring(L,(const char *) key);
+ ppname * key = ppname_decoded(ppdict_key(d->dictionary,i));
+ lua_pushlstring(L, ppname_data(key), ppname_size(key));
/* table key */
pdfelib_totable(L,object,flat);
/* table key { type, [value], [extra], [more] } */
@@ -874,7 +877,7 @@ static int pdfelib_new(lua_State * L)
if (! memstream) {
luaL_error(L, "no room for stream");
}
- memcpy(memstream, docstream, (streamsize + 1));
+ memcpy(memstream, docstream, streamsize);
memstream[streamsize]='\0';
if (lua_gettop(L) == 2) {
/* we stay at the lua end */
@@ -1011,7 +1014,6 @@ static int pdfelib_getsize(lua_State * L)
return 1;
}
-
static int pdfelib_getversion(lua_State * L)
{
pdfe_document *p = check_isdocument(L, 1);
@@ -1321,10 +1323,10 @@ static int pdfelib_getfromreference(lua_State * L)
static int pdfelib_getstring(lua_State * L)
{
if (lua_gettop(L) > 1) {
- ppstring value = NULL;
+ ppstring * value = NULL;
pdfelib_get_value_direct(ppdict_rget_string,pparray_rget_string);
if (value != NULL) {
- lua_pushstring(L,(const char *) value);
+ lua_pushlstring(L, ppstring_data(value), ppstring_size(value));
return 1;
}
}
@@ -1376,10 +1378,11 @@ static int pdfelib_getboolean(lua_State * L)
static int pdfelib_getname(lua_State * L)
{
if (lua_gettop(L) > 1) {
- ppname value = NULL;
+ ppname * value = NULL;
pdfelib_get_value_direct(ppdict_rget_name,pparray_rget_name);
if (value != NULL) {
- lua_pushstring(L,(const char *) ppname_decoded(value));
+ value = ppname_decoded(value) ;
+ lua_pushlstring(L, ppname_data(value), ppname_size(value));
return 1;
}
}
@@ -1446,10 +1449,13 @@ static int pdfelib_pushvalue(lua_State * L, ppobj *object)
lua_pushnumber(L, object->number);
break;
case PPNAME:
- lua_pushstring(L, (const char *) ppname_decoded(object->name));
+ {
+ ppname * n = ppname_decoded(object->name) ;
+ lua_pushlstring(L, ppname_data(n), ppname_size(n));
+ }
break;
case PPSTRING:
- lua_pushlstring(L,(const char *) object->string, ppstring_size((void *)object->string));
+ lua_pushlstring(L, ppstring_data(object->string), ppstring_size(object->string));
break;
case PPARRAY:
return pusharrayonly(L, object->array);
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.c b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.c
index 6c3bc8876ee..4fc62a2ccf9 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.c
@@ -78,7 +78,7 @@
#include
#include
-#include "luapplib/pplib.h"
+#include "luapplib/src/pplib.h"
#include
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.c b/Build/source/texk/web2c/luatexdir/lua/luainit.c
index 7570910b0ef..4926d8bd382 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.c
@@ -677,6 +677,7 @@ static int luatex_kpse_lua_find(lua_State * L)
/*tex library not found in this path */
return 1;
}
+ recorder_record_input(filename);
if (luaL_loadfile(L, filename) != 0) {
luaL_error(L, "error loading module %s from file %s:\n\t%s",
lua_tostring(L, 1), filename, lua_tostring(L, -1));
@@ -714,6 +715,7 @@ static int luatex_kpse_clua_find(lua_State * L)
/*tex library not found in this path */
return 1;
}
+ recorder_record_input(filename);
extensionless = strdup(filename);
if (!extensionless) {
/*tex allocation failure */
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
index bebf088af99..14650ffdcee 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
+++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
@@ -155,7 +155,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_to_lua(lua_State * L, int f, int usecache);
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 */
diff --git a/Build/source/texk/web2c/luatexdir/luaharfbuzz/README-win.md b/Build/source/texk/web2c/luatexdir/luaharfbuzz/README-win.md
deleted file mode 100644
index d7a769ffa4b..00000000000
--- a/Build/source/texk/web2c/luatexdir/luaharfbuzz/README-win.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# Building Harfbuzz and _luaharfbuzz_ on Windows
-
-## Building Harfbuzz
-
-### Prerequisites
-* [Visual Studio Community Edition](https://www.visualstudio.com/vs/community/)
-* C++ Support for Visual Studio (See [here](http://stackoverflow.com/questions/31953769/visual-studio-doesnt-have-cl-exe))
-
-### Building
-* Download the Harfbuzz source for win32 from the [releases pages](https://github.com/behdad/harfbuzz/releases) (look for a zip file that ends with _-win32_, for e.g. _harfbuzz-1.4.2-win32.zip_), and unzip it.
-* Launch the Visual Studio developer prompt for the platform you want to target. This is very important. For e.g, on my 64-bit system, I am using _VS2015 x64 Native Tools Command Prompt_
-* Navigate to the _win32_ folder in the Harfbuzz source tree and do `nmake /f Makefile.vc CFG=release`
-* This should generate _harfbuzz.lib_ and _harfbuzz-vs14.dll_.
-
-## Copying Harfbuzz headers and DLL to the right locations
-The Harfbuzz headers and DLLs must be copied to the right locations, for Lua and LuaRocks to be able to find them during installation and running:
-
-* Copy all the Harfbuzz header (_src/*.h_) files to _C:\external\include\harfbuzz_. This is where LuaRocks will look for them by default. Make sure the header files are in the _harfbuzz_ sub-directory under _C:\external\include_, otherwise it will not work.
-* Copy _harfbuzz.lib_ and _harfbuzz-vs14.dll_ to the folder _C:\external\lib_. This is where LuaRocks will look for them by default.
-* Copy _harfbuzz-vs14.dll_ to _C:\Windows\System32_. This is where running programs can locate the Harfbuzz DLL.
-
-## Installing Lua and LuaRocks
-It is highly recommended that you install Lua 5.2 and LuaRocks in a sandboxed environment on your machine. [Hererocks] makes it dead simple to do on Windows. Make sure you have installed Python first. On my system, I just did `chocolatey install python`, but you can use an alternate method and skip running that command below.
-
-[Hererocks]:https://github.com/mpeterv/hererocks
-
-```
-chocolatey install python
-wget https://raw.githubusercontent.com/mpeterv/hererocks/latest/hererocks.py
-python hererocks.py lua52 -l5.2 -rlatest
-source lua52/bin/activate
-```
-## Install _luaharfbuzz_
-If you followed the steps in the previous sections, and have a sandboxed Lua installation, which the Lua program on %PATH%, then doing the following should just work:
-
-```
-C:\> luarocks install luaharfbuzz
-```
-
-This will download the _luaharfbuzz_ source, compile the C modules, link them against Lua and Harfbuzz, and install it in the right location.
-
-## Test
-Test whether the installation was successful by loading _luaharfbuzz_ in the Lua REPL
-
-```
-C:\> lua
-Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
-> hb = require("harfbuzz")
-> print(hb.version())
-1.4.1
->
-```
-
diff --git a/Build/source/texk/web2c/luatexdir/luaharfbuzz/README.md b/Build/source/texk/web2c/luatexdir/luaharfbuzz/README.md
index f5a900c65b1..c5cee58f869 100644
--- a/Build/source/texk/web2c/luatexdir/luaharfbuzz/README.md
+++ b/Build/source/texk/web2c/luatexdir/luaharfbuzz/README.md
@@ -19,10 +19,17 @@ HarfBuzz is an OpenType text shaping engine. It is used in software like Qt,
Pango, Firefox, Chromium, XeTeX and LibreOffice.
_luaharfbuzz_ provides bindings for the most common types in Harfbuzz. The
-initial motivation for building it is to use Harfbuzz with the [LuaTeX]
+initial motivation for building it was to use Harfbuzz with the [LuaTeX]
typesetting system. However, the module isn’t tied to LuaTeX in any way. It
can be used with any Lua codebase.
+luaharfbuzz is currently being used inside [HarfTeX], a TeX engine built
+on top of LuaTeX and designed to use Harfbuzz for shaping text. For more
+details read this TUGboat journal article titled [Bringing world scripts to LuaTeX: The
+HarfBuzz experiment][tugboat-article]
+
+[HarfTeX]: https://github.com/khaledhosny/harftex
+[tugboat-article]: https://tug.org/TUGboat/tb40-1/tb124hosny-harfbuzz.pdf
[LuaTeX]:luatex.org
## Installing Harfbuzz
@@ -43,9 +50,6 @@ brew install harfbuzz
apt-get install libharfbuzz0b libharfbuzz-dev
```
-#### Windows
-Getting the whole setup running on Windows is very tedious, so all instructions are in their own file [README-win.md](https://github.com/deepakjois/luaharfbuzz/blob/master/README-win.md).
-
#### Other Platforms
_Send a pull request if you want to include specific instructions to install
Harfbuzz on your preferred platform._
@@ -139,6 +143,8 @@ In order to make changes to the code and run the tests, the following dependenci
* [Busted](http://olivinelabs.com/busted/) – `luarocks install busted`
* [luacheck](luacheck.readthedocs.org) – `luarocks install luacheck`
+* [luacov](https://keplerproject.github.io/luacov/) – `luarocks install luacov`
+* [ldoc](https://stevedonovan.github.io/ldoc/) – `luarocks install ldoc`
Run the test suite:
```
@@ -150,5 +156,10 @@ Lint the codebase:
make lint
```
+Generate documentation from sources:
+```
+make doc
+```
+
## Contact
Open a Github issue, or email me at .
diff --git a/Build/source/texk/web2c/luatexdir/luaharfbuzz/config.ld b/Build/source/texk/web2c/luatexdir/luaharfbuzz/config.ld
index 95d27f9a39f..d37be652ca9 100644
--- a/Build/source/texk/web2c/luatexdir/luaharfbuzz/config.ld
+++ b/Build/source/texk/web2c/luatexdir/luaharfbuzz/config.ld
@@ -1,6 +1,6 @@
project = 'luaharfbuzz'
description = 'Lua bindings to Harfbuzz'
-full_description = 'The documentation is available on the @{https://github.com/deepakjois/luaharfbuzz/wiki|wiki}'
+full_description = 'The documentation is available on the @{https://github.com/ufytex/luaharfbuzz/wiki|wiki}'
use_markdown_titles = true
backtick_references = false
title = 'luaharfbuzz Documentation'
diff --git a/Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/core_types.lua.html b/Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/core_types.lua.html
index fe9e5c39c9b..6345ea3c6fa 100644
--- a/Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/core_types.lua.html
+++ b/Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/core_types.lua.html
@@ -101,7 +101,7 @@ glyphs = buf:get_glyphs()
generated by LDoc 1.4.6
-
Last updated 2019-04-13 17:03:03
+
Last updated 2019-07-31 18:39:39
-
-
-
-
-
-
-
-
-
-
-
-
-
-
luaharfbuzz
-
-
-
-
-
Examples
-
-
Modules
-
-
-
-
-
-
-
custom_callbacks.lua
-
-callback.register("hyphenate", false)
-callback.register("ligaturing", false)
-callback.register("kerning", false)
-
-callback.register("post_linebreak_filter", function()
- texio.write_nl("POST_LINEBREAK")
- return true
-end)
-
-callback.register("hpack_filter", function()
- texio.write_nl("HPACK")
- return true
-end)
-
-callback.register("vpack_filter", function()
- texio.write_nl("VPACK")
- return true
-end)
-
-callback.register("buildpage_filter", function(extrainfo)
- texio.write_nl("BUILDPAGE_FILTER "..extrainfo)
-end)
-
-
-
-
-
-
generated by LDoc 1.4.5
-
Last updated 2016-08-31 21:59:58
-
-
-
diff --git a/Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/custom_callbacks.lua.html b/Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/custom_callbacks.lua.html
deleted file mode 100644
index eff09e27b8d..00000000000
--- a/Build/source/texk/web2c/luatexdir/luaharfbuzz/docs/examples/custom_callbacks.lua.html
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-