summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2014-03-28 15:33:53 +0000
committerTaco Hoekwater <taco@elvenkind.com>2014-03-28 15:33:53 +0000
commitcf765726d33562cf94dbd3608efb46ba0cc1e3e4 (patch)
treefa3553a9e22a3ddc42d818feb1474f893067777b /Build/source/texk/web2c/luatexdir
parent137b56a5c65d26eec13dede7b8f398611aaa008d (diff)
check in luatex 0.79.0 (release version)
git-svn-id: svn://tug.org/texlive/trunk@33312 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir')
-rw-r--r--Build/source/texk/web2c/luatexdir/NEWS490
-rw-r--r--Build/source/texk/web2c/luatexdir/font/mapfile.w12
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writecff.w47
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writet1.w33
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writet3.w8
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writetype0.w20
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writetype2.w42
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writeimg.w8
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writepng.w5
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c6
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c220
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lpdflib.c331
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lstatslib.c12
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexlib.c10
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luainit.w577
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luajitstuff.w50
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luanode.w54
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luastuff.w53
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatex-api.h813
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex_svnversion.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/luatexcallbackids.h47
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfdest.w5
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdffont.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.w60
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w5
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfthread.h4
-rw-r--r--Build/source/texk/web2c/luatexdir/ptexlib.h4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/align.w7
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/buildpage.w9
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/directions.w36
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/errors.h5
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/errors.w77
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mainbody.w9
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/maincontrol.w51
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/postlinebreak.w12
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texfileio.w51
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texmath.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.w21
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.w45
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/utils.w2
41 files changed, 1936 insertions, 1322 deletions
diff --git a/Build/source/texk/web2c/luatexdir/NEWS b/Build/source/texk/web2c/luatexdir/NEWS
index a7487e9e0dd..0d1dc49b10b 100644
--- a/Build/source/texk/web2c/luatexdir/NEWS
+++ b/Build/source/texk/web2c/luatexdir/NEWS
@@ -2,29 +2,119 @@
This file is in the public domain.
==============================================================
-Luatex beta-0.78.2 was released 20140113
+Luatex beta-0.79.0 was released 20140328 (4960)
+==============================================================
+
+* The luafontloader now returns 'tsidebearing' glyph values
+ for OT/TT fonts, if applicable.
+
+* new lua variables: stats.luatex_hashtype, stats.luatex_hashchars,
+ stats.lastluaerrorstring; the luajittex string hash method is now
+ lua 5.1 compliant which gives better results for similar strings
+
+* new lua functions: tex.init_rand(), tex.uniform_rand(),
+ tex.normal_rand(), tex.lua_math_randomseed(), tex.lua_math_random(),
+ tex.show_context(); these helpers make luatex and luajittex compatible
+
+* In the lua node interface, there were often issues with rubbish
+ in (especially) 'prev' fields because luatex itself never looks
+ at those values. This is now cleaned up to prevent weird stuff
+ happening inside lua node processing code.
+
+* pdf.pageattributes, pdf.pagesattributes, pdf.info, pdf.catalog,
+ pdf.names and pdf.trailer now behave consistent and can be used
+ to add these properties at the lua end in addition to their \pdf*
+ counterparts atthe tex end; there are now pdf.get* and pdf.set*
+ commands for them too (in future versions the old ways can become
+ obsolete)
+
+* new accessors pdf.geth, pdfgetv, pdfgetpos, getgetmatrix as well
+ as pdfhasmatrix helpers (in future versions the direct pdf.h and
+ pdf.v accessor can become obsolete)
+
+* the pdf.pdf* variables have been removed (they were already
+ obsolete for some years)
+
+* a new properties mechanism for associating lua tables with nodes
+ that get cleaned up when nodes a freed (see manual for details)
+
+* several improvements to the way temporary (backend) data is stored
+ at the lua end (better protection, more consistent)
+
+* a 'l' type for user nodes that holds a lua variable (can be set
+ at the lua end)
+
+* if a late lua node is set at the lua end the string value can be
+ a function as well which is then executed during serialization to
+ the backend stream
+
+* Various small speedups
+
+* Various smallish fixes to the node direct interface
+
+* LPeg is now at version 0.12
+
+* Some small fixes to the CFF (font) parsing
+
+* Font file inclusion reporting messages on the terminal now
+ comply to the texconfig.trace_file_names setting
+
+* Removed some of the additional luafontloader.info() return
+ information that was added in 0.78.2, but could not work
+ properly.
+
+* new primitive \luafunction (see manual), with associated
+ lua.get_functions_table() function
+
+* lua error message reporting has been altered a bit to make
+ the distinction between \directlua and other lua source code
+ sources clearer
+
+* Additional pdf document data functionality in the 'pdf' table
+ has been cleaned up internally
+
+* Additional pdf destination names can now be set via lua.
+
+* New callbacks: finish_pdfpage, show_error_message,
+ show_lua_error_hook, start_file, stop_file
+
+* Handling of \tracinglostchars is fixed
+
+* Embedded metapost library version is now 1.900
+
+* luajittex is now included in the distribution. One can use
+ buildjit.sh to build both luatex and luajittex, where
+ supported by the platform
+
+* Synchronization with the TeXLive sources updated the following
+ libraries:
+ * libpng is now 1.6.10
+ * poppler is now 0.25.2
+
+==============================================================
+Luatex beta-0.78.2 was released 20140113 (4748)
==============================================================
* Extended luafontloader's info() function to include data
from the 'pfminfo' and 'names' structure.
-* Fixed a bug in the luafontloader library that made loading
+* Fixed a bug in the luafontloader library that made loading
some fonts extremely slow (LastResort.ttf)
* Removed a recent extension in the luafontloader library that
made loading fonts with lots of glyphs slow (ArialUnicoce.ttf).
- Note: the extension made sure that there were no duplicate
- glyph names in the font after loading.
+ Note: the extension made sure that there were no duplicate
+ glyph names in the font after loading.
* Restored --recorder output for lua files (dofile/loadfile/io.open)
-* One-at-a-time pattern adding from lua used to require enormous
+* One-at-a-time pattern adding from lua used to require enormous
amounts of memory
* luatex's fontloader.to_table() no longer reports 'altuni' table
information for alternates that are solely driven by the font
- encoding. This fixes loading time issues for fonts that fill
- encodings by copying a single glyph many times, like e.g.
+ encoding. This fixes loading time issues for fonts that fill
+ encodings by copying a single glyph many times, like e.g.
LastResort.ttf from Apple.
* The datestamp no longer appears in any banners. The associated
@@ -54,7 +144,7 @@ Luatex beta-0.78.2 was released 20140113
is not given explicitly.
* node.unset_attribute() was broken in 0.78.0
-
+
* The UTF-8 commandline patch from 0.78.0 for Win32 was removed
again (did not work properly)
@@ -62,9 +152,9 @@ Luatex beta-0.78.2 was released 20140113
Luatex beta-0.78.0 was released 20131231
==============================================================
-* Instead of using expanded fonts, just calculate the expanded
+* Instead of using expanded fonts, just calculate the expanded
width of glyphs where needed, and carry expand info in the
- glyph nodes (all based on Hans' suggestions). All font expansion
+ glyph nodes (all based on Hans' suggestions). All font expansion
functions are disabled and most are removed.
* New, faster (but limited) direct node access from lua, see
@@ -75,7 +165,7 @@ Luatex beta-0.78.0 was released 20131231
* Extended build script for mingw/msys (includes 64-bit support)
-* Various patches from/via Akira Kakuta for better Win32
+* Various patches from/via Akira Kakuta for better Win32
integration
* Fixes for some bugs in de pdfscanner library (mostly related
@@ -83,12 +173,12 @@ Luatex beta-0.78.0 was released 20131231
* Maximum hyphenated word length is now 64Kb characters.
-* Various patches from Khaled Hosny and Luigi Scarso for the
+* Various patches from Khaled Hosny and Luigi Scarso for the
luafontloader subsystem
* Fix for a crash when re-dumping formats
-* Fix for a Selene unicode library bug where some characters in
+* Fix for a Selene unicode library bug where some characters in
UTF-8 were incorrectly flagged as having the 'Space' property
* Some smaller fixes
@@ -137,7 +227,7 @@ News:
* Fix Lua's loadfile().
-* Removed the cidmap callbacks again (let that be done by user lua
+* Removed the cidmap callbacks again (let that be done by user lua
code after the fact).
* Removed the fatal error on fonts where num_glyphs is too high,
@@ -158,15 +248,15 @@ Luatex beta-0.74.0 was released 20121224
News:
* lua 5.2
- There are no patches to the core Lua files; a future version
- of luatex will switch to loading the regular lua 5.2 dynamic
+ There are no patches to the core Lua files; a future version
+ of luatex will switch to loading the regular lua 5.2 dynamic
library instead of depending on a statically compiled
one.
-* A bleeding-edge version of luasocket is included, as there
- is no 5.2-compatible official release yet.
+* A bleeding-edge version of luasocket is included, as there
+ is no 5.2-compatible official release yet.
-* A new lua extension is the two-argument version of
+* A new lua extension is the two-argument version of
string.dump from Luajit:
string.dump(function f, [boolean strip])
@@ -176,14 +266,14 @@ News:
* The implied existence of the following lua libraries is now
deprecated:
- debug, unicode.*, luazip, lfs, lpeg, zlib, gzip, md5,
+ debug, unicode.*, luazip, lfs, lpeg, zlib, gzip, md5,
socket.*, profiler, epdf, fontloader, mplib, and
pdfscanner.
Future versions of luatex will load these modules on demand
- from dynamic libraries.
-
- Please update your sources to include a 'require' line for
+ from dynamic libraries.
+
+ Please update your sources to include a 'require' line for
each of the library modules mentioned.
* Two new callbacks: find_cidmap_file and load_cidmap_file
@@ -195,7 +285,7 @@ Luatex beta-0.72.0 was released 20121210
News:
-* update various used libraries, including mplib 1.770,
+* update various used libraries, including mplib 1.770,
poppler 0.21, libpng 1.5, and lpeg 0.10.2.
* new 'pdfscanner' lua library.
@@ -204,14 +294,14 @@ News:
* improved placement of bottom accents.
-* various other small fixes that have accumulated over the past
+* various other small fixes that have accumulated over the past
year-and-a-half.
==============================================================
Luatex beta-0.70.1 was released 20110519
==============================================================
-News:
+News:
* fixed: recorder file location from TL (Akira).
@@ -227,14 +317,14 @@ News:
* fixed: box output to synctex.
-* fixed: FontDescriptor for non-embedded OpenType fonts has an
+* fixed: FontDescriptor for non-embedded OpenType fonts has an
invalid FontFile3 entry (#654)
* fixed: crash on non-existent images.
* fixed: small memory leak in the ipc code.
-* fixed: tex.print() and tex.sprint() don't recognize -2 as the
+* fixed: tex.print() and tex.sprint() don't recognize -2 as the
first argument (#659)
==============================================================
@@ -264,7 +354,7 @@ Luatex beta-0.66.0 was released 20110412
News:
-* fixed: linebreak_filter doesn't do its default job when
+* fixed: linebreak_filter doesn't do its default job when
tex.linebreak is used
* fixed: \escapechar ignored by \meaning
@@ -281,7 +371,7 @@ News:
* fixed: an indexing problem with nonexistent font glyphs
-* fixed: some crashes and other bugs on the 'subtype' and 'prev'
+* fixed: some crashes and other bugs on the 'subtype' and 'prev'
fields (not all node types have those fields)
* fixed: crash on token.csname_id ("")
@@ -294,21 +384,21 @@ News:
* fixed: compilation failure on Hurd
-* fixed: a small bug leading to displacements when reading
+* fixed: a small bug leading to displacements when reading
the AccentTop table
-* fixed: \directlua followed by \pdfximage generates error if
+* fixed: \directlua followed by \pdfximage generates error if
draft mode is active
* fixed: a problem with \vadjust pre in alignments
* fixed: a lua stack growing problem in the backend in 0.65.0,
- resulting in an inability to create more than a few thousand
+ resulting in an inability to create more than a few thousand
generated pages
* fixed: inclusion of Scribus-generated pdfs
-* adapt: the default form margin is now zero (was 1bp before)
+* adapt: the default form margin is now zero (was 1bp before)
* adapt: libpng 1.4.4, zzuplib 0.13.60, mplib 1.504
@@ -318,7 +408,7 @@ News:
* feature: new function node.currentattr() queries the current
active attribute list
-* feature: Lua font loading; ignore unknown enumeration keys in
+* feature: Lua font loading; ignore unknown enumeration keys in
MathConstants
* feature: JPEG 2000 image support
@@ -353,7 +443,7 @@ News:
* The various node list fields in the lua node interface have
been renamed from 'list' to 'head', e.g. tex.box[0].head,
- and the 'list' name is deprecated. For now, the deprecation
+ and the 'list' name is deprecated. For now, the deprecation
is silent, as 'list' will stay for quite some time. Please
update your lua source as soon as possible, though.
@@ -363,8 +453,8 @@ News:
* Luafilesystem has been updated to 1.5.0. NOTE: there is an
incompatible change in the directory iterator method.
-* The restriction on linebreak_filter has been eased: at least one
- horizontal box should be returned, but that is not necessarily
+* The restriction on linebreak_filter has been eased: at least one
+ horizontal box should be returned, but that is not necessarily
the last node any more.
* Backward compatibility has been restored for \meaning\mathchar
@@ -387,19 +477,19 @@ Bugfixes:
* <box>.head.prev is now always initialized to null (0).
-* luatex -lua=<script> '\relax' no longer exits immediately,
+* luatex -lua=<script> '\relax' no longer exits immediately,
instead going into interactive mode as it should.
* The \jobname was initialized wrongly for input file names
with multiple dots in them.
-* The synctex file is now written in the right place when
+* The synctex file is now written in the right place when
--output-directory is given.
* \letterspacefont could cause crashes, especially when combined
with font expansion.
-* Luatex would crash on linux32 systems if it was build in an
+* Luatex would crash on linux32 systems if it was build in an
environment where LFS (>2GB files) was enabled by default.
* Node lists created by node.copy_list() could not be hyphenated
@@ -407,11 +497,11 @@ Bugfixes:
* Synctex support was partially broken since 0.60.0.
-* With OpenType math fonts, accents with multiple parts
+* With OpenType math fonts, accents with multiple parts
(like the \vec arrow) forgot to include all parts if the
accentee was too narrow.
-* With OpenType math fonts, accents over any class except 0 and 7
+* With OpenType math fonts, accents over any class except 0 and 7
were misplaced.
* kpse.lookup("plain", {all = true}) was broken in kpathsea
@@ -459,7 +549,7 @@ News:
Bugfixes:
-* Fix a bug where an explicit hyphen prevented hyphenation for the
+* Fix a bug where an explicit hyphen prevented hyphenation for the
whole rest of the paragraph
* Internal font copying forgot to copy the last font dimen
@@ -471,7 +561,7 @@ Bugfixes:
* Multi-page pdf inclusion was very slow in 0.63.0
-* Some extra checks added to the handling of glue_spec node
+* Some extra checks added to the handling of glue_spec node
objects in lua code.
* Some node.prev pointers have been corrected (but this is not
@@ -495,7 +585,7 @@ News:
* Add CIDset tables to the output pdf where appropriate.
-* Added a 'string' field to late_lua nodes on the lua side. This
+* Added a 'string' field to late_lua nodes on the lua side. This
field does not convert the assigned string to a tokenlist.
* The result of fontloader.open() now has some virtual accessors
@@ -514,13 +604,13 @@ Bugfixes:
* Fix hyphenation exceptions.
-* Prevent linebreak between initial local_par paragraph whatsit
+* Prevent linebreak between initial local_par paragraph whatsit
and a following skip (bugreport #437).
* Fix placement of scripts on textstyle big operators in MATH
fonts (bugreport #466).
-* Fix a crash on the return value of MPlib's 'postscript'
+* Fix a crash on the return value of MPlib's 'postscript'
operation on images.
* Fix a crash on \leftghost & \rightghost in math mode.
@@ -539,7 +629,7 @@ News:
* Input-ed lua files are now mentioned in the fls file if
the --recorder switch is specified on the command line.
-* Paragraph indentation hlist nodes and hlist and vlist nodes
+* Paragraph indentation hlist nodes and hlist and vlist nodes
generated by alignment rows and cells now have a subtype
(3 for indent box, 4 for rows/columns, 5 for cells).
@@ -562,7 +652,7 @@ Bugfixes:
* \letterspacefont was broken since a very long time.
-* The node subtype of the \leftskip and \rightskip glues was
+* The node subtype of the \leftskip and \rightskip glues was
wrong.
* Some memory leaks have been removed.
@@ -578,14 +668,14 @@ New features:
* New lua library 'epdf' for introspection of PDF inclusions,
see the manual for details.
-* Mplib version 1.502 is now included (which is still beta,
+* Mplib version 1.502 is now included (which is still beta,
so be careful).
* new "finish_pdffile" and "pre_dump" callbacks.
* new function pdf.pageref()
-* In the lua 'tex' library: assignment to internal glue
+* In the lua 'tex' library: assignment to internal glue
parameters is now allowed.
* New lua function tex.error().
@@ -622,7 +712,7 @@ Bugfixes:
* fix pdf overprinting bug (related to \pdfliteral).
* patch from Akira Kakuto that ensures that only absolute commands
-that are inside the %PATH% will be executed in win32's restricted
+that are inside the %PATH% will be executed in win32's restricted
\write18
* fix a buffer overflow in luafontloader.
@@ -648,12 +738,12 @@ New features:
* Added --warnings=[no|min|yes|max|all] option to build.sh.
-* While cross-compiling, build.sh now adds an extra linker switch
+* While cross-compiling, build.sh now adds an extra linker switch
to allow win32 exes to use 3G instead of 2G of virtual memory.
Bugfixes:
-* os.exec() & os.spawn() handled the environment differently from
+* os.exec() & os.spawn() handled the environment differently from
os.execute() on Win32 (patch from Tomek)
* Builds with --enable-ipc were broken.
@@ -662,12 +752,12 @@ Bugfixes:
* An initial attempt at fixing bug #372 (\predisplaydirection).
-* An attempt to fix \eqno/\leqno placements in mixed direction
+* An attempt to fix \eqno/\leqno placements in mixed direction
\mathdir/\textdir.
* Our local xpdf patch is reverted, it is not needed any more.
-* The os.selfdir variable was not documented, as well as broken
+* The os.selfdir variable was not documented, as well as broken
on WIN32.
* Fix "\input tikz hello \bye" bug, plus fix one sign error.
@@ -798,7 +888,7 @@ Bug fixes:
on following pages due to a lingering internal variable.
* \pdfthread crashed because the arguments were handled in reverse
- order.
+ order.
==============================================================
Luatex beta-0.51.0 was released 20100312
@@ -865,7 +955,7 @@ Bug fixes:
Removed features:
-* Support for Type3 .pgc files (nobody used them).
+* Support for Type3 .pgc files (nobody used them).
==============================================================
Luatex beta-0.50.0 was released 20091224
@@ -873,10 +963,10 @@ Luatex beta-0.50.0 was released 20091224
New features:
-* Fonts now listen also to the 'extend' key in the lua font
+* Fonts now listen also to the 'extend' key in the lua font
metrics table, and the processing for this is done via de
pdf text matrix instead of via the font matrix, which means
- it now works for all font types.
+ it now works for all font types.
* The embedded Metapost library is now at version 1.209.
@@ -893,18 +983,18 @@ Bug fixes:
* \pdfcolorstack handling was broken.
-* node.unset_attribute() had a bug whereby it inverted the
+* node.unset_attribute() had a bug whereby it inverted the
requested result in some cases (the node on which the unset
was called was sometimes the only node at the current level
that *kept* the attribute).
-* During font expansion, the internal font copy had one character
+* During font expansion, the internal font copy had one character
information object less than the original, resulting in the
disappearance of a glyph in some fonts when font expansion
was active.
-* Placement of operator scripts of OT MATH fonts is adjusted
- to be conformant with Word's logic where the italic correction
+* Placement of operator scripts of OT MATH fonts is adjusted
+ to be conformant with Word's logic where the italic correction
is only used to tuck in the subscript and for nothing else.
* luafontloader.open() no longer writes directly to stderr in
@@ -914,12 +1004,12 @@ Bug fixes:
* The lua 'pdf' table could not be assigned to.
-* The lua 'md5' library was returning incorrect results on
+* The lua 'md5' library was returning incorrect results on
64-bit architectures.
* Luatex now compiles on GNU Hurd systems.
-* Fix segfault when embedding stream file object (these
+* Fix segfault when embedding stream file object (these
backend segfaults were a side-effect of the string pool
patches).
@@ -929,20 +1019,20 @@ Luatex beta-0.47.0 was released 20091218
New features:
-* New read-write lua variables pdf.pdfcatalog, pdf.pdfnames,
+* New read-write lua variables pdf.pdfcatalog, pdf.pdfnames,
pdf.pdfinfo, pdf.pdftrailer
-* The horizontal mode nodes that are added to lines during line
- breaking now inherit the attributes from the first and last node
+* The horizontal mode nodes that are added to lines during line
+ breaking now inherit the attributes from the first and last node
inside the created line.
-* The new function pdf.registerannot(<number>) registers an
- annotation object number to be included in the current
+* The new function pdf.registerannot(<number>) registers an
+ annotation object number to be included in the current
page's /Annots list.
-* The variables <metrics>.Mathconstants.FractionDelimiterSize
+* The variables <metrics>.Mathconstants.FractionDelimiterSize
and <metrics>.Mathconstants.FractionDelimiterDisplayStyleSize
- are added to the font table. This allows proper setting of the
+ are added to the font table. This allows proper setting of the
size parameters for TeX's ...withdelims math primitives.
* The internal representation of the string pool is reorganized
@@ -952,7 +1042,7 @@ New features:
status.pool_ptr now simply returns the current number of bytes
in use for string characters.
-* There are new lua variables pdf.pdfmapline and pdf.pdfmapfile
+* There are new lua variables pdf.pdfmapline and pdf.pdfmapfile
(write-only strings that mimic \pdfmapline and \pdfmapfile).
* \pdfobj data and attribute are now stored as C strings instead
@@ -960,14 +1050,14 @@ New features:
* Artificially slanted fonts now work via the pdf text matrix
(instead of adjusting the actual font) so that it now also
- works for non-Type1 fonts. The lua <metrics>.slant font key is
+ works for non-Type1 fonts. The lua <metrics>.slant font key is
now obeyed in all cases.
-* The lua function font.id(<string>) returns the internal font id
+* The lua function font.id(<string>) returns the internal font id
number belonging to a control sequence name.
* Pdf image inclusion is optimized such that objects from an
- external pdf will now be included only once even if they are
+ external pdf will now be included only once even if they are
referenced from multiple inclusions.
Bug fixes:
@@ -975,7 +1065,7 @@ Bug fixes:
* Protrusion for non-TLT documents did not work properly for
the hyphenation character.
-* \lastbox could not remove the paragraph indent box for non-TLT
+* \lastbox could not remove the paragraph indent box for non-TLT
documents.
* Pdf images (\pdfximage) are no longer kept open during the
@@ -984,19 +1074,19 @@ Bug fixes:
This prevents the 'too many open files' error when lots of
images are included.
-* On Win32 Pdf image files are locked during the time that it is
+* On Win32 Pdf image files are locked during the time that it is
open, to prevent unnoticed file changes by external sources.
* Compilation now again works on FreeBSD.
-* Format sharing between 32-bit and 64-bit architectures was
+* Format sharing between 32-bit and 64-bit architectures was
broken.
* Unsetting attributes from lua could sometimes result in
- the unset state persisting beyond the current group level.
-
+ the unset state persisting beyond the current group level.
+
* If something went wrong in the scanning of pdf action items,
- the error message reported the current primitive name
+ the error message reported the current primitive name
incorrectly.
* Luatex would crash on non-existant pdfs that were referenced
@@ -1011,17 +1101,17 @@ New features:
* The build.sh script now has better support for new MacOSX-es
(patch from Mojca).
-* Luatex now has experimental support for dynamic loading of
+* Luatex now has experimental support for dynamic loading of
external compiled lua libraries. Building luatex and loading
external .so/.dll files is reported to work on Windows,
linux and osx, other platforms are still unknown.
* pdf.obj{type="stream"} no longer converts its argument to and
from a tokenlist. This allows the use of binary data in the
- "string" argument. Such data does still have to hidden from
- the normal file parser by putting the code in a dofile()
+ "string" argument. Such data does still have to hidden from
+ the normal file parser by putting the code in a dofile()
or by using string.char(), though.
-
+
Bug fixes:
* Luatex 0.45.0 was not able to find truetype nor opentype fonts
@@ -1030,14 +1120,14 @@ Bug fixes:
* 0.45.0 printed the user input instead of the full pathname
for \input-ed tex files.
-* The TFM reader now rejects fonts with tfm names that are
- longer than 255 characters because such font names cannot
+* The TFM reader now rejects fonts with tfm names that are
+ longer than 255 characters because such font names cannot
be stored in a DVI file.
* The combination of \immediate\pdfxform followed by a later
\pdfrefxform could cause broken pdf output files because
the box used for the form could have been freed and even
- reused already at that moment in time, sometimes resulting
+ reused already at that moment in time, sometimes resulting
in an invalid transformation matrix.
* The placement of super- and subscripts for displaystyle
@@ -1054,10 +1144,10 @@ Luatex beta-0.45.0 was released 20091118
New features:
* Loading big OTF fonts via lua is now much faster than before,
- at the expense of a bit of precision loss in the calculated
+ at the expense of a bit of precision loss in the calculated
bounding boxes.
-* Two new token lists are provided: \pdfxformresources and
+* Two new token lists are provided: \pdfxformresources and
\pdfxformattr, as an alternative to \pdfxform keywords.
* \input and \openin now accept braced filenames.
@@ -1079,18 +1169,18 @@ New features:
* Akira Kakuto suppled a patch that restricts writing to files
with names such as latex.bat etc. (on windows only)
-* (un-feature): from now on luatex now only handles 4 direction
- specifiers: TLT (latin), TRT (arabic), RTT (cjk), and LTL
+* (un-feature): from now on luatex now only handles 4 direction
+ specifiers: TLT (latin), TRT (arabic), RTT (cjk), and LTL
(mongolian). The other directions now generate an error.
-* (un-feature): xpdf's automatic lower- and uppercasing retry attempts
+* (un-feature): xpdf's automatic lower- and uppercasing retry attempts
for nonfound image pdf files has been removed.
* The callbacks hpack_filter, vpack_filter and pre_output_filter
pass on an extra string argument for the direction, when known
(nil == use default).
-* The lua functions node.hpack(), node.vpack() and node.dimensions()
+* The lua functions node.hpack(), node.vpack() and node.dimensions()
now accept an optional direction argument (not given == use default).
* \pdfrefxform [width <dimen>] [height <dimen>] [depth <dimen>] <formref>
@@ -1098,7 +1188,7 @@ New features:
doesn't scale, it shifts vertically.
* A change to the relative ordering inside font name discovery for use
- by the backend: now it tries <f>.psname first, as that is much less
+ by the backend: now it tries <f>.psname first, as that is much less
likely to contain spaces.
* For ttc fonts, now the used subfont name and its index id are printed
@@ -1119,7 +1209,7 @@ Bug fixes:
* Images inside virtual fonts were broken.
-* The processing of \language=-1 was wrong, resulting in
+* The processing of \language=-1 was wrong, resulting in
hyphenation attempts even though there was no proper language
set up.
@@ -1130,7 +1220,7 @@ Bug fixes:
* tex.box[] assingments are now checked to make sure the assigned
node has the right id (hlist or vlist).
-* show_node_list (as in \showbox) produced spurious local_par
+* show_node_list (as in \showbox) produced spurious local_par
whatsit prints in the output after direction nodes.
* The handling of pdf literals has been sped up.
@@ -1164,7 +1254,7 @@ Bug fixes:
* \leavevmode\penalty-10000\penalty-10000 crashed luatex.
-* the API of margin kern nodes to lua was using the wrong
+* the API of margin kern nodes to lua was using the wrong
fields in the nodes.
* A few fixes to the manual.
@@ -1189,7 +1279,7 @@ Bug fixes:
* The converter from lua strings to token lists (for the node
interface) sometimes generated invalid tokens.
-* CFF (OpenType) fonts now listen to 'embedding="full"'. TTF
+* CFF (OpenType) fonts now listen to 'embedding="full"'. TTF
is still todo.
* Font tables with 'embedding="no"' would cause luatex to crash.
@@ -1205,7 +1295,7 @@ Luatex beta-0.43.0 was released 20090819
New features:
-* There is a new allowed key in the table trhat is returned
+* There is a new allowed key in the table trhat is returned
by lua-loaded fonts: <f>.psname. This value should be set
to the original PostScript font name of the font. Fonts inside
dfont and ttc collections are fetched using this field
@@ -1217,14 +1307,14 @@ New features:
* \latelua is now allowed inside leaders.
* There is a new callback: process_output_buffer, from Manuel
- Pégourié-Gonnard. This callback is called just before
+ Pégourié-Gonnard. This callback is called just before
\write acts, so it can be used to alter the file encoding
of text output files.
* There is a new node.dimensions() function, which calculates
the natural size of (part of) a list of nodes.
-* The new primitive \gleaders provides 'globally aligned'
+* The new primitive \gleaders provides 'globally aligned'
leaders.
* The DVI and PDF backends now share much code internally.
@@ -1237,10 +1327,10 @@ Bugfixes:
* We fixed lots of anonymous bugs introduced in 0.42.0 (as expected)
-* fontloader.info() errors are no longer fatal, the function now
+* fontloader.info() errors are no longer fatal, the function now
just returns a nil,"error string" pair.
-* Automatically inserted kerns for \accents are now once again
+* Automatically inserted kerns for \accents are now once again
valid word ends, as in \TEX.
* Fixed the placement of math displays in mixed direction
@@ -1254,11 +1344,11 @@ Luatex beta-0.42.0 was released 20090717
* There is a new node.tail() function
-* lua-loaded fonts now support a 'nomath' key to speed up
+* lua-loaded fonts now support a 'nomath' key to speed up
loading the lua table.
* A bugfix in the ttf reader for the inclusion backend, and
- (also in the backend) support for treating ttc files by
+ (also in the backend) support for treating ttc files by
pretending they are single ttf fonts (both patches from pdftex)
* Add Khaled Hosny's man page to the repository
@@ -1266,13 +1356,13 @@ Luatex beta-0.42.0 was released 20090717
* The \pdfcompresslevel is now effectively fixed as soon as
output to the pdf file has occurred.
-* Patched status.filename so that it (nearly) always returns a
+* Patched status.filename so that it (nearly) always returns a
file name.
* fix '\the\delcode' and disable '\the\odelcode', '\the\Udelcode',
- and '\the\Udelcodenum'
+ and '\the\Udelcodenum'
-* Handle jfifs where either xres or yres is 0 and the other
+* Handle jfifs where either xres or yres is 0 and the other
res is != 0 (from pdftex)
* The single-argument version of lang.hyphenate() was broken.
@@ -1282,24 +1372,24 @@ Luatex beta-0.42.0 was released 20090717
* The Lua coroutine patch (coco) is now disabled on linux
powerpc architectures (because it caused crashes)
-* Removed obsolete pdftex primitives:
- \pdfoptionalwaysusepdfpagebox
- \pdfoptionpdfinclusionerrorlevel
+* Removed obsolete pdftex primitives:
+ \pdfoptionalwaysusepdfpagebox
+ \pdfoptionpdfinclusionerrorlevel
\pdfforcepagebox
\pdfmovechars
-* The loading speed of large fonts (especially ttf) via the
+* The loading speed of large fonts (especially ttf) via the
fontloader library, and the inclusion speed for subsetting
in the backend have both been improved.
-* The 'pdf' lua library has been enhanced with various new
+* The 'pdf' lua library has been enhanced with various new
functions, see the manual for details.
* BLT and BRT glyph position fixed.
* Various fixes for synctex offsets.
-* Support for exotic font string encodings has been removed
+* Support for exotic font string encodings has been removed
from the fontloader library.
* The embedded MPlib is now 1.205.
@@ -1317,13 +1407,13 @@ Luatex beta-0.40.6 was released 20090625
* Sometimes pdf.print() could be used before the proper structures
were initialized.
-* There was a bug in the type codes for the lua package filter
- callback: wrong extra info was passed to lua for the alignment
- and vsplit cases.
+* There was a bug in the type codes for the lua package filter
+ callback: wrong extra info was passed to lua for the alignment
+ and vsplit cases.
* The math parameters \Umathlimitdownvgap, \Umathlimitdownbgap,
and \Umathlimitdownkern have been renamed to \Umathlimitbelowbgap,
- \Umathlimitbelowvgap, and \Umathlimitbelowkern to be more
+ \Umathlimitbelowvgap, and \Umathlimitbelowkern to be more
consistent with the other parameter names.
* The embedded MPlib is now 1.204.
@@ -1345,7 +1435,7 @@ Luatex beta-0.40.5 was released 20090610
Luatex beta-0.40.4 was released 20090609
==============================================================
-* \the\textfont0 returned a number instead of doing a font
+* \the\textfont0 returned a number instead of doing a font
switch.
* The embedded MPlib is now 1.203.
@@ -1359,7 +1449,7 @@ Luatex beta-0.40.3 was released 20090608
* A set of fixes to the synctex support.
-* A patch to the build script to prevent installed X11 headers
+* A patch to the build script to prevent installed X11 headers
from being required.
* Some weave (web syntax) fixes from Manuel Pégourié-Gonnard.
@@ -1381,19 +1471,19 @@ Luatex beta-0.40.2 was released 20090603
* A complicated bugfix by Hartmut for a rounding problem in the
VF loading that resulted in 'character width mismatch in font
- XY.vf ignored' messages at large load sizes
+ XY.vf ignored' messages at large load sizes
* The embedded MPlib is now 1.202.
-* The post_page_number callback was accidentally run when
+* The post_page_number callback was accidentally run when
shipping out xforms as well as during actual pages.
-* When a math accent char doesn't have a bot_accent placer,
+* When a math accent char doesn't have a bot_accent placer,
luatex now uses the top_accent placer, if present.
* A crash caused by \Uroot .. {<list>}{...} is fixed
-* A portability fix for solaris 8 sparc using sun studio
+* A portability fix for solaris 8 sparc using sun studio
compiler, and one for glibc > 2.9.90
* luatex -ini now sets the \catcode of the BOM character to
@@ -1424,13 +1514,13 @@ Luatex beta-0.40.1 was released 20090508
and --credits output.
-* There is a new MPlib 1.200 release candidate with a few minor
+* There is a new MPlib 1.200 release candidate with a few minor
fixes included.
* The xpdf library is updated to patch level 3.
* New imports to the build system, from texlive. In particular,
- there is now configure-level support for building with
+ there is now configure-level support for building with
libpoppler and support for building under cygwin 1.7 is added.
==============================================================
@@ -1461,12 +1551,12 @@ Luatex beta-0.39.0 was released 20090415
==============================================================
* iniluatex will from now on start up with only the TeX82 primitives
- and \directlua, everything else has to be bootstrapped via
+ and \directlua, everything else has to be bootstrapped via
tex.enableprimitives(). This change was planned for 0.40.0,
but *now* is the time to test it.
-
+
* A bugfix for \primitive in various expandable contexts,
- and \primitive now generates an error message when the
+ and \primitive now generates an error message when the
argument is not actually a primitive's name.
* There was a bug found in the math accent handling.
@@ -1486,28 +1576,28 @@ Luatex beta-0.39.0 was released 20090415
* There was a leak of direction nodes in the paragraph builder.
-* The font backend now does a small peek to differentiate
+* The font backend now does a small peek to differentiate
truetype and postscript style opentype fonts. This fixes
the "Can't find CFF table" bug for otf's with truetype outlines.
* Parameters and registers can now also be assinged to globally
from lua (see the manual for details).
-* It is now possible to query the current math style while a
+* It is now possible to query the current math style while a
formula is still being constructed by using the new read-only
value \mathstyle. Associated is the new command \Ustack that
- is to be used as a prefix for {.. \over ..} and friends.
+ is to be used as a prefix for {.. \over ..} and friends.
See the manual for more information.
* The embedded MPLib is brought up to date with the current
metapost repository (version 1.110 and a few small patches).
-
+
* Luatex can now handle two breakpoints inside a single ligature
(like for the functional word of-f-ice). The solution is not
- perfect yet, but the chance of missed hyphenation points in
+ perfect yet, but the chance of missed hyphenation points in
actual documents should now be negligible.
-* Some speedups in the font loading code, and in the handling of
+* Some speedups in the font loading code, and in the handling of
pdf_literal nodes that are set from within Lua code.
* Some source code and manual cleanup, as usual.
@@ -1517,12 +1607,12 @@ Luatex beta-0.38.0 was released 20090410
==============================================================
* tex.enableprimitives() had a bug were previously defined (but
- currently undefined) control sequences prevented the creation
+ currently undefined) control sequences prevented the creation
of the new csname.
* The special calling format callback.register('name', false)
- not only disables the callback, but also the builtin code it
- is supposed to replace.
+ not only disables the callback, but also the builtin code it
+ is supposed to replace.
* Empty \localleftbox and \localrightbox -es are now suppressed.
@@ -1533,16 +1623,16 @@ Luatex beta-0.38.0 was released 20090410
corrections via the OpenType MATH mathkern table. See the
manual for details.
-* node.write() no longer copies its argument node list before
+* node.write() no longer copies its argument node list before
appending it.
-* There are six new primitives that are verbose forms
+* There are six new primitives that are verbose forms
of one and two byte special tokens:
- \Usuperscript \Usubscript
- \Ustartmath \Ustopmath
+ \Usuperscript \Usubscript
+ \Ustartmath \Ustopmath
\Ustartdisplaymath \Ustopdisplaymath
-* The attribute node leaks in math mode and alignmetns have been
+* The attribute node leaks in math mode and alignmetns have been
fixed.
* The 11 simple math noads are now combined into a single "noad"
@@ -1557,8 +1647,8 @@ Luatex beta-0.38.0 was released 20090410
* Lua now also has the "architecture independent bytecode"
patch applied.
-* Lua is updated to version 5.1.4 with coco patches 1.1.5, and
- lpeg is now 0.9.
+* Lua is updated to version 5.1.4 with coco patches 1.1.5, and
+ lpeg is now 0.9.
* Some TRT/TLT backend bugs are fixed.
@@ -1569,39 +1659,39 @@ Luatex beta-0.37.0 was released 20090331
==============================================================
* Luatex now implements shell_escape = 'p', a new feature
- in web2c that intends to make \write18 more secure. As
- a side-effect, if luatex is used for typesetting, it will
+ in web2c that intends to make \write18 more secure. As
+ a side-effect, if luatex is used for typesetting, it will
now also apply shell_escape = 'p' and shell_escape = 'f'
- to the lua functions io.popen(), os.execute(), os.exec(),
+ to the lua functions io.popen(), os.execute(), os.exec(),
and os.spawn().
- Nothing has changed for the case where luatex is used as
+ Nothing has changed for the case where luatex is used as
a script interpreter.
* Attributes can now have negative values. The special value
for 'unset' is lowered to -0x7FFFFFFF (it used to be -1).
-* The lua 'kpse' library now has an object-oriented interface
+* The lua 'kpse' library now has an object-oriented interface
as companion to the procedural interface. This is useful for
e.g. controlling the discovery of mplib files.
* The new internal integer parameter \outputbox allows setting
of the output box number (default: 255, max: 65535)
-* The new primitives \Udelimiterunder and \Udelimiterover
+* The new primitives \Udelimiterunder and \Udelimiterover
complete the set of 'StretchStacks' for OpenType Math.
-* Fixed a bug in font string conversions on the Macintosh that
+* Fixed a bug in font string conversions on the Macintosh that
resulted in warnings about 'unaligned pointers being freed'.
* Khaled Hosny spotted a bunch of manual errors.
-* There was bug in the width of math_accent objects when
+* There was bug in the width of math_accent objects when
there were super- or subscripts attached to the accentee.
* In PDF mode, TRT \leaders were bugged.
-* The source tree now uses the new texlive build system that
- Peter Breitenlohner created.
+* The source tree now uses the new texlive build system that
+ Peter Breitenlohner created.
* There is now a single build.sh instead of four separate
ones. It has a few options:
@@ -1625,7 +1715,7 @@ Luatex beta-0.36.0 was released 20090323
The old name ('fontforge') will remain present for a while,
but will eventually go away.
-* New lua functions: tex.primitives(), tex.extraprimitives,
+* New lua functions: tex.primitives(), tex.extraprimitives,
tex.enableprimitives(). This is a prelude to a big change
in the next beta: iniluatex will from now on start up with
only the TeX82 primitives and \directlua, everything else
@@ -1640,22 +1730,22 @@ Luatex beta-0.36.0 was released 20090323
directions (form and image placement, vertical typesetting,
synctex).
-* The kpathsea library is updated. Highlights: cleaner build
- process (thanks to Peter Breitenlohner), cleaner mingw32
+* The kpathsea library is updated. Highlights: cleaner build
+ process (thanks to Peter Breitenlohner), cleaner mingw32
(cross)compilation support, and a new reentrant API.
* Some possible endless loops within extended delimiters in
math mode are now trapped.
-* Movements inside VF font characters were considerably off
+* Movements inside VF font characters were considerably off
due to a wrong conversion routine.
* Error handling for \outer has been reinstated, but can be
suppressed via the new primitive \suppressoutererror.
* The new primitives: \suppresslongerror and \suppressifcsnameerror
- that can be used to suppress errors for \par in non-long macros
- and for non-expandable objects inside \ifcsname ... \endcsname,
+ that can be used to suppress errors for \par in non-long macros
+ and for non-expandable objects inside \ifcsname ... \endcsname,
respectively.
* New lua function: node.vpack() via a patch from Khaled Hosny
@@ -1671,10 +1761,10 @@ Luatex beta-0.36.0 was released 20090323
accept an array of strings as well as vararg list of strings
to print.
-* A change to be build process: luatex.p is no longer split
+* A change to be build process: luatex.p is no longer split
int smaller pieces before running the C compiler.
-* Melissa O'Neill contributed a bugfix to the Type1 font
+* Melissa O'Neill contributed a bugfix to the Type1 font
subsetting code.
* A bunch of smaller bugfixes and cleanups (as usual).
@@ -1685,22 +1775,22 @@ Luatex beta-0.35.0 was released 20090224
* The math handling portions of LuaTeX are converted to C code,
and extended to support Unicode math. There are a great many
- related changes, see the new Math chapter in the manual for
+ related changes, see the new Math chapter in the manual for
details.
* A nasty bug in the paragraph breaking routine was fixed.
(All lines except the first one were believed to be wider then
- they really were. This affected which nodes were considered
- as active breakpoints)
+ they really were. This affected which nodes were considered
+ as active breakpoints)
* Various changes to the PDF backend to make it support non-latin
directions.
-* Fixed the behaviour of the page offsets. Placement of the output
- on the physical page should now work correctly in all directions,
+* Fixed the behaviour of the page offsets. Placement of the output
+ on the physical page should now work correctly in all directions,
both in DVI and PDF.
There now are \pageleftoffset and \pagetopoffset primitives,
- as well as
+ as well as
* fontforge.apply_featurefile() was broken since 0.31.0
@@ -1713,10 +1803,10 @@ Luatex beta-0.35.0 was released 20090224
* An optional space afer a <direction specifier> for \textdir c.s.
is ignored from now on.
-* \bodydir and \pagedir can now be (re)set even after the first
+* \bodydir and \pagedir can now be (re)set even after the first
page has been output.
-* The new callback mlist_to_hlist can be used to intercept the
+* The new callback mlist_to_hlist can be used to intercept the
normal conversion of math lists to horizontal lists.
* The programs ttf2afm and pdftosrc are removed from the luatex
@@ -1740,9 +1830,9 @@ This release has a bunch of updates from the development trunk
* Closing of files opened by \externalocp.
* Fix for a locale-related bug that make PDF generation fail
- with a "Parsing CFF Dict failed" message when including
+ with a "Parsing CFF Dict failed" message when including
opentype fonts.
-
+
* The included metapost is now version 1.102.
* PDF rules in vertical modes in RL direction where output
@@ -1775,7 +1865,7 @@ Besides fixing building issues, this release has
Luatex beta-0.31.1 was released 20081209
==============================================================
-fixed a bunch of compilation errors on various platforms, but
+fixed a bunch of compilation errors on various platforms, but
with no other visible changes.
@@ -1891,7 +1981,7 @@ Luatex beta-0.30.1 was released 20081009
(active) was broken
* Luatex could crash on win32 with an access violation
because there was one predefined language too few
- (the one matching \language=-1)
+ (the one matching \language=-1)
==============================================================
Luatex beta-0.30.0 was released 20080930
@@ -2156,7 +2246,7 @@ Other news:
we probably introduced new problems as well).
* Most (all?) files now have a corrected Copyright header,
- and link in $Id: NEWS 4746 2014-01-13 08:47:45Z taco $ and $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/NEWS $ into the object file.
+ and link in $Id: NEWS 4962 2014-03-28 15:23:35Z taco $ and $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/NEWS $ into the object file.
* Some unnecessary files were removed from the distribution.
@@ -2188,7 +2278,7 @@ Other news:
* The fontforge library now dump AAT feature tags as and
"<id,flags>" string
* The new function font.nextid() predicts the next assigned font id
-* Some source code changes are backported from texlive
+* Some source code changes are backported from texlive
==============================================================
Luatex beta-0.25.2 was released 20080410
@@ -2414,7 +2504,7 @@ News compared to the last beta (0.11.2) is as follows:
* (internal) the node (de)allocation functions have been
rewritten, so that absolutely all nodes now have a type,
- even the ones with variable sizes.
+ even the ones with variable sizes.
==============================================================
@@ -2437,7 +2527,7 @@ Luatex snapshot-20071029 was released 20071029
* texio.print now accepts multiple strings as arguments.
-* The lua function os.sleep() is added
+* The lua function os.sleep() is added
==============================================================
Luatex beta-0.11.2 was released 20070918
@@ -2488,7 +2578,7 @@ Fixes:
caused a crash
* \handling of \if\noexpand was wrong
* applied a patch that cleans up XForm and page calculations
-* "autoconf" support from zziplib is stripped
+* "autoconf" support from zziplib is stripped
==============================================================
Luatex beta-0.10.2 was released 20070814
@@ -2564,7 +2654,7 @@ Luatex snapshot-20070626 was released 20070626
Luatex snapshot-20070622 was released 20070622
==============================================================
-Not a lot of news, but it fixes a few important bugs in the lua
+Not a lot of news, but it fixes a few important bugs in the lua
node processing. Also a few utility functions are added:
* tex.round()
@@ -2656,7 +2746,7 @@ now, but keep in mind the following:
but not done yet
The other changes in this snapshot are various bugfixes (for builds
-on various platforms as well as font issues) and speedups (in the
+on various platforms as well as font issues) and speedups (in the
execution of callbacks and the creation of lua font representations).
@@ -2758,11 +2848,11 @@ contains four fields:
is that csname\NC\NR
\NC mod \NC character \NC A single character string representing
the current processing mode. One of {\bf v}ertical, {\bf h}orizontal,
-display {\bf m}ath, {\bf n}o, internal {\bf V}ertical,
+display {\bf m}ath, {\bf n}o, internal {\bf V}ertical,
restricted {\bf H}orizontal, or inline {\bf M}ath mode.\NC\LR
\stoptabulate
-If you modify the table before returning it, then it is wise to return
+If you modify the table before returning it, then it is wise to return
either a (\type{cmd}, \type{chr}) pair, or a \type{cs} string. That is
because if both options are present, the pair has precedence and the
string is ignored. On the return table, {\bf mod} is ignored always.
@@ -2992,7 +3082,7 @@ Luatex snapshot-20070202 was released 20070202
making luatex run a bit faster.
* luatex now happily accepts the following low-level syntax:
-
+
\font\myfont = <general text> <at specifier>
It feeds the <general text> to either kpathsea or a lua script for
@@ -3013,8 +3103,8 @@ Luatex snapshot-20070202 was released 20070202
* It is now possible to define a font into the font.fonts[]
directly from lua, but becayse use is limited, I am only
mentioning it to be complete.
-
- Syntax:
+
+ Syntax:
<number> id = font.define(<table> font)
* There is a (not very reliable yet) virtual font parser accessible
@@ -3186,7 +3276,7 @@ Hot on the heels of 20070105, a new snapshot. It turns out
that using the callback to define a font broke all ligatures.
This snapshot fixes that, and it has a few minor updates to
the manual. Next shapshot will be after the inclusion of
-pdftex 1.40.1.
+pdftex 1.40.1.
==============================================================
Luatex snapshot-20070105 was released 20070105
@@ -3208,7 +3298,7 @@ Luatex snapshot-20070105 was released 20070105
The value returned should be a lua table representing a tfm
file.
- * there is a new lua table: font. It has one function:
+ * there is a new lua table: font. It has one function:
font.read_tfm() that returns a table reprentation of the tfm
contents, for use with the above mentioned callback
@@ -3358,7 +3448,7 @@ Luatex snapshot-20061204 was released 20061204
associated 'read_miscfonts_file' callback has been removed.
(nobody used it anyway)
-* General cleanups to the source tree and build process.
+* General cleanups to the source tree and build process.
==============================================================
Luatex snapshot-20061023 was released 20061023
@@ -3384,7 +3474,7 @@ as well, so that I can say: Please look at
https://foundry.supelec.fr/plugins/scmsvn/viewcvs.php/manual/
/luatexref-t.pdf?root=luatex&rev=148&view=log
-for all the details. :-)
+for all the details. :-)
==============================================================
Luatex snapshot-20061002 was released 20061002
@@ -3435,7 +3525,7 @@ Luatex snapshot-20061002 was released 20061002
* startup.lua is now always loaded into lua state 0
* The luazip library from kepler is linked in, so there the table 'zip'
- is accessible from all lua states.
+ is accessible from all lua states.
==============================================================
Luatex snapshot-20060922 was released 20060922
@@ -3451,7 +3541,7 @@ Luatex snapshot-20060922 was released 20060922
* In related news, there are two new callbacks you can define:
-
+
callback.register('open_read_file', f)
callback.register('open_write_file', f)
@@ -3645,7 +3735,7 @@ Luatex snapshot-20060915 was released 20060915
However,
tex.dimen["unknowndimen"] = d
- is still (and probably will remain) illegal
+ is still (and probably will remain) illegal
==============================================================
Luatex snapshot-20060908 was released 20060908
@@ -3878,7 +3968,7 @@ so far:
and the needed functionality from the normal io library will be
reimplemented. Along with that change, there will also be a callback
to open (i.e. find) files, and a simple interface to the compiled-in
- kpathsea to use within that callback.
+ kpathsea to use within that callback.
==============================================================
@@ -4000,4 +4090,4 @@ there are some differences, to summarize:
\ifabsdim
instead.
-* I probably forgot to mention some things :-) \ No newline at end of file
+* I probably forgot to mention some things :-)
diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.w b/Build/source/texk/web2c/luatexdir/font/mapfile.w
index aa076a0a587..24c8855509e 100644
--- a/Build/source/texk/web2c/luatexdir/font/mapfile.w
+++ b/Build/source/texk/web2c/luatexdir/font/mapfile.w
@@ -20,7 +20,7 @@
@ @c
static const char _svn_version[] =
- "$Id: mapfile.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: mapfile.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/mapfile.w $";
#include "ptexlib.h"
@@ -517,14 +517,12 @@ static void fm_read_info(void)
&file_opened, &fm_buffer, &fm_size)) {
if (file_opened) {
if (fm_size > 0) {
- if (tracefilenames)
- tex_printf("{%s", cur_file_name);
+ report_start_file(filetype_map,cur_file_name);
while (!fm_eof()) {
fm_scan_line();
mitem->lineno++;
}
- if (tracefilenames)
- tex_printf("}");
+ report_stop_file(filetype_map);
fm_file = NULL;
}
} else {
@@ -538,13 +536,13 @@ static void fm_read_info(void)
luatex_warn("cannot open font map file (%s)", cur_file_name);
} else {
fm_read_file();
- tex_printf("{%s", cur_file_name);
+ report_start_file(filetype_map,cur_file_name);
while (!fm_eof()) {
fm_scan_line();
mitem->lineno++;
}
fm_close();
- tex_printf("}");
+ report_stop_file(filetype_map);
fm_file = NULL;
}
}
diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.w b/Build/source/texk/web2c/luatexdir/font/writecff.w
index ed0ec53ce1e..3c9174d1aae 100644
--- a/Build/source/texk/web2c/luatexdir/font/writecff.w
+++ b/Build/source/texk/web2c/luatexdir/font/writecff.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writecff.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: writecff.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writecff.w $";
#include "ptexlib.h"
@@ -561,7 +561,7 @@ static double arg_stack[CFF_DICT_STACK_LIMIT];
@
CFF DICT encoding:
TODO: default values
-
+
@c
#define CFF_LAST_DICT_OP1 22
#define CFF_LAST_DICT_OP2 39
@@ -735,7 +735,7 @@ static double get_real(card8 ** data, card8 * endptr, int *status)
*status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
} else {
char *s;
- /* strtod sets errno for OVERFLOW and _maybe_ UNDERFLOW */
+ /* strtod sets errno for OVERFLOW and _maybe_ UNDERFLOW */
/* but not for an invalid conversion (as for example if we try to convert "foo" in a double )*/
/* At least in glib sets errno also for UNDERFLOW */
/* We don't save/restore the prev. errno */
@@ -1296,8 +1296,8 @@ static long pack_real(card8 * dest, long destlen, double value)
unsigned char ch = 0;
if (work_buffer[i] == '\0') {
- /* res should prevent this. */
- /* CFF_ERROR("Cannot happen"); */
+ /* res should prevent this. */
+ /* CFF_ERROR("Cannot happen"); */
break;
} else if (work_buffer[i] == '.') {
ch = 0x0a;
@@ -1544,7 +1544,7 @@ void cff_dict_set(cff_dict * dict, const char *key, int idx, double value)
}
-@ Strings
+@ Strings
@c
char *cff_get_string(cff_font * cff, s_SID id)
{
@@ -1913,7 +1913,7 @@ static double width = 0.0;
static double seac[4] = { 0.0, 0.0, 0.0, 0.0 };
#endif
-@ Operand stack and Transient array
+@ Operand stack and Transient array
@c
static int cs2_stack_top = 0;
static double cs2_arg_stack[CS_ARG_STACK_MAX];
@@ -2065,7 +2065,7 @@ static void clear_stack(card8 ** dest, card8 * limit)
@
Single byte operators:
Path construction, Operator for finishing a path, Hint operators.
-
+
phase:
\item 0: inital state
\item 1: hint declaration, first stack-clearing operator appeared
@@ -2194,10 +2194,10 @@ do_operator1(card8 ** dest, card8 * limit, card8 ** data, card8 * endptr)
@
Double byte operators:
Flex, arithmetic, conditional, and storage operators.
-
+
Following operators are not supported:
random: How random ?
-
+
@c
static void
do_operator2(card8 ** dest, card8 * limit, card8 ** data, card8 * endptr)
@@ -2475,7 +2475,7 @@ static void get_fixed(card8 ** data, card8 * endptr)
@
Subroutines:
The bias for subroutine number is introduced in type 2 charstrings.
-
+
subr: set to a pointer to the subroutine charstring.
len: set to the length of subroutine charstring.
|subr_idx|: CFF INDEX data that contains subroutines.
@@ -3175,8 +3175,8 @@ void write_cff(PDF pdf, cff_font * cffont, fd_entry * fd)
}
}
- /* CIDSet: a table of bits indexed by cid, bytes with high order bit first,
- each (set) bit is a (present) CID. */
+ /* CIDSet: a table of bits indexed by cid, bytes with high order bit first,
+ each (set) bit is a (present) CID. */
if (1) {
int cid;
cidset = pdf_create_obj(pdf, obj_type_others, 0);
@@ -3386,7 +3386,7 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd)
}
}
- /* CIDSet: a table of bits indexed by cid, bytes with high order bit first,
+ /* CIDSet: a table of bits indexed by cid, bytes with high order bit first,
each (set) bit is a (present) CID. */
if (1) {
cidset = pdf_create_obj(pdf, obj_type_others, 0);
@@ -3555,13 +3555,11 @@ void writetype1w(PDF pdf, fd_entry * fd)
}
fclose(fp);
- if (tracefilenames) {
- if (is_subsetted(fd->fm))
- tex_printf("<%s", cur_file_name);
- else
- tex_printf("<<%s", cur_file_name);
+ if (is_subsetted(fd->fm)) {
+ report_start_file(filetype_subset,cur_file_name);
+ } else {
+ report_start_file(filetype_font,cur_file_name);
}
-
(void) ff_createcff(ff->ff_path, &tfm_buffer, &tfm_size);
if (tfm_size > 0) {
@@ -3578,11 +3576,10 @@ void writetype1w(PDF pdf, fd_entry * fd)
cur_file_name);
uexit(1);
}
- if (tracefilenames) {
- if (is_subsetted(fd->fm))
- tex_printf(">");
- else
- tex_printf(">>");
+ if (is_subsetted(fd->fm)) {
+ report_stop_file(filetype_subset);
+ } else {
+ report_stop_file(filetype_font);
}
cur_file_name = NULL;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/writet1.w b/Build/source/texk/web2c/luatexdir/font/writet1.w
index 567d3768936..2e65017d2f8 100644
--- a/Build/source/texk/web2c/luatexdir/font/writet1.w
+++ b/Build/source/texk/web2c/luatexdir/font/writet1.w
@@ -20,13 +20,12 @@
@ @c
static const char _svn_version[] =
- "$Id: writet1.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: writet1.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writet1.w $";
#include "ptexlib.h"
#include <string.h>
-#define t1_log(str) if(tracefilenames) tex_printf("%s", str)
#define get_length1() t1_length1 = t1_offset() - t1_save_offset
#define get_length2() t1_length2 = t1_offset() - t1_save_offset
#define get_length3() t1_length3 = fixedcontent? t1_offset() - t1_save_offset : 0
@@ -305,9 +304,7 @@ char **load_enc_file(char *enc_name)
glyph_names = xtalloc(256, char *);
for (i = 0; i < 256; i++)
glyph_names[i] = (char *) notdef;
- t1_log("{");
-
- t1_log(cur_file_name);
+ report_start_file(filetype_map,cur_file_name);
enc_getline();
if (*enc_line != '/' || (r = strchr(enc_line, '[')) == NULL) {
remove_eol(r, enc_line);
@@ -343,7 +340,7 @@ char **load_enc_file(char *enc_name)
r = enc_line;
}
done:
- t1_log("}");
+ report_stop_file(filetype_map);
cur_file_name = NULL;
xfree(enc_buffer);
return glyph_names;
@@ -573,10 +570,9 @@ static void t1_printf(PDF pdf, const char *fmt, ...)
}
@ @c
-static void t1_init_params(const char *open_name_prefix)
+static void t1_init_params(int open_name_prefix)
{
- t1_log(open_name_prefix);
- t1_log(cur_file_name);
+ report_start_file(open_name_prefix,cur_file_name);
t1_lenIV = 4;
t1_dr = 55665;
t1_er = 55665;
@@ -589,9 +585,9 @@ static void t1_init_params(const char *open_name_prefix)
t1_check_pfa();
}
-static void t1_close_font_file(const char *close_name_suffix)
+static void t1_close_font_file(int close_name_suffix)
{
- t1_log(close_name_suffix);
+ report_stop_file(close_name_suffix);
cur_file_name = NULL;
}
@@ -897,7 +893,7 @@ static void t1_check_end(PDF pdf)
@
@c
-static boolean t1_open_fontfile(const char *open_name_prefix)
+static boolean t1_open_fontfile(int open_name_prefix)
{
ff_entry *ff;
int callback_id = 0;
@@ -1361,8 +1357,7 @@ static void t1_subset_ascii_part(PDF pdf)
}
make_subset_tag(fd_cur);
assert(t1_fontname_offset != 0);
- strncpy((char *) pdf->fb->data + t1_fontname_offset, fd_cur->subset_tag,
- 6);
+ strncpy((char *) pdf->fb->data + t1_fontname_offset, fd_cur->subset_tag,6);
}
/* now really all glyphs needed from this font are in the |fd_cur->gl_tree| */
if (t1_encoding == ENC_STANDARD)
@@ -1635,7 +1630,7 @@ static void t1_check_unusual_charstring(void)
char *p = strstr(t1_line_array, charstringname) + strlen(charstringname);
int i;
/* if no number follows "/CharStrings", let's read the next line */
- if (sscanf(p, "%i", &i) != 1) {
+ if (sscanf(p, "%i", &i) != 1) {
strcpy(t1_buf_array, t1_line_array);
t1_getline();
strcat(t1_buf_array, t1_line_array);
@@ -1720,15 +1715,15 @@ void writet1(PDF pdf, fd_entry * fd)
t1_save_offset = 0;
if (!is_subsetted(fd_cur->fm)) { /* include entire font */
- if (!(fd->ff_found = t1_open_fontfile("<<")))
+ if (!(fd->ff_found = t1_open_fontfile(filetype_subset)))
return;
t1_include(pdf);
- t1_close_font_file(">>");
+ t1_close_font_file(7);
xfree(t1_buffer);
return;
}
/* partial downloading */
- if (!(fd->ff_found = t1_open_fontfile("<")))
+ if (!(fd->ff_found = t1_open_fontfile(filetype_font)))
return;
t1_subset_ascii_part(pdf);
t1_start_eexec(pdf);
@@ -1737,7 +1732,7 @@ void writet1(PDF pdf, fd_entry * fd)
t1_read_subrs(pdf);
t1_subset_charstrings(pdf);
t1_subset_end(pdf);
- t1_close_font_file(">");
+ t1_close_font_file(3);
xfree(t1_buffer);
}
diff --git a/Build/source/texk/web2c/luatexdir/font/writet3.w b/Build/source/texk/web2c/luatexdir/font/writet3.w
index c03a6d84374..d88bbf48a1a 100644
--- a/Build/source/texk/web2c/luatexdir/font/writet3.w
+++ b/Build/source/texk/web2c/luatexdir/font/writet3.w
@@ -20,7 +20,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writet3.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: writet3.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writet3.w $";
#include "ptexlib.h"
@@ -162,8 +162,7 @@ static boolean writepk(PDF pdf, internal_font_number f)
}
t3_image_used = true;
is_pk_font = true;
- if (tracefilenames)
- tex_printf(" <%s", (char *) name);
+ report_start_file(filetype_font,(char *) name);
cd.rastersize = 256;
cd.raster = xtalloc((unsigned long) cd.rastersize, halfword);
check_preamble = true;
@@ -378,7 +377,6 @@ void writet3(PDF pdf, internal_font_number f)
}
pdf_end_dict(pdf);
pdf_end_obj(pdf);
- if (tracefilenames)
- tex_printf(">");
+ report_stop_file(filetype_font);
cur_file_name = NULL;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/writetype0.w b/Build/source/texk/web2c/luatexdir/font/writetype0.w
index 1196899ba79..ca5e0d7ca08 100644
--- a/Build/source/texk/web2c/luatexdir/font/writetype0.w
+++ b/Build/source/texk/web2c/luatexdir/font/writetype0.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writetype0.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: writetype0.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writetype0.w $";
#include "ptexlib.h"
@@ -71,11 +71,10 @@ void writetype0(PDF pdf, fd_entry * fd)
fd_cur->ff_found = true;
- if (tracefilenames) {
- if (is_subsetted(fd_cur->fm))
- tex_printf("<%s", cur_file_name);
- else
- tex_printf("<<%s", cur_file_name);
+ if (is_subsetted(fd_cur->fm)) {
+ report_start_file(filetype_subset, cur_file_name);
+ } else {
+ report_start_file(filetype_font, cur_file_name);
}
ttf_read_tabdir();
/* read font parameters */
@@ -116,11 +115,10 @@ void writetype0(PDF pdf, fd_entry * fd)
}
xfree(dir_tab);
xfree(ttf_buffer);
- if (tracefilenames) {
- if (is_subsetted(fd_cur->fm))
- tex_printf(">");
- else
- tex_printf(">>");
+ if (is_subsetted(fd_cur->fm)) {
+ report_stop_file(filetype_subset);
+ } else {
+ report_stop_file(filetype_font);
}
cur_file_name = NULL;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/writetype2.w b/Build/source/texk/web2c/luatexdir/font/writetype2.w
index c2bdb97b152..50c5c193682 100644
--- a/Build/source/texk/web2c/luatexdir/font/writetype2.w
+++ b/Build/source/texk/web2c/luatexdir/font/writetype2.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writetype2.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: writetype2.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writetype2.w $";
#include "ptexlib.h"
@@ -37,7 +37,7 @@ void make_tt_subset(PDF pdf, fd_entry * fd, unsigned char *buff, int buflen);
@ @c
unsigned long cidtogid_obj = 0;
-@ low-level helpers
+@ low-level helpers
@c
#define test_loc(l) \
if ((f->loc + l) > f->buflen) { \
@@ -173,47 +173,43 @@ void writetype2(PDF pdf, fd_entry * fd)
fd_cur->ff_found = true;
- if (tracefilenames) {
- if (is_subsetted(fd_cur->fm))
- tex_printf("<%s", cur_file_name);
- else
- tex_printf("<<%s", cur_file_name);
- }
-
+ if (is_subsetted(fd_cur->fm))
+ report_start_file(filetype_subset,cur_file_name);
+ else
+ report_start_file(filetype_font,cur_file_name);
+
/* here is the real work */
make_tt_subset(pdf, fd, ttf_buffer, ttf_size);
#if 0
- xfree (dir_tab);
+ xfree (dir_tab);
#endif
xfree(ttf_buffer);
- if (tracefilenames) {
- if (is_subsetted(fd_cur->fm))
- tex_printf(">");
- else
- tex_printf(">>");
- }
+ if (is_subsetted(fd_cur->fm))
+ report_stop_file(filetype_subset);
+ else
+ report_stop_file(filetype_font);
cur_file_name = NULL;
}
@ PDF viewer applications use following tables (CIDFontType 2)
-
+
\.{head, hhea, loca, maxp, glyf, hmtx, fpgm, cvt\_, prep}
-
+
\rightline{from PDF Ref. v.1.3, 2nd ed.}
-
+
The \.{fpgm}, \.{cvt\_} and \.{prep} tables appears only when TrueType instructions
requires them. Those tables must be preserved if they exist.
We use |must_exist| flag to indicate `preserve it if present'
and to make sure not to cause an error when it does not exist.
-
+
\.{post} and \.{name} table must exist in ordinary TrueType font file,
but when a TrueType font is converted to CIDFontType 2 font, those tables
are no longer required.
-
+
The OS/2 table (required for TrueType font for Windows and OS/2) contains
liscencing information, but PDF viewers seems not using them.
-
+
The \.{name} table added. See comments in \.{writettf.w}.
@c
@@ -400,7 +396,7 @@ void make_tt_subset(PDF pdf, fd_entry * fd, unsigned char *buff, int buflen)
pdf_release_obj(fontfile);
- /* CIDSet: a table of bits indexed by cid, bytes with high order bit first,
+ /* CIDSet: a table of bits indexed by cid, bytes with high order bit first,
each (set) bit is a (present) CID. */
if (is_subsetted(fd->fm)) {
cidset = pdf_create_obj(pdf, obj_type_others, 0);
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.w b/Build/source/texk/web2c/luatexdir/image/writeimg.w
index e5c39466ce7..e8a770684b5 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.w
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.w
@@ -22,7 +22,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writeimg.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: writeimg.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/writeimg.w $";
#include "ptexlib.h"
@@ -579,8 +579,7 @@ void write_img(PDF pdf, image_dict * idict)
{
assert(idict != NULL);
if (img_state(idict) < DICT_WRITTEN) {
- if (tracefilenames)
- tex_printf(" <%s", img_filepath(idict));
+ report_start_file(filetype_image, img_filepath(idict));
switch (img_type(idict)) {
case IMG_TYPE_PNG:
write_png(pdf, idict);
@@ -603,8 +602,7 @@ void write_img(PDF pdf, image_dict * idict)
default:
luatex_fail("internal error: unknown image type (1)");
}
- if (tracefilenames)
- tex_printf(">");
+ report_stop_file(filetype_image);
if (img_type(idict) == IMG_TYPE_PNG) {
write_additional_png_objects(pdf);
}
diff --git a/Build/source/texk/web2c/luatexdir/image/writepng.w b/Build/source/texk/web2c/luatexdir/image/writepng.w
index 56c853b26bd..5e2f34e1570 100644
--- a/Build/source/texk/web2c/luatexdir/image/writepng.w
+++ b/Build/source/texk/web2c/luatexdir/image/writepng.w
@@ -20,7 +20,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writepng.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: writepng.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/writepng.w $";
#include "ptexlib.h"
@@ -578,9 +578,6 @@ void write_png(PDF pdf, image_dict * idict)
&& !png_get_valid(png_p, info_p, PNG_INFO_hIST)
&& !png_get_valid(png_p, info_p, PNG_INFO_tRNS)
&& !png_get_valid(png_p, info_p, PNG_INFO_sPLT)) {
- /* PNG copy */
- if (tracefilenames)
- tex_printf(" (PNG copy)");
copy_png(pdf, idict);
} else {
if (0) {
diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
index 54a7b7602ff..160fbe3bde6 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
@@ -21,13 +21,14 @@
#include "lua/luatex-api.h"
static const char _svn_version[] =
- "$Id: lcallbacklib.c 4877 2014-03-14 01:26:05Z luigi $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lcallbacklib.c $";
+ "$Id: lcallbacklib.c 4956 2014-03-28 12:12:17Z luigi $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lcallbacklib.c $";
int callback_count = 0;
int saved_callback_count = 0;
int callback_set[total_callbacks] = { 0 };
+/* See also callback_callback_type in luatexcallbackids.h: they must have the same order ! */
static const char *const callbacknames[] = {
"", /* empty on purpose */
"find_write_file",
@@ -66,7 +67,8 @@ static const char *const callbacknames[] = {
"mlist_to_hlist",
"finish_pdffile",
"finish_pdfpage",
- "pre_dump",
+ "pre_dump","start_file", "stop_file",
+ "show_error_message","show_lua_error_hook",
NULL
};
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index ba623572641..4f98dc19526 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -96,7 +96,7 @@
*/
static const char _svn_version[] =
- "$Id: lnodelib.c 4847 2014-03-05 18:13:17Z luigi $ "
+ "$Id: lnodelib.c 4956 2014-03-28 12:12:17Z luigi $ "
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lnodelib.c $";
#include "ptexlib.h"
@@ -1467,10 +1467,10 @@ static int lua_nodelib_hpack(lua_State * L)
if (lua_gettop(L) > 2) {
if (lua_type(L, 3) == LUA_TSTRING) {
s = lua_tostring(L, 3);
- if (lua_key_eq(s, additional)) {
- m = 1;
- } else if (lua_key_eq(s, exactly)) {
+ if (lua_key_eq(s, exactly)) {
m = 0;
+ } else if (lua_key_eq(s, additional)) {
+ m = 1;
} else if (lua_key_eq(s, cal_expand_ratio)) {
m = 2;
} else if (lua_key_eq(s, subst_ex_font)) {
@@ -1732,7 +1732,8 @@ static int lua_nodelib_mlist_to_hlist(lua_State * L)
int w;
boolean m;
n = *(check_isnode(L, 1));
- w = luaL_checkoption(L, 2, "text", math_style_names);
+ //w = luaL_checkoption(L, 2, "text", math_style_names);
+ assign_math_style(L,2,w);
luaL_checkany(L, 3);
m = lua_toboolean(L, 3);
mlist_to_hlist_args(n, w, m);
@@ -1877,22 +1878,26 @@ static int lua_nodelib_fields(lua_State * L)
}
lua_checkstack(L, 2);
lua_newtable(L);
- lua_pushstring(L, "next"); /* next, id, subtype, prev could be predefined string */
+ // lua_pushstring(L, "next");
+ lua_push_string_by_name(L,next);
lua_rawseti(L, -2, 0);
- lua_pushstring(L, "id");
+ // lua_pushstring(L, "id");
+ lua_push_string_by_name(L,id);
lua_rawseti(L, -2, 1);
if (nodetype_has_subtype(t)) {
- lua_pushstring(L, "subtype");
- lua_rawseti(L, -2, 2);
- offset++;
+ // lua_pushstring(L, "subtype");
+ lua_push_string_by_name(L,subtype);
+ lua_rawseti(L, -2, 2);
+ offset++;
}
if (fields != NULL) {
if (nodetype_has_prev(t)) {
- lua_pushstring(L, "prev");
- lua_rawseti(L, -2, -1);
+// lua_pushstring(L, "prev");
+ lua_push_string_by_name(L,prev);
+ lua_rawseti(L, -2, -1);
}
for (i = 0; fields[i] != NULL; i++) {
- lua_pushstring(L, fields[i]);
+ lua_pushstring(L, fields[i]); /* todo */
lua_rawseti(L, -2, (i + offset));
}
}
@@ -2386,14 +2391,14 @@ static int lua_nodelib_direct_count(lua_State * L)
/* directions (could be a macro) */
-static void nodelib_pushdir(lua_State * L, int n, boolean dirnode)
-{
- if (dirnode) {
- lua_pushstring(L, dir_strings[n+64]);
- } else {
- lua_pushstring(L, dir_strings[n+64]+1);
- }
-}
+// static void nodelib_pushdir(lua_State * L, int n, boolean dirnode)
+// {
+// if (dirnode) {
+// lua_pushstring(L, dir_strings[n+64]);
+// } else {
+// lua_pushstring(L, dir_strings[n+64]+1);
+// }
+// }
/* getting and setting fields (helpers) */
@@ -2412,8 +2417,8 @@ int nodelib_getdir(lua_State * L, int n, int absolute_only)
{
if (lua_type(L, n) == LUA_TSTRING) {
const char *s = lua_tostring(L, n);
- RETURN_DIR_VALUES(TRT);
RETURN_DIR_VALUES(TLT);
+ RETURN_DIR_VALUES(TRT);
RETURN_DIR_VALUES(LTL);
RETURN_DIR_VALUES(RTT);
luaL_error(L, "Bad direction specifier %s", s);
@@ -2458,7 +2463,8 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
if (t == dir_node) {
if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, dir_dir(n), true);
+ // nodelib_pushdir(L, dir_dir(n), true);
+ lua_push_dir_text(L, dir_dir(n));
} else if (lua_key_eq(s, level)) {
lua_pushnumber(L, dir_level(n));
} else if (lua_key_eq(s, dvi_ptr)) {
@@ -2481,6 +2487,13 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
case 'd':
lua_pushnumber(L, user_node_value(n));
break;
+ case 'l':
+ if (user_node_value(n) != 0) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, user_node_value(n));
+ } else {
+ lua_pushnil(L);
+ }
+ break;
case 'n':
nodelib_pushlist(L, user_node_value(n));
break;
@@ -2503,7 +2516,8 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
} else if (lua_key_eq(s, pen_broken)) {
lua_pushnumber(L, local_pen_broken(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, local_par_dir(n), false);
+// nodelib_pushdir(L, local_par_dir(n), false);
+ lua_push_dir_par(L, local_par_dir(n));
} else if (lua_key_eq(s, box_left)) {
/* can be: fast_metatable_or_nil(local_box_left(n)) */
nodelib_pushlist(L, local_box_left(n));
@@ -2522,7 +2536,7 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
lua_pushnumber(L, pdf_literal_mode(n));
} else if (lua_key_eq(s, data)) {
if (pdf_literal_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, pdf_literal_data(n));
} else {
tokenlist_to_luastring(L, pdf_literal_data(n));
}
@@ -2530,14 +2544,14 @@ static void lua_nodelib_getfield_whatsit(lua_State * L, int n, const char *s)
lua_pushnil(L);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, name)) {
- tokenlist_to_luastring(L, late_lua_name(n));
- } else if (lua_key_eq(s, data) || lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string) || lua_key_eq(s, data)) {
if (late_lua_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, late_lua_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, late_lua_data(n));
} else {
tokenlist_to_luastring(L, late_lua_data(n));
}
+ } else if (lua_key_eq(s, name)) {
+ tokenlist_to_luastring(L, late_lua_name(n));
} else {
lua_pushnil(L);
}
@@ -2742,7 +2756,11 @@ static int lua_nodelib_fast_getfield(lua_State * L)
p = vlink(p);
while (p != null) {
if (attribute_id(p) == i) {
- lua_pushnumber(L, (int) attribute_value(p));
+ if ((int) attribute_value(p) > UNUSED_ATTRIBUTE) {
+ lua_pushnumber(L, (int) attribute_value(p));
+ } else {
+ lua_pushnil(L);
+ }
return 1;
} else if (attribute_id(p) > i) {
lua_pushnil(L);
@@ -2814,7 +2832,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shift)) {
lua_pushnumber(L, shift_amount(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -2897,7 +2916,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, rule_dir(n), false);
+ // nodelib_pushdir(L, rule_dir(n), false);
+ lua_push_dir_par(L, rule_dir(n));
} else {
lua_pushnil(L);
}
@@ -2984,7 +3004,7 @@ static int lua_nodelib_fast_getfield(lua_State * L)
if (lua_key_eq(s, subtype)) {
lua_pushnumber(L, subtype(n));
} else if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ lua_push_math_style_name(L,subtype(n));
} else {
lua_pushnil(L);
}
@@ -3150,7 +3170,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shrink)) {
lua_pushnumber(L, glue_shrink(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -3208,7 +3229,8 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
if (t == dir_node) {
if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, dir_dir(n), true);
+ // nodelib_pushdir(L, dir_dir(n), true);
+ lua_push_dir_text(L, dir_dir(n));
} else if (lua_key_eq(s, level)) {
lua_pushnumber(L, dir_level(n));
} else if (lua_key_eq(s, dvi_ptr)) {
@@ -3231,6 +3253,13 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
case 'd':
lua_pushnumber(L, user_node_value(n));
break;
+ case 'l':
+ if (user_node_value(n) != 0) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, user_node_value(n));
+ } else {
+ lua_pushnil(L);
+ }
+ break;
case 'n':
nodelib_pushdirect(user_node_value(n));
break;
@@ -3253,7 +3282,8 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
} else if (lua_key_eq(s, pen_broken)) {
lua_pushnumber(L, local_pen_broken(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, local_par_dir(n), false);
+// nodelib_pushdir(L, local_par_dir(n), false);
+ lua_push_dir_par(L, local_par_dir(n));
} else if (lua_key_eq(s, box_left)) {
nodelib_pushdirect_or_nil(local_box_left(n));
} else if (lua_key_eq(s, box_left_width)) {
@@ -3270,7 +3300,7 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
lua_pushnumber(L, pdf_literal_mode(n));
} else if (lua_key_eq(s, data)) {
if (pdf_literal_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, pdf_literal_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, pdf_literal_data(n));
} else {
tokenlist_to_luastring(L, pdf_literal_data(n));
}
@@ -3278,14 +3308,14 @@ static void lua_nodelib_direct_getfield_whatsit(lua_State * L, int n, const char
lua_pushnil(L);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, name)) {
- tokenlist_to_luastring(L, late_lua_name(n));
- } else if (lua_key_eq(s, data) || lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string) || lua_key_eq(s, data)) {
if (late_lua_type(n) == lua_refid_literal) {
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, late_lua_data(n));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, late_lua_data(n));
} else {
tokenlist_to_luastring(L, late_lua_data(n));
}
+ } else if (lua_key_eq(s, name)) {
+ tokenlist_to_luastring(L, late_lua_name(n));
} else {
lua_pushnil(L);
}
@@ -3477,7 +3507,11 @@ static int lua_nodelib_direct_getfield(lua_State * L)
p = vlink(p);
while (p != null) {
if (attribute_id(p) == i) {
- lua_pushnumber(L, (int) attribute_value(p));
+ if ((int) attribute_value(p) > UNUSED_ATTRIBUTE) {
+ lua_pushnumber(L, (int) attribute_value(p));
+ } else {
+ lua_pushnil(L);
+ }
return 1;
} else if (attribute_id(p) > i) {
lua_pushnil(L) ;
@@ -3550,7 +3584,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shift)) {
lua_pushnumber(L, shift_amount(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -3621,7 +3656,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, rule_dir(n), false);
+ // nodelib_pushdir(L, rule_dir(n), false);
+ lua_push_dir_par(L, rule_dir(n));
} else {
lua_pushnil(L);
}
@@ -3689,7 +3725,7 @@ static int lua_nodelib_direct_getfield(lua_State * L)
}
} else if (t == style_node) {
if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ lua_push_math_style_name(L,subtype(n));
} else {
lua_pushnil(L);
}
@@ -3829,7 +3865,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
} else if (lua_key_eq(s, depth)) {
lua_pushnumber(L, depth(n));
} else if (lua_key_eq(s, dir)) {
- nodelib_pushdir(L, box_dir(n), false);
+ // nodelib_pushdir(L, box_dir(n), false);
+ lua_push_dir_par(L, box_dir(n));
} else if (lua_key_eq(s, shrink)) {
lua_pushnumber(L, glue_shrink(n));
} else if (lua_key_eq(s, glue_order)) {
@@ -4353,6 +4390,24 @@ static int lua_nodelib_direct_tonode(lua_State * L)
/* node.setfield */
+/* ls-hh: normally a value will not be reassigned */
+
+#define cleanup_late_lua(n) do { \
+ if (late_lua_data(n) != 0) { \
+ if (late_lua_type(n) == normal) { \
+ delete_token_ref(late_lua_data(n)); \
+ } else if (late_lua_type(n) == lua_refid_literal) { \
+ luaL_unref(L, LUA_REGISTRYINDEX,late_lua_data(n)); \
+ } \
+ } \
+} while (0)
+
+#define cleanup_late_lua_name(n) do { \
+ if (late_lua_name(n) != 0) { \
+ delete_token_ref(late_lua_name(n)); \
+ } \
+} while (0)
+
static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
{
int t ;
@@ -4385,12 +4440,8 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
return nodelib_cantset(L, n, s);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, data)) {
- late_lua_data(n) = nodelib_gettoks(L, 3);
- late_lua_type(n) = normal;
- } else if (lua_key_eq(s, name)) {
- late_lua_name(n) = nodelib_gettoks(L, 3);
- } else if (lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string)) {
+ cleanup_late_lua(n) ; /* ls-hh */
if (ini_version) {
late_lua_data(n) = nodelib_gettoks(L, 3);
late_lua_type(n) = normal;
@@ -4399,9 +4450,17 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
late_lua_data(n) = luaL_ref(L, LUA_REGISTRYINDEX);
late_lua_type(n) = lua_refid_literal;
}
+ } else if (lua_key_eq(s, data)) {
+ cleanup_late_lua(n) ; /* ls-hh */
+ late_lua_data(n) = nodelib_gettoks(L, 3);
+ late_lua_type(n) = normal;
+ } else if (lua_key_eq(s, name)) {
+ cleanup_late_lua_name(n) ; /* ls-hh */
+ late_lua_name(n) = nodelib_gettoks(L, 3);
} else {
return nodelib_cantset(L, n, s);
}
+ /* done */
} else if (t == user_defined_node) {
if (lua_key_eq(s, user_id)) {
user_node_id(n) = (halfword) lua_tointeger(L, 3);
@@ -4415,6 +4474,13 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s)
case 'd':
user_node_value(n) = (halfword) lua_tointeger(L, 3);
break;
+ case 'l':
+ lua_pushvalue(L, 3);
+ if (user_node_value(n) != 0) {
+ luaL_unref(L, LUA_REGISTRYINDEX,user_node_value(n));
+ }
+ user_node_value(n) = luaL_ref(L, LUA_REGISTRYINDEX);
+ break;
case 'n':
user_node_value(n) = nodelib_getlist(L, 3);
break;
@@ -4641,9 +4707,10 @@ static int lua_nodelib_fast_setfield(lua_State * L)
s = lua_tostring(L, 2);
- if (lua_key_eq(s, id)) {
- lua_pushnumber(L, t);
- } else if (lua_key_eq(s, next)) {
+ /*if (lua_key_eq(s, id)) {
+ type(n) = (quarteword) lua_tointeger(L, 3);
+ }* else */
+ if (lua_key_eq(s, next)) {
halfword x = nodelib_getlist(L, 3);
if (x>0 && type(x) == glue_spec_node) {
return luaL_error(L, "You can't assign a %s node to a next field\n", node_data[type(x)].name);
@@ -4749,7 +4816,7 @@ static int lua_nodelib_fast_setfield(lua_State * L)
} else if (lua_key_eq(s, stretch_order)) {
stretch_order(n) = (quarterword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, shrink_order)) {
- lua_pushnumber(L, shrink_order(n));
+ shrink_order(n) = (quarterword) lua_tointeger(L, 3);
/* } else if (lua_key_eq(s, ref_count)) {
glue_ref_count(n) = (halfword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, writable)) {
@@ -4872,10 +4939,10 @@ static int lua_nodelib_fast_setfield(lua_State * L)
if (lua_key_eq(s, subtype)) {
/* dummy subtype */
} else if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ assign_math_style(L,3,subtype(n));
+ //subtype(n) = (quarterword) luaL_checkoption(L, 3, "text", math_style_names); /* not 2? */
} else {
/* return nodelib_cantset(L, n, s); */
- subtype(n) = (quarterword) luaL_checkoption(L, 3, "text", math_style_names); /* not 2? */
}
} else if (t == accent_noad) {
if (lua_key_eq(s, subtype)) {
@@ -5120,12 +5187,8 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char
return nodelib_cantset(L, n, s);
}
} else if (t == late_lua_node) {
- if (lua_key_eq(s, data)) {
- late_lua_data(n) = nodelib_gettoks(L, 3);
- late_lua_type(n) = normal;
- } else if (lua_key_eq(s, name)) {
- late_lua_name(n) = nodelib_gettoks(L, 3);
- } else if (lua_key_eq(s, string)) {
+ if (lua_key_eq(s, string)) {
+ cleanup_late_lua(n) ; /* ls-hh */
if (ini_version) {
late_lua_data(n) = nodelib_gettoks(L, 3);
late_lua_type(n) = normal;
@@ -5134,6 +5197,13 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char
late_lua_data(n) = luaL_ref(L, LUA_REGISTRYINDEX);
late_lua_type(n) = lua_refid_literal;
}
+ } else if (lua_key_eq(s, data)) {
+ cleanup_late_lua(n) ; /* ls-hh */
+ late_lua_data(n) = nodelib_gettoks(L, 3);
+ late_lua_type(n) = normal;
+ } else if (lua_key_eq(s, name)) {
+ cleanup_late_lua_name(n) ; /* ls-hh */
+ late_lua_name(n) = nodelib_gettoks(L, 3);
} else {
return nodelib_cantset(L, n, s);
}
@@ -5150,6 +5220,13 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char
case 'd':
user_node_value(n) = (halfword) lua_tointeger(L, 3);
break;
+ case 'l':
+ lua_pushvalue(L, 3);
+ if (user_node_value(n) != 0) {
+ luaL_unref(L, LUA_REGISTRYINDEX,user_node_value(n));
+ }
+ user_node_value(n) = luaL_ref(L, LUA_REGISTRYINDEX);
+ break;
case 'n':
user_node_value(n) = nodelib_getlist(L, 3);
break;
@@ -5376,9 +5453,10 @@ static int lua_nodelib_direct_setfield(lua_State * L)
s = lua_tostring(L, 2);
- if (lua_key_eq(s, id)) {
- lua_pushnumber(L, t);
- } else if (lua_key_eq(s, next)) {
+ /*if (lua_key_eq(s, id)) {
+ type(n) = (quarteword) lua_tointeger(L, 3);
+ } else*/
+ if (lua_key_eq(s, next)) {
halfword x = nodelib_popdirect(3);
if (x>0 && type(x) == glue_spec_node) {
return luaL_error(L, "You can't assign a %s node to a next field\n", node_data[type(x)].name);
@@ -5484,7 +5562,7 @@ static int lua_nodelib_direct_setfield(lua_State * L)
} else if (lua_key_eq(s, stretch_order)) {
stretch_order(n) = (quarterword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, shrink_order)) {
- lua_pushnumber(L, shrink_order(n));
+ shrink_order(n) = (quarterword) lua_tointeger(L, 3);
/* } else if (lua_key_eq(s, ref_count)) {
glue_ref_count(n) = (halfword) lua_tointeger(L, 3);
} else if (lua_key_eq(s, writable)) {
@@ -5606,10 +5684,10 @@ static int lua_nodelib_direct_setfield(lua_State * L)
if (lua_key_eq(s, subtype)) {
/* dummy subtype */
} else if (lua_key_eq(s, style)) {
- lua_pushstring(L, math_style_names[subtype(n)]);
+ assign_math_style(L,2,subtype(n));
+ //subtype(n) = (quarterword) luaL_checkoption(L, 2, "text", math_style_names); /* was 3 */
} else {
/* return nodelib_cantset(L, n, s); */
- subtype(n) = (quarterword) luaL_checkoption(L, 2, "text", math_style_names); /* was 3 */
}
} else if (t == accent_noad) {
if (lua_key_eq(s, subtype)) {
@@ -6024,7 +6102,7 @@ static int lua_nodelib_attributes_to_properties(lua_State * L)
}
}
}
- lua_rawset(Luas,-3);
+ lua_rawset(L,-3);
n = vlink(n);
}
return 1 ;
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
index 00cffd398d7..a93f75a2aa0 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -18,14 +18,12 @@
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
static const char _svn_version[] =
- "$Id: lpdflib.c 4877 2014-03-14 01:26:05Z luigi $ "
+ "$Id: lpdflib.c 4956 2014-03-28 12:12:17Z luigi $ "
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lpdflib.c $";
#include "ptexlib.h"
#include "lua/luatex-api.h"
-#define PDF_ENV "pdf.env"
-
static int luapdfprint(lua_State * L)
{
int n;
@@ -185,47 +183,10 @@ static int l_immediateobj(lua_State * L)
return 1;
}
-/**********************************************************************/
-/* for lookup within table in LUA_REGISTRYINDEX (instead of repeated strcmp()) */
-
-typedef enum { P__ZERO,
- P_CATALOG,
- P_H,
- P_INFO,
- P_NAMES,
- P_PDFCATALOG,
- P_PDFINFO,
- P_PDFNAMES,
- P_PDFTRAILER,
- P_RAW,
- P_STREAM,
- P_TRAILER,
- P_V,
- P__SENTINEL
-} parm_idx;
-
-static const parm_struct pdf_parms[] = {
- {NULL, P__ZERO}, /* dummy; lua indices run from 1 */
- {"catalog", P_CATALOG},
- {"h", P_H},
- {"info", P_INFO},
- {"names", P_NAMES},
- {"pdfcatalog", P_PDFCATALOG}, /* obsolescent */
- {"pdfinfo", P_PDFINFO}, /* obsolescent */
- {"pdfnames", P_PDFNAMES}, /* obsolescent */
- {"pdftrailer", P_PDFTRAILER}, /* obsolescent */
- {"raw", P_RAW},
- {"stream", P_STREAM},
- {"trailer", P_TRAILER},
- {"v", P_V},
- {NULL, P__SENTINEL}
-};
-
-/**********************************************************************/
-
static int table_obj(lua_State * L)
{
- int k, type, obj_compression;
+ const char *type;
+ int k, obj_compression;
int compress_level = -1; /* unset */
int os_threshold = OBJSTM_ALWAYS; /* default: put non-stream objects into object streams */
int saved_compress_level = static_pdf->compress_level;
@@ -238,33 +199,20 @@ static int table_obj(lua_State * L)
/* get object "type" */
- /* lua_pushstring(L, "type"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* vs? t *\/ */
lua_key_rawgeti(type);
if (lua_isnil(L, -1)) /* !vs t */
luaL_error(L, "pdf.obj(): object \"type\" missing");
if (!lua_isstring(L, -1)) /* !vs t */
luaL_error(L, "pdf.obj(): object \"type\" must be string");
- lua_pushstring(L, PDF_ENV); /* s vs t */
- lua_gettable(L, LUA_REGISTRYINDEX); /* t vs t */
- lua_pushvalue(L, -2); /* vs t vs t */
- lua_gettable(L, -2); /* i? t vs t */
- if (!lua_isnumber(L, -1)) /* !i t vs t */
- luaL_error(L, "pdf.obj(): \"%s\" is not a valid object type", lua_tostring(L, -3));
- type = (int) lua_tointeger(L, -1); /* i t vs t */
- switch (type) {
- case P_RAW:
- case P_STREAM:
- break;
- default:
- luaL_error(L, "pdf.obj(): \"%s\" is not a valid object type", lua_tostring(L, -3)); /* i vs t */
+ type = lua_tostring(L, -1);
+
+ if (! (lua_key_eq(type, raw) || lua_key_eq(type, stream))) {
+ luaL_error(L, "pdf.obj(): \"%s\" is not a valid object type", type); /* i vs t */
}
- lua_pop(L, 3); /* t */
+ lua_pop(L, 1); /* t */
/* get optional "immediate" */
- /* lua_pushstring(L, "immediate"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* b? t *\/ */
lua_key_rawgeti(immediate);
if (!lua_isnil(L, -1)) { /* b? t */
if (!lua_isboolean(L, -1)) /* !b t */
@@ -275,8 +223,6 @@ static int table_obj(lua_State * L)
/* is a reserved object referenced by "objnum"? */
- /* lua_pushstring(L, "objnum"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* vi? t *\/ */
lua_key_rawgeti(objnum);
if (!lua_isnil(L, -1)) { /* vi? t */
if (!lua_isnumber(L, -1)) /* !vi t */
@@ -298,11 +244,9 @@ static int table_obj(lua_State * L)
/* get optional "attr" (allowed only for stream case) */
- /* lua_pushstring(L, "attr"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* attr-s? t *\/ */
lua_key_rawgeti(attr);
if (!lua_isnil(L, -1)) { /* attr-s? t */
- if (type != P_STREAM)
+ if (! lua_key_eq(type, stream))
luaL_error(L, "pdf.obj(): \"attr\" key not allowed for non-stream object");
if (!lua_isstring(L, -1)) /* !attr-s t */
luaL_error(L, "pdf.obj(): object \"attr\" must be string");
@@ -311,16 +255,15 @@ static int table_obj(lua_State * L)
lua_pop(L, 1); /* t */
} else
obj_obj_stream_attr(static_pdf, k) = luaL_ref(Luas, LUA_REGISTRYINDEX); /* t */
- } else
+ } else {
lua_pop(L, 1); /* t */
+ }
/* get optional "compresslevel" (allowed only for stream case) */
- /* lua_pushstring(L, "compresslevel"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* vi? t *\/ */
lua_key_rawgeti(compresslevel);
if (!lua_isnil(L, -1)) { /* vi? t */
- if (type == P_RAW)
+ if (lua_key_eq(type, raw))
luaL_error(L, "pdf.obj(): \"compresslevel\" key not allowed for raw object");
if (!lua_isnumber(L, -1)) /* !vi t */
luaL_error(L, "pdf.obj(): \"compresslevel\" must be integer");
@@ -336,11 +279,9 @@ static int table_obj(lua_State * L)
/* get optional "objcompression" (allowed only for non-stream case) */
- /* lua_pushstring(L, "objcompression"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* b? t *\/ */
lua_key_rawgeti(objcompression);
if (!lua_isnil(L, -1)) { /* b? t */
- if (type == P_STREAM)
+ if (lua_key_eq(type, stream))
luaL_error(L, "pdf.obj(): \"objcompression\" key not allowed for stream object");
if (!lua_isboolean(L, -1)) /* !b t */
luaL_error(L, "pdf.obj(): \"objcompression\" must be boolean");
@@ -357,21 +298,15 @@ static int table_obj(lua_State * L)
/* now the object contents for all cases are handled */
- /* lua_pushstring(L, "string"); /\* ks t *\/ */
- /* lua_gettable(L, -2); /\* string-s? t *\/ */
lua_key_rawgeti(string);
- /* lua_pushstring(L, "file"); /\* ks string-s? t *\/ */
- /* lua_gettable(L, -3); /\* file-s? string-s? t *\/ */
- lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(file));
- lua_gettable(L, -3);
+ lua_key_rawgeti_n(file,-2);
if (!lua_isnil(L, -1) && !lua_isnil(L, -2)) /* file-s? string-s? t */
luaL_error(L, "pdf.obj(): \"string\" and \"file\" must not be given together");
if (lua_isnil(L, -1) && lua_isnil(L, -2)) /* nil nil t */
luaL_error(L, "pdf.obj(): no \"string\" or \"file\" given");
- switch (type) {
- case P_RAW:
+ if (lua_key_eq(type, raw)) {
if (immediate == 1)
pdf_begin_obj(static_pdf, k, os_threshold);
if (!lua_isnil(L, -2)) { /* file-s? string-s? t */
@@ -408,8 +343,7 @@ static int table_obj(lua_State * L)
}
if (immediate == 1)
pdf_end_obj(static_pdf);
- break;
- case P_STREAM:
+ } else {
if (immediate == 1) {
pdf_begin_obj(static_pdf, k, OBJSTM_NEVER); /* 0 = not an object stream candidate! */
pdf_begin_dict(static_pdf);
@@ -456,9 +390,6 @@ static int table_obj(lua_State * L)
pdf_end_stream(static_pdf);
pdf_end_obj(static_pdf);
}
- break;
- default:
- assert(0);
}
static_pdf->compress_level = saved_compress_level;
return k;
@@ -511,7 +442,7 @@ static int orig_obj(lua_State * L)
}
if (lua_key_eq(st_s, stream)) {
set_obj_obj_is_stream(static_pdf, k);
- } else if (lua_key_eq(st_s, streamfile)) {
+ } else if (lua_key_eq(st_s, streamfile)) {
set_obj_obj_is_stream(static_pdf, k);
set_obj_obj_is_file(static_pdf, k);
} else
@@ -566,7 +497,7 @@ static int l_reserveobj(lua_State * L)
case 1:
if (!lua_isstring(L, -1))
luaL_error(L, "pdf.reserveobj() optional argument must be string");
- if (lua_key_eq(st_s, annot)) {
+ if (lua_key_eq(st_s, annot)) {
pdf_last_annot = pdf_create_obj(static_pdf, obj_type_annot, 0);
} else {
luaL_error(L, "pdf.reserveobj() optional string must be \"annot\"");
@@ -599,102 +530,135 @@ static int l_registerannot(lua_State * L)
return 0;
}
+static int l_get_pdf_value(lua_State * L, int key)
+{
+ lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [table] */
+ lua_rawgeti(L, LUA_REGISTRYINDEX, key);
+ /* [table] [key] */
+ lua_rawget(L,-2);
+ return 1;
+}
+static int l_get_pageresources(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(pageresources));
+}
+static int l_get_pageattributes(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(pageattributes));
+}
+static int l_get_pagesattributes(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(pagesattributes));
+}
+static int l_get_catalog(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(catalog));
+}
+static int l_get_info(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(info));
+}
+static int l_get_names(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(names));
+}
+
+
+static int l_get_trailer(lua_State * L) {
+ return l_get_pdf_value(L,lua_key_index(trailer));
+}
+
+
static int getpdf(lua_State * L)
{
- char *s;
- int i, l;
- if (lua_isstring(L, 2) && (lua_tostring(L, 2) != NULL)) {
- lua_pushstring(L, PDF_ENV); /* s ... */
- lua_gettable(L, LUA_REGISTRYINDEX); /* t ... */
- lua_pushvalue(L, 2); /* st t ... */
- lua_gettable(L, -2); /* i? t ... */
- if (lua_isnumber(L, -1)) { /* i t ... */
- i = (int) lua_tointeger(L, -1); /* i t ... */
- lua_pop(L, 2); /* ... */
- switch (i) {
- case P_PDFCATALOG:
- case P_CATALOG:
- s = tokenlist_to_cstring(pdf_catalog_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_PDFINFO:
- case P_INFO:
- s = tokenlist_to_cstring(pdf_info_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_PDFNAMES:
- case P_NAMES:
- s = tokenlist_to_cstring(pdf_names_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_PDFTRAILER:
- case P_TRAILER:
- s = tokenlist_to_cstring(pdf_trailer_toks, true, &l);
- lua_pushlstring(L, s, (size_t) l);
- break;
- case P_H:
- lua_pushnumber(L, static_pdf->posstruct->pos.h);
- break;
- case P_V:
- lua_pushnumber(L, static_pdf->posstruct->pos.v);
- break;
- default:
- lua_rawget(L, -2);
- }
- } else {
- lua_pop(L, 2); /* ... */
- lua_rawget(L, -2);
+ /* [pdf table] [key] */
+ const char *s ;
+ if (lua_gettop(L) != 2) {
+ return 0;
+ }
+ if (lua_isstring(L, -1)) {
+ s = lua_tostring(L, -1);
+ if (lua_key_eq(s,h)) {
+ lua_pushnumber(L, static_pdf->posstruct->pos.h);
+ } else if (lua_key_eq(s,v)) {
+ lua_pushnumber(L, static_pdf->posstruct->pos.v);
+ } else if (
+ lua_key_eq(s,catalog) || lua_key_eq(s,info) || lua_key_eq(s,trailer) || lua_key_eq(s,names) ||
+ lua_key_eq(s,pageattributes) || lua_key_eq(s,pagesattributes) || lua_key_eq(s,pageresources)
+ ) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [pdf table] [key] [pdf.data table] */
+ lua_replace(L, -3);
+ /* [pdf.data table] [key] */
}
- } else {
- lua_pushnil(L);
}
- return 1;
+ lua_rawget(L, -2);
+ return 0;
}
+
+
+
+static int l_set_pdf_value(lua_State * L, int key)
+{
+ if (lua_isstring(L, -1)) {
+ /* [value] */
+ lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [value] [table] */
+ lua_rawgeti(L, LUA_REGISTRYINDEX, key);
+ /* [value] [table] [key] */
+ lua_pushvalue(L, -3);
+ /* [table] [key] [value] */
+ lua_rawset(L,-3);
+ }
+ return 0;
+}
+static int l_set_pageresources(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(pageresources));
+}
+static int l_set_pageattributes(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(pageattributes));
+}
+static int l_set_pagesattributes(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(pagesattributes));
+}
+static int l_set_catalog(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(catalog));
+}
+static int l_set_info(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(info));
+}
+static int l_set_names(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(names));
+}
+static int l_set_trailer(lua_State * L) {
+ return l_set_pdf_value(L,lua_key_index(trailer));
+}
+
+
static int setpdf(lua_State * L)
{
- int i;
+ /* [pdf table] [key] [value] */
+ const char *s ;
if (lua_gettop(L) != 3) {
return 0;
}
- (void) luaL_checkstring(L, 2); /* ... */
- lua_pushstring(L, PDF_ENV); /* s ... */
- lua_gettable(L, LUA_REGISTRYINDEX); /* t ... */
- lua_pushvalue(L, 2); /* st t ... */
- lua_gettable(L, -2); /* i? t ... */
- if (lua_isnumber(L, -1)) { /* i t ... */
- i = (int) lua_tointeger(L, -1); /* i t ... */
- lua_pop(L, 2); /* ... */
- switch (i) {
- case P_PDFCATALOG:
- case P_CATALOG:
- pdf_catalog_toks = tokenlist_from_lua(L);
- break;
- case P_PDFINFO:
- case P_INFO:
- pdf_info_toks = tokenlist_from_lua(L);
- break;
- case P_PDFNAMES:
- case P_NAMES:
- pdf_names_toks = tokenlist_from_lua(L);
- break;
- case P_PDFTRAILER:
- case P_TRAILER:
- pdf_trailer_toks = tokenlist_from_lua(L);
- break;
- case P_H:
- case P_V:
- /* can't set |h| and |v| yet */
- default:
- lua_rawset(L, -3);
+ if (lua_isstring(L, -2)) {
+ s = lua_tostring(L, -1);
+ if (
+ lua_key_eq(s,catalog) || lua_key_eq(s,info) || lua_key_eq(s,trailer) || lua_key_eq(s,names) ||
+ lua_key_eq(s,pageattributes) || lua_key_eq(s,pagesattributes) || lua_key_eq(s,pageresources)
+ ) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(pdf_data));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ /* [pdf table] [key] [value] [pdf.data table] */
+ lua_replace(L, -4);
+ /* [pdf.data table] [key] [value] */
}
- } else {
- lua_pop(L, 2); /* ... */
- lua_rawset(L, -3);
}
+ lua_rawset(L, -3);
return 0;
}
+
static int l_objtype(lua_State * L)
{
int n = lua_gettop(L);
@@ -741,18 +705,6 @@ static int l_mapline(lua_State * L)
return 0;
}
-static int l_pdfmapfile(lua_State * L)
-{
- luaL_error(L, "pdf.pdfmapfile() is obsolete. Use pdf.mapfile() instead.");
- return 0;
-}
-
-static int l_pdfmapline(lua_State * L)
-{
- luaL_error(L, "pdf.pdfmapline() is obsolete. Use pdf.mapline() instead.");
- return 0;
-}
-
static int l_pageref(lua_State * L)
{
int n = lua_gettop(L);
@@ -821,8 +773,6 @@ static const struct luaL_Reg pdflib[] = {
{"obj", l_obj},
{"objtype", l_objtype},
{"pageref", l_pageref},
- {"pdfmapfile", l_pdfmapfile}, /* obsolete */
- {"pdfmapline", l_pdfmapline}, /* obsolete */
{"print", luapdfprint},
{"refobj", l_refobj},
{"registerannot", l_registerannot},
@@ -832,6 +782,20 @@ static const struct luaL_Reg pdflib[] = {
{"getvpos", l_getvpos},
{"getmatrix", l_getmatrix},
{"hasmatrix", l_hasmatrix},
+ {"setcatalog", l_set_catalog},
+ {"setinfo", l_set_info},
+ {"setnames", l_set_names},
+ {"settrailer", l_set_trailer},
+ {"setpageresources", l_set_pageresources},
+ {"setpageattributes", l_set_pageattributes},
+ {"setpagesattributes", l_set_pagesattributes},
+ {"getcatalog", l_get_catalog},
+ {"getinfo", l_get_info},
+ {"getnames", l_get_names},
+ {"gettrailer", l_get_trailer},
+ {"getpageresources", l_get_pageresources},
+ {"getpageattributes", l_get_pageattributes},
+ {"getpagesattributes", l_get_pagesattributes},
{NULL, NULL} /* sentinel */
};
@@ -839,7 +803,10 @@ static const struct luaL_Reg pdflib[] = {
int luaopen_pdf(lua_State * L)
{
- preset_environment(L, pdf_parms, PDF_ENV);
+ lua_pushstring(L,"pdf.data");
+ lua_newtable(L);
+ lua_settable(L,LUA_REGISTRYINDEX);
+ /* */
luaL_register(L, "pdf", pdflib);
/* build meta table */
luaL_newmetatable(L, "pdf.meta");
diff --git a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
index 6c2413137c7..eae0bcb98f4 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
@@ -18,7 +18,7 @@
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
static const char _svn_version[] =
- "$Id: lstatslib.c 4857 2014-03-07 00:01:41Z luigi $ "
+ "$Id: lstatslib.c 4956 2014-03-28 12:12:17Z luigi $ "
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/lstatslib.c $";
#include "ptexlib.h"
@@ -34,6 +34,8 @@ typedef const char *(*charfunc) (void);
typedef lua_Number(*numfunc) (void);
typedef int (*intfunc) (void);
+const char *last_lua_error;
+
static const char *getbanner(void)
{
return (const char *) ptexbanner;
@@ -73,6 +75,13 @@ static const char *getlasterror(void)
return last_error;
}
+static const char *getlastluaerror(void)
+{
+ return last_lua_error;
+}
+
+
+
static const char *luatexrevision(void)
{
return (const char *) (strrchr(luatex_version_string, '.') + 1);
@@ -245,6 +254,7 @@ static struct statistic stats[] = {
{"inputid", 'g', &(iname)},
{"linenumber", 'g', &line},
{"lasterrorstring", 'S', (void *) &getlasterror},
+ {"lastluaerrorstring", 'S', (void *) &getlastluaerror},
{"luabytecodes", 'g', &luabytecode_max},
{"luabytecode_bytes", 'g', &luabytecode_bytes},
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
index 905b1694164..48c9e6f17ac 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
@@ -27,7 +27,7 @@ setter no prev link is created so we can presume that it's not used later on. */
static const char _svn_version[] =
- "$Id: ltexlib.c 4878 2014-03-14 10:48:03Z taco $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/ltexlib.c $";
+ "$Id: ltexlib.c 4956 2014-03-28 12:12:17Z luigi $ $URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/ltexlib.c $";
#define attribute(A) eqtb[attribute_base+(A)].hh.rh
#define dimen(A) eqtb[scaled_base+(A)].hh.rh
@@ -2520,7 +2520,12 @@ static int tex_run_end(lua_State * L)
return 0;
}
-
+static int tex_show_context(lua_State * L)
+{
+ (void) L;
+ show_context();
+ return 0;
+}
void init_tex_table(lua_State * L)
{
@@ -2604,6 +2609,7 @@ static const struct luaL_Reg texlib[] = {
{"normal_rand", tex_norm_rand},
{"lua_math_randomseed", tex_init_rand}, /* syntactic sugar */
{"lua_math_random", lua_math_random},
+ {"show_context", tex_show_context},
{NULL, NULL} /* sentinel */
};
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.w b/Build/source/texk/web2c/luatexdir/lua/luainit.w
index 66312164133..c95ecb43867 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: luainit.w 4881 2014-03-14 12:51:16Z taco $"
+ "$Id: luainit.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/luainit.w $";
#include "ptexlib.h"
@@ -29,251 +29,8 @@ static const char _svn_version[] =
#include "lua/luatex-api.h"
/* internalized strings: see luatex-api.h */
-make_lua_key(LTL);
-make_lua_key(MathConstants);
-make_lua_key(RTT);
-make_lua_key(TLT);
-make_lua_key(TRT);
-make_lua_key(accent);
-make_lua_key(action);
-make_lua_key(action_id);
-make_lua_key(action_type);
-make_lua_key(additional);
-make_lua_key(adjust_head);
-make_lua_key(advance);
-make_lua_key(aleph);
-make_lua_key(align_head);
-make_lua_key(area);
-make_lua_key(attr);
-make_lua_key(attributes);
-make_lua_key(auto_expand);
-make_lua_key(best_ins_ptr);
-make_lua_key(best_page_break);
-make_lua_key(best_size);
-make_lua_key(bot);
-make_lua_key(bot_accent);
-make_lua_key(bottom_left);
-make_lua_key(bottom_right);
-make_lua_key(box_left);
-make_lua_key(box_left_width);
-make_lua_key(box_right);
-make_lua_key(box_right_width);
-make_lua_key(broken_ins);
-make_lua_key(broken_ptr);
-make_lua_key(cache);
-make_lua_key(cal_expand_ratio);
-make_lua_key(char);
-make_lua_key(characters);
-make_lua_key(checksum);
-make_lua_key(cidinfo);
-make_lua_key(class);
-make_lua_key(command);
-make_lua_key(commands);
-make_lua_key(comment);
-make_lua_key(components);
-make_lua_key(contrib_head);
-make_lua_key(core);
-make_lua_key(cost);
-make_lua_key(count);
-make_lua_key(data);
-make_lua_key(degree);
-make_lua_key(delim);
-make_lua_key(delimptr);
-make_lua_key(denom);
-make_lua_key(depth);
-make_lua_key(designsize);
-make_lua_key(dest_id);
-make_lua_key(dest_type);
-make_lua_key(dir);
-make_lua_key(dir_h);
-make_lua_key(direction);
-make_lua_key(dirs);
-make_lua_key(display);
-make_lua_key(down);
-make_lua_key(dvi_ptr);
-make_lua_key(embedding);
-make_lua_key(encodingbytes);
-make_lua_key(encodingname);
-make_lua_key(end);
-make_lua_key(etex);
-make_lua_key(exactly);
-make_lua_key(expansion_factor);
-make_lua_key(ext);
-make_lua_key(extend);
-make_lua_key(extender);
-make_lua_key(extensible);
-make_lua_key(extra_space);
-make_lua_key(fam);
-make_lua_key(fast);
-make_lua_key(file);
-make_lua_key(filename);
-make_lua_key(font);
-make_lua_key(fonts);
-make_lua_key(format);
-make_lua_key(fullname);
-make_lua_key(global);
-make_lua_key(glue_order);
-make_lua_key(glue_set);
-make_lua_key(glue_sign);
-make_lua_key(glyph);
-make_lua_key(head);
-make_lua_key(height);
-make_lua_key(hold_head);
-make_lua_key(horiz_variants);
-make_lua_key(hyphenchar);
-make_lua_key(id);
-make_lua_key(image);
-make_lua_key(index);
-make_lua_key(italic);
-make_lua_key(kern);
-make_lua_key(kerns);
-make_lua_key(lang);
-make_lua_key(large_char);
-make_lua_key(large_fam);
-make_lua_key(last_ins_ptr);
-make_lua_key(leader);
-make_lua_key(least_page_cost);
-make_lua_key(left);
-make_lua_key(left_boundary);
-make_lua_key(left_protruding);
-make_lua_key(level);
-make_lua_key(ligatures);
-make_lua_key(link_attr);
-make_lua_key(list);
-make_lua_key(log);
-make_lua_key(lua);
-make_lua_key(luatex);
-make_lua_key(luatex_node);
-make_lua_key(mLTL);
-make_lua_key(mRTT);
-make_lua_key(mTLT);
-make_lua_key(mTRT);
-make_lua_key(mark);
-make_lua_key(mathdir);
-make_lua_key(mathkern);
-make_lua_key(mathstyle);
-make_lua_key(mid);
-make_lua_key(mode);
-make_lua_key(modeline);
-make_lua_key(name);
-make_lua_key(named_id);
-make_lua_key(new_window);
-make_lua_key(next);
-make_lua_key(no);
-make_lua_key(noad);
-make_lua_key(node);
-make_lua_key(node_properties);
-make_lua_key(node_properties_indirect);
-make_lua_key(nomath);
-make_lua_key(nop);
-make_lua_key(nucleus);
-make_lua_key(num);
-make_lua_key(number);
-make_lua_key(objnum);
-make_lua_key(omega);
-make_lua_key(ordering);
-make_lua_key(pLTL);
-make_lua_key(pRTT);
-make_lua_key(pTLT);
-make_lua_key(pTRT);
-make_lua_key(page_head);
-make_lua_key(page_ins_head);
-make_lua_key(parameters);
-make_lua_key(pdftex);
-make_lua_key(pen_broken);
-make_lua_key(pen_inter);
-make_lua_key(penalty);
-make_lua_key(pop);
-make_lua_key(post);
-make_lua_key(pre);
-make_lua_key(pre_adjust_head);
-make_lua_key(prev);
-make_lua_key(prevdepth);
-make_lua_key(prevgraf);
-make_lua_key(psname);
-make_lua_key(ptr);
-make_lua_key(push);
-make_lua_key(quad);
-make_lua_key(ref_count);
-make_lua_key(reg);
-make_lua_key(registry);
-make_lua_key(renew);
-make_lua_key(rep);
-make_lua_key(replace);
-make_lua_key(right);
-make_lua_key(right_boundary);
-make_lua_key(right_protruding);
-make_lua_key(rule);
-make_lua_key(scale);
-make_lua_key(script);
-make_lua_key(scriptscript);
-make_lua_key(shift);
-make_lua_key(shrink);
-make_lua_key(shrink_order);
-make_lua_key(size);
-make_lua_key(skewchar);
-make_lua_key(slant);
-make_lua_key(slot);
-make_lua_key(small_char);
-make_lua_key(small_fam);
-make_lua_key(space);
-make_lua_key(space_shrink);
-make_lua_key(space_stretch);
-make_lua_key(spacefactor);
-make_lua_key(spec);
-make_lua_key(special);
-make_lua_key(stack);
-make_lua_key(start);
-make_lua_key(step);
-make_lua_key(stream);
-make_lua_key(stretch);
-make_lua_key(stretch_order);
-make_lua_key(string);
-make_lua_key(style);
-make_lua_key(sub);
-make_lua_key(subst_ex_font);
-make_lua_key(subtype);
-make_lua_key(sup);
-make_lua_key(supplement);
-make_lua_key(surround);
-make_lua_key(tail);
-make_lua_key(temp_head);
-make_lua_key(term);
-make_lua_key(term_and_log);
-make_lua_key(tex);
-make_lua_key(text);
-make_lua_key(thread_attr);
-make_lua_key(thread_id);
-make_lua_key(top);
-make_lua_key(top_accent);
-make_lua_key(top_left);
-make_lua_key(top_right);
-make_lua_key(tounicode);
-make_lua_key(transform);
-make_lua_key(type);
-make_lua_key(uchyph);
-make_lua_key(umath);
-make_lua_key(units_per_em);
-make_lua_key(used);
-make_lua_key(user_id);
-make_lua_key(value);
-make_lua_key(version);
-make_lua_key(vert_variants);
-make_lua_key(width);
-make_lua_key(writable);
-make_lua_key(x_height);
-make_lua_key(xoffset);
-make_lua_key(xyz_zoom);
-make_lua_key(yoffset);
-
-make_lua_key(immediate);
-make_lua_key(compresslevel);
-make_lua_key(objcompression);
-make_lua_key(direct);
-make_lua_key(page);
-make_lua_key(streamfile);
-make_lua_key(annot);
-make_lua_key(lua_functions);
+set_make_keys;
+
@
TH: TODO
@@ -284,7 +41,7 @@ Better to wait until Karl has some time (after texlive 2008) so we can
synchronize with kpathsea. One problem, for instance, is that I would
like to resolve the full executable path. |kpse_set_program_name()| does
that, indirectly (by setting SELFAUTOLOC in the environment), but it
-does much more, making it hard to use for our purpose.
+does much more, making it hard to use for our purpose.
In fact, it sets three C variables:
@@ -449,11 +206,11 @@ char *jithash_hashname = NULL;
int safer_option = 0;
int nosocket_option = 0;
-@ Reading the options.
+@ Reading the options.
@ Test whether getopt found an option ``A''.
Assumes the option index is in the variable |option_index|, and the
-option table in a variable |long_options|.
+option table in a variable |long_options|.
@c
#define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a)
@@ -550,7 +307,7 @@ static void parse_options(int ac, char **av)
if (g == -1) /* End of arguments, exit the loop. */
break;
if (g == '?') { /* Unknown option. */
- if (!luainit)
+ if (!luainit)
fprintf(stderr,"%s: unrecognized option '%s'\n", argv[0], argv[optind-1]);
continue;
}
@@ -571,15 +328,15 @@ static void parse_options(int ac, char **av)
} else if (ARGUMENT_IS("jithash")) {
size_t len = strlen(optarg);
if (len<16)
- jithash_hashname = optarg;
+ jithash_hashname = optarg;
else{
- WARNING2("hash name truncated to 15 characters from %d. (%s)",
+ WARNING2("hash name truncated to 15 characters from %d. (%s)",
(int) len, optarg);
jithash_hashname = (string) xmalloc(16);
strncpy(jithash_hashname, optarg, 15);
jithash_hashname[15] = 0;
}
-#endif
+#endif
} else if (ARGUMENT_IS("luahashchars")) {
show_luahashchars = 1;
@@ -670,7 +427,7 @@ static void parse_options(int ac, char **av)
"There is NO warranty. Redistribution of this software is covered by\n"
"the terms of the GNU General Public License, version 2 or (at your option)\n"
"any later version. For more information about these matters, see the file\n"
- "named COPYING and the LuaTeX source.\n\n"
+ "named COPYING and the LuaTeX source.\n\n"
#ifdef LuajitTeX
"LuaTeX is Copyright 2014 Taco Hoekwater, the LuaTeX Team.\n"
"Libraries and JIT extensions by Luigi Scarso, the LuaTeX SwigLib team.\n");
@@ -684,31 +441,31 @@ static void parse_options(int ac, char **av)
initversionstring(&versions);
print_version_banner();
/* *INDENT-OFF* */
- puts("\n\nThe LuaTeX team is Hans Hagen, Hartmut Henkel, Taco Hoekwater.\n"
+ puts("\n\nThe LuaTeX team is Hans Hagen, Hartmut Henkel, Taco Hoekwater.\n"
#ifdef LuajitTex
- "LuajitTeX merges and builds upon (parts of) the code from these projects:\n\n"
+ "LuajitTeX merges and builds upon (parts of) the code from these projects:\n\n"
#else
- "LuaTeX merges and builds upon (parts of) the code from these projects:\n\n"
+ "LuaTeX merges and builds upon (parts of) the code from these projects:\n\n"
#endif
- "tex by Donald Knuth\n"
- "etex by Peter Breitenlohner, Phil Taylor and friends\n"
- "omega by John Plaice and Yannis Haralambous\n"
- "aleph by Giuseppe Bilotta\n"
- "pdftex by Han The Thanh and friends\n"
- "kpathsea by Karl Berry, Olaf Weber and others\n"
- "lua by Roberto Ierusalimschy, Waldemar Celes,\n"
- " Luiz Henrique de Figueiredo\n"
- "metapost by John Hobby, Taco Hoekwater and friends.\n"
- "poppler by Derek Noonburg, Kristian H\\ogsberg (partial)\n"
+ "tex by Donald Knuth\n"
+ "etex by Peter Breitenlohner, Phil Taylor and friends\n"
+ "omega by John Plaice and Yannis Haralambous\n"
+ "aleph by Giuseppe Bilotta\n"
+ "pdftex by Han The Thanh and friends\n"
+ "kpathsea by Karl Berry, Olaf Weber and others\n"
+ "lua by Roberto Ierusalimschy, Waldemar Celes,\n"
+ " Luiz Henrique de Figueiredo\n"
+ "metapost by John Hobby, Taco Hoekwater and friends.\n"
+ "poppler by Derek Noonburg, Kristian H\\ogsberg (partial)\n"
#ifdef LuajitTeX
- "fontforge by George Williams (partial)\n"
- "luajit by Mike Pall\n\n"
+ "fontforge by George Williams (partial)\n"
+ "luajit by Mike Pall\n\n"
#else
- "fontforge by George Williams (partial)\n\n"
+ "fontforge by George Williams (partial)\n\n"
#endif
- "Some extensions to lua and additional lua libraries are used, as well as\n"
- "libraries for graphic inclusion. More details can be found in the source.\n"
- "Code development was sponsored by a grant from Colorado State University\n"
+ "Some extensions to lua and additional lua libraries are used, as well as\n"
+ "libraries for graphic inclusion. More details can be found in the source.\n"
+ "Code development was sponsored by a grant from Colorado State University\n"
#ifdef LuajitTeX
"via the 'oriental tex' project, the TeX User Groups, and donations.\n"
"The additional libraries and the LuaJIT extensions are provided by the LuaTeX SwigLib project.\n");
@@ -787,7 +544,7 @@ static void parse_options(int ac, char **av)
}
}
-@ test for readability
+@ test for readability
@c
#define is_readable(a) (stat(a,&finfo)==0) && S_ISREG(finfo.st_mode) && \
(f=fopen(a,"r")) != NULL && !fclose(f)
@@ -903,12 +660,12 @@ static const char *luatex_kpse_find_aux(lua_State *L, const char *name,
}
@ The lua search function.
-
+
When kpathsea is not initialized, then it runs the
normal lua function that is saved in the registry, otherwise
it uses kpathsea.
-two registry ref variables are needed: one for the actual lua
+two registry ref variables are needed: one for the actual lua
function, the other for its environment .
@c
@@ -971,7 +728,7 @@ static int luatex_kpse_clua_find(lua_State * L)
break;
}
if ((unsigned char)temp_name[j]=='.'){
- temp_name[j]=LUA_DIRSEP[0];
+ temp_name[j]=LUA_DIRSEP[0];
}
}
p = strstr(extensionless, temp_name);
@@ -1009,9 +766,9 @@ static int luatex_kpse_clua_find(lua_State * L)
}
}
-@ Setting up the new search functions.
+@ Setting up the new search functions.
-This replaces package.searchers[2] and package.searchers[3] with the
+This replaces package.searchers[2] and package.searchers[3] with the
functions defined above.
@c
@@ -1044,6 +801,13 @@ int pdf_table_id;
int token_table_id;
int node_table_id;
+@ @c
+int l_pack_type_index [PACK_TYPE_SIZE] ;
+int l_group_code_index [GROUP_CODE_SIZE];
+int l_math_style_name_index [MATH_STYLE_NAME_SIZE];
+int l_dir_par_index [DIR_PAR_SIZE];
+int l_dir_text_index [DIR_TEXT_SIZE];
+
#if defined(WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
char **suffixlist;
@@ -1126,7 +890,7 @@ void lua_initialize(int ac, char **av)
#endif
size_t len;
len = strlen(fmt) + strlen(luatex_version_string) ;
-
+
banner = xmalloc(len);
sprintf(banner, fmt, luatex_version_string);
} else {
@@ -1197,256 +961,19 @@ void lua_initialize(int ac, char **av)
luainterpreter();
/* init internalized strings */
- init_lua_key(LTL);
- init_lua_key(MathConstants);
- init_lua_key(RTT);
- init_lua_key(TLT);
- init_lua_key(TRT);
- init_lua_key(accent);
- init_lua_key(action);
- init_lua_key(action_id);
- init_lua_key(action_type);
- init_lua_key(additional);
- init_lua_key(adjust_head);
- init_lua_key(advance);
- init_lua_key(aleph);
- init_lua_key(align_head);
- init_lua_key(area);
- init_lua_key(attr);
- init_lua_key(attributes);
- init_lua_key(auto_expand);
- init_lua_key(best_ins_ptr);
- init_lua_key(best_page_break);
- init_lua_key(best_size);
- init_lua_key(bot);
- init_lua_key(bot_accent);
- init_lua_key(bottom_left);
- init_lua_key(bottom_right);
- init_lua_key(box_left);
- init_lua_key(box_left_width);
- init_lua_key(box_right);
- init_lua_key(box_right_width);
- init_lua_key(broken_ins);
- init_lua_key(broken_ptr);
- init_lua_key(cache);
- init_lua_key(cal_expand_ratio);
- init_lua_key(char);
- init_lua_key(characters);
- init_lua_key(checksum);
- init_lua_key(cidinfo);
- init_lua_key(class);
- init_lua_key(command);
- init_lua_key(commands);
- init_lua_key(comment);
- init_lua_key(components);
- init_lua_key(contrib_head);
- init_lua_key(core);
- init_lua_key(cost);
- init_lua_key(count);
- init_lua_key(data);
- init_lua_key(degree);
- init_lua_key(delim);
- init_lua_key(delimptr);
- init_lua_key(denom);
- init_lua_key(depth);
- init_lua_key(designsize);
- init_lua_key(dest_id);
- init_lua_key(dest_type);
- init_lua_key(dir);
- init_lua_key(dir_h);
- init_lua_key(direction);
- init_lua_key(dirs);
- init_lua_key(display);
- init_lua_key(down);
- init_lua_key(dvi_ptr);
- init_lua_key(embedding);
- init_lua_key(encodingbytes);
- init_lua_key(encodingname);
- init_lua_key(end);
- init_lua_key(etex);
- init_lua_key(exactly);
- init_lua_key(expansion_factor);
- init_lua_key(ext);
- init_lua_key(extend);
- init_lua_key(extender);
- init_lua_key(extensible);
- init_lua_key(extra_space);
- init_lua_key(fam);
- init_lua_key(fast);
- init_lua_key(file);
- init_lua_key(filename);
- init_lua_key(font);
- init_lua_key(fonts);
- init_lua_key(format);
- init_lua_key(fullname);
- init_lua_key(global);
- init_lua_key(glue_order);
- init_lua_key(glue_set);
- init_lua_key(glue_sign);
- init_lua_key(glyph);
- init_lua_key(head);
- init_lua_key(height);
- init_lua_key(hold_head);
- init_lua_key(horiz_variants);
- init_lua_key(hyphenchar);
- init_lua_key(id);
- init_lua_key(image);
- init_lua_key(index);
- init_lua_key(italic);
- init_lua_key(kern);
- init_lua_key(kerns);
- init_lua_key(lang);
- init_lua_key(large_char);
- init_lua_key(large_fam);
- init_lua_key(last_ins_ptr);
- init_lua_key(leader);
- init_lua_key(least_page_cost);
- init_lua_key(left);
- init_lua_key(left_boundary);
- init_lua_key(left_protruding);
- init_lua_key(level);
- init_lua_key(ligatures);
- init_lua_key(link_attr);
- init_lua_key(list);
- init_lua_key(log);
- init_lua_key(lua);
- init_lua_key(luatex);
- init_lua_key(mark);
- init_lua_key(mathdir);
- init_lua_key(mathkern);
- init_lua_key(mathstyle);
- init_lua_key(mid);
- init_lua_key(mode);
- init_lua_key(modeline);
- init_lua_key(name);
- init_lua_key(named_id);
- init_lua_key(new_window);
- init_lua_key(next);
- init_lua_key(no);
- init_lua_key(noad);
- init_lua_key(node);
- init_lua_key(nomath);
- init_lua_key(nop);
- init_lua_key(nucleus);
- init_lua_key(num);
- init_lua_key(number);
- init_lua_key(objnum);
- init_lua_key(omega);
- init_lua_key(ordering);
- init_lua_key(page_head);
- init_lua_key(page_ins_head);
- init_lua_key(parameters);
- init_lua_key(pdftex);
- init_lua_key(pen_broken);
- init_lua_key(pen_inter);
- init_lua_key(penalty);
- init_lua_key(pop);
- init_lua_key(post);
- init_lua_key(pre);
- init_lua_key(pre_adjust_head);
- init_lua_key(prev);
- init_lua_key(prevdepth);
- init_lua_key(prevgraf);
- init_lua_key(psname);
- init_lua_key(ptr);
- init_lua_key(push);
- init_lua_key(quad);
- init_lua_key(ref_count);
- init_lua_key(reg);
- init_lua_key(registry);
- init_lua_key(renew);
- init_lua_key(rep);
- init_lua_key(replace);
- init_lua_key(right);
- init_lua_key(right_boundary);
- init_lua_key(right_protruding);
- init_lua_key(rule);
- init_lua_key(scale);
- init_lua_key(script);
- init_lua_key(scriptscript);
- init_lua_key(shift);
- init_lua_key(shrink);
- init_lua_key(shrink_order);
- init_lua_key(size);
- init_lua_key(skewchar);
- init_lua_key(slant);
- init_lua_key(slot);
- init_lua_key(small_char);
- init_lua_key(small_fam);
- init_lua_key(space);
- init_lua_key(space_shrink);
- init_lua_key(space_stretch);
- init_lua_key(spacefactor);
- init_lua_key(spec);
- init_lua_key(special);
- init_lua_key(stack);
- init_lua_key(start);
- init_lua_key(step);
- init_lua_key(stream);
- init_lua_key(stretch);
- init_lua_key(stretch_order);
- init_lua_key(string);
- init_lua_key(style);
- init_lua_key(sub);
- init_lua_key(subst_ex_font);
- init_lua_key(subtype);
- init_lua_key(sup);
- init_lua_key(supplement);
- init_lua_key(surround);
- init_lua_key(tail);
- init_lua_key(temp_head);
- init_lua_key(term);
- init_lua_key(tex);
- init_lua_key(text);
- init_lua_key(thread_attr);
- init_lua_key(thread_id);
- init_lua_key(top);
- init_lua_key(top_accent);
- init_lua_key(top_left);
- init_lua_key(top_right);
- init_lua_key(tounicode);
- init_lua_key(transform);
- init_lua_key(type);
- init_lua_key(uchyph);
- init_lua_key(umath);
- init_lua_key(units_per_em);
- init_lua_key(used);
- init_lua_key(user_id);
- init_lua_key(value);
- init_lua_key(version);
- init_lua_key(vert_variants);
- init_lua_key(width);
- init_lua_key(writable);
- init_lua_key(x_height);
- init_lua_key(xoffset);
- init_lua_key(xyz_zoom);
- init_lua_key(yoffset);
- init_lua_key_alias(luatex_node, "luatex.node");
- init_lua_key_alias(mLTL,"-LTL");
- init_lua_key_alias(mRTT,"-RTT");
- init_lua_key_alias(mTLT,"-TLT");
- init_lua_key_alias(mTRT,"-TRT");
- init_lua_key_alias(node_properties,"node.properties");
- init_lua_key_alias(node_properties_indirect,"node.properties.indirect");
- init_lua_key_alias(pLTL,"+LTL");
- init_lua_key_alias(pRTT,"+RTT");
- init_lua_key_alias(pTLT,"+TLT");
- init_lua_key_alias(pTRT,"+TRT");
- init_lua_key_alias(term_and_log,"term and log");
- init_lua_key_alias(lua_functions,"lua.functions");
-
- init_lua_key(immediate);
- init_lua_key(compresslevel);
- init_lua_key(objcompression);
- init_lua_key(direct);
- init_lua_key(page);
- init_lua_key(streamfile);
- init_lua_key(annot);
+ set_init_keys;
lua_pushstring(Luas,"lua.functions");
lua_newtable(Luas);
lua_settable(Luas,LUA_REGISTRYINDEX);
+ /* here start the key definitions */
+ set_pack_type_index;
+ set_l_group_code_index;
+ set_l_math_style_name_index;
+ set_l_dir_par_index;
+ set_l_dir_text_index;
+
prepare_cmdline(Luas, argv, argc, lua_offset); /* collect arguments */
setup_lua_path(Luas);
diff --git a/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w b/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w
index 6c20e9d10fb..3e78fd2d940 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w
@@ -451,16 +451,30 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
}
lua_active++;
if (is_string) {
- const char *ss = NULL;
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
- ss = lua_tolstring(Luas, -1, &ll);
- s = xmalloc(ll+1);
- memcpy(s,ss,ll+1);
- lua_pop(Luas,1);
+ const char *ss = NULL;
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
+ if (lua_isfunction(Luas,-1)) {
+ int base = lua_gettop(Luas); /* function index */
+ lua_checkstack(Luas, 1);
+ lua_pushcfunction(Luas, lua_traceback); /* push traceback function */
+ lua_insert(Luas, base); /* put it under chunk */
+ i = lua_pcall(Luas, 0, 0, base);
+ lua_remove(Luas, base); /* remove traceback function */
+ if (i != 0) {
+ lua_gc(Luas, LUA_GCCOLLECT, 0);
+ Luas = luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1));
+ }
+ lua_active--;
+ return ;
+ }
+ ss = lua_tolstring(Luas, -1, &ll);
+ s = xmalloc(ll+1);
+ memcpy(s,ss,ll+1);
+ lua_pop(Luas,1);
} else {
- int l = 0;
- s = tokenlist_to_cstring(p, 1, &l);
- ll = (size_t)l;
+ int l = 0;
+ s = tokenlist_to_cstring(p, 1, &l);
+ ll = (size_t)l;
}
ls.s = s;
ls.size = ll;
@@ -469,17 +483,16 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
int l = 0; /* not used */
lua_id = tokenlist_to_cstring(nameptr, 1, &l);
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
+ xfree(lua_id);
} else if (nameptr < 0) {
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ");
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]");
}
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ");
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]");
}
if (i != 0) {
Luas = luatex_error(Luas, (i == LUA_ERRSYNTAX ? 0 : 1));
@@ -500,6 +513,7 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
lua_active--;
}
+
@ @c
void late_lua(PDF pdf, halfword p)
{
@@ -530,17 +544,16 @@ void luatokencall(int p, int nameptr) /* hh-ls: optimized lua_id resolving */
if (nameptr > 0) {
lua_id = tokenlist_to_cstring(nameptr, 1, &l);
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
+ xfree(lua_id);
} else if (nameptr < 0) {
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ");
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]");
}
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ");
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]");
}
xfree(s);
if (i != 0) {
@@ -571,6 +584,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
luaerr.s = lua_tolstring(L, -1, &luaerr.l);
err = (char *) xmalloc((unsigned) (luaerr.l + 1));
snprintf(err, (luaerr.l + 1), "%s", luaerr.s);
+ last_lua_error = err;
}
if (is_fatal > 0) {
/* Normally a memory error from lua.
@@ -583,7 +597,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
return (lua_State *) NULL;
} else {
lua_norm_error(err);
- xfree(err);
+ /* last_lua_error = err so no need to xfree(err) */
return L;
}
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luanode.w b/Build/source/texk/web2c/luatexdir/lua/luanode.w
index 879b0b3d27e..b0a9849c561 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luanode.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luanode.w
@@ -22,13 +22,13 @@ nodes are removedor inserted, temp nodes don't interfere */
@ @c
static const char _svn_version[] =
- "$Id: luanode.w 4442 2012-05-25 22:40:34Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/lua/luanode.w $";
+ "$Id: luanode.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/luanode.w $";
#include "ptexlib.h"
#include "lua/luatex-api.h"
-@ @c
+/* TO BE REMOVED
static const char *group_code_names[] = {
"",
"simple",
@@ -56,10 +56,11 @@ static const char *group_code_names[] = {
};
const char *pack_type_name[] = { "exactly", "additional" };
-
+*/
@ @c
-void lua_node_filter_s(int filterid, const char *extrainfo)
+void
+lua_node_filter_s(int filterid, int extrainfo)
{
lua_State *L = Luas;
int callback_id = callback_defined(filterid);
@@ -72,7 +73,7 @@ void lua_node_filter_s(int filterid, const char *extrainfo)
lua_settop(L, s_top);
return;
}
- lua_pushstring(L, extrainfo); /* arg 1 */
+ lua_push_string_by_index(L,extrainfo); /* arg 1 */
if (lua_pcall(L, 1, 0, 0) != 0) {
fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
lua_settop(L, s_top);
@@ -83,16 +84,15 @@ void lua_node_filter_s(int filterid, const char *extrainfo)
return;
}
+
@ @c
void
-lua_node_filter(int filterid, int xextrainfo, halfword head_node,
- halfword * tail_node)
+lua_node_filter(int filterid, int extrainfo, halfword head_node, halfword * tail_node)
{
halfword ret;
int a;
lua_State *L = Luas;
int s_top = lua_gettop(L);
- const char *extrainfo = group_code_names[xextrainfo];
int callback_id = callback_defined(filterid);
if (head_node == null || vlink(head_node) == null || callback_id <= 0) {
lua_settop(L, s_top);
@@ -104,7 +104,7 @@ lua_node_filter(int filterid, int xextrainfo, halfword head_node,
}
alink(vlink(head_node)) = null ; /* hh-ls */
nodelist_to_lua(L, vlink(head_node)); /* arg 1 */
- lua_pushstring(L, extrainfo); /* arg 2 */
+ lua_push_group_code(L,extrainfo); /* arg 2 */
if (lua_pcall(L, 2, 1, 0) != 0) { /* no arg, 1 result */
fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
lua_settop(L, s_top);
@@ -135,7 +135,6 @@ lua_node_filter(int filterid, int xextrainfo, halfword head_node,
return;
}
-
@ @c
int
lua_linebreak_callback(int is_broken, halfword head_node, halfword * new_head)
@@ -195,11 +194,11 @@ lua_hpack_filter(halfword head_node, scaled size, int pack_type, int extrainfo,
}
alink(head_node) = null ; /* hh-ls */
nodelist_to_lua(L, head_node);
- lua_pushstring(L, group_code_names[extrainfo]);
+ lua_push_group_code(L,extrainfo);
lua_pushnumber(L, size);
- lua_pushstring(L, pack_type_name[pack_type]);
+ lua_push_pack_type(L,pack_type);
if (pack_direction >= 0)
- lua_pushstring(L, string_dir(pack_direction));
+ lua_push_dir_par(L, pack_direction);
else
lua_pushnil(L);
if (lua_pcall(L, 5, 1, 0) != 0) { /* no arg, 1 result */
@@ -239,7 +238,7 @@ lua_vpack_filter(halfword head_node, scaled size, int pack_type, scaled maxd,
lua_settop(L, s_top);
return head_node;
}
- if (strcmp("output", group_code_names[extrainfo]) == 0) {
+ if (extrainfo == 8) { /* output */
callback_id = callback_defined(pre_output_filter_callback);
} else {
callback_id = callback_defined(vpack_filter_callback);
@@ -254,12 +253,12 @@ lua_vpack_filter(halfword head_node, scaled size, int pack_type, scaled maxd,
}
alink(head_node) = null ; /* hh-ls */
nodelist_to_lua(L, head_node);
- lua_pushstring(L, group_code_names[extrainfo]);
+ lua_push_group_code(L,extrainfo);
lua_pushnumber(L, size);
- lua_pushstring(L, pack_type_name[pack_type]);
+ lua_push_pack_type(L,pack_type);
lua_pushnumber(L, maxd);
if (pack_direction >= 0)
- lua_pushstring(L, string_dir(pack_direction));
+ lua_push_dir_par(L, pack_direction);
else
lua_pushnil(L);
if (lua_pcall(L, 6, 1, 0) != 0) { /* no arg, 1 result */
@@ -338,6 +337,7 @@ void copy_pdf_literal(pointer r, pointer p)
}
}
+@ @c
void copy_late_lua(pointer r, pointer p)
{
late_lua_type(r) = late_lua_type(p);
@@ -352,6 +352,15 @@ void copy_late_lua(pointer r, pointer p)
}
}
+@ @c
+void copy_user_lua(pointer r, pointer p)
+{
+ if (user_node_value(p) != 0) {
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, user_node_value(p));
+ user_node_value(r) = luaL_ref(Luas, LUA_REGISTRYINDEX);
+ }
+}
+
@ @c
void free_pdf_literal(pointer p)
@@ -375,6 +384,15 @@ void free_late_lua(pointer p)
}
@ @c
+void free_user_lua(pointer p)
+{
+ if (user_node_value(p) != 0) {
+ luaL_unref(Luas, LUA_REGISTRYINDEX, user_node_value(p));
+ }
+}
+
+
+@ @c
void show_pdf_literal(pointer p)
{
tprint_esc("pdfliteral");
diff --git a/Build/source/texk/web2c/luatexdir/lua/luastuff.w b/Build/source/texk/web2c/luatexdir/lua/luastuff.w
index e9942881baf..b8df4a79cb4 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luastuff.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luastuff.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: luastuff.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: luastuff.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/lua/luastuff.w $";
#include "ptexlib.h"
@@ -367,7 +367,7 @@ void unhide_lua_value(lua_State * L, const char *name, const char *item, int r)
@ @c
int lua_traceback(lua_State * L)
-{
+{
lua_getglobal(L, "debug");
if (!lua_istable(L, -1)) {
lua_pop(L, 1);
@@ -398,16 +398,30 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
}
lua_active++;
if (is_string) {
- const char *ss = NULL;
- lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
- ss = lua_tolstring(Luas, -1, &ll);
- s = xmalloc(ll+1);
- memcpy(s,ss,ll+1);
- lua_pop(Luas,1);
+ const char *ss = NULL;
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, p);
+ if (lua_isfunction(Luas,-1)) {
+ int base = lua_gettop(Luas); /* function index */
+ lua_checkstack(Luas, 1);
+ lua_pushcfunction(Luas, lua_traceback); /* push traceback function */
+ lua_insert(Luas, base); /* put it under chunk */
+ i = lua_pcall(Luas, 0, 0, base);
+ lua_remove(Luas, base); /* remove traceback function */
+ if (i != 0) {
+ lua_gc(Luas, LUA_GCCOLLECT, 0);
+ Luas = luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1));
+ }
+ lua_active--;
+ return ;
+ }
+ ss = lua_tolstring(Luas, -1, &ll);
+ s = xmalloc(ll+1);
+ memcpy(s,ss,ll+1);
+ lua_pop(Luas,1);
} else {
- int l = 0;
- s = tokenlist_to_cstring(p, 1, &l);
- ll = (size_t)l;
+ int l = 0;
+ s = tokenlist_to_cstring(p, 1, &l);
+ ll = (size_t)l;
}
ls.s = s;
ls.size = ll;
@@ -421,12 +435,11 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id, NULL);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]", NULL);
}
} else {
- i = lua_load(Luas, getS, &ls, "\\latelua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\latelua]", NULL);
}
if (i != 0) {
Luas = luatex_error(Luas, (i == LUA_ERRSYNTAX ? 0 : 1));
@@ -447,6 +460,8 @@ static void luacall(int p, int nameptr, boolean is_string) /* hh-ls: optimized l
lua_active--;
}
+
+
@ @c
void late_lua(PDF pdf, halfword p)
{
@@ -477,17 +492,16 @@ void luatokencall(int p, int nameptr) /* hh-ls: optimized lua_id resolving */
if (nameptr > 0) {
lua_id = tokenlist_to_cstring(nameptr, 1, &l);
i = lua_load(Luas, getS, &ls, lua_id, NULL);
- xfree(lua_id);
+ xfree(lua_id);
} else if (nameptr < 0) {
lua_id = get_lua_name((nameptr + 65536));
if (lua_id != NULL) {
i = lua_load(Luas, getS, &ls, lua_id, NULL);
- xfree(lua_id);
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]", NULL);
}
} else {
- i = lua_load(Luas, getS, &ls, "\\directlua ", NULL);
+ i = lua_load(Luas, getS, &ls, "=[\\directlua]", NULL);
}
xfree(s);
if (i != 0) {
@@ -518,6 +532,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
luaerr.s = lua_tolstring(L, -1, &luaerr.l);
err = (char *) xmalloc((unsigned) (luaerr.l + 1));
snprintf(err, (luaerr.l + 1), "%s", luaerr.s);
+ last_lua_error = err;
}
if (is_fatal > 0) {
/* Normally a memory error from lua.
@@ -530,7 +545,7 @@ lua_State *luatex_error(lua_State * L, int is_fatal)
return (lua_State *) NULL;
} else {
lua_norm_error(err);
- xfree(err);
+ /* last_lua_error = err so no need to xfree(err) */
return L;
}
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
index 3fe463d8068..77792e94b4d 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
+++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: luatex-api.h 4877 2014-03-14 01:26:05Z luigi $ */
+/* $Id: luatex-api.h 4956 2014-03-28 12:12:17Z luigi $ */
#ifndef LUATEX_API_H
# define LUATEX_API_H 1
@@ -137,9 +137,9 @@ extern char *jithash_hashname ;
#ifdef LuajitTeX
#define LUAJITTEX_HASHCHARS 6 /* todo: It must be like that one on lj_str.c */
-#else
+#else
#define LUATEX_HASHCHARS 6 /* todo: It must be LUAI_HASHLIMIT! */
-#endif
+#endif
extern unsigned char show_luahashchars ;
extern void unhide_lua_table(lua_State * lua, const char *name, int r);
@@ -169,6 +169,9 @@ extern int saved_callback_count;
extern const char *ptexbanner;
+extern const char *last_lua_error;
+
+
/* luastuff.h */
typedef struct {
@@ -210,6 +213,7 @@ extern int lua_traceback(lua_State * L);
extern int luainit;
+
extern char *luanames[];
extern int ff_get_ttc_index(char *ffname, char *psname); /* luafontloader/src/luafflib.c */
@@ -241,14 +245,14 @@ extern char **environ;
luaS_##a##_index = luaL_ref (Luas,LUA_REGISTRYINDEX); \
} while (0)
- /*#define init_luaS_index_s(a,b) do { */
+ /*#define init_luaS_index_s(a,b) do { */
#define init_lua_key_alias(a,b) do { \
lua_pushliteral(Luas,b); \
luaS_##a##_ptr = lua_tostring(Luas,-1); \
luaS_##a##_index = luaL_ref (Luas,LUA_REGISTRYINDEX); \
} while (0)
- /*#define make_luaS_index(a) */
+ /*#define make_luaS_index(a) */
#define make_lua_key(a) \
int luaS_##a##_index = 0; \
const char * luaS_##a##_ptr = NULL
@@ -262,26 +266,747 @@ extern char **environ;
#define lua_key(a) luaS_##a##_ptr
#define use_lua_key(a) \
extern int luaS_##a##_index ; \
- extern const char * luaS_##a##_ptr
+ extern const char * luaS_##a##_ptr
#define lua_key_rawgeti(a) \
lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_##a##_index);\
lua_rawget(L, -2)
+#define lua_key_rawgeti_n(a,n) \
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_##a##_index);\
+ lua_rawget(L, -1+n)
#define lua_roundnumber(a,b) (int)floor((double)lua_tonumber(L,-1)+0.5)
extern int lua_numeric_field_by_index(lua_State *, int , int);
-
+
+
+
+/* Currently we sometimes use numbers and sometimes strings in node properties. We can
+make that consistent by having a check on number and if not then assign a string. The
+strings are prehashed and we make a bunch of lua tables that have these values. We can
+preassign these at startup time. */
+
+/* no need for L state argument */
+
+#define PACK_TYPE_SIZE 4
+#define GROUP_CODE_SIZE 23
+#define MATH_STYLE_NAME_SIZE 8
+#define DIR_PAR_SIZE 128
+#define DIR_TEXT_SIZE 128
+
+extern int l_pack_type_index [PACK_TYPE_SIZE] ;
+extern int l_group_code_index [GROUP_CODE_SIZE];
+extern int l_math_style_name_index [MATH_STYLE_NAME_SIZE];
+extern int l_dir_par_index [DIR_PAR_SIZE];
+extern int l_dir_text_index [DIR_TEXT_SIZE];
+
+#define lua_push_pack_type(L,pack_type) lua_rawgeti(L, LUA_REGISTRYINDEX, l_pack_type_index [pack_type] );
+#define lua_push_group_code(L,group_code) lua_rawgeti(L, LUA_REGISTRYINDEX, l_group_code_index [group_code]);
+#define lua_push_math_style_name(L,style_name) lua_rawgeti(L, LUA_REGISTRYINDEX, l_math_style_name_index[style_name]);
+#define lua_push_dir_par(L,dir) lua_rawgeti(L, LUA_REGISTRYINDEX, l_dir_par_index[dir+64])
+#define lua_push_dir_text(L,dir) lua_rawgeti(L, LUA_REGISTRYINDEX, l_dir_text_index[dir+64])
+
+
+#define lua_push_string_by_index(L,index) lua_rawgeti(L, LUA_REGISTRYINDEX, index)
+#define lua_push_string_by_name(L,index) lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(index))
+
+
+#define set_pack_type_index \
+l_pack_type_index[0] = lua_key_index(exactly); \
+l_pack_type_index[1] = lua_key_index(additional); \
+l_pack_type_index[2] = lua_key_index(cal_expand_ratio);\
+l_pack_type_index[3] = lua_key_index(subst_ex_font);
+
+#define set_l_group_code_index \
+l_group_code_index[0] = lua_key_index(empty_string);\
+l_group_code_index[1] = lua_key_index(simple);\
+l_group_code_index[2] = lua_key_index(hbox);\
+l_group_code_index[3] = lua_key_index(adjusted_hbox);\
+l_group_code_index[4] = lua_key_index(vbox);\
+l_group_code_index[5] = lua_key_index(vtop);\
+l_group_code_index[6] = lua_key_index(align);\
+l_group_code_index[7] = lua_key_index(no_align);\
+l_group_code_index[8] = lua_key_index(output);\
+l_group_code_index[9] = lua_key_index(math);\
+l_group_code_index[10] = lua_key_index(disc);\
+l_group_code_index[11] = lua_key_index(insert);\
+l_group_code_index[12] = lua_key_index(vcenter);\
+l_group_code_index[13] = lua_key_index(math_choice);\
+l_group_code_index[14] = lua_key_index(semi_simple);\
+l_group_code_index[15] = lua_key_index(math_shift);\
+l_group_code_index[16] = lua_key_index(math_left);\
+l_group_code_index[17] = lua_key_index(local_box);\
+l_group_code_index[18] = lua_key_index(split_off);\
+l_group_code_index[19] = lua_key_index(split_keep);\
+l_group_code_index[20] = lua_key_index(preamble);\
+l_group_code_index[21] = lua_key_index(align_set);\
+l_group_code_index[22] = lua_key_index(fin_row)
+
+#define set_l_math_style_name_index \
+l_math_style_name_index[0] = lua_key_index(display);\
+l_math_style_name_index[1] = lua_key_index(crampeddisplay);\
+l_math_style_name_index[2] = lua_key_index(text);\
+l_math_style_name_index[3] = lua_key_index(crampedtext);\
+l_math_style_name_index[4] = lua_key_index(script);\
+l_math_style_name_index[5] = lua_key_index(crampedscript);\
+l_math_style_name_index[6] = lua_key_index(scriptscript);\
+l_math_style_name_index[7] = lua_key_index(crampedscriptscript)
+
+#define set_l_dir_par_index \
+l_dir_par_index[0] = lua_key_index(TLT);\
+l_dir_par_index[4] = lua_key_index(TRT);\
+l_dir_par_index[9] = lua_key_index(LTL);\
+l_dir_par_index[24] = lua_key_index(RTT);\
+l_dir_par_index[64] = lua_key_index(TLT);\
+l_dir_par_index[68] = lua_key_index(TRT);\
+l_dir_par_index[73] = lua_key_index(LTL);\
+l_dir_par_index[88] = lua_key_index(RTT);\
+
+#define set_l_dir_text_index \
+l_dir_text_index[0] = lua_key_index(mTLT);\
+l_dir_text_index[4] = lua_key_index(mTRT);\
+l_dir_text_index[9] = lua_key_index(mLTL);\
+l_dir_text_index[24] = lua_key_index(mRTT);\
+l_dir_text_index[64] = lua_key_index(pTLT);\
+l_dir_text_index[68] = lua_key_index(pTRT);\
+l_dir_text_index[73] = lua_key_index(pLTL);\
+l_dir_text_index[88] = lua_key_index(pRTT);\
+
+
+#define set_make_keys \
+make_lua_key(LTL);\
+make_lua_key(MathConstants);\
+make_lua_key(RTT);\
+make_lua_key(TLT);\
+make_lua_key(TRT);\
+make_lua_key(accent);\
+make_lua_key(action);\
+make_lua_key(action_id);\
+make_lua_key(action_type);\
+make_lua_key(additional);\
+make_lua_key(adjust);\
+make_lua_key(adjust_head);\
+make_lua_key(adjusted_hbox);\
+make_lua_key(advance);\
+make_lua_key(after_display);\
+make_lua_key(after_output);\
+make_lua_key(aleph);\
+make_lua_key(align);\
+make_lua_key(align_head);\
+make_lua_key(align_set);\
+make_lua_key(alignment);\
+make_lua_key(annot);\
+make_lua_key(area);\
+make_lua_key(attr);\
+make_lua_key(attributes);\
+make_lua_key(auto_expand);\
+make_lua_key(before_display);\
+make_lua_key(best_ins_ptr);\
+make_lua_key(best_page_break);\
+make_lua_key(best_size);\
+make_lua_key(bot);\
+make_lua_key(bot_accent);\
+make_lua_key(bottom_left);\
+make_lua_key(bottom_right);\
+make_lua_key(box);\
+make_lua_key(box_left);\
+make_lua_key(box_left_width);\
+make_lua_key(box_right);\
+make_lua_key(box_right_width);\
+make_lua_key(broken_ins);\
+make_lua_key(broken_ptr);\
+make_lua_key(cache);\
+make_lua_key(cal_expand_ratio);\
+make_lua_key(catalog);\
+make_lua_key(char);\
+make_lua_key(characters);\
+make_lua_key(checksum);\
+make_lua_key(cidinfo);\
+make_lua_key(class);\
+make_lua_key(command);\
+make_lua_key(commands);\
+make_lua_key(comment);\
+make_lua_key(components);\
+make_lua_key(compresslevel);\
+make_lua_key(contrib_head);\
+make_lua_key(core);\
+make_lua_key(cost);\
+make_lua_key(count);\
+make_lua_key(crampeddisplay);\
+make_lua_key(crampedscript);\
+make_lua_key(crampedscriptscript);\
+make_lua_key(crampedtext);\
+make_lua_key(data);\
+make_lua_key(degree);\
+make_lua_key(delim);\
+make_lua_key(delimptr);\
+make_lua_key(denom);\
+make_lua_key(depth);\
+make_lua_key(designsize);\
+make_lua_key(dest_id);\
+make_lua_key(dest_type);\
+make_lua_key(dir);\
+make_lua_key(dir_h);\
+make_lua_key(direct);\
+make_lua_key(direction);\
+make_lua_key(dirs);\
+make_lua_key(disc);\
+make_lua_key(display);\
+make_lua_key(down);\
+make_lua_key(dvi_ptr);\
+make_lua_key(embedding);\
+make_lua_key(empty_string);\
+make_lua_key(encodingbytes);\
+make_lua_key(encodingname);\
+make_lua_key(end);\
+make_lua_key(etex);\
+make_lua_key(exactly);\
+make_lua_key(expansion_factor);\
+make_lua_key(ext);\
+make_lua_key(extend);\
+make_lua_key(extender);\
+make_lua_key(extensible);\
+make_lua_key(extra_space);\
+make_lua_key(fam);\
+make_lua_key(fast);\
+make_lua_key(file);\
+make_lua_key(filename);\
+make_lua_key(fin_row);\
+make_lua_key(font);\
+make_lua_key(fonts);\
+make_lua_key(format);\
+make_lua_key(fullname);\
+make_lua_key(global);\
+make_lua_key(glue_order);\
+make_lua_key(glue_set);\
+make_lua_key(glue_sign);\
+make_lua_key(glyph);\
+make_lua_key(h);\
+make_lua_key(hbox);\
+make_lua_key(head);\
+make_lua_key(height);\
+make_lua_key(hmode_par);\
+make_lua_key(hold_head);\
+make_lua_key(horiz_variants);\
+make_lua_key(hyphenchar);\
+make_lua_key(id);\
+make_lua_key(image);\
+make_lua_key(immediate);\
+make_lua_key(index);\
+make_lua_key(info);\
+make_lua_key(insert);\
+make_lua_key(italic);\
+make_lua_key(kern);\
+make_lua_key(kerns);\
+make_lua_key(lang);\
+make_lua_key(large_char);\
+make_lua_key(large_fam);\
+make_lua_key(last_ins_ptr);\
+make_lua_key(leader);\
+make_lua_key(least_page_cost);\
+make_lua_key(left);\
+make_lua_key(left_boundary);\
+make_lua_key(left_protruding);\
+make_lua_key(level);\
+make_lua_key(ligatures);\
+make_lua_key(link_attr);\
+make_lua_key(list);\
+make_lua_key(local_box);\
+make_lua_key(log);\
+make_lua_key(lua);\
+make_lua_key(lua_functions);\
+make_lua_key(luatex);\
+make_lua_key(luatex_node);\
+make_lua_key(mLTL);\
+make_lua_key(mRTT);\
+make_lua_key(mTLT);\
+make_lua_key(mTRT);\
+make_lua_key(mark);\
+make_lua_key(math);\
+make_lua_key(math_choice);\
+make_lua_key(math_left);\
+make_lua_key(math_shift);\
+make_lua_key(mathdir);\
+make_lua_key(mathkern);\
+make_lua_key(mathstyle);\
+make_lua_key(mid);\
+make_lua_key(mode);\
+make_lua_key(modeline);\
+make_lua_key(name);\
+make_lua_key(named_id);\
+make_lua_key(names);\
+make_lua_key(new_graf);\
+make_lua_key(new_window);\
+make_lua_key(next);\
+make_lua_key(no);\
+make_lua_key(no_align);\
+make_lua_key(noad);\
+make_lua_key(node);\
+make_lua_key(node_properties);\
+make_lua_key(node_properties_indirect);\
+make_lua_key(nomath);\
+make_lua_key(nop);\
+make_lua_key(nucleus);\
+make_lua_key(num);\
+make_lua_key(number);\
+make_lua_key(objcompression);\
+make_lua_key(objnum);\
+make_lua_key(omega);\
+make_lua_key(ordering);\
+make_lua_key(output);\
+make_lua_key(pLTL);\
+make_lua_key(pRTT);\
+make_lua_key(pTLT);\
+make_lua_key(pTRT);\
+make_lua_key(page);\
+make_lua_key(page_head);\
+make_lua_key(page_ins_head);\
+make_lua_key(pageattributes);\
+make_lua_key(pageresources);\
+make_lua_key(pagesattributes);\
+make_lua_key(parameters);\
+make_lua_key(pdf_data);\
+make_lua_key(pdftex);\
+make_lua_key(pen_broken);\
+make_lua_key(pen_inter);\
+make_lua_key(penalty);\
+make_lua_key(pop);\
+make_lua_key(post);\
+make_lua_key(pre);\
+make_lua_key(pre_adjust);\
+make_lua_key(pre_adjust_head);\
+make_lua_key(pre_align);\
+make_lua_key(pre_box);\
+make_lua_key(preamble);\
+make_lua_key(prev);\
+make_lua_key(prevdepth);\
+make_lua_key(prevgraf);\
+make_lua_key(psname);\
+make_lua_key(ptr);\
+make_lua_key(push);\
+make_lua_key(quad);\
+make_lua_key(raw);\
+make_lua_key(ref_count);\
+make_lua_key(reg);\
+make_lua_key(registry);\
+make_lua_key(renew);\
+make_lua_key(rep);\
+make_lua_key(replace);\
+make_lua_key(right);\
+make_lua_key(right_boundary);\
+make_lua_key(right_protruding);\
+make_lua_key(rule);\
+make_lua_key(scale);\
+make_lua_key(script);\
+make_lua_key(scriptscript);\
+make_lua_key(semi_simple);\
+make_lua_key(shift);\
+make_lua_key(shrink);\
+make_lua_key(shrink_order);\
+make_lua_key(simple);\
+make_lua_key(size);\
+make_lua_key(skewchar);\
+make_lua_key(slant);\
+make_lua_key(slot);\
+make_lua_key(small_char);\
+make_lua_key(small_fam);\
+make_lua_key(space);\
+make_lua_key(space_shrink);\
+make_lua_key(space_stretch);\
+make_lua_key(spacefactor);\
+make_lua_key(spec);\
+make_lua_key(special);\
+make_lua_key(split_keep);\
+make_lua_key(split_off);\
+make_lua_key(stack);\
+make_lua_key(start);\
+make_lua_key(step);\
+make_lua_key(stream);\
+make_lua_key(streamfile);\
+make_lua_key(stretch);\
+make_lua_key(stretch_order);\
+make_lua_key(string);\
+make_lua_key(style);\
+make_lua_key(sub);\
+make_lua_key(subst_ex_font);\
+make_lua_key(subtype);\
+make_lua_key(sup);\
+make_lua_key(supplement);\
+make_lua_key(surround);\
+make_lua_key(tail);\
+make_lua_key(temp_head);\
+make_lua_key(term);\
+make_lua_key(term_and_log);\
+make_lua_key(tex);\
+make_lua_key(text);\
+make_lua_key(thread_attr);\
+make_lua_key(thread_id);\
+make_lua_key(top);\
+make_lua_key(top_accent);\
+make_lua_key(top_left);\
+make_lua_key(top_right);\
+make_lua_key(tounicode);\
+make_lua_key(trailer);\
+make_lua_key(transform);\
+make_lua_key(type);\
+make_lua_key(uchyph);\
+make_lua_key(umath);\
+make_lua_key(units_per_em);\
+make_lua_key(used);\
+make_lua_key(user_id);\
+make_lua_key(v);\
+make_lua_key(value);\
+make_lua_key(vbox);\
+make_lua_key(vcenter);\
+make_lua_key(version);\
+make_lua_key(vert_variants);\
+make_lua_key(vmode_par);\
+make_lua_key(vtop);\
+make_lua_key(width);\
+make_lua_key(writable);\
+make_lua_key(x_height);\
+make_lua_key(xoffset);\
+make_lua_key(xyz_zoom);\
+make_lua_key(yoffset)
+
+
+ #define set_init_keys \
+init_lua_key(LTL);\
+init_lua_key(MathConstants);\
+init_lua_key(RTT);\
+init_lua_key(TLT);\
+init_lua_key(TRT);\
+init_lua_key(accent);\
+init_lua_key(action);\
+init_lua_key(action_id);\
+init_lua_key(action_type);\
+init_lua_key(additional);\
+init_lua_key(adjust);\
+init_lua_key(adjust_head);\
+init_lua_key(adjusted_hbox);\
+init_lua_key(advance);\
+init_lua_key(after_display);\
+init_lua_key(after_output);\
+init_lua_key(aleph);\
+init_lua_key(align);\
+init_lua_key(align_head);\
+init_lua_key(align_set);\
+init_lua_key(alignment);\
+init_lua_key(annot);\
+init_lua_key(area);\
+init_lua_key(attr);\
+init_lua_key(attributes);\
+init_lua_key(auto_expand);\
+init_lua_key(before_display);\
+init_lua_key(best_ins_ptr);\
+init_lua_key(best_page_break);\
+init_lua_key(best_size);\
+init_lua_key(bot);\
+init_lua_key(bot_accent);\
+init_lua_key(bottom_left);\
+init_lua_key(bottom_right);\
+init_lua_key(box);\
+init_lua_key(box_left);\
+init_lua_key(box_left_width);\
+init_lua_key(box_right);\
+init_lua_key(box_right_width);\
+init_lua_key(broken_ins);\
+init_lua_key(broken_ptr);\
+init_lua_key(cache);\
+init_lua_key(cal_expand_ratio);\
+init_lua_key(catalog);\
+init_lua_key(char);\
+init_lua_key(characters);\
+init_lua_key(checksum);\
+init_lua_key(cidinfo);\
+init_lua_key(class);\
+init_lua_key(command);\
+init_lua_key(commands);\
+init_lua_key(comment);\
+init_lua_key(components);\
+init_lua_key(compresslevel);\
+init_lua_key(contrib_head);\
+init_lua_key(core);\
+init_lua_key(cost);\
+init_lua_key(count);\
+init_lua_key(crampeddisplay);\
+init_lua_key(crampedscript);\
+init_lua_key(crampedscriptscript);\
+init_lua_key(crampedtext);\
+init_lua_key(data);\
+init_lua_key(degree);\
+init_lua_key(delim);\
+init_lua_key(delimptr);\
+init_lua_key(denom);\
+init_lua_key(depth);\
+init_lua_key(designsize);\
+init_lua_key(dest_id);\
+init_lua_key(dest_type);\
+init_lua_key(dir);\
+init_lua_key(dir_h);\
+init_lua_key(direct);\
+init_lua_key(direction);\
+init_lua_key(dirs);\
+init_lua_key(disc);\
+init_lua_key(display);\
+init_lua_key(down);\
+init_lua_key(dvi_ptr);\
+init_lua_key(embedding);\
+init_lua_key(encodingbytes);\
+init_lua_key(encodingname);\
+init_lua_key(end);\
+init_lua_key(etex);\
+init_lua_key(exactly);\
+init_lua_key(expansion_factor);\
+init_lua_key(ext);\
+init_lua_key(extend);\
+init_lua_key(extender);\
+init_lua_key(extensible);\
+init_lua_key(extra_space);\
+init_lua_key(fam);\
+init_lua_key(fast);\
+init_lua_key(file);\
+init_lua_key(filename);\
+init_lua_key(fin_row);\
+init_lua_key(font);\
+init_lua_key(fonts);\
+init_lua_key(format);\
+init_lua_key(fullname);\
+init_lua_key(global);\
+init_lua_key(glue_order);\
+init_lua_key(glue_set);\
+init_lua_key(glue_sign);\
+init_lua_key(glyph);\
+init_lua_key(h);\
+init_lua_key(hbox);\
+init_lua_key(head);\
+init_lua_key(height);\
+init_lua_key(hmode_par);\
+init_lua_key(hold_head);\
+init_lua_key(horiz_variants);\
+init_lua_key(hyphenchar);\
+init_lua_key(id);\
+init_lua_key(image);\
+init_lua_key(immediate);\
+init_lua_key(index);\
+init_lua_key(info);\
+init_lua_key(insert);\
+init_lua_key(italic);\
+init_lua_key(kern);\
+init_lua_key(kerns);\
+init_lua_key(lang);\
+init_lua_key(large_char);\
+init_lua_key(large_fam);\
+init_lua_key(last_ins_ptr);\
+init_lua_key(leader);\
+init_lua_key(least_page_cost);\
+init_lua_key(left);\
+init_lua_key(left_boundary);\
+init_lua_key(left_protruding);\
+init_lua_key(level);\
+init_lua_key(ligatures);\
+init_lua_key(link_attr);\
+init_lua_key(list);\
+init_lua_key(local_box);\
+init_lua_key(log);\
+init_lua_key(lua);\
+init_lua_key(luatex);\
+init_lua_key(mark);\
+init_lua_key(math);\
+init_lua_key(math_choice);\
+init_lua_key(math_left);\
+init_lua_key(math_shift);\
+init_lua_key(mathdir);\
+init_lua_key(mathkern);\
+init_lua_key(mathstyle);\
+init_lua_key(mid);\
+init_lua_key(mode);\
+init_lua_key(modeline);\
+init_lua_key(name);\
+init_lua_key(named_id);\
+init_lua_key(names);\
+init_lua_key(new_graf);\
+init_lua_key(new_window);\
+init_lua_key(next);\
+init_lua_key(no);\
+init_lua_key(no_align);\
+init_lua_key(noad);\
+init_lua_key(node);\
+init_lua_key(nomath);\
+init_lua_key(nop);\
+init_lua_key(nucleus);\
+init_lua_key(num);\
+init_lua_key(number);\
+init_lua_key(objcompression);\
+init_lua_key(objnum);\
+init_lua_key(omega);\
+init_lua_key(ordering);\
+init_lua_key(output);\
+init_lua_key(page);\
+init_lua_key(page_head);\
+init_lua_key(page_ins_head);\
+init_lua_key(pageattributes);\
+init_lua_key(pageresources);\
+init_lua_key(pagesattributes);\
+init_lua_key(parameters);\
+init_lua_key(pdftex);\
+init_lua_key(pen_broken);\
+init_lua_key(pen_inter);\
+init_lua_key(penalty);\
+init_lua_key(pop);\
+init_lua_key(post);\
+init_lua_key(pre);\
+init_lua_key(pre_adjust);\
+init_lua_key(pre_adjust_head);\
+init_lua_key(pre_align);\
+init_lua_key(pre_box);\
+init_lua_key(preamble);\
+init_lua_key(prev);\
+init_lua_key(prevdepth);\
+init_lua_key(prevgraf);\
+init_lua_key(psname);\
+init_lua_key(ptr);\
+init_lua_key(push);\
+init_lua_key(quad);\
+init_lua_key(raw);\
+init_lua_key(ref_count);\
+init_lua_key(reg);\
+init_lua_key(registry);\
+init_lua_key(renew);\
+init_lua_key(rep);\
+init_lua_key(replace);\
+init_lua_key(right);\
+init_lua_key(right_boundary);\
+init_lua_key(right_protruding);\
+init_lua_key(rule);\
+init_lua_key(scale);\
+init_lua_key(script);\
+init_lua_key(scriptscript);\
+init_lua_key(semi_simple);\
+init_lua_key(shift);\
+init_lua_key(shrink);\
+init_lua_key(shrink_order);\
+init_lua_key(simple);\
+init_lua_key(size);\
+init_lua_key(skewchar);\
+init_lua_key(slant);\
+init_lua_key(slot);\
+init_lua_key(small_char);\
+init_lua_key(small_fam);\
+init_lua_key(space);\
+init_lua_key(space_shrink);\
+init_lua_key(space_stretch);\
+init_lua_key(spacefactor);\
+init_lua_key(spec);\
+init_lua_key(special);\
+init_lua_key(split_keep);\
+init_lua_key(split_off);\
+init_lua_key(stack);\
+init_lua_key(start);\
+init_lua_key(step);\
+init_lua_key(stream);\
+init_lua_key(streamfile);\
+init_lua_key(stretch);\
+init_lua_key(stretch_order);\
+init_lua_key(string);\
+init_lua_key(style);\
+init_lua_key(sub);\
+init_lua_key(subst_ex_font);\
+init_lua_key(subtype);\
+init_lua_key(sup);\
+init_lua_key(supplement);\
+init_lua_key(surround);\
+init_lua_key(tail);\
+init_lua_key(temp_head);\
+init_lua_key(term);\
+init_lua_key(tex);\
+init_lua_key(text);\
+init_lua_key(thread_attr);\
+init_lua_key(thread_id);\
+init_lua_key(top);\
+init_lua_key(top_accent);\
+init_lua_key(top_left);\
+init_lua_key(top_right);\
+init_lua_key(tounicode);\
+init_lua_key(trailer);\
+init_lua_key(transform);\
+init_lua_key(type);\
+init_lua_key(uchyph);\
+init_lua_key(umath);\
+init_lua_key(units_per_em);\
+init_lua_key(used);\
+init_lua_key(user_id);\
+init_lua_key(v);\
+init_lua_key(value);\
+init_lua_key(vbox);\
+init_lua_key(vcenter);\
+init_lua_key(version);\
+init_lua_key(vert_variants);\
+init_lua_key(vmode_par);\
+init_lua_key(vtop);\
+init_lua_key(width);\
+init_lua_key(writable);\
+init_lua_key(x_height);\
+init_lua_key(xoffset);\
+init_lua_key(xyz_zoom);\
+init_lua_key(yoffset);\
+init_lua_key_alias(empty_string,"");\
+init_lua_key_alias(lua_functions,"lua.functions");\
+init_lua_key_alias(luatex_node, "luatex.node");\
+init_lua_key_alias(mLTL,"-LTL");\
+init_lua_key_alias(mRTT,"-RTT");\
+init_lua_key_alias(mTLT,"-TLT");\
+init_lua_key_alias(mTRT,"-TRT");\
+init_lua_key_alias(node_properties,"node.properties");\
+init_lua_key_alias(node_properties_indirect,"node.properties.indirect");\
+init_lua_key_alias(pLTL,"+LTL");\
+init_lua_key_alias(pRTT,"+RTT");\
+init_lua_key_alias(pTLT,"+TLT");\
+init_lua_key_alias(pTRT,"+TRT");\
+init_lua_key_alias(pdf_data,"pdf.data");\
+init_lua_key_alias(term_and_log,"term and log")
+
+
+#define assign_math_style(L,n,target) do { \
+ if (lua_isnumber(L,n)) { \
+ /* new, often same as subtype anyway */ \
+ target = lua_tonumber(L,n); \
+ } else if (lua_isstring(L,n)) { \
+ const char *s = lua_tostring(L, n); \
+ if (lua_key_eq(s,display)) { \
+ target = 0; \
+ } else if (lua_key_eq(s,crampeddisplay)) { \
+ target = 1; \
+ } else if (lua_key_eq(s,text)) { \
+ target = 2; \
+ } else if (lua_key_eq(s,crampedtext)) { \
+ target = 3; \
+ } else if (lua_key_eq(s,script)) { \
+ target = 4; \
+ } else if (lua_key_eq(s,crampedscript)) { \
+ target = 5; \
+ } else if (lua_key_eq(s,scriptscript)) { \
+ target = 6; \
+ } else if (lua_key_eq(s,crampedscriptscript)) { \
+ target = 7; \
+ } else { \
+ target = 2; \
+ } \
+ } else { \
+ target = 2; /* text by default */ \
+ } \
+} while(0)
+
#endif /* LUATEX_API_H */
-/* */
+/* */
/* These keys have to available to different files */
-/* */
+/* */
use_lua_key(LTL);
@@ -294,14 +1019,23 @@ use_lua_key(action);
use_lua_key(action_id);
use_lua_key(action_type);
use_lua_key(additional);
+use_lua_key(adjust);
use_lua_key(adjust_head);
+use_lua_key(adjusted_hbox);
use_lua_key(advance);
+use_lua_key(after_display);
+use_lua_key(after_output);
use_lua_key(aleph);
+use_lua_key(align);
use_lua_key(align_head);
+use_lua_key(align_set);
+use_lua_key(alignment);
+use_lua_key(annot);
use_lua_key(area);
use_lua_key(attr);
use_lua_key(attributes);
use_lua_key(auto_expand);
+use_lua_key(before_display);
use_lua_key(best_ins_ptr);
use_lua_key(best_page_break);
use_lua_key(best_size);
@@ -309,6 +1043,7 @@ use_lua_key(bot);
use_lua_key(bot_accent);
use_lua_key(bottom_left);
use_lua_key(bottom_right);
+use_lua_key(box);
use_lua_key(box_left);
use_lua_key(box_left_width);
use_lua_key(box_right);
@@ -317,6 +1052,7 @@ use_lua_key(broken_ins);
use_lua_key(broken_ptr);
use_lua_key(cache);
use_lua_key(cal_expand_ratio);
+use_lua_key(catalog);
use_lua_key(char);
use_lua_key(characters);
use_lua_key(checksum);
@@ -326,10 +1062,15 @@ use_lua_key(command);
use_lua_key(commands);
use_lua_key(comment);
use_lua_key(components);
+use_lua_key(compresslevel);
use_lua_key(contrib_head);
use_lua_key(core);
use_lua_key(cost);
use_lua_key(count);
+use_lua_key(crampeddisplay);
+use_lua_key(crampedscript);
+use_lua_key(crampedscriptscript);
+use_lua_key(crampedtext);
use_lua_key(data);
use_lua_key(degree);
use_lua_key(delim);
@@ -341,12 +1082,15 @@ use_lua_key(dest_id);
use_lua_key(dest_type);
use_lua_key(dir);
use_lua_key(dir_h);
+use_lua_key(direct);
use_lua_key(direction);
use_lua_key(dirs);
+use_lua_key(disc);
use_lua_key(display);
use_lua_key(down);
use_lua_key(dvi_ptr);
use_lua_key(embedding);
+use_lua_key(empty_string);
use_lua_key(encodingbytes);
use_lua_key(encodingname);
use_lua_key(end);
@@ -362,6 +1106,7 @@ use_lua_key(fam);
use_lua_key(fast);
use_lua_key(file);
use_lua_key(filename);
+use_lua_key(fin_row);
use_lua_key(font);
use_lua_key(fonts);
use_lua_key(format);
@@ -371,14 +1116,20 @@ use_lua_key(glue_order);
use_lua_key(glue_set);
use_lua_key(glue_sign);
use_lua_key(glyph);
+use_lua_key(h);
+use_lua_key(hbox);
use_lua_key(head);
use_lua_key(height);
+use_lua_key(hmode_par);
use_lua_key(hold_head);
use_lua_key(horiz_variants);
use_lua_key(hyphenchar);
use_lua_key(id);
use_lua_key(image);
+use_lua_key(immediate);
use_lua_key(index);
+use_lua_key(info);
+use_lua_key(insert);
use_lua_key(italic);
use_lua_key(kern);
use_lua_key(kerns);
@@ -395,8 +1146,10 @@ use_lua_key(level);
use_lua_key(ligatures);
use_lua_key(link_attr);
use_lua_key(list);
+use_lua_key(local_box);
use_lua_key(log);
use_lua_key(lua);
+use_lua_key(lua_functions);
use_lua_key(luatex);
use_lua_key(luatex_node);
use_lua_key(mLTL);
@@ -404,6 +1157,10 @@ use_lua_key(mRTT);
use_lua_key(mTLT);
use_lua_key(mTRT);
use_lua_key(mark);
+use_lua_key(math);
+use_lua_key(math_choice);
+use_lua_key(math_left);
+use_lua_key(math_shift);
use_lua_key(mathdir);
use_lua_key(mathkern);
use_lua_key(mathstyle);
@@ -412,9 +1169,12 @@ use_lua_key(mode);
use_lua_key(modeline);
use_lua_key(name);
use_lua_key(named_id);
+use_lua_key(names);
+use_lua_key(new_graf);
use_lua_key(new_window);
use_lua_key(next);
use_lua_key(no);
+use_lua_key(no_align);
use_lua_key(noad);
use_lua_key(node);
use_lua_key(node_properties);
@@ -424,16 +1184,23 @@ use_lua_key(nop);
use_lua_key(nucleus);
use_lua_key(num);
use_lua_key(number);
+use_lua_key(objcompression);
use_lua_key(objnum);
use_lua_key(omega);
use_lua_key(ordering);
+use_lua_key(output);
use_lua_key(pLTL);
use_lua_key(pRTT);
use_lua_key(pTLT);
use_lua_key(pTRT);
+use_lua_key(page);
use_lua_key(page_head);
use_lua_key(page_ins_head);
+use_lua_key(pageattributes);
+use_lua_key(pageresources);
+use_lua_key(pagesattributes);
use_lua_key(parameters);
+use_lua_key(pdf_data);
use_lua_key(pdftex);
use_lua_key(pen_broken);
use_lua_key(pen_inter);
@@ -441,7 +1208,11 @@ use_lua_key(penalty);
use_lua_key(pop);
use_lua_key(post);
use_lua_key(pre);
+use_lua_key(pre_adjust);
use_lua_key(pre_adjust_head);
+use_lua_key(pre_align);
+use_lua_key(pre_box);
+use_lua_key(preamble);
use_lua_key(prev);
use_lua_key(prevdepth);
use_lua_key(prevgraf);
@@ -449,6 +1220,7 @@ use_lua_key(psname);
use_lua_key(ptr);
use_lua_key(push);
use_lua_key(quad);
+use_lua_key(raw);
use_lua_key(ref_count);
use_lua_key(reg);
use_lua_key(registry);
@@ -462,9 +1234,11 @@ use_lua_key(rule);
use_lua_key(scale);
use_lua_key(script);
use_lua_key(scriptscript);
+use_lua_key(semi_simple);
use_lua_key(shift);
use_lua_key(shrink);
use_lua_key(shrink_order);
+use_lua_key(simple);
use_lua_key(size);
use_lua_key(skewchar);
use_lua_key(slant);
@@ -477,10 +1251,13 @@ use_lua_key(space_stretch);
use_lua_key(spacefactor);
use_lua_key(spec);
use_lua_key(special);
+use_lua_key(split_keep);
+use_lua_key(split_off);
use_lua_key(stack);
use_lua_key(start);
use_lua_key(step);
use_lua_key(stream);
+use_lua_key(streamfile);
use_lua_key(stretch);
use_lua_key(stretch_order);
use_lua_key(string);
@@ -504,6 +1281,7 @@ use_lua_key(top_accent);
use_lua_key(top_left);
use_lua_key(top_right);
use_lua_key(tounicode);
+use_lua_key(trailer);
use_lua_key(transform);
use_lua_key(type);
use_lua_key(uchyph);
@@ -511,24 +1289,17 @@ use_lua_key(umath);
use_lua_key(units_per_em);
use_lua_key(used);
use_lua_key(user_id);
+use_lua_key(v);
use_lua_key(value);
+use_lua_key(vbox);
+use_lua_key(vcenter);
use_lua_key(version);
use_lua_key(vert_variants);
+use_lua_key(vmode_par);
+use_lua_key(vtop);
use_lua_key(width);
use_lua_key(writable);
use_lua_key(x_height);
use_lua_key(xoffset);
use_lua_key(xyz_zoom);
use_lua_key(yoffset);
-
-use_lua_key(immediate);
-use_lua_key(compresslevel);
-use_lua_key(objcompression);
-use_lua_key(direct);
-use_lua_key(page);
-use_lua_key(streamfile);
-use_lua_key(annot);
-use_lua_key(lua_functions);
-
-
-
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
index 78ec29e3b34..ad371665df3 100644
--- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1 +1 @@
-#define luatex_svn_revision 4903
+#define luatex_svn_revision 4914
diff --git a/Build/source/texk/web2c/luatexdir/luatexcallbackids.h b/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
index 8a8b3baa253..c05e4f6024e 100644
--- a/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
+++ b/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: luatexcallbackids.h 4877 2014-03-14 01:26:05Z luigi $ */
+/* $Id: luatexcallbackids.h 4956 2014-03-28 12:12:17Z luigi $ */
#ifndef LUATEXCALLBACKIDS_H
#define LUATEXCALLBACKIDS_H
@@ -60,6 +60,8 @@ typedef enum {
finish_pdffile_callback,
finish_pdfpage_callback,
pre_dump_callback,
+ start_file_callback, stop_file_callback,
+ show_error_message_callback,show_lua_error_hook_callback,
total_callbacks
} callback_callback_types;
@@ -94,5 +96,48 @@ extern char *get_lua_name(int i);
extern char *luatex_find_file(const char *s, int callback_index);
extern int readbinfile(FILE * f, unsigned char **b, int *s);
+#define filetype_unknown 0
+#define filetype_tex 1
+#define filetype_map 2
+#define filetype_image 3
+#define filetype_subset 4
+#define filetype_font 5
+
+static const char *const filetypes_left[] = { "?", "(", "{", "<", "<", "<<" } ;
+static const char *const filetypes_right[] = { "?", ")", "}", ">", ">", ">>" } ;
+
+#define report_start_file(left,name) do { \
+ if (tracefilenames) { \
+ int report_id = callback_defined(start_file_callback); \
+ if (report_id == 0) { \
+ if (left == 1) { \
+ /* we only do this for traditional name reporting, normally name is iname */ \
+ if (term_offset + strlen(name) > max_print_line - 2) \
+ print_ln(); \
+ else if ((term_offset > 0) || (file_offset > 0)) \
+ print_char(' '); \
+ tex_printf("%s", filetypes_left[left]); \
+ tprint_file_name(NULL, (unsigned char *) name, NULL); \
+ } else { \
+ tex_printf("%s", filetypes_left[left]); \
+ tex_printf("%s", (unsigned char *) name); \
+ } \
+ } else { \
+ /* (void) run_callback(report_id, "dS->",left,(unsigned char *) fullnameoffile); */ \
+ (void) run_callback(report_id, "dS->",left,name); \
+ } \
+ } \
+} while (0)
+
+#define report_stop_file(right) do { \
+ if (tracefilenames) { \
+ int report_id = callback_defined(stop_file_callback); \
+ if (report_id == 0) { \
+ tex_printf("%s", filetypes_right[right]); \
+ } else { \
+ (void) run_callback(report_id, "d->",right); \
+ } \
+ } \
+} while (0)
#endif
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w b/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w
index 7b0c7261713..fbb103add26 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfdest.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: pdfdest.w 4448 2012-06-21 15:07:03Z taco $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/pdf/pdfdest.w $";
+ "$Id: pdfdest.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdfdest.w $";
#include "ptexlib.h"
@@ -404,6 +404,7 @@ int output_name_tree(PDF pdf)
delete_token_ref(pdf_names_toks);
pdf_names_toks = null;
}
+ print_pdf_table_string(pdf, "names");
pdf_end_dict(pdf);
pdf_end_obj(pdf);
return m;
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdffont.w b/Build/source/texk/web2c/luatexdir/pdf/pdffont.w
index 967869b318c..20dba5e2fd5 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdffont.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdffont.w
@@ -21,7 +21,7 @@
@ @c
static const char _svn_version[] =
- "$Id: pdffont.w 4710 2014-01-02 13:26:55Z oneiros $"
+ "$Id: pdffont.w 4934 2014-03-26 08:17:27Z taco $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdffont.w $";
#include "ptexlib.h"
@@ -51,6 +51,10 @@ scaled_whd output_one_char(PDF pdf, halfword p)
int c = character(p);
int ex_glyph = ex_glyph(p)/1000;
ci = get_charinfo_whd(f, c);
+ if (!(char_exists(f,c))) {
+ char_warning(f,c);
+ return ci;
+ }
//ci.wd = round_xn_over_d(ci.wd, 1000 + ex_glyph, 1000);
ci.wd = ext_xn_over_d(ci.wd, 1000000 + ex_glyph(p), 1000000);
switch (pdf->posstruct->dir) {
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
index 89fca3af9dd..9e2bee44f99 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: pdfgen.h 4679 2013-12-19 15:47:53Z luigi $ */
+/* $Id: pdfgen.h 4956 2014-03-28 12:12:17Z luigi $ */
#ifndef PDFGEN_H
# define PDFGEN_H
@@ -197,6 +197,7 @@ extern char *get_resname_prefix(PDF);
extern void pdf_begin_page(PDF pdf);
extern void pdf_end_page(PDF pdf);
extern void print_pdf_table_string(PDF pdf, const char *s);
+extern char *get_pdf_table_string(const char *s);
extern int get_pdf_table_bool(PDF, const char *, int);
extern void fix_o_mode(PDF pdf);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
index bfda9102e7b..7d6b74fd09c 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: pdfgen.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: pdfgen.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdfgen.w $";
#include "ptexlib.h"
@@ -1884,9 +1884,10 @@ void print_pdf_table_string(PDF pdf, const char *s)
{
size_t len;
const char *ls;
- lua_getglobal(Luas, "pdf"); /* t ... */
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, lua_key_index(pdf_data));
+ lua_rawget(Luas, LUA_REGISTRYINDEX);
lua_pushstring(Luas, s); /* s t ... */
- lua_gettable(Luas, -2); /* s? t ... */
+ lua_rawget(Luas, -2); /* s? t ... */
if (lua_isstring(Luas, -1)) { /* s t ... */
ls = lua_tolstring(Luas, -1, &len);
if (len > 0) {
@@ -1900,6 +1901,23 @@ void print_pdf_table_string(PDF pdf, const char *s)
}
@ @c
+char *get_pdf_table_string(const char *s)
+{
+ const_lstring ls;
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, lua_key_index(pdf_data));
+ lua_rawget(Luas, LUA_REGISTRYINDEX);
+ lua_pushstring(Luas, s); /* s t ... */
+ lua_rawget(Luas, -2); /* s? t ... */
+ if (lua_isstring(Luas, -1)) { /* s t ... */
+ ls.s = lua_tolstring(Luas, -1, &ls.l);
+ lua_pop(Luas, 2); /* ... */
+ return (char *)ls.s;
+ }
+ lua_pop(Luas, 2); /* ... */
+ return NULL ;
+}
+
+@ @c
#define pdf_page_attr equiv(pdf_page_attr_loc)
#define pdf_page_resources equiv(pdf_page_resources_loc)
@@ -2247,6 +2265,7 @@ static int pdf_print_info(PDF pdf, int luatexversion,
boolean creator_given, producer_given, creationdate_given, moddate_given,
trapped_given;
char *s = NULL;
+ char *p = NULL;
int k, len = 0;
k = pdf_create_obj(pdf, obj_type_info, 0);
pdf_begin_obj(pdf, k, 3); /* keep Info readable unless explicitely forced */
@@ -2264,16 +2283,13 @@ static int pdf_print_info(PDF pdf, int luatexversion,
moddate_given = substr_of_str("/ModDate", s);
trapped_given = substr_of_str("/Trapped", s);
}
- if (!producer_given) {
- /* Print the Producer key */
- pdf_add_name(pdf, "Producer");
- pdf_puts(pdf, " (LuaTeX-");
- pdf_print_int(pdf, luatexversion / 100);
- pdf_out(pdf, '.');
- pdf_print_int(pdf, luatexversion % 100);
- pdf_out(pdf, '.');
- pdf_print(pdf, luatexrevision);
- pdf_out(pdf, ')');
+ p = get_pdf_table_string("info");
+ if (strlen(p) > 0) {
+ creator_given = creator_given || substr_of_str("/Creator", p);
+ producer_given = producer_given || substr_of_str("/Producer", p);
+ creationdate_given = creationdate_given || substr_of_str("/CreationDate", p);
+ moddate_given = moddate_given || substr_of_str("/ModDate", p);
+ trapped_given = trapped_given || substr_of_str("/Trapped", p);
}
if (pdf_info_toks != null) {
if (len > 0) {
@@ -2285,6 +2301,22 @@ static int pdf_print_info(PDF pdf, int luatexversion,
delete_token_ref(pdf_info_toks);
pdf_info_toks = null;
}
+ if (strlen(p) > 0) {
+ pdf_out(pdf, '\n');
+ pdf_puts(pdf, p); /* no free, pointer */
+ pdf_out(pdf, '\n');
+ }
+ if (!producer_given) {
+ /* Print the Producer key */
+ pdf_add_name(pdf, "Producer");
+ pdf_puts(pdf, " (LuaTeX-");
+ pdf_print_int(pdf, luatexversion / 100);
+ pdf_out(pdf, '.');
+ pdf_print_int(pdf, luatexversion % 100);
+ pdf_out(pdf, '.');
+ pdf_print(pdf, luatexrevision);
+ pdf_out(pdf, ')');
+ }
if (!creator_given)
pdf_dict_add_string(pdf, "Creator", "TeX");
if (!creationdate_given) {
@@ -2443,6 +2475,7 @@ void finish_pdf_file(PDF pdf, int luatexversion, str_number luatexrevision)
delete_token_ref(pdf_catalog_toks);
pdf_catalog_toks = null;
}
+ print_pdf_table_string(pdf, "catalog");
if (pdf_catalog_openaction != 0)
pdf_dict_add_ref(pdf, "OpenAction", pdf_catalog_openaction);
pdf_end_dict(pdf);
@@ -2490,6 +2523,7 @@ void finish_pdf_file(PDF pdf, int luatexversion, str_number luatexrevision)
delete_token_ref(pdf_trailer_toks);
pdf_trailer_toks = null;
}
+ print_pdf_table_string(pdf, "trailer");
print_ID(pdf);
pdf_dict_add_streaminfo(pdf);
pdf_end_dict(pdf);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w b/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w
index 8d5708d1027..d35d91578d9 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfpagetree.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: pdfpagetree.w 4634 2013-04-21 14:45:45Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/pdf/pdfpagetree.w $";
+ "$Id: pdfpagetree.w 4957 2014-03-28 13:14:51Z taco $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/pdf/pdfpagetree.w $";
#include "ptexlib.h"
@@ -226,6 +226,7 @@ static void write_pages(PDF pdf, pages_entry * p, int parent)
pdf_out(pdf, ' ');
}
print_pdf_table_string(pdf, "pagesattributes");
+ pdf_out(pdf, ' ');
} else
pdf_dict_add_ref(pdf, "Parent", parent);
pdf_dict_add_int(pdf, "Count", (int) p->number_of_pages);
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h b/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h
index c1671f4f0aa..acc6f1aa66f 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfthread.h
@@ -17,10 +17,10 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: pdfthread.h 3905 2010-10-02 20:29:20Z hhenkel $ */
+/* $Id: pdfthread.h 4935 2014-03-26 08:17:57Z taco $ */
#ifndef PDFTHREAD_H
-# define PDFTHREADH
+# define PDFTHREAD_H
/* data structure of threads; words 1..4 represent the coordinates of the corners */
diff --git a/Build/source/texk/web2c/luatexdir/ptexlib.h b/Build/source/texk/web2c/luatexdir/ptexlib.h
index 994856533b4..98bc822ef11 100644
--- a/Build/source/texk/web2c/luatexdir/ptexlib.h
+++ b/Build/source/texk/web2c/luatexdir/ptexlib.h
@@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: ptexlib.h 4877 2014-03-14 01:26:05Z luigi $ */
+/* $Id: ptexlib.h 4911 2014-03-20 14:00:02Z luigi $ */
#ifndef PTEXLIB_H
# define PTEXLIB_H
@@ -265,7 +265,9 @@ void free_pdf_literal(pointer p);
void show_pdf_literal(pointer p);
void copy_late_lua(pointer r, pointer p);
+void copy_user_lua(pointer r, pointer p);
void free_late_lua(pointer p);
+void free_user_lua(pointer p);
void show_late_lua(pointer p);
void load_tex_patterns(int curlang, halfword head);
diff --git a/Build/source/texk/web2c/luatexdir/tex/align.w b/Build/source/texk/web2c/luatexdir/tex/align.w
index 8330f03642e..de80cc0a093 100644
--- a/Build/source/texk/web2c/luatexdir/tex/align.w
+++ b/Build/source/texk/web2c/luatexdir/tex/align.w
@@ -21,8 +21,8 @@
@ @c
static const char _svn_version[] =
- "$Id: align.w 4442 2012-05-25 22:40:34Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/align.w $";
+ "$Id: align.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/align.w $";
#include "ptexlib.h"
@@ -1140,7 +1140,8 @@ value is changed to zero and so is the next tabskip.
cur_list.tail_field = q;
if (cur_list.mode_field == vmode) {
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "alignment");
+ // lua_node_filter_s(buildpage_filter_callback, "alignment");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(alignment));
build_page();
}
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/buildpage.w b/Build/source/texk/web2c/luatexdir/tex/buildpage.w
index 2623d66f90f..5e96e701c71 100644
--- a/Build/source/texk/web2c/luatexdir/tex/buildpage.w
+++ b/Build/source/texk/web2c/luatexdir/tex/buildpage.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: buildpage.w 4442 2012-05-25 22:40:34Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/buildpage.w $";
+ "$Id: buildpage.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/buildpage.w $";
#include "ptexlib.h"
@@ -1053,7 +1053,8 @@ void resume_after_output(void)
flush_node_list(page_disc);
page_disc = null;
pop_nest();
- lua_node_filter_s(buildpage_filter_callback, "after_output");
- build_page();
+ //lua_node_filter_s(buildpage_filter_callback, "after_output");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(after_output));
+ build_page();
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.w b/Build/source/texk/web2c/luatexdir/tex/directions.w
index a859540ba09..704f8ff2508 100644
--- a/Build/source/texk/web2c/luatexdir/tex/directions.w
+++ b/Build/source/texk/web2c/luatexdir/tex/directions.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: directions.w 4709 2014-01-02 13:24:29Z oneiros $"
+ "$Id: directions.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/directions.w $";
#include "ptexlib.h"
@@ -56,7 +56,7 @@ void scan_direction(void)
cur_chr = save_cur_chr;
}
-@ the next two are used by postlinebreak.c
+@ the next two are used by postlinebreak.c
@c
halfword do_push_dir_node(halfword p, halfword a)
@@ -103,21 +103,21 @@ about the actual values of |dir_TRT| etc.
@c
const char *dir_strings[128] = {
- "-TLT","???", "???", "???", "-TRT","???", "???", "???",
- "???", "-LTL","???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "-RTT","???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "+TLT","???", "???", "???", "+TRT","???", "???", "???",
- "???", "+LTL","???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "+RTT","???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
+ "-TLT","???", "???", "???", "-TRT","???", "???", "???",
+ "???", "-LTL","???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "-RTT","???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "+TLT","???", "???", "???", "+TRT","???", "???", "???",
+ "???", "+LTL","???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "+RTT","???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
"???", "???", "???", "???", "???", "???", "???", "???" };
const char *string_dir(int d)
@@ -129,6 +129,8 @@ const char *string_dir(int d)
@ @c
void print_dir(int d)
{
+ /* hh-ls: todo: just fetch the string pt from the registry ... then the above can go */
+
tprint(string_dir(d));
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.h b/Build/source/texk/web2c/luatexdir/tex/errors.h
index 2d55e31aa75..e0ea6e671ad 100644
--- a/Build/source/texk/web2c/luatexdir/tex/errors.h
+++ b/Build/source/texk/web2c/luatexdir/tex/errors.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: errors.h 3385 2010-01-26 05:45:55Z taco $ */
+/* $Id: errors.h 4956 2014-03-28 12:12:17Z luigi $ */
#ifndef ERRORS_H
# define ERRORS_H
@@ -37,9 +37,10 @@ typedef enum {
extern int interaction; /* current level of interaction */
extern int interactionoption; /* set from command line */
-extern const char *last_error;
extern void initialize_errors(void);
+
+extern char *last_error;
extern void print_err(const char *s);
extern void fixup_selector(boolean log_opened);
diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.w b/Build/source/texk/web2c/luatexdir/tex/errors.w
index 7c2601930c1..120d44b8a3c 100644
--- a/Build/source/texk/web2c/luatexdir/tex/errors.w
+++ b/Build/source/texk/web2c/luatexdir/tex/errors.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: errors.w 4563 2013-01-21 03:22:53Z khaled $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/errors.w $";
+ "$Id: errors.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/errors.w $";
#include "ptexlib.h"
@@ -53,22 +53,64 @@ message may be printed.
@c
int interaction; /* current level of interaction */
int interactionoption; /* set from command line */
-const char *last_error;
+
+/* ls-hh: so, new code only kicks in when we have a callback defined */
+
+char *last_error = NULL;
+int err_old_setting = 0 ;
+int in_error = 0 ;
+
+static void flush_err(void)
+{
+ str_number s_error;
+ char *s = NULL;
+ int callback_id ;
+ if (in_error) {
+ selector = err_old_setting;
+ str_room(1);
+ s_error = make_string();
+ s = makecstring(s_error);
+ flush_str(s_error);
+ if (interaction == error_stop_mode) {
+ wake_up_terminal();
+ }
+ xfree(last_error);
+ last_error = (string) xmalloc((unsigned) (strlen(s) + 1));
+ strcpy(last_error,s);
+ callback_id = callback_defined(show_error_message_callback);
+ if (callback_id > 0) {
+ run_callback(callback_id, "->");
+ } else {
+ tprint(s);
+ }
+ in_error = 0 ;
+ }
+}
void print_err(const char *s)
{
+ int callback_id = callback_defined(show_error_message_callback);
if (interaction == error_stop_mode) {
wake_up_terminal();
}
- if (filelineerrorstylep)
+ if (callback_id > 0) {
+ err_old_setting = selector;
+ selector = new_string;
+ in_error = 1 ;
+ }
+ if (filelineerrorstylep) {
print_file_line();
- else
+ } else {
tprint_nl("! ");
+ }
tprint(s);
- last_error = (const char *) s;
+ if (callback_id <= 0) {
+ xfree(last_error);
+ last_error = (string) xmalloc((unsigned) (strlen(s) + 1));
+ strcpy(last_error,s);
+ }
}
-
@ \TeX\ is careful not to call |error| when the print |selector| setting
might be unusual. The only possible values of |selector| at the time of
error messages are
@@ -142,7 +184,7 @@ occurs while \TeX\ is trying to fix a non-fatal one. But such recursion
@^recursion@>
is never more than two levels deep.
-@ Individual lines of help are recorded in the array |help_line|.
+@ Individual lines of help are recorded in the array |help_line|.
@c
const char *help_line[7]; /* helps for the next |error| */
@@ -178,13 +220,16 @@ void error(void)
int callback_id;
int s1, s2, s3, s4; /* used to save global variables when deleting tokens */
int i;
+ flush_err(); /* hh-ls */
if (history < error_message_issued)
history = error_message_issued;
- print_char('.');
callback_id = callback_defined(show_error_hook_callback);
- if (callback_id > 0)
+ if (callback_id > 0) {
run_callback(callback_id, "->");
- show_context();
+ } else {
+ print_char('.');
+ show_context();
+ }
if (haltonerrorp) {
history = fatal_error_stop;
jump_out();
@@ -440,10 +485,16 @@ void fatal_error(const char *s)
void lua_norm_error(const char *s)
{ /* lua found a problem */
int saved_new_line_char;
+ int report_id ;
saved_new_line_char = new_line_char;
new_line_char = 10;
- print_err("LuaTeX error ");
- tprint(s);
+ report_id = callback_defined(show_lua_error_hook_callback);
+ if (report_id == 0) {
+ print_err("LuaTeX error ");
+ tprint(s);
+ } else {
+ (void) run_callback(report_id, "->");
+ }
help2("The lua interpreter ran into a problem, so the",
"remainder of this lua chunk will be ignored.");
error();
diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.w b/Build/source/texk/web2c/luatexdir/tex/mainbody.w
index 9aada03cf30..4fe5f20c30b 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mainbody.w
+++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.w
@@ -23,12 +23,12 @@
@ @c
static const char _svn_version[] =
- "$Id: mainbody.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: mainbody.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mainbody.w $";
#include "ptexlib.h"
-@
+@
pdfTeX is copyright (C) 1996-2006 Han The Thanh, <thanh@@pdftex.org>.
e-TeX is copyright (C) 1994,98 by Peter Breitenlohner.
@@ -590,8 +590,7 @@ void final_cleanup(void)
else
end_file_reading();
while (open_parens > 0) {
- if (tracefilenames)
- tprint(" )");
+ report_stop_file(filetype_tex);
decr(open_parens);
}
if (cur_level > level_one) {
@@ -647,7 +646,7 @@ void final_cleanup(void)
}
@ Once \TeX\ is working, you should be able to diagnose most errors with
-the \.{\\show} commands and other diagnostic features.
+the \.{\\show} commands and other diagnostic features.
An additional routine called |debug_help|
will come into play when you type `\.D' after an error message;
|debug_help| also occurs just before a fatal error causes \TeX\ to succumb.
diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
index 305def96472..5ee630dc24d 100644
--- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
+++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
@@ -19,10 +19,11 @@
@ @c
static const char _svn_version[] =
- "$Id: maincontrol.w 4562 2013-01-21 02:58:59Z khaled $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/maincontrol.w $";
+ "$Id: maincontrol.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/maincontrol.w $";
#include "ptexlib.h"
+#include "lua/luatex-api.h"
@ @c
#define explicit 1
@@ -97,7 +98,7 @@ static const char _svn_version[] =
#define prev_graf cur_list.pg_field
#define dir_save cur_list.dirs_field
-#define check_filter(A) if (!output_active) lua_node_filter_s(buildpage_filter_callback,(A))
+#define check_filter(A) if (!output_active) lua_node_filter_s(buildpage_filter_callback,lua_key_index(A))
#define var_code 7 /* math code meaning ``use the current family'' */
@@ -196,21 +197,21 @@ Here are all the functions that are called from |main_control| that
are not already defined elsewhere. For the moment, this list simply
in the order that the appear in |init_main_control|, below.
-@
+@
@c
static void run_char_num (void) {
scan_char_num();
cur_chr = cur_val;
adjust_space_factor();
tail_append(new_char(cur_font, cur_chr));
-}
+}
static void run_char (void) {
adjust_space_factor();
tail_append(new_char(cur_font, cur_chr));
}
-@
+@
The occurrence of blank spaces is almost part of \TeX's inner loop,
since we usually encounter about one space for every five non-blank characters.
Therefore |main_control| gives second-highest priority to ordinary spaces.
@@ -281,9 +282,9 @@ static void run_relax (void) {
return;
}
-@ |ignore_spaces| is a special case: after it has acted, |get_x_token| has already
+@ |ignore_spaces| is a special case: after it has acted, |get_x_token| has already
fetched the next token from the input, so that operation in |main_control|
-should be skipped.
+should be skipped.
@c
static void run_ignore_spaces (void) {
@@ -478,13 +479,13 @@ static void run_new_graf (void) {
@ A paragraph ends when a |par_end| command is sensed, or when we are in
horizontal mode when reaching the right brace of vertical-mode routines
-like \.{\\vbox}, \.{\\insert}, or \.{\\output}.
-
+like \.{\\vbox}, \.{\\insert}, or \.{\\output}.
+
@c
static void run_par_end_vmode (void) {
normal_paragraph();
if (mode > 0) {
- check_filter("vmode_par");
+ check_filter(vmode_par);
build_page();
}
}
@@ -495,7 +496,7 @@ static void run_par_end_hmode (void) {
off_save(); /* this tries to recover from an alignment that didn't end properly */
end_graf(bottom_level); /* this takes us to the enclosing mode, if |mode>0| */
if (mode == vmode) {
- check_filter("hmode_par");
+ check_filter(hmode_par);
build_page();
}
}
@@ -642,7 +643,7 @@ it makes sense ot have a macro for that as well.
@c
#define any_mode(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B; jump_table[mmode+(A)]=B
-#define non_math(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B;
+#define non_math(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B;
@ The |main_control| uses a jump table, and |init_main_control| sets that table up.
@@ -882,7 +883,7 @@ void main_control(void)
show_cur_cmd_chr();
(jump_table[(abs(mode) + cur_cmd)])(); /* run the command */
-
+
if (main_control_state == goto_return) {
return;
}
@@ -941,7 +942,7 @@ void you_cant(void)
print_in_mode(mode);
}
-@
+@
When erroneous situations arise, \TeX\ usually issues an error message
specific to the particular error. For example, `\.{\\noalign}' should
not appear in any mode, since it is recognized by the |align_peek| routine
@@ -1001,7 +1002,7 @@ boolean its_all_over(void)
width(tail) = hsize;
tail_append(new_glue(fill_glue));
tail_append(new_penalty(-010000000000));
- lua_node_filter_s(buildpage_filter_callback, "end");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(end));
build_page(); /* append \.{\\hbox to \\hsize\{\}\\vfill\\penalty-'10000000000} */
}
return false;
@@ -1199,7 +1200,7 @@ void handle_right_brace(void)
list_ptr(p) = null;
flush_node(p);
if (nest_ptr == 0) {
- check_filter("insert");
+ check_filter(insert);
build_page();
}
break;
@@ -1328,7 +1329,7 @@ void box_end(int box_context)
adjust_tail = null;
}
if (mode > 0) {
- check_filter("box");
+ check_filter(box);
build_page();
}
} else {
@@ -1444,7 +1445,7 @@ void new_graf(boolean indented)
if (every_par != null)
begin_token_list(every_par, every_par_text);
if (nest_ptr == 1) {
- check_filter("new_graf");
+ check_filter(new_graf);
build_page(); /* put |par_skip| glue on current page */
}
}
@@ -1582,7 +1583,7 @@ void append_penalty(void)
scan_int();
tail_append(new_penalty(cur_val));
if (mode == vmode) {
- check_filter("penalty");
+ check_filter(penalty);
build_page();
}
}
@@ -1596,7 +1597,7 @@ appears at the tail of the current list, using a brute-force linear scan.
Like \.{\\lastbox}, this command is not allowed in vertical mode (except
internal vertical mode), since the current list in vertical mode is sent
to the page builder. But if we happen to be able to implement it in
-vertical mode, we do.
+vertical mode, we do.
@c
void delete_last(void)
@@ -1694,7 +1695,7 @@ void unpackage(void)
}
}
-@
+@
Italic corrections are converted to kern nodes when the |ital_corr| command
follows a character. In math mode the same effect is achieved by appending
a kern of zero here, since italic corrections are supplied later.
@@ -2051,7 +2052,7 @@ void do_endv(void)
}
}
-@ Finally, \.{\\endcsname} is not supposed to get through to |main_control|.
+@ Finally, \.{\\endcsname} is not supposed to get through to |main_control|.
@c
void cs_error(void)
@@ -2383,8 +2384,8 @@ void prefixed_command(void)
break;
case int_base + text_direction_code:
#if 0
- /* various tests hint that this is unnecessary and
- * sometimes even produces weird results, eg
+ /* various tests hint that this is unnecessary and
+ * sometimes even produces weird results, eg
* (\hbox{\textdir TRT ABC\textdir TLT DEF})
* becomes
* (DEFCBA)
diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
index 5d8f77eedf7..ef769f7a357 100644
--- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
+++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: postlinebreak.w 4457 2012-07-13 13:16:19Z taco $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/postlinebreak.w $";
+ "$Id: postlinebreak.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/postlinebreak.w $";
#include "ptexlib.h"
@@ -441,20 +441,20 @@ void ext_post_line_break(int paragraph_dir,
if ((vlink(contrib_head) != null))
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "pre_box");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(pre_box));
if (pre_adjust_head != pre_adjust_tail) {
append_list(pre_adjust_head, pre_adjust_tail);
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "pre_adjust");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(pre_adjust));
}
pre_adjust_tail = null;
append_to_vlist(just_box);
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "box");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(box));
if (adjust_head != adjust_tail) {
append_list(adjust_head, adjust_tail);
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "adjust");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(adjust));
}
adjust_tail = null;
diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.w b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
index 3a7ab5578c0..f6314e3f181 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texfileio.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: texfileio.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: texfileio.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texfileio.w $";
#include "ptexlib.h"
@@ -30,7 +30,7 @@ static const char _svn_version[] =
@ @c
#define end_line_char int_par(end_line_char_code)
-
+
@ The bane of portability is the fact that different operating systems treat
input and output quite differently, perhaps because computer scientists
have not given sufficient attention to this problem. People have felt somehow
@@ -66,7 +66,7 @@ for us to specify simple operations on word files before they are defined.
@ We finally did away with |nameoffile| and |namelength|, but the variables
have to be kept otherwise there will be link errors from |openclose.c| in
-the web2c library
+the web2c library
@c
char *nameoffile;
@@ -90,7 +90,7 @@ int read_file_callback_id[17];
We assume that it is OK to look here first. Possibly it
would be better to replace lookups in "." with lookups in the
|output_directory| followed by "." but to do this requires much more
-invasive surgery in libkpathsea.
+invasive surgery in libkpathsea.
@c
static char *find_in_output_directory(const char *s)
@@ -110,7 +110,7 @@ static char *find_in_output_directory(const char *s)
return NULL;
}
-@ find an \.{\\input} or \.{\\read} file. |n| differentiates between those case.
+@ find an \.{\\input} or \.{\\read} file. |n| differentiates between those case.
@c
char *luatex_find_read_file(const char *s, int n, int callback_index)
@@ -194,8 +194,8 @@ char *luatex_find_file(const char *s, int callback_index)
}
-@ LuaTeX used to have private functions for these that did not use kpathsea,
-but since the file paranoia tests have to come from kpathsea anyway, that is no
+@ LuaTeX used to have private functions for these that did not use kpathsea,
+but since the file paranoia tests have to come from kpathsea anyway, that is no
longer useful. The only downside to using luatex is that if one wants to disable
kpathsea via the Lua startup script, it is now an absolute requirement that all
file discovery callbacks are specified. Just using the find_read_file, but not
@@ -207,7 +207,7 @@ to be used at all.
#define openinnameok(A) kpse_in_name_ok (A)
@ Open an input file F, using the kpathsea format FILEFMT and passing
- |FOPEN_MODE| to fopen. The filename is in `fn'. We return whether or
+ |FOPEN_MODE| to fopen. The filename is in `fn'. We return whether or
not the open succeeded.
@c
@@ -399,7 +399,7 @@ void lua_a_close_out(alpha_file f)
}
-@ Binary input and output are done with C's ordinary
+@ Binary input and output are done with C's ordinary
procedures, so we don't have to make any other special arrangements for
binary~I/O. Text output is also easy to do with standard routines.
The treatment of text input is more difficult, however, because
@@ -451,7 +451,7 @@ from the user's terminal as well as from ordinary text files.
Since the inner loop of |lua_input_ln| is part of \TeX's ``inner loop''---each
character of input comes in at this place---it is wise to reduce system
overhead by making use of special routines that read in an entire array
-of characters at once, if such routines are available.
+of characters at once, if such routines are available.
@^inner loop@>
@c
@@ -673,7 +673,7 @@ pool_pointer ext_delimiter; /* the relevant `\..', if any */
system area called |TEX_area|. Font metric files whose areas are not given
explicitly are assumed to appear in a standard system area called
|TEX_font_area|. $\Omega$'s compiled translation process files whose areas
-are not given explicitly are assumed to appear in a standard system area.
+are not given explicitly are assumed to appear in a standard system area.
These system area names will, of course, vary from place to place.
@c
@@ -719,7 +719,7 @@ length will be set in the main program.
char *TEX_format_default;
-@ This part of the program becomes active when a ``virgin'' \TeX\ is trying to get going,
+@ This part of the program becomes active when a ``virgin'' \TeX\ is trying to get going,
just after the preliminary initialization, or when the user is substituting another
format file by typing `\.\&' after the initial `\.{**}' prompt. The buffer
contains the first line of input in |buffer[loc..(last-1)]|, where
@@ -859,7 +859,7 @@ char *get_full_log_name (void)
return ret;
} else {
return xstrdup((const char*)texmf_log_name);
- }
+ }
}
@ Synctex uses this to get the anchored path of an input file.
@@ -905,7 +905,7 @@ void start_input(void)
fn = prompt_file_name("input file name", "");
}
iname = maketexstring(fullnameoffile);
- /* Now that we have |fullnameoffile|, it is time to post-adjust
+ /* Now that we have |fullnameoffile|, it is time to post-adjust
|cur_name| and |cur_ext| for trailing |.tex| */
{
char *n, *p;
@@ -949,14 +949,7 @@ void start_input(void)
}
/* |open_log_file| doesn't |show_context|, so |limit|
and |loc| needn't be set to meaningful values yet */
- if (tracefilenames) {
- if (term_offset + (int) str_length(iname) > max_print_line - 2)
- print_ln();
- else if ((term_offset > 0) || (file_offset > 0))
- print_char(' ');
- print_char('(');
- tprint_file_name(NULL, (unsigned char *) fullnameoffile, NULL);
- }
+ report_start_file(filetype_tex,fullnameoffile);
incr(open_parens);
update_terminal();
istate = new_line;
@@ -984,7 +977,7 @@ void start_input(void)
@ Read and write dump files through zlib
@ Earlier versions recast |*f| from |FILE *| to |gzFile|, but there is
-no guarantee that these have the same size, so a static variable
+no guarantee that these have the same size, so a static variable
is needed.
@c
@@ -1079,7 +1072,7 @@ swap_items(char *pp, int nitems, int size)
FATAL1("Can't swap a %d-byte item for (un)dumping", size);
}
memcpy(pp,q,total);
- xfree(q);
+ xfree(q);
}
#endif /* not WORDS_BIGENDIAN and not NO_DUMP_SHARE */
@@ -1178,7 +1171,7 @@ void zwclose(FILE * f)
gzclose(gz_fmtfile);
}
-@ create the dvi or pdf file
+@ create the dvi or pdf file
@c
int open_outfile(FILE ** f, const char *name, const char *mode)
{
@@ -1222,7 +1215,7 @@ int readbinfile(FILE * f, unsigned char **tfm_buffer, int *tfm_size)
@ Like |runsystem()|, the |runpopen()| function is called only when
|shellenabledp == 1|. Unlike |runsystem()|, here we write errors to
stderr, since we have nowhere better to use; and of course we return
- a file handle (or NULL) instead of a status indicator.
+ a file handle (or NULL) instead of a status indicator.
@c
static FILE *runpopen(char *cmd, const char *mode)
@@ -1267,14 +1260,14 @@ static FILE *runpopen(char *cmd, const char *mode)
@ piped I/O
-@ The code that implements |popen()| needs an array for tracking
+@ The code that implements |popen()| needs an array for tracking
possible pipe file pointers, because these need to be
closed using |pclose()|.
@c
#define NUM_PIPES 16
static FILE *pipes[NUM_PIPES];
-
+
#ifdef WIN32
FILE *Poptr;
#endif
@@ -1335,7 +1328,7 @@ boolean open_out_or_pipe(FILE ** f_ptr, char *fn, const_string fopen_mode)
fname = (string) xmalloc((unsigned) (strlen(fn) + 1));
strcpy(fname, fn);
if (strchr(fname, ' ') == NULL && strchr(fname, '>') == NULL) {
- /* mp and mf currently do not use this code, but it
+ /* mp and mf currently do not use this code, but it
is better to be prepared */
if (STREQ((fname + strlen(fname) - 3), "tex"))
*(fname + strlen(fname) - 4) = 0;
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w
index f9e400b6098..527be959082 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texmath.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: texmath.w 4750 2014-01-15 09:13:32Z taco $"
+ "$Id: texmath.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texmath.w $";
#include "ptexlib.h"
@@ -1023,7 +1023,7 @@ void enter_display_math(void)
begin_token_list(every_display, every_display_text);
if (nest_ptr == 1) {
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "before_display");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(before_display));
build_page();
}
}
@@ -1977,7 +1977,7 @@ static void resume_after_display(void)
if (cur_cmd != spacer_cmd)
back_input();
if (nest_ptr == 1) {
- lua_node_filter_s(buildpage_filter_callback, "after_display");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(after_display));
build_page();
}
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
index 73b39d08757..e5c4e1cacfd 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: texnodes.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: texnodes.w 4911 2014-03-20 14:00:02Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texnodes.w $";
#include "ptexlib.h"
@@ -874,16 +874,19 @@ halfword copy_node(const halfword p)
case 'a':
add_node_attr_ref(user_node_value(p));
break;
- case 't':
- add_token_ref(user_node_value(p));
- break;
- case 's':
- /* |add_string_ref(user_node_value(p));| *//* if this was mpost .. */
+ case 'l':
+ copy_user_lua(r, p);
break;
case 'n':
s = copy_node_list(user_node_value(p));
user_node_value(r) = s;
break;
+ case 's':
+ /* |add_string_ref(user_node_value(p));| *//* if this was mpost .. */
+ break;
+ case 't':
+ add_token_ref(user_node_value(p));
+ break;
}
break;
#if 0
@@ -1217,8 +1220,7 @@ void flush_node(halfword p)
case 'a':
delete_attribute_ref(user_node_value(p));
break;
- case 't':
- delete_token_ref(user_node_value(p));
+ case 'd':
break;
case 'n':
flush_node_list(user_node_value(p));
@@ -1226,7 +1228,8 @@ void flush_node(halfword p)
case 's':
/* |delete_string_ref(user_node_value(p));| *//* if this was mpost .. */
break;
- case 'd':
+ case 't':
+ delete_token_ref(user_node_value(p));
break;
default:
{
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w
index 48f6e43d48b..e9ae2e670a4 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.w
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: textoken.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: textoken.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textoken.w $";
#include "ptexlib.h"
@@ -42,7 +42,7 @@ static const char _svn_version[] =
a=get_cat_code(cat_code_table,b); \
} while (0)
-
+
@ The \TeX\ system does nearly all of its own memory allocation, so that it
can readily be transported into environments that do not have automatic
facilities for strings, garbage collection, etc., and so that it can be in
@@ -59,7 +59,7 @@ value represents a null pointer. \TeX\ does not assume that |mem[null]| exists.
-@ Locations in |fixmem| are used for storing one-word records; a conventional
+@ Locations in |fixmem| are used for storing one-word records; a conventional
\.{AVAIL} stack is used for allocation in this array.
@c
@@ -406,7 +406,7 @@ void token_show(halfword p)
}
-
+
@ |delete_token_ref|, is called when
a pointer to a token list's reference count is being removed. This means
that the token list should disappear if the reference count was |null|,
@@ -456,7 +456,7 @@ typedef enum { next_line_ok, next_line_return,
static next_line_retval next_line(void); /* below */
-
+
@ In case you are getting bored, here is a slightly less trivial routine:
Given a string of lowercase letters, like `\.{pt}' or `\.{plus}' or
`\.{width}', the |scan_keyword| routine checks to see whether the next
@@ -497,7 +497,7 @@ boolean scan_keyword(const char *s)
token_link(q) = null;
token_link(p) = q;
begin_token_list(token_link(backup_head), backed_up);
- if (cur_cmd != endv_cmd)
+ if (cur_cmd != endv_cmd)
align_state = saved_align_state;
} else {
back_input();
@@ -515,7 +515,7 @@ boolean scan_keyword(const char *s)
@ We can not return |undefined_control_sequence| under some conditions
(inside |shift_case|, for example). This needs thinking.
-
+
@c
halfword active_to_cs(int curchr, int force)
{
@@ -542,7 +542,7 @@ halfword active_to_cs(int curchr, int force)
return curcs;
}
-@ TODO this function should listen to \.{\\escapechar}
+@ TODO this function should listen to \.{\\escapechar}
@c
static char *cs_to_string(halfword p)
@@ -586,7 +586,7 @@ static char *cs_to_string(halfword p)
return (char *) ret;
}
-@ TODO this is a quick hack, will be solved differently soon
+@ TODO this is a quick hack, will be solved differently soon
@c
static char *cmd_chr_to_string(int cmd, int chr)
@@ -821,7 +821,7 @@ static boolean get_next_file(void)
} else {
do_get_cat_code(cur_cmd, cur_chr);
}
- /*
+ /*
Change state if necessary, and |goto switch| if the current
character should be ignored, or |goto reswitch| if the current
character changes to another;
@@ -926,13 +926,13 @@ static boolean get_next_file(void)
case skip_blanks + mac_param:
case skip_blanks + sub_mark:
case skip_blanks + letter:
- case skip_blanks + other_char:
+ case skip_blanks + other_char:
case new_line + math_shift:
case new_line + tab_mark:
case new_line + mac_param:
case new_line + sub_mark:
case new_line + letter:
- case new_line + other_char:
+ case new_line + other_char:
#else
default:
#endif
@@ -1071,7 +1071,7 @@ static boolean process_sup_mark(void)
a file; once they have been scanned the first time, their |eqtb| location
serves as a unique identification, so \TeX\ doesn't need to refer to the
original name any more except when it prints the equivalent in symbolic form.
-
+
The program that scans a control sequence has been written carefully
in order to avoid the blowups that might otherwise occur if a malicious
user tried something like `\.{\\catcode\'15=0}'. The algorithm might
@@ -1301,9 +1301,8 @@ static next_line_retval next_line(void)
if (!((iname == 19) || (iname == 21)))
file_warning(); /* give warning for some unfinished groups and/or conditionals */
if ((iname > 21) || (iname == 20)) {
- if (tracefilenames)
- print_char(')');
- open_parens--;
+ report_stop_file(filetype_tex);
+ decr(open_parens);
#if 0
update_terminal(); /* show user that file has been read */
#endif
@@ -1361,7 +1360,7 @@ static next_line_retval next_line(void)
return next_line_ok;
}
-@ Let's consider now what happens when |get_next| is looking at a token list.
+@ Let's consider now what happens when |get_next| is looking at a token list.
@c
static boolean get_next_tokenlist(void)
@@ -1414,7 +1413,7 @@ static boolean get_next_tokenlist(void)
this routine are executed more often than any other instructions of \TeX.
@^mastication@>@^inner loop@>
-@ sets |cur_cmd|, |cur_chr|, |cur_cs| to next token
+@ sets |cur_cmd|, |cur_chr|, |cur_cs| to next token
@c
void get_next(void)
@@ -1495,7 +1494,7 @@ void get_token_lua(void)
}
-@ changes the string |s| to a token list
+@ changes the string |s| to a token list
@c
halfword string_to_toks(char *ss)
{
@@ -1562,7 +1561,7 @@ static halfword lua_str_toks(lstring b)
}
-@ Incidentally, the main reason for wanting |str_toks| is the function |the_toks|,
+@ Incidentally, the main reason for wanting |str_toks| is the function |the_toks|,
which has similar input/output characteristics.
@c
@@ -1621,7 +1620,7 @@ static void print_job_name(void)
@ Here is a routine that print the result of a convert command, using
the argument |i|. It returns |false | if it does not know to print
the code |c|. The function exists because lua code and tex code can
- both call it to convert something.
+ both call it to convert something.
@c
static boolean print_convert_string(halfword c, int i)
@@ -2046,7 +2045,7 @@ void conv_toks(void)
@c
boolean in_lua_escape;
-@ probably not needed anymore
+@ probably not needed anymore
@c
boolean is_convert(halfword c)
{
@@ -2262,7 +2261,7 @@ str_number tokens_to_string(halfword p)
#define is_cat_letter(a) \
(get_char_cat_code(pool_to_unichar(str_string((a)))) == 11)
-@ the actual token conversion in this function is now functionally
+@ the actual token conversion in this function is now functionally
equivalent to |show_token_list|, except that it always prints the
whole token list.
TODO: check whether this causes problems in the lua library.
diff --git a/Build/source/texk/web2c/luatexdir/utils/utils.w b/Build/source/texk/web2c/luatexdir/utils/utils.w
index 10b4c5c687f..c164a0463fb 100644
--- a/Build/source/texk/web2c/luatexdir/utils/utils.w
+++ b/Build/source/texk/web2c/luatexdir/utils/utils.w
@@ -20,7 +20,7 @@
@ @c
static const char _svn_version[] =
- "$Id: utils.w 4882 2014-03-14 12:56:21Z taco $"
+ "$Id: utils.w 4903 2014-03-15 12:18:10Z taco $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/utils/utils.w $";
@ @c