diff -Nru luatex-0.47.0/debian/ANNOUNCE-0.50.0 luatex-0.50.0/debian/ANNOUNCE-0.50.0 --- luatex-0.47.0/debian/ANNOUNCE-0.50.0 1970-01-01 01:00:00.000000000 +0100 +++ luatex-0.50.0/debian/ANNOUNCE-0.50.0 2009-12-25 05:12:15.000000000 +0000 @@ -0,0 +1,74 @@ +Hi, + +I have just uploaded the archives for a new luatex release, 0.50.0. + +This release starts a new chain of stable beta's. + +New features: + +* 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. + +* The embedded Metapost library is now at version 1.209. + +Dropped features: + +* It is no longer possible for fonts from embedded pdf files + to be replaced by / merged with the document fonts of the + enveloping pdf. This regression may be temporary, depending + on how the rewritten font backend will look after beta 0.60. + +Bug fixes: + +* Use of \middle confused the \mathstyle operation. + +* \pdfcolorstack handling was broken. + +* 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 + 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 + is only used to tuck in the subscript and for nothing else. + +* luafontloader.open() no longer writes directly to stderr in + case of internal font errors. + +* Any .objnum could not be assigned to. + +* The lua 'pdf' table could not be assigned to. + +* 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 + backend segfaults were a side-effect of the string pool + patches). + +The archives can be downloaded from supelec as usual: + + http://foundry.supelec.fr/gf/project/luatex/ + +You could also check out the sources via anonymous svn: + + svn co http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0 + +Bugs and feature requests can be added to the issue tracker at + + http://tracker.luatex.org + + +Have fun, +Taco + diff -Nru luatex-0.47.0/debian/changelog luatex-0.50.0/debian/changelog --- luatex-0.47.0/debian/changelog 2009-12-25 05:12:14.000000000 +0000 +++ luatex-0.50.0/debian/changelog 2009-12-25 05:12:15.000000000 +0000 @@ -1,4 +1,19 @@ -luatex (0.47.0-1~1) unstable; urgency=low +luatex (0.50.0-1~1) unstable; urgency=low + + * new upstream release + * disable fix-hurd-ftbfs patch, included upstream + * disable upstram-fixes, included upstream + * disable ubuntu_libpoppler-0.11, not needed anymore + + -- Norbert Preining Fri, 25 Dec 2009 09:47:05 +0900 + +luatex (0.47.0-2) unstable; urgency=low + + * add patch fix-hurd-ftbfs from Pino Toscano (Closes: #562176) + + -- Norbert Preining Thu, 24 Dec 2009 03:32:02 +0900 + +luatex (0.47.0-1) unstable; urgency=low * new upstream release * add debian/patches/upstream-fixes that collects small bits fixed diff -Nru luatex-0.47.0/debian/patches/fix-hurd-ftbfs luatex-0.50.0/debian/patches/fix-hurd-ftbfs --- luatex-0.47.0/debian/patches/fix-hurd-ftbfs 1970-01-01 01:00:00.000000000 +0100 +++ luatex-0.50.0/debian/patches/fix-hurd-ftbfs 2009-12-25 05:12:15.000000000 +0000 @@ -0,0 +1,72 @@ +Fix compilation on GNU/Hurd +Patch from Pino Toscano +From his email: +currently[1] luatex does not build on GNU/Hurd. +The problem is the unconditional usage of PATH_MAX. +The attached patch solves the issue, malloc'ing the buffers as needed. +It also adds a small bit to "recognize" the GNU platform. +--- + source/texk/web2c/luatexdir/lua/loslibext.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +Index: luatex-0.47.0/source/texk/web2c/luatexdir/lua/loslibext.c +=================================================================== +--- luatex-0.47.0.orig/source/texk/web2c/luatexdir/lua/loslibext.c 2009-12-24 03:28:17.000000000 +0900 ++++ luatex-0.47.0/source/texk/web2c/luatexdir/lua/loslibext.c 2009-12-24 03:28:30.000000000 +0900 +@@ -81,6 +81,9 @@ + # elif defined(__MACH__) && defined(__APPLE__) + # undef OS_PLATNAME + # define OS_PLATNAME "macosx" ++# elif defined(__GNU__) ++# undef OS_PLATNAME ++# define OS_PLATNAME "gnu" + # endif + #endif + +@@ -117,7 +120,7 @@ + + static int exec_command(const char *file, char *const *argv, char *const *envp) + { +- char path[PATH_MAX]; ++ char *path; + const char *searchpath, *esp; + size_t prefixlen, filelen, totallen; + +@@ -125,6 +128,7 @@ + return execve(file, argv, envp); + + filelen = strlen(file); ++ path = NULL; + + searchpath = getenv("PATH"); + if (!searchpath) +@@ -141,14 +145,20 @@ + + if (prefixlen == 0 || searchpath[prefixlen - 1] == '/') { + totallen = prefixlen + filelen; ++#ifdef PATH_MAX + if (totallen >= PATH_MAX) + continue; ++#endif ++ path = malloc(totallen + 1); + memcpy(path, searchpath, prefixlen); + memcpy(path + prefixlen, file, filelen); + } else { + totallen = prefixlen + filelen + 1; ++#ifdef PATH_MAX + if (totallen >= PATH_MAX) + continue; ++#endif ++ path = malloc(totallen + 1); + memcpy(path, searchpath, prefixlen); + path[prefixlen] = '/'; + memcpy(path + prefixlen + 1, file, filelen); +@@ -156,6 +166,8 @@ + path[totallen] = '\0'; + + execve(path, argv, envp); ++ free(path); ++ path = NULL; + if (errno == E2BIG || errno == ENOEXEC || + errno == ENOMEM || errno == ETXTBSY) + break; /* Report this as an error, no more search */ diff -Nru luatex-0.47.0/debian/patches/series luatex-0.50.0/debian/patches/series --- luatex-0.47.0/debian/patches/series 2009-12-25 05:12:14.000000000 +0000 +++ luatex-0.50.0/debian/patches/series 2009-12-25 05:12:15.000000000 +0000 @@ -13,7 +13,8 @@ #texdoclua-fix #fix-arm-buildfailure #fix-pwd-inclusion -ubuntu_libpoppler-0.11 +#ubuntu_libpoppler-0.11 libpoppler-0.12 #fix-opentype-loading -upstream-fixes +#upstream-fixes +#fix-hurd-ftbfs Binary files /tmp/kEC0JL6YXp/luatex-0.47.0/manual/luatexref-t.pdf and /tmp/BTSPjGLNfk/luatex-0.50.0/manual/luatexref-t.pdf differ diff -Nru luatex-0.47.0/manual/luatexref-t.tex luatex-0.50.0/manual/luatexref-t.tex --- luatex-0.47.0/manual/luatexref-t.tex 2009-12-18 09:38:17.000000000 +0000 +++ luatex-0.50.0/manual/luatexref-t.tex 2009-12-24 18:51:37.000000000 +0000 @@ -23,7 +23,7 @@ \setvariables [document] - [beta=0.47.0] + [beta=0.50.0] \starttext @@ -59,11 +59,11 @@ \blank -\bf If you are not willing to deal with this situation, you should +{\bf If you are not willing to deal with this situation, you should wait for the stable version. Currently we expect the first release with (some) fixed interfaces to be available sometime in the autumn of~2008. Full stabilization will not happen soon, the TODO list is -still very large. +still very large.} \stopframedtext @@ -73,8 +73,8 @@ distinguishable parts: \startitemize[packed] -\item \PDFTEX\ version 1.40.9 -\item \ALEPH\ RC4 (from the \TEXLIVE\ repository) +\item \PDFTEX\ version 1.40.9, converted to C. +\item \ALEPH\ RC4 converted to C. \item \LUA\ 5.1.4 ($+$ coco 1.1.5 $+$ portable bytecode) \item dedicated \LUA\ libraries \item various \TEX\ extensions @@ -124,8 +124,8 @@ before the above line. More fine-grained primitives control is possible, you can look the details in -\in{section}[luaprimitives]. For simplicity's sake, this manual -assumes that you have executed the lua command given above. +\in{section}[luaprimitives]. For simplicity's sake, this manual assumes +that you have executed the \type{\directlua} command as given above. \section{Version information} @@ -148,7 +148,7 @@ \startitemize \item The major version is the integer result of \tex{luatexversion} divided by 100. - The primitive is and \quote{internal variable}, so you may need to prefix it + The primitive is an \quote{internal variable}, so you may need to prefix its use with \type{\the} depending on the context. \item The minor version is the two-digit result of \tex{luatexversion} modulo 100. \item The revision is the given by \tex{luatexrevision}. This primitive expands to a @@ -159,7 +159,7 @@ Note that the \tex{luatexdatestamp} depends on both the compilation -time and compilation place of the current executable, it is defined in +time and compilation place of the current executable; it is defined in terms of the local time. The purpose of this primitive is solely to be an aid in the development process, do not use it for anything besides debugging. @@ -354,10 +354,10 @@ such a chunk you can use the \type {local} directive to keep your variables from interfering with those used by the macro package. -The conversion from and to a token list means that you normally can +The conversion to and from a token list means that you normally can not use \LUA\ line comments (starting with \type{--}) within the -argument, as there typically will be only one \quote{line}, so that comment -will then run on until the end of the input. You will either need to +argument. As there typically will be only one \quote{line} the first +line comment will run on until the end of the input. You will either need to use \TEX-style line comments (starting with \%), or change the \TEX\ category codes locally. Another possibility is to say: @@ -408,7 +408,7 @@ Because the \syntax{} is a chunk, the normal \LUA\ error handling is triggered if there is a problem in the included code. The \LUA\ error messages should be clear enough, but the contextual -information is still pretty bad. Typically, you will only see the line +information is still pretty bad. Often, you will only see the line number of the right brace at the end of the code. While on the subject of errors: some of the things you can do inside @@ -670,6 +670,18 @@ This allows for embedded spaces, without the need for double quotes. Macro expansion takes place inside the argument. +\subsection{File syntax (0.45)} + +\LUATEX\ will accept a braced argument as a file name: + +\starttyping +\input {plain} +\openin 0 {plain} +\stoptyping + +This allows for embedded spaces, without the need for double quotes. +Macro expansion takes place inside the argument. + \subsection{Images and Forms} \LUATEX\ accepts optional dimension parameters for \type{\pdfrefximage} @@ -834,7 +846,7 @@ \section{\LUA\ changes} The C coroutine (\COCO) patches from luajit are applied to the \LUA\ core, the used -version is 1.1.3. See \hyphenatedurl{http://luajit.org/coco.html} for details. This +version is 1.1.5. See \hyphenatedurl{http://luajit.org/coco.html} for details. This functionality currently (0.45) does not work on non-intel OpenBSD platforms nor on powerpc Linux-es. @@ -852,7 +864,7 @@ \LUA\ function \type{kpse.set_program_name()}. -Starting from version 0.46.0 (as an experimental feature!) \LUATEX\ is +Starting from version 0.46.0 (as an {\bf experimental} feature!) \LUATEX\ is also able to use dynamically loadable \LUA\ libraries, unless \type{--safer} was given as an option on the command line. @@ -904,9 +916,9 @@ {CR} or \type{CR+LF} are acceptable line endings. The \lua{tostring()} printer for numbers has been changed so that it -returns~\type{0} instead of something like~\hbox{\type{2e-5}} (which confused \TEX\ -enormously) when the value is so small that \TEX\ cannot distinguish -it from zero. +returns~\type{0.00000000000001} instead of~\hbox{\type{1e-14}} (which +confused \TEX\ enormously). Even values with an even smaller exponent +print simply as~\type{0}. \lua{luafilesystem} has been extended with two extra boolean functions (\luatex{isdir(filename)} and \luatex{isfile(filename)}) and one extra @@ -1036,7 +1048,7 @@ The list for the type \type{unix} is more precise: \type{linux}, \type{freebsd}, \type{openbsd}, \type{solaris}, \type{sunos} (pre-solaris), -\type{hpux}, \type{irix}, \type{macosx}, \type{bsd} (unknown, but \BSD|-|like), +\type{hpux}, \type{irix}, \type{macosx}, \type{gnu} (hurd), \type{bsd} (unknown, but \BSD|-|like), \type{sysv} (unknown, but \SYSV|-|like), \type{generic} (unknown). (\type{os.version} is planned as a future extension) @@ -1582,6 +1594,12 @@ In the function-based interface, it is possible to define values globally by using the string \type{'global'} as the first function argument. +Note: the above functions and tables are likely to go away in a future +version because one can just as well use the direct interface to the +box node via \type{tex.box} as documented below. + +\blank + It is also possible to set and query actual boxes, using the node interface as defined in the \luatex{node} library: @@ -1819,6 +1837,11 @@ top||level values scaled in that manner. If the multiplied number(s) are of range, it generates \quote{number to big} error(s) as well. +Note: the precision of the output of this function will depend on your +computer's architecture and operating system, so use with care! An +interface to \TEX's internal, 100\% portable scale function will be +added at a later date. + \subsubsection{\luatex{tex.definefont}} \startfunctioncall @@ -2613,12 +2636,15 @@ \type{\pdfmapfile} from \PDFTEX. The values are write-only: when queried they return \type{nil}. +Note: this interface will almost certainly change in the future. + \subsubsubject{\luatex{pdf.pdfcatalog}, \luatex{pdf.pdfinfo}, \luatex{pdf.pdfnames}, \luatex{pdf.pdftrailer} (new in 0.47.0)} These variable offer a read-write interface to the corresponding \PDFTEX\ token lists. The value types are strings. +Note: this interface will almost certainly change in the future. \subsubsubject{\luatex{pdf.h}, \luatex{pdf.v}} @@ -2633,6 +2659,8 @@ pdf.v \stoptyping +Note: this interface will almost certainly change in the future. + % not implemented yet: % \subsubsubject{\luatex{pdf.seth()}, \luatex{pdf.setv()}} % @@ -2703,9 +2731,11 @@ This function creates a \PDF\ object, which is written to the \PDF\ file only when referenced. -It is modelled after \PDFTEX's \tex{pdfobj} primitive. -All function variants return the object number -of the newly generated object. + +All function variants return the object number of the newly generated +object, and there are two separate calling modes. + +The first mode is modelled after \PDFTEX's \tex{pdfobj} primitive. \startfunctioncall n = pdf.obj( objtext) @@ -2724,6 +2754,28 @@ n = pdf.obj( n, "streamfile", filename, {, attrtext}) \stopfunctioncall +The second mode accepts a single argument table with key--value pairs. + +\startfunctioncall +n = pdf.obj{ type = , + immmediate = , + objnum = , + attr = , + compresslevel = , + objcompression = , + file = , + string = } +\stopfunctioncall + +The \type{string} field can have the values \type{raw} and +\type{stream}, this field is required, the others are optional +(within constraints). + +Note: this mode makes \type{pdf.obj} look more flexible than it +actually is: the constraints from the separate parameter version +still apply, so for example you can't have both \type{string} and +\type{file} at the same time. + \subsubsubject{\luatex{pdf.reserveobj()}} This function creates an empty \PDF\ object and returns its number. @@ -2736,14 +2788,14 @@ \subsubsubject{\luatex{pdf.registerannot()} (new in 0.47.0)} This function adds an object number to the \type{/Annots} array for the -current page without doing anything else. +current page without doing anything else. This function can only be +used from within \type{\latelua}. \startfunctioncall pdf.registerannot ( objnum) \stopfunctioncall - %*********************************************************************** \section{The \luatex{img} library} @@ -4092,9 +4144,8 @@ s = lua.version \stoptyping -This returns a \LUATEX\ version identifier string. The value is -currently \directlua {tex.print('lua.version')}, but it is soon to be -replaced by something more elaborate. +This returns the \LUA\ version identifier string. The value is +currently \directlua {tex.print('lua.version')}. \subsection{\LUA\ bytecode registers} @@ -6043,9 +6094,9 @@ \starttabulate[|l|l|l|p|] \NC \bf variable \NC \bf style \NC \bf default value opentype \NC \bf default value tfm \NC\NR \NC \tex{Umathaxis} \NC -- \NC AxisHeight \NC axis_height \NC\NR -\NC \tex{Umathoperatorsize} \NC D, D' \NC DisplayOperatorMinHeight \NC $^6$ \NC\NR -\NC \tex{Umathfractiondelsize} \NC D, D' \NC 0$^1$ \NC delim1 \NC\NR -\NC " \NC T, T', S, S', SS, SS' \NC 0$^1$ \NC delim2 \NC\NR +\NC \tex{Umathoperatorsize} \NC D, D' \NC DisplayOperatorMinHeight \NC $^6$ \NC\NR +\NC \tex{Umathfractiondelsize} \NC D, D' \NC FractionDelimiterDisplaySize$^9$ \NC delim1 \NC\NR +\NC " \NC T, T', S, S', SS, SS' \NC FractionDelimiterSize$^9$ \NC delim2 \NC\NR \NC \tex{Umathfractiondenomdown}\NC D, D' \NC FractionDenominatorDisplayStyleShiftDown \NC denom1 \NC\NR \NC " \NC T, T', S, S', SS, SS' \NC FractionDenominatorShiftDown \NC denom2 \NC\NR \NC \tex{Umathfractiondenomvgap}\NC D, D' \NC FractionDenominatorDisplayStyleGapMin \NC 3*default_rule_thickness \NC\NR @@ -6105,7 +6156,7 @@ \stop -Note 1: \OPENTYPE\ fonts set \tex{Umathfractiondelsize}, \tex{Umathlimitabovekern},\crlf +Note 1: \OPENTYPE\ fonts set \tex{Umathlimitabovekern} and \tex{Umathlimitbelowkern} to zero and set \tex{Umathquad} to the font size of the used font, because these are not supported in the MATH table, @@ -6137,6 +6188,10 @@ Note 8: \type{SubscriptShiftDownWithSuperscript} does not actually exist in the \quote{standard} Opentype Math font Cambria, but it is useful enough to be added. New in version 0.38. +Note 9: \type{FractionDelimiterDisplaySize} and \type{FractionDelimiterSize} do not actually exist in the \quote{standard} +Opentype Math font Cambria, but were useful enough to be added. New in version 0.47. + + \section{Math spacing setting} Besides the parameters mentioned in the previous sections, there are @@ -6862,6 +6917,8 @@ character enties for math-specific keys. (0.42.0)\NC\NR \NC slant \NC no \NC no \NC yes \NC number \NC This has the same semantics as the \type{SlantFont} operator in font map files. (0.47.0)\NC\NR +\NC extent \NC no \NC no \NC yes \NC number \NC This has the same semantics as the \type{ExtendFont} operator + in font map files. (0.50.0)\NC\NR \stoptabulate The key \type{name} is always required. The keys \type{stretch}, @@ -7482,7 +7539,8 @@ \starttabulate[|lT|l|p|] \NC \ssbf field \NC \bf type \NC \bf explanation \NC\NR -\NC subtype \NC number \NC unused\NC\NR +\NC subtype \NC number \NC 0 = unknown origin, 1 = created by +linebreaking, 2 = explict box command. (0.46.0)\NC\NR \NC attr \NC \syntax{} \NC The head of the associated attribute list \NC\NR \NC width \NC number \NC \NC\NR \NC height \NC number \NC \NC\NR @@ -7497,6 +7555,11 @@ \NC dir \NC string \NC the direction of this box. see~\in{}[dirnodes]\NC\NR \stoptabulate +A warning: never assign a node list to the list field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + + \subsubsection{vlist nodes} Valid fields: As for hlist, except that \quote{shift} is a displacement @@ -7532,6 +7595,11 @@ \NC spec \NC \syntax{} \NC a pointer to the \tex{splittopskip} glue spec\NC\NR \stoptabulate +A warning: never assign a node list to the list field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + + \subsubsection{mark nodes} Valid fields: \showfields{mark} @@ -7555,6 +7623,12 @@ \NC list \NC \syntax{} \NC adjusted material\NC\NR \stoptabulate + +A warning: never assign a node list to the list field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + + \subsubsection{disc nodes} Valid fields: \showfields{disc} @@ -7576,6 +7650,10 @@ The subtype numbers~4 and~5 belong to the \quote{of-f-ice} explanation given elsewhere. +A warning: never assign a node list to the pre, post or replace field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + \subsubsection{math nodes} Valid fields: \showfields{math} @@ -7647,6 +7725,10 @@ \NC yoffset \NC number \NC \NC\NR \stoptabulate +A warning: never assign a node list to the components field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + Valid bits for the \type{subtype} field are: \starttabulate[|c|l|] @@ -7724,6 +7806,10 @@ hbox. For \type{sub_mlist}, the \type{list} points to a math list that is yet to be converted. +A warning: never assign a node list to the components field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + \subsubsection{Math delimiter subnode} There is a fifth subnode type that is used exclusively for delimiter @@ -7828,6 +7914,10 @@ \NC scriptscript \NC \syntax{}\NC \NC\NR \stoptabulate +A warning: never assign a node list to the display, text, script, or +scriptscript field unless you are sure its internal link structure is +correct, otherwise an error may be result. + \subsubsubsection{radical nodes} Valid fields: \showfields{radical} @@ -7842,6 +7932,11 @@ \NC degree \NC \syntax{}\NC Only set by \type{\Uroot} \NC \NR \stoptabulate +A warning: never assign a node list to the nucleus, sub, sup, left, or +degree field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + \subsubsubsection{fraction nodes} Valid fields: \showfields{fraction} @@ -7856,6 +7951,10 @@ \NC right \NC \syntax{}\NC \NC \NR \stoptabulate +A warning: never assign a node list to the num, or denom field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + \subsubsubsection{fence nodes} Valid fields: \showfields{fence} @@ -7869,7 +7968,6 @@ \NC delim \NC \syntax{}\NC \NC \NR \stoptabulate - \subsection{whatsit nodes} Whatsit nodes come in many subtypes that you can ask for by running @@ -7945,6 +8043,13 @@ \NC box_right_width\NC number\NC width of the \tex{localrightbox}\NC\NR \stoptabulate +A warning: never assign a node list to the box_left or box_right field +unless you are sure its internal link structure is correct, otherwise +an error may be result. + + + + \subsubsection[dirnodes]{dir nodes} Valid fields: \showfields{whatsit,dir} @@ -8353,6 +8458,12 @@ \item \LUATEX~0.45.0 introduces two extra token lists, \tex{pdfxformresources} and \tex{pdfxformattr}, as an alternative to \tex{pdfxform} keywords. +\item As of \LUATEX~0.50.0 is no longer possible for fonts from embedded pdf files + to be replaced by / merged with the document fonts of the enveloping + pdf document. This regression may be temporary, depending on how the + rewritten font backend will look after beta 0.60. + + \stopitemize \section{Changes from \ALEPH\ RC4} diff -Nru luatex-0.47.0/NEWS luatex-0.50.0/NEWS --- luatex-0.47.0/NEWS 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/NEWS 2009-12-24 18:51:10.000000000 +0000 @@ -1,4 +1,60 @@ ============================================================== +Luatex beta-0.50.0 was released 20091224 +============================================================== + +New features: + +* 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. + +* The embedded Metapost library is now at version 1.209. + +Dropped features: + +* It is no longer possible for fonts from embedded pdf files + to be replaced by / merged with the document fonts of the + enveloping pdf. This regression may be temporary, depending + on how the rewritten font backend will look after beta 0.60. + +Bug fixes: + +* Use of \middle confused the \mathstyle operation. + +* \pdfcolorstack handling was broken. + +* 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 + 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 + is only used to tuck in the subscript and for nothing else. + +* luafontloader.open() no longer writes directly to stderr in + case of internal font errors. + +* Any .objnum could not be assigned to. + +* The lua 'pdf' table could not be assigned to. + +* 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 + backend segfaults were a side-effect of the string pool + patches). + +============================================================== Luatex beta-0.47.0 was released 20091218 ============================================================== @@ -1231,7 +1287,7 @@ we probably introduced new problems as well). * Most (all?) files now have a corrected Copyright header, - and link in $Id: NEWS 3259 2009-12-18 09:26:22Z taco $ and $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/NEWS $ into the object file. + and link in $Id: NEWS 3295 2009-12-24 14:43:31Z taco $ and $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/NEWS $ into the object file. * Some unnecessary files were removed from the distribution. diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/dvi/dvigen.c luatex-0.50.0/source/texk/web2c/luatexdir/dvi/dvigen.c --- luatex-0.47.0/source/texk/web2c/luatexdir/dvi/dvigen.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/dvi/dvigen.c 2009-12-24 18:50:48.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: dvigen.c 3217 2009-12-03 16:52:01Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/dvi/dvigen.c $"; + "$Id: dvigen.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/dvi/dvigen.c $"; #include "ptexlib.h" @@ -577,18 +577,18 @@ @^recursion@> */ -integer total_pages = 0; /* the number of pages that have been shipped out */ +int total_pages = 0; /* the number of pages that have been shipped out */ scaled max_v = 0; /* maximum height-plus-depth of pages shipped so far */ scaled max_h = 0; /* maximum width of pages shipped so far */ -integer max_push = 0; /* deepest nesting of |push| commands encountered so far */ -integer last_bop = -1; /* location of previous |bop| in the \.{DVI} output */ -integer dead_cycles = 0; /* recent outputs that didn't ship anything out */ +int max_push = 0; /* deepest nesting of |push| commands encountered so far */ +int last_bop = -1; /* location of previous |bop| in the \.{DVI} output */ +int dead_cycles = 0; /* recent outputs that didn't ship anything out */ boolean doing_leaders = false; /* are we inside a leader box? */ -integer c, f; /* character and font in current |char_node| */ -integer oval, ocmd; /* used by |out_cmd| for generating |set|, |fnt| and |fnt_def| commands */ +int c, f; /* character and font in current |char_node| */ +int oval, ocmd; /* used by |out_cmd| for generating |set|, |fnt| and |fnt_def| commands */ pointer g; /* current glue specification */ -integer lq, lr; /* quantities used in calculations for leaders */ -integer cur_s = -1; /* current depth of output box nesting, initially $-1$ */ +int lq, lr; /* quantities used in calculations for leaders */ +int cur_s = -1; /* current depth of output box nesting, initially $-1$ */ /* @ The \.{DVI} bytes are output to a buffer instead of being written directly @@ -626,13 +626,13 @@ after it first fills up. */ -integer dvi_buf_size = 800; /* size of the output buffer; must be a multiple of 8 */ +int dvi_buf_size = 800; /* size of the output buffer; must be a multiple of 8 */ eight_bits *dvi_buf; /* buffer for \.{DVI} output */ dvi_index half_buf = 0; /* half of |dvi_buf_size| */ dvi_index dvi_limit = 0; /* end of the current half buffer */ dvi_index dvi_ptr = 0; /* the next available buffer address */ -integer dvi_offset = 0; /* |dvi_buf_size| times the number of times the output buffer has been fully emptied */ -integer dvi_gone = 0; /* the number of bytes already output to |dvi_file| */ +int dvi_offset = 0; /* |dvi_buf_size| times the number of times the output buffer has been fully emptied */ +int dvi_gone = 0; /* the number of bytes already output to |dvi_file| */ /* The actual output of |dvi_buf[a..b]| to |dvi_file| is performed by calling @@ -674,7 +674,7 @@ without risking arithmetic overflow. */ -void dvi_four(integer x) +void dvi_four(int x) { if (x >= 0) { dvi_out(x / 0100000000); @@ -702,7 +702,7 @@ dvi_out(push); } -void dvi_pop(integer l) +void dvi_pop(int l) { if ((l == dvi_offset + dvi_ptr) && (dvi_ptr > 0)) decr(dvi_ptr); @@ -854,7 +854,7 @@ { small_number mstate; /* have we seen a |y| or |z|? */ halfword p, q; /* current and top nodes on the stack */ - integer k; /* index into |dvi_buf|, modulo |dvi_buf_size| */ + int k; /* index into |dvi_buf|, modulo |dvi_buf_size| */ if (false) { /* TODO: HUH? */ q = new_node(movement_node, 0); /* new node for the top of the stack */ width(q) = w; @@ -1020,7 +1020,7 @@ */ /* delete movement nodes with |location>=l| */ -void prune_movements(integer l) +void prune_movements(int l) { pointer p; /* node being deleted */ while (down_ptr != null) { @@ -1075,7 +1075,7 @@ dvi_four(size.h); } -void dvi_place_glyph(PDF pdf, internal_font_number f, integer c) +void dvi_place_glyph(PDF pdf, internal_font_number f, int c) { scaled_whd ci; synch_dvi_with_pos(pdf->posstruct->pos); @@ -1103,7 +1103,7 @@ void dvi_special(PDF pdf, halfword p) { int old_setting; /* holds print |selector| */ - unsigned k; /* index into |cur_string| */ + unsigned k; /* index into |cur_string| */ synch_dvi_with_pos(pdf->posstruct->pos); old_setting = selector; selector = new_string; @@ -1118,7 +1118,7 @@ } for (k = 0; k < cur_length; k++) dvi_out(cur_string[k]); - cur_length = 0; /* erase the string */ + cur_length = 0; /* erase the string */ } /* @@ -1136,7 +1136,7 @@ void expand_macros_in_tokenlist(halfword p) { - integer old_mode; /* saved |mode| */ + int old_mode; /* saved |mode| */ pointer q, r; /* temporary variables for list manipulation */ q = get_avail(); token_info(q) = right_brace_token + '}'; @@ -1176,7 +1176,7 @@ int old_setting; /* holds print |selector| */ int j; /* write stream number */ boolean clobbered; /* system string is ok? */ - integer ret; /* return value from |runsystem| */ + int ret; /* return value from |runsystem| */ char *s, *ss; /* line to be written, as a C string */ int callback_id; int lua_retval; @@ -1217,20 +1217,20 @@ if (!log_opened) selector = term_only; tprint_nl("runsystem("); - tprint((char *)cur_string); + tprint((char *) cur_string); tprint(")..."); if (shellenabledp) { clobbered = false; - if (strlen((char *)cur_string)!=cur_length) + if (strlen((char *) cur_string) != cur_length) clobbered = true; - /* minimal checking: NUL not allowed in argument string of |system|() */ + /* minimal checking: NUL not allowed in argument string of |system|() */ if (clobbered) { tprint("clobbered"); } else { /* We have the command. See if we're allowed to execute it, and report in the log. We don't check the actual exit status of the command, or do anything with the output. */ - ret = runsystem((char *)cur_string); + ret = runsystem((char *) cur_string); if (ret == -1) tprint("quotation error in system command"); else if (ret == 0) @@ -1246,7 +1246,7 @@ print_char('.'); tprint_nl(""); print_ln(); - cur_length = 0; /* erase the string */ + cur_length = 0; /* erase the string */ } selector = old_setting; } @@ -1260,7 +1260,7 @@ void ensure_dvi_header_written(PDF pdf) { unsigned l; - unsigned s; /* index into |str_pool| */ + unsigned s; /* index into |str_pool| */ int old_setting; /* saved |selector| setting */ assert(pdf->o_mode == OMODE_DVI); assert(pdf->o_state == ST_FILE_OPEN); @@ -1303,8 +1303,8 @@ void dvi_begin_page(PDF pdf) { - integer k; - integer page_loc; /* location of the current |bop| */ + int k; + int page_loc; /* location of the current |bop| */ ensure_output_state(pdf, ST_HEADER_WRITTEN); /* Initialize variables as |ship_out| begins */ page_loc = dvi_offset + dvi_ptr; @@ -1351,9 +1351,9 @@ void finish_dvi_file(PDF pdf, int version, int revision) { - integer k; + int k; boolean res; - integer callback_id = callback_defined(stop_run_callback); + int callback_id = callback_defined(stop_run_callback); (void) version; (void) revision; while (cur_s > -1) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/dvi/dvigen.h luatex-0.50.0/source/texk/web2c/luatexdir/dvi/dvigen.h --- luatex-0.47.0/source/texk/web2c/luatexdir/dvi/dvigen.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/dvi/dvigen.h 2009-12-24 18:50:48.000000000 +0000 @@ -17,33 +17,33 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: dvigen.h 3041 2009-08-26 19:42:00Z hhenkel $ */ +/* $Id: dvigen.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef DVIGEN_H # define DVIGEN_H -extern integer total_pages; +extern int total_pages; extern scaled max_v; extern scaled max_h; -extern integer max_push; -extern integer last_bop; -extern integer dead_cycles; +extern int max_push; +extern int last_bop; +extern int dead_cycles; extern boolean doing_leaders; -extern integer c, f; -extern integer oval, ocmd; +extern int c, f; +extern int oval, ocmd; extern halfword g; -extern integer lq, lr; -extern integer cur_s; +extern int lq, lr; +extern int cur_s; typedef int dvi_index; /* an index into the output buffer */ -extern integer dvi_buf_size; +extern int dvi_buf_size; extern eight_bits *dvi_buf; /* 0 is unused */ extern dvi_index half_buf; extern dvi_index dvi_limit; extern dvi_index dvi_ptr; -extern integer dvi_offset; -extern integer dvi_gone; +extern int dvi_offset; +extern int dvi_gone; /* To put a byte in the buffer without paying the cost of invoking a procedure @@ -56,9 +56,9 @@ } while (0) extern void dvi_swap(void); -extern void dvi_four(integer x); +extern void dvi_four(int x); extern void dvi_push(void); -extern void dvi_pop(integer l); +extern void dvi_pop(int l); extern void out_cmd(void); extern void dvi_font_def(internal_font_number f); @@ -121,7 +121,7 @@ # define z_seen 12 /* we have seen |z_here| but not |y_here| */ extern void movement(scaled w, eight_bits o); -extern void prune_movements(integer l); +extern void prune_movements(int l); /* The actual distances by which we want to move might be computed as the @@ -184,7 +184,7 @@ extern void ensure_dvi_header_written(PDF pdf); extern void finish_dvi_file(PDF pdf, int version, int revision); -extern void dvi_place_glyph(PDF pdf, internal_font_number f, integer c); +extern void dvi_place_glyph(PDF pdf, internal_font_number f, int c); extern void dvi_place_rule(PDF pdf, halfword q, scaledpos size); extern void dvi_begin_page(PDF pdf); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/dofont.c luatex-0.50.0/source/texk/web2c/luatexdir/font/dofont.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/dofont.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/dofont.c 2009-12-24 18:51:08.000000000 +0000 @@ -22,7 +22,7 @@ #include "lua/luatex-api.h" static const char _svn_version[] = - "$Id: dofont.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/dofont.c $"; + "$Id: dofont.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/dofont.c $"; /* a bit more interfacing is needed for proper error reporting */ @@ -44,11 +44,11 @@ return str; } -static int do_define_font(integer f, char *cnom, scaled s, integer natural_dir) +static int do_define_font(int f, char *cnom, scaled s, int natural_dir) { boolean res; /* was the callback successful? */ - integer callback_id; + int callback_id; char *cnam; int r; res = 0; @@ -102,9 +102,9 @@ } -int read_font_info(pointer u, str_number nom, scaled s, integer natural_dir) +int read_font_info(pointer u, str_number nom, scaled s, int natural_dir) { - integer f; + int f; char *cnom; char *msg; cnom = makecstring(nom); @@ -137,7 +137,7 @@ int find_font_id(char *nom, scaled s) { - integer f; + int f; f = new_font(); if ((f = do_define_font(f, nom, s, -1))) { return f; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/luafont.c luatex-0.50.0/source/texk/web2c/luatexdir/font/luafont.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/luafont.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/luafont.c 2009-12-24 18:51:08.000000000 +0000 @@ -1,5 +1,5 @@ /* luafont.c - + Copyright 2006-2009 Taco Hoekwater This file is part of LuaTeX. @@ -17,14 +17,13 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ +static const char _svn_version[] = + "$Id: luafont.c 3274 2009-12-20 19:25:34Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/luafont.c $"; #include - #include "lua/luatex-api.h" -static const char _svn_version[] = - "$Id: luafont.c 3246 2009-12-10 22:22:21Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/luafont.c $"; - #define noVERBOSE char *font_type_strings[] = { "unknown", "virtual", "real", NULL }; @@ -385,7 +384,7 @@ int k; charinfo *co; if (font_cache_id(f) > 0) { - /* fetch the table from the registry if it was + /* fetch the table from the registry if it was saved there by font_from_lua() */ lua_rawgeti(L, LUA_REGISTRYINDEX, font_cache_id(f)); /* fontdimens can be changed from tex code */ @@ -436,13 +435,8 @@ lua_setfield(L, -2, "checksum"); lua_pushnumber(L, font_slant(f)); lua_setfield(L, -2, "slant"); - - if (font_extend(f) == 1000) - lua_pushnumber(L, 0); /* maybe this special case should be removed,... */ - else - lua_pushnumber(L, font_extend(f)); /* ...better 1000 = nonextended/natural */ + lua_pushnumber(L, font_extend(f)); lua_setfield(L, -2, "extend"); - lua_pushnumber(L, font_natural_dir(f)); lua_setfield(L, -2, "direction"); lua_pushnumber(L, font_encodingbytes(f)); @@ -527,7 +521,7 @@ lua_setfield(L, -2, "characters"); if (font_cache_id(f) == 0) { /* renew */ - integer r; + int r; lua_pushvalue(L, -1); r = luaL_ref(Luas, LUA_REGISTRYINDEX); /* pops the table */ set_font_cache_id(f, r); @@ -870,7 +864,7 @@ static void -read_char_packets(lua_State * L, integer * l_fonts, charinfo * co, int atsize) +read_char_packets(lua_State * L, int *l_fonts, charinfo * co, int atsize) { int i, n, m; size_t l; @@ -1172,8 +1166,8 @@ } void -font_char_from_lua(lua_State * L, internal_font_number f, integer i, - integer * l_fonts, boolean has_math) +font_char_from_lua(lua_State * L, internal_font_number f, int i, + int *l_fonts, boolean has_math) { int k, r, t; charinfo *co; @@ -1301,7 +1295,7 @@ ["bottom_right"]={ { ["height"]=0, ["kern"]=48 } }, ["top_left"] ={ { ["height"]=620, ["kern"]=0 }, { ["height"]=720, ["kern"]=-80 } }, ["top_right"] ={ { ["height"]=676, ["kern"]=115 }, { ["height"]=776, ["kern"]=45 } }, - } + } */ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_mathkern_index); lua_rawget(L, -2); @@ -1377,7 +1371,7 @@ lua_pushnil(L); /* first key */ if (lua_next(L, -2) != 0) { lua_pop(L, 2); - read_char_packets(L, (integer *) l_fonts, co, atsize); + read_char_packets(L, (int *) l_fonts, co, atsize); } } lua_pop(L, 1); @@ -1451,8 +1445,8 @@ int bc; /* first char index */ int ec; /* last char index */ char *s; - integer *l_fonts = NULL; - integer save_ref = 1; /* unneeded, really */ + int *l_fonts = NULL; + int save_ref = 1; /* unneeded, really */ boolean no_math = false; /* will we save a cache of the luat table? */ @@ -1502,19 +1496,17 @@ i = numeric_field(L, "tounicode", 0); set_font_tounicode(f, i); - i = numeric_field(L, "extend", 0); - if (i < -2000) - i = -2000; - if (i > 2000) - i = 2000; - if (i == 0) - i = 1000; + i = numeric_field(L, "extend", 1000); + if (i < FONT_EXTEND_MIN) + i = FONT_EXTEND_MIN; + if (i > FONT_EXTEND_MAX) + i = FONT_EXTEND_MAX; set_font_extend(f, i); i = numeric_field(L, "slant", 0); - if (i < -1000) - i = -1000; - if (i > 1000) - i = 1000; + if (i < FONT_SLANT_MIN) + i = FONT_SLANT_MIN; + if (i > FONT_SLANT_MAX) + i = FONT_SLANT_MAX; set_font_slant(f, i); i = numeric_field(L, "hyphenchar", int_par(default_hyphen_char_code)); @@ -1545,8 +1537,8 @@ /* now fetch the base fonts, if needed */ n = count_hash_items(L, luaS_index(fonts)); if (n > 0) { - l_fonts = xmalloc((n + 2) * sizeof(integer)); - memset(l_fonts, 0, (n + 2) * sizeof(integer)); + l_fonts = xmalloc((n + 2) * sizeof(int)); + memset(l_fonts, 0, (n + 2) * sizeof(int)); lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(fonts)); lua_rawget(L, -2); for (i = 1; i <= n; i++) { @@ -1573,8 +1565,8 @@ t = (lua_isnumber(L, -1) ? lua_roundnumber(L, -1) : -1000); lua_pop(L, 1); - /* TODO: the stack is messed up, otherwise this - * explicit resizing would not be needed + /* TODO: the stack is messed up, otherwise this + * explicit resizing would not be needed */ s_top = lua_gettop(L); if (strcmp(font_name(f), s) == 0) @@ -1592,7 +1584,7 @@ if (font_type(f) == virtual_font_type) { pdftex_fail("Invalid local fonts in font %s!\n", font_name(f)); } else { - l_fonts = xmalloc(3 * sizeof(integer)); + l_fonts = xmalloc(3 * sizeof(int)); l_fonts[0] = 0; l_fonts[1] = f; l_fonts[2] = 0; @@ -1659,7 +1651,7 @@ } lua_pop(L, 1); - /* handle font expansion last: the |copy_font| routine is called eventually, + /* handle font expansion last: the |copy_font| routine is called eventually, and that needs to know |bc| and |ec|. */ if (font_type(f) != virtual_font_type) { int fstep = numeric_field(L, "step", 0); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/luatexfont.h luatex-0.50.0/source/texk/web2c/luatexdir/font/luatexfont.h --- luatex-0.47.0/source/texk/web2c/luatexdir/font/luatexfont.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/luatexfont.h 2009-12-24 18:51:08.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: luatexfont.h 3246 2009-12-10 22:22:21Z hhenkel $ */ +/* $Id: luatexfont.h 3285 2009-12-23 19:37:18Z hhenkel $ */ #ifndef LUATEXFONT_H # define LUATEXFONT_H @@ -83,19 +83,19 @@ } intparm; typedef struct { - integer fe_objnum; /* object number */ + int fe_objnum; /* object number */ char *name; /* encoding file name */ char **glyph_names; /* array of glyph names */ struct avl_table *tx_tree; /* tree of encoding positions marked as used by TeX */ } fe_entry; typedef struct fd_entry_ { - integer fd_objnum; /* object number of the font descriptor object */ + int fd_objnum; /* object number of the font descriptor object */ char *fontname; /* /FontName (without subset tag) */ char *subset_tag; /* 6-character subset tag */ boolean ff_found; - integer ff_objnum; /* object number of the font program stream */ - integer fn_objnum; /* font name object number (embedded PDF) */ + int ff_objnum; /* object number of the font program stream */ + int fn_objnum; /* font name object number (embedded PDF) */ boolean all_glyphs; /* embed all glyphs? */ boolean write_ttf_glyph_names; intparm font_dim[FONT_KEYS_NUM]; @@ -107,16 +107,16 @@ } fd_entry; typedef struct fo_entry_ { - integer fo_objnum; /* object number of the font dictionary */ + int fo_objnum; /* object number of the font dictionary */ internalfontnumber tex_font; /* needed only for \pdffontattr{} */ fm_entry *fm; /* pointer to font map structure for this font dictionary */ fd_entry *fd; /* pointer to /FontDescriptor object structure */ fe_entry *fe; /* pointer to encoding structure */ - integer cw_objnum; /* object number of the font program object */ - integer first_char; /* first character used in this font */ - integer last_char; /* last character used in this font */ + int cw_objnum; /* object number of the font program object */ + int first_char; /* first character used in this font */ + int last_char; /* last character used in this font */ struct avl_table *tx_tree; /* tree of non-reencoded TeX characters marked as used */ - integer tounicode_objnum; /* object number of ToUnicode */ + int tounicode_objnum; /* object number of ToUnicode */ } fo_entry; typedef struct { @@ -132,7 +132,7 @@ } glw_entry; typedef struct { - integer charcode, cwidth, cheight, xoff, yoff, xescape, rastersize; + int charcode, cwidth, cheight, xoff, yoff, xescape, rastersize; halfword *raster; } chardesc; @@ -141,15 +141,15 @@ # include "texfont.h" /* tounicode.c */ -integer write_cid_tounicode(PDF, fo_entry *, internal_font_number); +int write_cid_tounicode(PDF, fo_entry *, internal_font_number); void glyph_unicode_free(void); void def_tounicode(str_number, str_number); -integer write_tounicode(PDF, char **, char *); +int write_tounicode(PDF, char **, char *); /* vfpacket.c */ -void replace_packet_fonts(internal_font_number f, integer * old_fontid, - integer * new_fontid, int count); -integer *packet_local_fonts(internal_font_number f, integer * num); +void replace_packet_fonts(internal_font_number f, int *old_fontid, + int *new_fontid, int count); +int *packet_local_fonts(internal_font_number f, int *num); /* writecff.c */ void writetype1w(PDF pdf, fd_entry * fd); @@ -158,13 +158,10 @@ void writetype0(PDF pdf, fd_entry * fd); /* writefont.c */ -void do_pdf_font(PDF, integer, internalfontnumber); -fd_entry *lookup_fd_entry(char *, integer); +void do_pdf_font(PDF, int, internalfontnumber); +fd_entry *lookup_fd_entry(char *); fd_entry *new_fd_entry(void); void write_fontstuff(PDF); -integer get_fd_objnum(fd_entry * fd); -integer get_fn_objnum(PDF, fd_entry *); -void embed_whole_font(fd_entry * fd); void register_fd_entry(fd_entry * fd); /* writet1.c */ @@ -172,7 +169,7 @@ char **load_enc_file(char *); void writet1(PDF, fd_entry *); void t1_free(void); -extern integer t1_length1, t1_length2, t1_length3; +extern int t1_length1, t1_length2, t1_length3; /* writetype2.c */ void writetype2(PDF, fd_entry *); @@ -194,7 +191,7 @@ void writettf(PDF, fd_entry *); void writeotf(PDF, fd_entry *); void ttf_free(void); -extern integer ttf_length; +extern int ttf_length; /* pkin.c */ int readchar(boolean, chardesc *); @@ -205,9 +202,9 @@ /* vfovf.c */ void vf_expand_local_fonts(internal_font_number f); internal_font_number letter_space_font(halfword u, internal_font_number f, - integer e); -internal_font_number auto_expand_font(internal_font_number f, integer e); -str_number expand_font_name(internal_font_number f, integer e); + int e); +internal_font_number auto_expand_font(internal_font_number f, int e); +str_number expand_font_name(internal_font_number f, int e); void pdf_check_vf(internal_font_number f); internal_font_number copy_font_info(internal_font_number f); @@ -216,8 +213,8 @@ void writet3(PDF, int, internalfontnumber); extern unsigned char *t3_buffer; -extern integer t3_size; -extern integer t3_curbyte; +extern int t3_size; +extern int t3_curbyte; # define t3_read_file() readbinfile(t3_file, &t3_buffer, &t3_size) # define t3_close() xfclose(t3_file, cur_file_name) diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/macnames.c luatex-0.50.0/source/texk/web2c/luatexdir/font/macnames.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/macnames.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/macnames.c 2009-12-24 18:51:08.000000000 +0000 @@ -19,7 +19,7 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: macnames.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/macnames.c $"; + "$Id: macnames.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/macnames.c $"; const char notdef[] = ".notdef"; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/mapfile.c luatex-0.50.0/source/texk/web2c/luatexdir/font/mapfile.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/mapfile.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/mapfile.c 2009-12-24 18:51:08.000000000 +0000 @@ -1,5 +1,5 @@ /* mapfile.c - + Copyright 1996-2006 Han The Thanh Copyright 2006-2009 Taco Hoekwater @@ -18,24 +18,23 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ +static const char _svn_version[] = + "$Id: mapfile.c 3282 2009-12-21 21:55:47Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/mapfile.c $"; + #include #include "ptexlib.h" #include #include #include - -static const char _svn_version[] = - "$Id: mapfile.c 3247 2009-12-10 23:57:37Z oneiros $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/mapfile.c $"; - #define FM_BUF_SIZE 1024 static FILE *fm_file; static unsigned char *fm_buffer = NULL; -static integer fm_size = 0; -static integer fm_curbyte = 0; +static int fm_size = 0; +static int fm_curbyte = 0; #define fm_open(a) \ (fm_file = fopen((char *)(a), FOPEN_RBIN_MODE)) @@ -91,7 +90,9 @@ fm->pid = -1; fm->eid = -1; fm->subfont = NULL; - fm->in_use = false; + unset_slantset(fm); + unset_extendset(fm); + unset_inuse(fm); return fm; } @@ -129,7 +130,6 @@ /**********************************************************************/ struct avl_table *tfm_tree = NULL; -struct avl_table *ps_tree = NULL; struct avl_table *ff_tree = NULL; struct avl_table *encname_tree = NULL; @@ -142,20 +142,6 @@ ((const fm_entry *) pb)->tfm_name); } -/* AVL sort fm_entry into ps_tree by ps_name and extend */ - -static int comp_fm_entry_ps(const void *pa, const void *pb, void *p) -{ - int i; - const fm_entry *p1 = (const fm_entry *) pa, *p2 = (const fm_entry *) pb; - (void) p; - assert(p1->ps_name != NULL && p2->ps_name != NULL); - if ((i = strcmp(p1->ps_name, p2->ps_name))) - return i; - cmp_return(p1->extend, p2->extend); - return 0; -} - /* AVL sort ff_entry into ff_tree by ff_name */ static int comp_ff_entry(const void *pa, const void *pb, void *p) @@ -170,9 +156,6 @@ assert(tfm_tree == NULL); tfm_tree = avl_create(comp_fm_entry_tfm, NULL, &avl_xallocator); assert(tfm_tree != NULL); - assert(ps_tree == NULL); - ps_tree = avl_create(comp_fm_entry_ps, NULL, &avl_xallocator); - assert(ps_tree != NULL); assert(ff_tree == NULL); ff_tree = avl_create(comp_ff_entry, NULL, &avl_xallocator); assert(ff_tree != NULL); @@ -181,21 +164,11 @@ assert(encname_tree != NULL); } -/* -The function avl_do_entry() is not completely symmetrical with regards -to tfm_name and ps_name handling, e. g. a duplicate tfm_name gives a -"goto exit", and no ps_name link is tried. This is to keep it compatible -with the original version. -*/ - int avl_do_entry(fm_entry * fm, int mode) { fm_entry *p; void *a; void **aa; - - /* handle tfm_name link */ - if (strcmp(fm->tfm_name, nontfm)) { p = (fm_entry *) avl_find(tfm_tree, fm); if (p != NULL) { @@ -208,7 +181,7 @@ break; case FM_REPLACE: case FM_DELETE: - if (p->in_use) { + if (is_inuse(p)) { pdftex_warn ("fontmap entry for `%s' has been used, replace/delete not allowed", fm->tfm_name); @@ -217,8 +190,7 @@ a = avl_delete(tfm_tree, p); assert(a != NULL); unset_tfmlink(p); - if (!has_pslink(p)) - delete_fm_entry(p); + delete_fm_entry(p); break; default: assert(0); @@ -230,38 +202,8 @@ set_tfmlink(fm); } } - - /* handle ps_name link */ - - if (fm->ps_name != NULL) { - p = (fm_entry *) avl_find(ps_tree, fm); - if (p != NULL) { - switch (mode) { - case FM_DUPIGNORE: - goto exit; - break; - case FM_REPLACE: - case FM_DELETE: - if (p->in_use) - goto exit; - a = avl_delete(ps_tree, p); - assert(a != NULL); - unset_pslink(p); - if (!has_tfmlink(p)) - delete_fm_entry(p); - break; - default: - assert(0); - } - } - if (mode != FM_DELETE && is_t1fontfile(fm) && is_included(fm)) { - aa = avl_probe(ps_tree, fm); - assert(aa != NULL); - set_pslink(fm); - } - } exit: - if (!has_tfmlink(fm) && !has_pslink(fm)) /* e. g. after FM_DELETE */ + if (!has_tfmlink(fm)) /* e. g. after FM_DELETE */ return 1; /* deallocation of fm_entry structure required */ else return 0; @@ -318,24 +260,15 @@ a += 2; } - /* ExtendFont can be used only with Type1 fonts */ - if (fm->extend != 1000 && !(is_t1fontfile(fm) && is_included(fm))) { - if (warn) - pdftex_warn - ("invalid entry for `%s': ExtendFont can be used only with embedded Type1 fonts", - fm->tfm_name); - a += 4; - } - /* the value of SlantFont and ExtendFont must be reasonable */ - if (abs(fm->slant) > 1000) { + if (fm->slant < FONT_SLANT_MIN || fm->slant > FONT_SLANT_MAX) { if (warn) pdftex_warn ("invalid entry for `%s': too big value of SlantFont (%g)", fm->tfm_name, fm->slant / 1000.0); a += 8; } - if (abs(fm->extend) > 2000) { + if (fm->extend < FONT_EXTEND_MIN || fm->extend > FONT_EXTEND_MAX) { if (warn) pdftex_warn ("invalid entry for `%s': too big value of ExtendFont (%g)", @@ -474,13 +407,13 @@ s--; /* e. g. 0.5ExtendFont: %f = 0.5E */ if (str_prefix(s, "SlantFont")) { d *= 1000.0; /* correct rounding also for neg. numbers */ - fm->slant = (integer) (d > 0 ? d + 0.5 : d - 0.5); + fm->slant = (int) (d > 0 ? d + 0.5 : d - 0.5); + set_slantset(fm); r = s + strlen("SlantFont"); } else if (str_prefix(s, "ExtendFont")) { d *= 1000.0; - fm->extend = (integer) (d > 0 ? d + 0.5 : d - 0.5); - if (fm->extend == 0) /* special user case... */ - fm->extend = 1000; /* ...mapped to natural internal representation */ + fm->extend = (int) (d > 0 ? d + 0.5 : d - 0.5); + set_extendset(fm); r = s + strlen("ExtendFont"); } else { /* unknown name */ for (r = s; *r != ' ' && *r != '"' && *r != '\0'; r++); /* jump over name */ @@ -660,11 +593,11 @@ return (fm_entry_ptr) dummy_fm_entry(); assert(strcmp(tfm, nontfm)); - /* Look up for full [+-] */ + /* Look up for tfmname */ tmp.tfm_name = tfm; fm = (fm_entry *) avl_find(tfm_tree, &tmp); if (fm != NULL) { - fm->in_use = true; + set_inuse(fm); return (fm_entry_ptr) fm; } return (fm_entry_ptr) dummy_fm_entry(); @@ -675,98 +608,14 @@ if (font_map(f) == NULL) set_font_map(f, (fm_entry_ptr) fmlookup(f)); assert(font_map(f) != NULL); - font_slant(f) = ((fm_entry *) font_map(f))->slant; - font_extend(f) = ((fm_entry *) font_map(f))->extend; + /* TODO: this still overrides already set font_slant(f) */ + if (is_slantset((fm_entry *) font_map(f))) + font_slant(f) = ((fm_entry *) font_map(f))->slant; + if (is_extendset((fm_entry *) font_map(f))) + font_extend(f) = ((fm_entry *) font_map(f))->extend; return font_map(f) != (fm_entry_ptr) dummy_fm_entry(); } -/* check whether a map entry is valid for font replacement */ - -static boolean fm_valid_for_font_replacement(fm_entry * fm) -{ - ff_entry *ff; - - assert(fm != NULL); - assert(is_fontfile(fm)); /* ps_tree should contain only entries with font file */ - assert(is_type1(fm)); /* ps_tree should contain only Type1 entries */ - - ff = check_ff_exist(fm->ff_name, false); - assert(ff != NULL); - if (ff->ff_path == NULL) /* ...there is no font file available */ - return false; - return true; /* all tests passed */ -} - -/**********************************************************************/ -/* - * lookup fontmap by ps_name; - * used for Type1 font replacement when embedding of PDF files - */ - -fm_entry *lookup_fontmap(char *ps_name) -{ - fm_entry *fm, *fm2, tmp; - char *a, *b, *e, *s; - int i, ex; - struct avl_traverser t, t2; - if (tfm_tree == NULL) - fm_read_info(); /* only to read default map file */ - assert(ps_name != NULL); - s = ps_name; - if (strlen(ps_name) > 7) { /* check for subsetted name tag */ - for (i = 0; i < 6; i++, s++) - if (*s < 'A' || *s > 'Z') - break; - if (i == 6 && *s == '+') - s++; /* if name tag found, skip behind it */ - else - s = ps_name; - } - - /* - * Scan -Extend_ font name extensions; format: - * -Extend_ - */ - - tmp.extend = 1000; - if ((a = strstr(s, "-Extend_")) != NULL) { - b = a + strlen("-Extend_"); - ex = (int) strtol(b, &e, 10); - if ((e != b) && (e == strend(b))) { - tmp.extend = ex; - *a = '\0'; /* ps_name string ends before "-Extend_" */ - } - } - tmp.ps_name = s; - - fm = (fm_entry *) avl_t_find(&t, ps_tree, &tmp); - if (fm == NULL) - return NULL; /* no entry found */ - - /* at this point we know there is at least one fm_entry with given ps_name; - * we test all such entries and return the first one that is valid for font - * replacement */ - - t2 = t; - fm2 = (fm_entry *) avl_t_prev(&t2); - - /* search forward */ - do { - if (fm_valid_for_font_replacement(fm)) - return fm; - fm = (fm_entry *) avl_t_next(&t); - } while (fm != NULL && comp_fm_entry_ps(fm, &tmp, NULL) == 0); - - /* search backward */ - while (fm2 != NULL && comp_fm_entry_ps(fm2, &tmp, NULL) == 0) { - if (fm_valid_for_font_replacement(fm2)) - return fm2; - fm2 = (fm_entry *) avl_t_prev(&t2); - } - - return NULL; -} - /**********************************************************************/ /* * Process map file given by its name or map line contents. Items not @@ -822,14 +671,14 @@ } } -void pdfmapfile(integer t) +void pdfmapfile(int t) { char *s = tokenlist_to_cstring(t, true, NULL); process_map_item(s, MAPFILE); free(s); } -void pdfmapline(integer t) +void pdfmapline(int t) { char *s = tokenlist_to_cstring(t, true, NULL); process_map_item(s, MAPLINE); @@ -854,7 +703,7 @@ * same fonts are to be embedded. * * The ff_tree contains only font files, which are actually needed, - * so this tree typically is much smaller than the tfm_tree or ps_tree. + * so this tree typically is much smaller than the tfm_tree. */ ff_entry *check_ff_exist(char *ff_name, boolean is_tt) @@ -914,21 +763,7 @@ fm_entry *fm; (void) pb; fm = (fm_entry *) pa; - if (!has_pslink(fm)) - delete_fm_entry(fm); - else - unset_tfmlink(fm); -} - -static void destroy_fm_entry_ps(void *pa, void *pb) -{ - fm_entry *fm; - (void) pb; - fm = (fm_entry *) pa; - if (!has_tfmlink(fm)) - delete_fm_entry(fm); - else - unset_pslink(fm); + delete_fm_entry(fm); } static void destroy_ff_entry(void *pa, void *pb) @@ -945,10 +780,6 @@ avl_destroy(tfm_tree, destroy_fm_entry_tfm); tfm_tree = NULL; } - if (ps_tree != NULL) { - avl_destroy(ps_tree, destroy_fm_entry_ps); - ps_tree = NULL; - } if (ff_tree != NULL) { avl_destroy(ff_tree, destroy_ff_entry); ff_tree = NULL; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/mapfile.h luatex-0.50.0/source/texk/web2c/luatexdir/font/mapfile.h --- luatex-0.47.0/source/texk/web2c/luatexdir/font/mapfile.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/mapfile.h 2009-12-24 18:51:08.000000000 +0000 @@ -17,19 +17,22 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: mapfile.h 3225 2009-12-04 11:20:53Z taco $ */ +/* $Id: mapfile.h 3282 2009-12-21 21:55:47Z hhenkel $ */ #ifndef MAPFILE_H # define MAPFILE_H -# define F_INCLUDED 0x01 -# define F_SUBSETTED 0x02 -# define F_STDT1FONT 0x04 -# define F_SUBFONT 0x08 -# define F_TYPE1 0x10 -# define F_TRUETYPE 0x20 -# define F_OTF 0x40 -# define F_CIDKEYED 0x80 +# define F_INCLUDED (1 << 0) +# define F_SUBSETTED (1 << 1) +# define F_STDT1FONT (1 << 2) +# define F_SUBFONT (1 << 3) +# define F_TYPE1 (1 << 4) +# define F_TRUETYPE (1 << 5) +# define F_OTF (1 << 6) +# define F_CIDKEYED (1 << 7) +# define F_SLANTSET (1 << 8) +# define F_EXTENDSET (1 << 9) +# define F_INUSE (1 << 10) typedef enum { MAPFILE, MAPLINE } maptype; extern void process_map_item(char *s, int type); @@ -41,8 +44,10 @@ # define set_type1(fm) ((fm)->type |= F_TYPE1) # define set_truetype(fm) ((fm)->type |= F_TRUETYPE) # define set_opentype(fm) ((fm)->type |= F_OTF) -# define set_subfont(fm) ((fm)->type |= F_SUBFONT) # define set_cidkeyed(fm) ((fm)->type |= F_CIDKEYED) +# define set_slantset(fm) ((fm)->type |= F_SLANTSET) +# define set_extendset(fm) ((fm)->type |= F_EXTENDSET) +# define set_inuse(fm) ((fm)->type |= F_INUSE) # define unset_included(fm) ((fm)->type &= ~F_INCLUDED) # define unset_subsetted(fm) ((fm)->type &= ~F_SUBSETTED) @@ -51,8 +56,10 @@ # define unset_type1(fm) ((fm)->type &= ~F_TYPE1) # define unset_truetype(fm) ((fm)->type &= ~F_TRUETYPE) # define unset_opentype(fm) ((fm)->type &= ~F_OTF) -# define unset_subfont(fm) ((fm)->type &= ~F_SUBFONT) # define unset_cidkeyed(fm) ((fm)->type &= ~F_CIDKEYED) +# define unset_slantset(fm) ((fm)->type &= ~F_SLANTSET) +# define unset_extendset(fm) ((fm)->type &= ~F_EXTENDSET) +# define unset_inuse(fm) ((fm)->type &= ~F_INUSE) # define is_included(fm) (((fm)->type & F_INCLUDED) != 0) # define is_subsetted(fm) (((fm)->type & F_SUBSETTED) != 0) @@ -61,8 +68,10 @@ # define is_type1(fm) (((fm)->type & F_TYPE1) != 0) # define is_truetype(fm) (((fm)->type & F_TRUETYPE) != 0) # define is_opentype(fm) (((fm)->type & F_OTF) != 0) -# define is_subfont(fm) (((fm)->type & F_SUBFONT) != 0) # define is_cidkeyed(fm) (((fm)->type & F_CIDKEYED) != 0) +# define is_slantset(fm) (((fm)->type & F_SLANTSET) != 0) +# define is_extendset(fm) (((fm)->type & F_EXTENDSET) != 0) +# define is_inuse(fm) (((fm)->type & F_INUSE) != 0) # define fm_slant(fm) (fm)->slant # define fm_extend(fm) (fm)->extend @@ -74,13 +83,9 @@ # define is_builtin(fm) (!is_fontfile(fm)) # define LINK_TFM 0x01 -# define LINK_PS 0x02 # define set_tfmlink(fm) ((fm)->links |= LINK_TFM) -# define set_pslink(fm) ((fm)->links |= LINK_PS) # define unset_tfmlink(fm) ((fm)->links &= ~LINK_TFM) -# define unset_pslink(fm) ((fm)->links &= ~LINK_PS) # define has_tfmlink(fm) ((fm)->links & LINK_TFM) -# define has_pslink(fm) ((fm)->links & LINK_PS) /**********************************************************************/ @@ -89,9 +94,9 @@ char *tfm_name; /* TFM file name (1st field in map line) */ char *sfd_name; /* subfont directory name, like @sfd_name@ */ char *ps_name; /* PostScript name (optional 2nd field in map line) */ - integer fd_flags; /* font descriptor /Flags (PDF Ref. section 5.7.1) */ - integer slant; /* SlantFont */ - integer extend; /* ExtendFont */ + int fd_flags; /* font descriptor /Flags (PDF Ref. section 5.7.1) */ + int slant; /* SlantFont */ + int extend; /* ExtendFont */ char *encname; /* encoding file name */ char *ff_name; /* font file name */ unsigned short type; /* various flags */ @@ -100,7 +105,6 @@ /* parameters NOT scanned from the map file: */ subfont_entry *subfont; /* subfont mapping */ unsigned short links; /* link flags from tfm_tree and ps_tree */ - boolean in_use; /* true if this structure has been referenced already */ } fm_entry; typedef struct { @@ -110,13 +114,19 @@ /**********************************************************************/ -fm_entry *lookup_fontmap(char *); +# define FONT_SLANT_MIN -2000 +# define FONT_SLANT_MAX 2000 +# define FONT_EXTEND_MIN -5000 +# define FONT_EXTEND_MAX 5000 + +/**********************************************************************/ + boolean hasfmentry(internalfontnumber); void fm_free(void); void fm_read_info(void); ff_entry *check_ff_exist(char *, boolean); -void pdfmapfile(integer); -void pdfmapline(integer); +void pdfmapfile(int); +void pdfmapline(int); void pdf_init_map_file(string map_name); fm_entry *new_fm_entry(void); void delete_fm_entry(fm_entry *); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/pkin.c luatex-0.50.0/source/texk/web2c/luatexdir/font/pkin.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/pkin.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/pkin.c 2009-12-24 18:51:08.000000000 +0000 @@ -47,7 +47,7 @@ typedef short shalfword; static const char _svn_version[] = - "$Id: pkin.c 2870 2009-07-16 11:46:18Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/pkin.c $"; + "$Id: pkin.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/pkin.c $"; /* * Now we have some routines to get stuff from the pk file. pkbyte returns @@ -63,9 +63,9 @@ return (i); } -static integer pkduo(void) +static int pkduo(void) { - register integer i; + register int i; i = pkbyte(); if (i > 127) @@ -74,9 +74,9 @@ return (i); } -static integer pktrio(void) +static int pktrio(void) { - register integer i; + register int i; i = pkbyte(); if (i > 127) @@ -86,9 +86,9 @@ return (i); } -static integer pkquad(void) +static int pkquad(void) { - register integer i; + register int i; i = pkbyte(); if (i > 127) @@ -225,7 +225,7 @@ static void unpack(chardesc * cd) { - register integer i, j; + register int i, j; register halfword word, wordweight; halfword *raster; shalfword rowsleft; @@ -315,7 +315,7 @@ } turnon = !turnon; } - if ((rowsleft != 0) || ((integer) hbit != cd->cwidth)) + if ((rowsleft != 0) || ((int) hbit != cd->cwidth)) pdftex_fail("error while unpacking; more bits than required"); } } @@ -336,8 +336,8 @@ int readchar(boolean check_preamble, chardesc * cd) { register shalfword i; - register integer k; - register integer length = 0; + register int k; + register int length = 0; /* * Check the preamble of the pkfile diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/sfnt.c luatex-0.50.0/source/texk/web2c/luatexdir/font/sfnt.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/sfnt.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/sfnt.c 2009-12-24 18:51:08.000000000 +0000 @@ -40,7 +40,7 @@ #include "sfnt.h" static const char _svn_version[] = - "$Id: sfnt.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/sfnt.c $"; + "$Id: sfnt.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/sfnt.c $"; #ifdef XETEX UNSIGNED_BYTE ft_unsigned_byte(sfnt * f) @@ -162,7 +162,7 @@ } #else /* not XETEX */ # ifdef pdfTeX -sfnt *sfnt_open(unsigned char *buffer, integer buflen) +sfnt *sfnt_open(unsigned char *buffer, int buflen) { sfnt *sfont; ULONG type; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/sfnt.h luatex-0.50.0/source/texk/web2c/luatexdir/font/sfnt.h --- luatex-0.47.0/source/texk/web2c/luatexdir/font/sfnt.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/sfnt.h 2009-12-24 18:51:08.000000000 +0000 @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: sfnt.h 2271 2009-04-12 23:42:21Z oneiros $ */ +/* $Id: sfnt.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef _SFNT_H_ # define _SFNT_H_ @@ -157,7 +157,7 @@ # ifdef XETEX extern sfnt *sfnt_open(FT_Face face, int accept_types); # elif defined(pdfTeX) -extern sfnt *sfnt_open(unsigned char *buffer, integer buflen); +extern sfnt *sfnt_open(unsigned char *buffer, int buflen); # else extern sfnt *sfnt_open(FILE * fp); # endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/subfont.c luatex-0.50.0/source/texk/web2c/luatexdir/font/subfont.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/subfont.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/subfont.c 2009-12-24 18:51:08.000000000 +0000 @@ -22,13 +22,13 @@ #include static const char _svn_version[] = - "$Id: subfont.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/subfont.c $"; + "$Id: subfont.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/subfont.c $"; static struct avl_table *sfd_tree = NULL; static unsigned char *sfd_buffer = NULL; -static integer sfd_size = 0; -static integer sfd_curbyte = 0; +static int sfd_size = 0; +static int sfd_curbyte = 0; #define SFD_BUF_SIZE SMALL_BUF_SIZE diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/texfont.c luatex-0.50.0/source/texk/web2c/luatexdir/font/texfont.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/texfont.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/texfont.c 2009-12-24 18:51:08.000000000 +0000 @@ -17,6 +17,10 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ +static const char _svn_version[] = + "$Id: texfont.c 3272 2009-12-20 18:58:08Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/texfont.c $"; + /* Main font API implementation for the pascal parts */ /* stuff to watch out for: @@ -32,22 +36,18 @@ */ #include "ptexlib.h" - #include "lua/luatex-api.h" #define noDEBUG -static const char _svn_version[] = - "$Id: texfont.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/texfont.c $"; - #define proper_char_index(c) (c<=font_ec(f) && c>=font_bc(f)) #define dxfree(a,b) { xfree(a); a = b ; } #define do_realloc(a,b,d) a = xrealloc(a,(b)*sizeof(d)) texfont **font_tables = NULL; -static integer font_arr_max = 0; -static integer font_id_maxval = 0; +static int font_arr_max = 0; +static int font_id_maxval = 0; extern extinfo *get_charinfo_vert_variants(charinfo * ci); extern extinfo *get_charinfo_hor_variants(charinfo * ci); @@ -57,7 +57,7 @@ extern extinfo *copy_variants(extinfo * o); -static void grow_font_table(integer id) +static void grow_font_table(int id) { int j; if (id >= font_arr_max) { @@ -71,7 +71,7 @@ } } -integer new_font_id(void) +int new_font_id(void) { int i; for (i = 0; i < font_arr_max; i++) { @@ -86,17 +86,17 @@ return i; } -integer max_font_id(void) +int max_font_id(void) { return font_id_maxval; } -void set_max_font_id(integer i) +void set_max_font_id(int i) { font_id_maxval = i; } -integer new_font(void) +int new_font(void) { int k; int id; @@ -121,6 +121,8 @@ set_font_bc(id, 1); /* ec = 0 */ set_hyphen_char(id, '-'); set_skew_char(id, -1); + font_slant(id) = 0; /* vertical */ + font_extend(id) = 1000; /* normal width */ /* allocate eight values including 0 */ set_font_params(id, 7); @@ -150,7 +152,7 @@ #define find_charinfo_id(f,c) get_sa_item(font_tables[f]->characters,c) -charinfo *get_charinfo(internal_font_number f, integer c) +charinfo *get_charinfo(internal_font_number f, int c) { sa_tree_item glyph; charinfo *ci; @@ -184,7 +186,7 @@ return &(font_tables[f]->charinfo[0]); } -void set_charinfo(internal_font_number f, integer c, charinfo * ci) +void set_charinfo(internal_font_number f, int c, charinfo * ci) { sa_tree_item glyph; if (proper_char_index(c)) { @@ -314,7 +316,7 @@ return co; } -charinfo *char_info(internal_font_number f, integer c) +charinfo *char_info(internal_font_number f, int c) { if (f > font_id_maxval) return 0; @@ -329,7 +331,7 @@ return &(font_tables[f]->charinfo[0]); } -scaled_whd get_charinfo_whd(internal_font_number f, integer c) +scaled_whd get_charinfo_whd(internal_font_number f, int c) { scaled_whd s; charinfo *i; @@ -340,7 +342,7 @@ return s; } -integer char_exists(internal_font_number f, integer c) +int char_exists(internal_font_number f, int c) { if (f > font_id_maxval) return 0; @@ -354,9 +356,9 @@ return 0; } -int lua_char_exists_callback(internal_font_number f, integer c) +int lua_char_exists_callback(internal_font_number f, int c) { - integer callback_id; + int callback_id; lua_State *L = Luas; int ret = 0; callback_id = callback_defined(char_exists_callback); @@ -420,7 +422,7 @@ extinfo *undump_variant(void) { - integer x; + int x; extinfo *ext; undump_int(x); if (x == 0) @@ -683,7 +685,7 @@ static void dump_math_kerns(charinfo * ci) { - integer k, l; + int k, l; l = ci->top_left_math_kerns; dump_int(l); for (k = 0; k < l; k++) { @@ -713,7 +715,7 @@ static void undump_math_kerns(charinfo * ci) { int k; - integer x; + int x; undump_int(x); ci->top_left_math_kerns = (int) x; if (x > 0) @@ -834,7 +836,7 @@ return ci->tag; } -integer get_charinfo_remainder(charinfo * ci) +int get_charinfo_remainder(charinfo * ci) { return ci->remainder; } @@ -844,7 +846,7 @@ return ci->used; } -integer get_charinfo_index(charinfo * ci) +int get_charinfo_index(charinfo * ci) { return ci->index; } @@ -874,17 +876,17 @@ return ci->packets; } -integer get_charinfo_ef(charinfo * ci) +int get_charinfo_ef(charinfo * ci) { return ci->ef; } -integer get_charinfo_rp(charinfo * ci) +int get_charinfo_rp(charinfo * ci) { return ci->rp; } -integer get_charinfo_lp(charinfo * ci) +int get_charinfo_lp(charinfo * ci) { return ci->lp; } @@ -906,7 +908,7 @@ } -scaled char_width(internal_font_number f, integer c) +scaled char_width(internal_font_number f, int c) { charinfo *ci = char_info(f, c); scaled w = get_charinfo_width(ci); @@ -914,7 +916,7 @@ return w; } -scaled char_depth(internal_font_number f, integer c) +scaled char_depth(internal_font_number f, int c) { charinfo *ci = char_info(f, c); scaled w = get_charinfo_depth(ci); @@ -922,7 +924,7 @@ return w; } -scaled char_height(internal_font_number f, integer c) +scaled char_height(internal_font_number f, int c) { charinfo *ci = char_info(f, c); scaled w = get_charinfo_height(ci); @@ -930,68 +932,68 @@ return w; } -scaled char_italic(internal_font_number f, integer c) +scaled char_italic(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_italic(ci); } -scaled char_top_accent(internal_font_number f, integer c) +scaled char_top_accent(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_top_accent(ci); } -scaled char_bot_accent(internal_font_number f, integer c) +scaled char_bot_accent(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_bot_accent(ci); } -integer char_remainder(internal_font_number f, integer c) +int char_remainder(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_remainder(ci); } -char char_tag(internal_font_number f, integer c) +char char_tag(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_tag(ci); } -char char_used(internal_font_number f, integer c) +char char_used(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_used(ci); } -char *char_name(internal_font_number f, integer c) +char *char_name(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_name(ci); } -integer char_index(internal_font_number f, integer c) +int char_index(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_index(ci); } -liginfo *char_ligatures(internal_font_number f, integer c) +liginfo *char_ligatures(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_ligatures(ci); } -kerninfo *char_kerns(internal_font_number f, integer c) +kerninfo *char_kerns(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_kerns(ci); } -eight_bits *char_packets(internal_font_number f, integer c) +eight_bits *char_packets(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_packets(ci); @@ -1004,7 +1006,7 @@ i = font_params(f); if (i != b) { font_bytes += (b - font_params(f) + 1) * sizeof(scaled); - do_realloc(param_base(f), (b + 2), integer); + do_realloc(param_base(f), (b + 2), int); font_params(f) = b; if (b > i) { while (i < b) { @@ -1021,7 +1023,7 @@ i = font_math_params(f); if (i != b) { font_bytes += (b - font_math_params(f) + 1) * sizeof(scaled); - do_realloc(math_param_base(f), (b + 2), integer); + do_realloc(math_param_base(f), (b + 2), int); font_math_params(f) = b; if (b > i) { while (i < b) { @@ -1034,11 +1036,11 @@ -integer copy_font(integer f) +int copy_font(int f) { int i, ci_cnt, ci_size; charinfo *ci; - integer k = new_font(); + int k = new_font(); { ci = font_tables[k]->charinfo; @@ -1094,7 +1096,7 @@ memcpy(math_param_base(k), math_param_base(f), i); } - for (i = 0; i < font_tables[f]->charinfo_count; i++) { + for (i = 0; i <= font_tables[f]->charinfo_count; i++) { ci = copy_charinfo(&font_tables[f]->charinfo[i]); font_tables[k]->charinfo[i] = *ci; } @@ -1111,7 +1113,7 @@ return k; } -void delete_font(integer f) +void delete_font(int f) { int i; charinfo *co; @@ -1166,7 +1168,7 @@ set_font_touched(i, 1); } -boolean is_valid_font(integer id) +boolean is_valid_font(int id) { int ret = 0; if (id >= 0 && id <= font_id_maxval && font_tables[id] != NULL) @@ -1175,7 +1177,7 @@ } /* return 1 == identical */ -boolean cmp_font_name(integer id, str_number t) +boolean cmp_font_name(int id, str_number t) { char *tid, *tt; if (!is_valid_font(id)) @@ -1190,7 +1192,7 @@ return 1; } -boolean cmp_font_area(integer id, str_number t) +boolean cmp_font_area(int id, str_number t) { char *tt = NULL; char *tid = font_area(id); @@ -1210,7 +1212,7 @@ } -static boolean same_font_name(integer id, integer t) +static boolean same_font_name(int id, int t) { int ret = 0; if (font_name(t) == NULL || @@ -1257,9 +1259,9 @@ return ret; } -integer test_no_ligatures(internal_font_number f) +int test_no_ligatures(internal_font_number f) { - integer c; + int c; for (c = font_bc(f); c <= font_ec(f); c++) { if (has_lig(f, c)) /* char_exists(f,c) */ return 0; @@ -1267,7 +1269,7 @@ return 1; } -integer get_tag_code(internal_font_number f, integer c) +int get_tag_code(internal_font_number f, int c) { small_number i; if (char_exists(f, c)) { @@ -1284,27 +1286,27 @@ return -1; } -integer get_lp_code(internal_font_number f, integer c) +int get_lp_code(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_lp(ci); } -integer get_rp_code(internal_font_number f, integer c) +int get_rp_code(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_rp(ci); } -integer get_ef_code(internal_font_number f, integer c) +int get_ef_code(internal_font_number f, int c) { charinfo *ci = char_info(f, c); return get_charinfo_ef(ci); } -void set_tag_code(internal_font_number f, integer c, integer i) +void set_tag_code(internal_font_number f, int c, int i) { - integer fixedi; + int fixedi; charinfo *co; if (char_exists(f, c)) { /* abs(fix_int(i-7,0)) */ @@ -1330,7 +1332,7 @@ } -void set_lp_code(internal_font_number f, integer c, integer i) +void set_lp_code(internal_font_number f, int c, int i) { charinfo *co; if (char_exists(f, c)) { @@ -1339,7 +1341,7 @@ } } -void set_rp_code(internal_font_number f, integer c, integer i) +void set_rp_code(internal_font_number f, int c, int i) { charinfo *co; if (char_exists(f, c)) { @@ -1348,7 +1350,7 @@ } } -void set_ef_code(internal_font_number f, integer c, integer i) +void set_ef_code(internal_font_number f, int c, int i) { charinfo *co; if (char_exists(f, c)) { @@ -1359,7 +1361,7 @@ void set_no_ligatures(internal_font_number f) { - integer c; + int c; charinfo *co; if (font_tables[f]->ligatures_disabled) @@ -1376,7 +1378,7 @@ font_tables[f]->ligatures_disabled = 1; } -liginfo get_ligature(internal_font_number f, integer lc, integer rc) +liginfo get_ligature(internal_font_number f, int lc, int rc) { int k; liginfo t, u; @@ -1405,9 +1407,9 @@ } -scaled raw_get_kern(internal_font_number f, integer lc, integer rc) +scaled raw_get_kern(internal_font_number f, int lc, int rc) { - integer k; + int k; kerninfo u; charinfo *co; if (lc == non_boundarychar || rc == non_boundarychar) @@ -1430,7 +1432,7 @@ } -scaled get_kern(internal_font_number f, integer lc, integer rc) +scaled get_kern(internal_font_number f, int lc, int rc) { if (lc == non_boundarychar || rc == non_boundarychar || (!has_kern(f, lc))) return 0; @@ -1451,7 +1453,7 @@ void dump_charinfo(int f, int c) { charinfo *co; - integer x; + int x; liginfo *lig; kerninfo *kern; dump_int(c); @@ -1550,7 +1552,7 @@ void dump_font(int f) { - integer i, x; + int i, x; set_font_used(f, 0); font_tables[f]->charinfo_cache = NULL; @@ -1592,7 +1594,7 @@ int undump_charinfo(int f) { charinfo *co; - integer x, i; + int x, i; char *s = NULL; liginfo *lig = NULL; kerninfo *kern = NULL; @@ -1686,7 +1688,7 @@ void undump_font_entry(texfont * f) { - integer x = 0; + int x = 0; /* *INDENT-OFF* */ undump_int(x); f->_font_size = x; undump_int(x); f->_font_dsize = x; @@ -1728,7 +1730,7 @@ void undump_font(int f) { - integer x, i; + int x, i; texfont *tt; charinfo *ci; char *s; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/texfont.h luatex-0.50.0/source/texk/web2c/luatexdir/font/texfont.h --- luatex-0.47.0/source/texk/web2c/luatexdir/font/texfont.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/texfont.h 2009-12-24 18:51:08.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: texfont.h 3246 2009-12-10 22:22:21Z hhenkel $ */ +/* $Id: texfont.h 3261 2009-12-18 11:38:21Z taco $ */ /* Here we have the interface to LuaTeX's font system, as seen from the main pascal program. There is a companion list in luatex.defines to @@ -33,13 +33,13 @@ # define pointer halfword typedef struct liginfo { - integer adj; - integer lig; + int adj; + int lig; char type; } liginfo; typedef struct kerninfo { - integer adj; + int adj; scaled sc; } kerninfo; @@ -58,16 +58,16 @@ kerninfo *kerns; /* kern items */ eight_bits *packets; /* virtual commands. */ unsigned short index; /* CID index */ - integer remainder; /* spare value for odd items, could be union-ed with extensible */ + int remainder; /* spare value for odd items, could be union-ed with extensible */ scaled width; /* width */ scaled height; /* height */ scaled depth; /* depth */ scaled italic; /* italic correction */ scaled top_accent; /* top accent alignment */ scaled bot_accent; /* bot accent alignment */ - integer ef; /* font expansion factor */ - integer lp; /* left protruding factor */ - integer rp; /* right protruding factor */ + int ef; /* font expansion factor */ + int lp; /* left protruding factor */ + int rp; /* right protruding factor */ char tag; /* list / ext taginfo */ char used; /* char is typeset ? */ char *tounicode; /* unicode equivalent */ @@ -98,13 +98,13 @@ extern extinfo *new_variant(int glyph, int startconnect, int endconnect, int advance, int repeater); -extern scaled_whd get_charinfo_whd(internal_font_number f, integer c); +extern scaled_whd get_charinfo_whd(internal_font_number f, int c); typedef struct texfont { - integer _font_size; - integer _font_dsize; + int _font_size; + int _font_dsize; char *_font_name; char *_font_area; char *_font_filename; @@ -113,51 +113,51 @@ char *_font_encodingname; char *_font_cidregistry; char *_font_cidordering; - integer _font_cidversion; - integer _font_cidsupplement; + int _font_cidversion; + int _font_cidsupplement; - integer _font_ec; + int _font_ec; unsigned _font_checksum; /* internal information */ char _font_used; /* internal information */ char _font_touched; /* internal information */ - integer _font_cache_id; /* internal information */ + int _font_cache_id; /* internal information */ char _font_encodingbytes; /* 1 or 2 bytes */ - integer _font_slant; /* a slant in ppt */ - integer _font_extend; /* an extension in ppt, or 1000 */ + int _font_slant; /* a slant in ppt */ + int _font_extend; /* an extension in ppt, or 1000 */ char _font_tounicode; /* 1 if info is present */ fm_entry_ptr _font_map; - integer _font_type; - integer _font_format; - integer _font_embedding; - integer _font_bc; - integer _hyphen_char; - integer _skew_char; - integer _font_natural_dir; + int _font_type; + int _font_format; + int _font_embedding; + int _font_bc; + int _hyphen_char; + int _skew_char; + int _font_natural_dir; charinfo *_left_boundary; charinfo *_right_boundary; - integer _font_params; + int _font_params; scaled *_param_base; - integer _font_math_params; + int _font_math_params; scaled *_math_param_base; sa_tree characters; - integer charinfo_count; - integer charinfo_size; + int charinfo_count; + int charinfo_size; charinfo *charinfo; int *charinfo_cache; - integer ligatures_disabled; + int ligatures_disabled; - integer _pdf_font_num; /* maps to a PDF resource ID */ + int _pdf_font_num; /* maps to a PDF resource ID */ scaled _pdf_font_size; /* maps to a PDF font size */ internal_font_number _pdf_font_blink; /* link to base font for expanded fonts */ internal_font_number _pdf_font_elink; /* link to expanded fonts for base font */ - integer _pdf_font_expand_ratio; /* expansion ratio of a particular font */ + int _pdf_font_expand_ratio; /* expansion ratio of a particular font */ internal_font_number _pdf_font_shrink; /* font at limit of shrinking */ internal_font_number _pdf_font_stretch; /* font at limit of stretching */ - integer _pdf_font_step; /* amount of one step of expansion */ + int _pdf_font_step; /* amount of one step of expansion */ boolean _pdf_font_auto_expand; /* this font is auto-expanded? */ str_number _pdf_font_attr; /* pointer to additional attributes */ } texfont; @@ -206,14 +206,14 @@ # define set_font_name(f,b) font_name(f) = b # define tex_font_name(a) maketexstring(font_name(a)) -boolean cmp_font_name(integer, str_number); +boolean cmp_font_name(int, str_number); # define font_area(a) font_tables[a]->_font_area # define get_font_area(a) (unsigned char *)font_area(a) # define set_font_area(f,b) font_area(f) = b # define tex_font_area(a) maketexstring(font_area(a)) -boolean cmp_font_area(integer, str_number); +boolean cmp_font_area(int, str_number); # define font_reassign(a,b) { if (a!=NULL) free(a); a = b; } @@ -400,9 +400,9 @@ top_left_kern = 4 } font_math_kern_codes; -extern charinfo *get_charinfo(internal_font_number f, integer c); -extern integer char_exists(internal_font_number f, integer c); -extern charinfo *char_info(internal_font_number f, integer c); +extern charinfo *get_charinfo(internal_font_number f, int c); +extern int char_exists(internal_font_number f, int c); +extern charinfo *char_info(internal_font_number f, int c); /* Here is a quick way to test if a glyph exists, when you are already certain the font |f| exists, and that the |c| is a regular @@ -446,23 +446,23 @@ extern scaled get_charinfo_top_accent(charinfo * ci); extern scaled get_charinfo_bot_accent(charinfo * ci); extern char get_charinfo_tag(charinfo * ci); -extern integer get_charinfo_remainder(charinfo * ci); +extern int get_charinfo_remainder(charinfo * ci); extern char get_charinfo_used(charinfo * ci); -extern integer get_charinfo_index(charinfo * ci); +extern int get_charinfo_index(charinfo * ci); extern char *get_charinfo_name(charinfo * ci); extern char *get_charinfo_tounicode(charinfo * ci); extern liginfo *get_charinfo_ligatures(charinfo * ci); extern kerninfo *get_charinfo_kerns(charinfo * ci); extern eight_bits *get_charinfo_packets(charinfo * ci); -extern integer get_charinfo_ef(charinfo * ci); -extern integer get_charinfo_rp(charinfo * ci); -extern integer get_charinfo_lp(charinfo * ci); -extern integer get_charinfo_extensible(charinfo * ci, int which); - -extern integer ext_top(internal_font_number f, integer c); -extern integer ext_bot(internal_font_number f, integer c); -extern integer ext_rep(internal_font_number f, integer c); -extern integer ext_mid(internal_font_number f, integer c); +extern int get_charinfo_ef(charinfo * ci); +extern int get_charinfo_rp(charinfo * ci); +extern int get_charinfo_lp(charinfo * ci); +extern int get_charinfo_extensible(charinfo * ci, int which); + +extern int ext_top(internal_font_number f, int c); +extern int ext_bot(internal_font_number f, int c); +extern int ext_rep(internal_font_number f, int c); +extern int ext_mid(internal_font_number f, int c); # define set_ligature_item(f,b,c,d) { f.type = b; f.adj = c; f.lig = d; } @@ -508,30 +508,30 @@ # define list_tag 2 /* character has a successor in a charlist */ # define ext_tag 3 /* character is extensible */ -extern scaled char_height(internal_font_number f, integer c); -extern scaled char_width(internal_font_number f, integer c); -extern scaled char_depth(internal_font_number f, integer c); -extern scaled char_italic(internal_font_number f, integer c); -extern scaled char_top_accent(internal_font_number f, integer c); -extern scaled char_bot_accent(internal_font_number f, integer c); - -extern liginfo *char_ligatures(internal_font_number f, integer c); -extern kerninfo *char_kerns(internal_font_number f, integer c); -extern eight_bits *char_packets(internal_font_number f, integer c); +extern scaled char_height(internal_font_number f, int c); +extern scaled char_width(internal_font_number f, int c); +extern scaled char_depth(internal_font_number f, int c); +extern scaled char_italic(internal_font_number f, int c); +extern scaled char_top_accent(internal_font_number f, int c); +extern scaled char_bot_accent(internal_font_number f, int c); + +extern liginfo *char_ligatures(internal_font_number f, int c); +extern kerninfo *char_kerns(internal_font_number f, int c); +extern eight_bits *char_packets(internal_font_number f, int c); # define has_lig(f,b) (char_exists(f,b) &&( char_ligatures(f,b) != NULL)) # define has_kern(f,b) (char_exists(f,b) && (char_kerns(f,b) != NULL)) # define has_packet(f,b) (char_exists(f,b) && (char_packets(f,b) != NULL)) -extern integer char_remainder(internal_font_number f, integer c); -extern char char_tag(internal_font_number f, integer c); -extern char char_used(internal_font_number f, integer c); -extern char *char_name(internal_font_number f, integer c); -extern integer char_index(internal_font_number f, integer c); - -scaled raw_get_kern(internalfontnumber f, integer lc, integer rc); -scaled get_kern(internalfontnumber f, integer lc, integer rc); -liginfo get_ligature(internalfontnumber f, integer lc, integer rc); +extern int char_remainder(internal_font_number f, int c); +extern char char_tag(internal_font_number f, int c); +extern char char_used(internal_font_number f, int c); +extern char *char_name(internal_font_number f, int c); +extern int char_index(internal_font_number f, int c); + +scaled raw_get_kern(internalfontnumber f, int lc, int rc); +scaled get_kern(internalfontnumber f, int lc, int rc); +liginfo get_ligature(internalfontnumber f, int lc, int rc); # define EXT_TOP 0 # define EXT_BOT 1 @@ -540,39 +540,39 @@ extern texfont **font_tables; -integer new_font(void); +int new_font(void); extern void font_malloc_charinfo(internal_font_number f, int num); -integer copy_font(integer id); -integer scale_font(integer id, integer atsize); -integer max_font_id(void); -void set_max_font_id(integer id); -integer new_font_id(void); +int copy_font(int id); +int scale_font(int id, int atsize); +int max_font_id(void); +void set_max_font_id(int id); +int new_font_id(void); void create_null_font(void); -void delete_font(integer id); -boolean is_valid_font(integer id); +void delete_font(int id); +boolean is_valid_font(int id); void dump_font(int font_number); void undump_font(int font_number); -integer test_no_ligatures(internal_font_number f); +int test_no_ligatures(internal_font_number f); void set_no_ligatures(internal_font_number f); -extern integer get_tag_code(internal_font_number f, integer c); -extern integer get_lp_code(internal_font_number f, integer c); -extern integer get_rp_code(internal_font_number f, integer c); -extern integer get_ef_code(internal_font_number f, integer c); - -extern void set_tag_code(internal_font_number f, integer c, integer i); -extern void set_lp_code(internal_font_number f, integer c, integer i); -extern void set_rp_code(internal_font_number f, integer c, integer i); -extern void set_ef_code(internal_font_number f, integer c, integer i); +extern int get_tag_code(internal_font_number f, int c); +extern int get_lp_code(internal_font_number f, int c); +extern int get_rp_code(internal_font_number f, int c); +extern int get_ef_code(internal_font_number f, int c); + +extern void set_tag_code(internal_font_number f, int c, int i); +extern void set_lp_code(internal_font_number f, int c, int i); +extern void set_rp_code(internal_font_number f, int c, int i); +extern void set_ef_code(internal_font_number f, int c, int i); int read_tfm_info(internal_font_number f, char *nom, scaled s); /* from dofont.c */ -extern int read_font_info(pointer u, str_number nom, scaled s, integer ndir); +extern int read_font_info(pointer u, str_number nom, scaled s, int ndir); extern int find_font_id(char *nom, scaled s); /* for and from vfpacket.c */ @@ -591,9 +591,9 @@ packet_end_code } packet_command_codes; -extern scaled store_scaled_f(scaled sq, integer fw); +extern scaled store_scaled_f(scaled sq, int fw); -extern void do_vf_packet(PDF pdf, internal_font_number vf_f, integer c); +extern void do_vf_packet(PDF pdf, internal_font_number vf_f, int c); extern int vf_packet_bytes(charinfo * co); charinfo *copy_charinfo(charinfo * ci); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/tfmofm.c luatex-0.50.0/source/texk/web2c/luatexdir/font/tfmofm.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/tfmofm.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/tfmofm.c 2009-12-24 18:51:08.000000000 +0000 @@ -22,7 +22,7 @@ #include "luatexfont.h" static const char _svn_version[] = - "$Id: tfmofm.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/tfmofm.c $"; + "$Id: tfmofm.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/tfmofm.c $"; /* Here are some macros that help process ligatures and kerns */ @@ -375,11 +375,11 @@ xfree(xligs); xfree(xkerns); return 1; } -int open_tfm_file(char *nom, unsigned char **tfm_buf, integer * tfm_siz) +int open_tfm_file(char *nom, unsigned char **tfm_buf, int *tfm_siz) { boolean res; /* was the callback successful? */ boolean opened; /* was |tfm_file| successfully opened? */ - integer callback_id; + int callback_id; FILE *tfm_file; char *fname = luatex_find_file(nom, find_font_file_callback); if (!fname) @@ -517,7 +517,7 @@ { eight_bits a, b, c, d; scaled sw; - static integer alpha, beta; /* beta:1..16 */ + static int alpha, beta; /* beta:1..16 */ static scaled z, z_prev = 0; /* @; */ if (z_in != z_prev || z_prev == 0) { @@ -564,46 +564,46 @@ } typedef struct tfmcharacterinfo { - integer _kern_index; - integer _lig_index; - integer _width_index; - integer _height_index; - integer _depth_index; - integer _italic_index; - integer _remainder; + int _kern_index; + int _lig_index; + int _width_index; + int _height_index; + int _depth_index; + int _italic_index; + int _remainder; unsigned char _tag; } tfmcharacterinfo; int read_tfm_info(internalfontnumber f, char *cnom, scaled s) { - integer k; /* index into |font_info| */ + int k; /* index into |font_info| */ halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np, slh; /* sizes of subfiles */ scaled *widths, *heights, *depths, *italics, *kerns; halfword font_dir; - integer a, b, c, d; /* byte variables */ - integer i; /* counter */ - integer font_level, header_length; - integer nco, ncw, npc, nlw, neew; + int a, b, c, d; /* byte variables */ + int i; /* counter */ + int font_level, header_length; + int nco, ncw, npc, nlw, neew; tfmcharacterinfo ci; charinfo *co; four_quarters qw; four_quarters *lig_kerns, *extens; scaled sw; /* accumulators */ - integer bch_label; /* left boundary start location, or infinity */ + int bch_label; /* left boundary start location, or infinity */ int bchar; /* :0..too_big_char; *//* right boundary character, or |too_big_char| */ - integer first_two; + int first_two; scaled z; /* the design size or the ``at'' size */ - integer alpha; + int alpha; char beta; /* :1..16 */ - integer *xligs, *xkerns; /* aux. for ligkern processing */ + int *xligs, *xkerns; /* aux. for ligkern processing */ liginfo *cligs; kerninfo *ckerns; int fligs, fkerns; char *tmpnam; - integer tfm_byte = 0; /* index into |tfm_buffer| */ - integer saved_tfm_byte = 0; /* saved index into |tfm_buffer| */ + int tfm_byte = 0; /* index into |tfm_buffer| */ + int saved_tfm_byte = 0; /* saved index into |tfm_buffer| */ unsigned char *tfm_buffer = NULL; /* byte buffer for tfm files */ - integer tfm_size = 0; /* total size of the tfm file */ + int tfm_size = 0; /* total size of the tfm file */ widths = NULL; heights = NULL; @@ -1001,8 +1001,8 @@ /* first pass: count ligs and kerns */ - xligs = xcalloc((ec + 1), sizeof(integer)); - xkerns = xcalloc((ec + 1), sizeof(integer)); + xligs = xcalloc((ec + 1), sizeof(int)); + xkerns = xcalloc((ec + 1), sizeof(int)); for (i = bc; i <= ec; i++) { if (char_tag(f, i) == lig_tag) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/tounicode.c luatex-0.50.0/source/texk/web2c/luatexdir/font/tounicode.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/tounicode.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/tounicode.c 2009-12-24 18:51:08.000000000 +0000 @@ -20,7 +20,7 @@ #include "ptexlib.h" static const char _svn_version[] = - "$Id: tounicode.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/tounicode.c $"; + "$Id: tounicode.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/tounicode.c $"; #define isXdigit(c) (isdigit(c) || ('A' <= (c) && (c) <= 'F')) #define UNI_UNDEF -1 @@ -65,7 +65,7 @@ void def_tounicode(str_number glyph, str_number unistr) { - char buf[SMALL_BUF_SIZE], *p ,*ph; + char buf[SMALL_BUF_SIZE], *p, *ph; char buf2[SMALL_BUF_SIZE], *q; int valid_unistr; /* 0: invalid; 1: unicode value; 2: string */ int i, l; @@ -310,13 +310,13 @@ } -integer write_tounicode(PDF pdf, char **glyph_names, char *name) +int write_tounicode(PDF pdf, char **glyph_names, char *name) { char buf[SMALL_BUF_SIZE], *p; static char builtin_suffix[] = "-builtin"; short range_size[257]; glyph_unicode_entry gtab[257]; - integer objnum; + int objnum; int i, j; int bfchar_count, bfrange_count, subrange_count; assert(strlen(name) + strlen(builtin_suffix) < SMALL_BUF_SIZE); @@ -458,12 +458,12 @@ return objnum; } -integer write_cid_tounicode(PDF pdf, fo_entry * fo, internalfontnumber f) +int write_cid_tounicode(PDF pdf, fo_entry * fo, internalfontnumber f) { int range_size[65537]; glyph_unicode_entry gtab[65537]; - integer objnum; + int objnum; int i, j, k; int bfchar_count, bfrange_count, subrange_count; char *buf; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/tt_glyf.c luatex-0.50.0/source/texk/web2c/luatexdir/font/tt_glyf.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/tt_glyf.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/tt_glyf.c 2009-12-24 18:51:08.000000000 +0000 @@ -32,7 +32,7 @@ #include "writettf.h" static const char _svn_version[] = - "$Id: tt_glyf.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/tt_glyf.c $"; + "$Id: tt_glyf.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/tt_glyf.c $"; #define NUM_GLYPH_LIMIT 65534 #define TABLE_DATA_ALLOC_SIZE 40960 diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/tt_table.c luatex-0.50.0/source/texk/web2c/luatexdir/font/tt_table.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/tt_table.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/tt_table.c 2009-12-24 18:51:08.000000000 +0000 @@ -34,7 +34,7 @@ #include "tt_table.h" static const char _svn_version[] = - "$Id: tt_table.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/tt_table.c $"; + "$Id: tt_table.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/tt_table.c $"; /* tables contains information refered by other tables diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/vfovf.c luatex-0.50.0/source/texk/web2c/luatexdir/font/vfovf.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/vfovf.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/vfovf.c 2009-12-24 18:51:08.000000000 +0000 @@ -23,8 +23,8 @@ #include "luatexfont.h" static const char _svn_version[] = - "$Id: vfovf.c 3218 2009-12-04 08:21:56Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/vfovf.c $"; + "$Id: vfovf.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/vfovf.c $"; /* this is a hack! */ #define font_max 5000 @@ -155,10 +155,10 @@ #define vf_read(k, l) \ { \ - integer itmp = 0, dtmp = k, jtmp = 0; \ + int itmp = 0, dtmp = k, jtmp = 0; \ while (dtmp > 0) { \ vf_byte(jtmp); \ - if ((dtmp == (integer) k) && jtmp > 127) \ + if ((dtmp == (int) k) && jtmp > 127) \ jtmp = jtmp - 256; \ itmp = itmp * 256 + jtmp; \ decr(dtmp); \ @@ -184,7 +184,7 @@ static void vf_local_font_warning(internal_font_number f, internal_font_number k, char *s, - integer a, integer b) + int a, int b) { print_nlp(); tprint(s); @@ -203,14 +203,14 @@ /* process a local font in \.{VF} file */ internal_font_number -vf_def_font(internal_font_number f, unsigned char *vf_buffer, integer * vf_cr) +vf_def_font(internal_font_number f, unsigned char *vf_buffer, int *vf_cr) { internal_font_number k; str_number s; scaled ds, fs; four_quarters cs; memory_word tmp_w; /* accumulator */ - integer junk; + int junk; unsigned long checksum; cs.b0 = vf_buffer[(*vf_cr)]; cs.b1 = vf_buffer[(*vf_cr) + 1]; @@ -254,7 +254,7 @@ tmp_b0--; (*vf_cr)++; /* skip the font path */ } - str_room((unsigned)tmp_b1); + str_room((unsigned) tmp_b1); while (tmp_b1 > 0) { tmp_b1--; junk = vf_buffer[(*vf_cr)]; @@ -283,10 +283,10 @@ } -int open_vf_file(char *fn, unsigned char **vbuffer, integer * vsize) +int open_vf_file(char *fn, unsigned char **vbuffer, int *vsize) { boolean res; /* was the callback successful? */ - integer callback_id; + int callback_id; boolean file_read = false; /* was |vf_file| successfully read? */ FILE *vf_file; char *fname = luatex_find_file(fn, find_vf_file_callback); @@ -647,27 +647,27 @@ void do_vf(internal_font_number f) { - integer k, i; + int k, i; unsigned cmd, n; scaled x, y, w, z, h, v; - integer cc, cmd_length, packet_length; + int cc, cmd_length, packet_length; charinfo *co; scaled tfm_width; - integer save_cur_byte; + int save_cur_byte; vf_stack_index stack_level; - integer vf_z; /* multiplier */ - integer vf_alpha; /* correction for negative values */ + int vf_z; /* multiplier */ + int vf_alpha; /* correction for negative values */ char vf_beta; /* divisor */ - integer vf_np; + int vf_np; eight_bits *vpackets; memory_word tmp_w; /* accumulator */ vf_stack_record vf_stack[256]; - integer junk; + int junk; unsigned char *vf_buffer; - integer vf_size; - integer vf_cur; - integer *vf_local_fnts = NULL; /* external font ids */ - integer *vf_real_fnts = NULL; /* internal font ids */ + int vf_size; + int vf_cur; + int *vf_local_fnts = NULL; /* external font ids */ + int *vf_real_fnts = NULL; /* internal font ids */ unsigned vf_nf = 0; /* local font counter */ if (font_type(f) != unknown_font_type) @@ -721,7 +721,7 @@ vf_byte(cmd); /* malloc and fill the local font arrays */ if (vf_nf > 0) { - i = vf_nf * sizeof(integer); + i = vf_nf * sizeof(int); vf_local_fnts = xmalloc(i); memset(vf_local_fnts, 0, i); vf_real_fnts = xmalloc(i); @@ -1031,25 +1031,25 @@ int make_vf_table(lua_State * L, char *cnom, scaled atsize) { - integer cmd, k, i; - integer cc, cmd_length, packet_length; + int cmd, k, i; + int cc, cmd_length, packet_length; scaled tfm_width; vf_stack_index stack_level; - integer vf_z; /* multiplier */ - integer vf_alpha; /* correction for negative values */ + int vf_z; /* multiplier */ + int vf_alpha; /* correction for negative values */ char vf_beta; /* divisor */ char *s; scaled h, v; scaled w, x, y, z; - integer s_top; /* lua stack */ - integer vf_nf; /* local font counter */ + int s_top; /* lua stack */ + int vf_nf; /* local font counter */ scaled ds, fs; four_quarters cs; memory_word tmp_w; /* accumulator */ vf_stack_record vf_stack[256]; unsigned char *vf_buffer; - integer vf_size; - integer vf_cur; + int vf_size; + int vf_cur; stack_level = 0; @@ -1394,9 +1394,9 @@ { internal_font_number bf; - integer e, k; - integer *vf_old_fonts, *vf_new_fonts; - integer num = 0; + int e, k; + int *vf_old_fonts, *vf_new_fonts; + int num = 0; if ((!pdf_font_auto_expand(f)) || (pdf_font_blink(f) == null_font)) return false; /* not an auto-expanded font */ @@ -1409,7 +1409,7 @@ vf_old_fonts = packet_local_fonts(bf, &num); if (num > 0) { - vf_new_fonts = xmalloc(num * sizeof(integer)); + vf_new_fonts = xmalloc(num * sizeof(int)); for (k = 0; k < num; k++) { vf_new_fonts[k] = auto_expand_font(vf_old_fonts[k], e); copy_expand_params(vf_new_fonts[k], vf_old_fonts[k], e); @@ -1422,7 +1422,7 @@ return true; } -str_number expand_font_name(internal_font_number f, integer e) +str_number expand_font_name(internal_font_number f, int e) { int old_setting; old_setting = selector; @@ -1437,13 +1437,13 @@ } -internal_font_number auto_expand_font(internal_font_number f, integer e) +internal_font_number auto_expand_font(internal_font_number f, int e) { internal_font_number k; kerninfo *krn; charinfo *co; char *fn; - integer i; + int i; scaled w; k = copy_font(f); i = strlen(font_name(f)) + 12; @@ -1473,8 +1473,8 @@ void vf_expand_local_fonts(internal_font_number f) { internal_font_number lf; - integer k, num; - integer *vf_old_fonts; + int k, num; + int *vf_old_fonts; pdfassert(font_type(f) == virtual_font_type); num = 0; vf_old_fonts = packet_local_fonts(f, &num); @@ -1493,15 +1493,15 @@ } internal_font_number -letter_space_font(halfword u, internal_font_number f, integer e) +letter_space_font(halfword u, internal_font_number f, int e) { internal_font_number k; scaled w, r; char *new_font_name; - integer vf_z; - integer vf_alpha; - integer vf_beta; + int vf_z; + int vf_alpha; + int vf_beta; memory_word tmp_w; /* accumulator */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/vfpacket.c luatex-0.50.0/source/texk/web2c/luatexdir/font/vfpacket.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/vfpacket.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/vfpacket.c 2009-12-24 18:51:08.000000000 +0000 @@ -21,8 +21,8 @@ #include "ptexlib.h" static const char _svn_version[] = - "$Id: vfpacket.c 3217 2009-12-03 16:52:01Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/vfpacket.c $"; + "$Id: vfpacket.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/vfpacket.c $"; /* The |do_vf_packet| procedure is called in order to interpret the @@ -59,7 +59,7 @@ fw = fw*256 + do_packet_byte(); \ fw = fw*256 + do_packet_byte(); } -#define packet_scaled(a,fs) { integer fw; \ +#define packet_scaled(a,fs) { int fw; \ fw = do_packet_byte(); \ if (fw>127) fw = fw - 256; \ fw = fw*256 + do_packet_byte(); \ @@ -72,7 +72,7 @@ int vf_packet_bytes(charinfo * co) { eight_bits *vf_packets; - integer cur_packet_byte; + int cur_packet_byte; unsigned k; int cmd; @@ -123,14 +123,14 @@ }; -void do_vf_packet(PDF pdf, internal_font_number vf_f, integer c) +void do_vf_packet(PDF pdf, internal_font_number vf_f, int c) { internal_font_number lf; charinfo *co; scaledpos cur = { 0, 0 }, size; eight_bits *vf_packets; - integer cur_packet_byte; - integer cmd, fs_f; + int cur_packet_byte; + int cmd, fs_f; scaled i; unsigned k; str_number s; @@ -208,7 +208,7 @@ break; case packet_special_code: packet_number(k); - str_room((unsigned)k); + str_room((unsigned) k); while (k > 0) { k--; append_char(do_packet_byte()); @@ -236,11 +236,11 @@ pdf->posstruct = refpos; } -integer *packet_local_fonts(internal_font_number f, integer * num) +int *packet_local_fonts(internal_font_number f, int *num) { int c, cmd, cur_packet_byte, lf, k, l, i; - integer localfonts[256] = { 0 }; - integer *lfs; + int localfonts[256] = { 0 }; + int *lfs; charinfo *co; eight_bits *vf_packets; @@ -295,8 +295,8 @@ } *num = k; if (k > 0) { - lfs = xmalloc(k * sizeof(integer)); - memcpy(lfs, localfonts, k * sizeof(integer)); + lfs = xmalloc(k * sizeof(int)); + memcpy(lfs, localfonts, k * sizeof(int)); return lfs; } return NULL; @@ -304,8 +304,8 @@ void -replace_packet_fonts(internal_font_number f, integer * old_fontid, - integer * new_fontid, int count) +replace_packet_fonts(internal_font_number f, int *old_fontid, + int *new_fontid, int count) { int c, cmd, cur_packet_byte, lf, k, l; charinfo *co; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writecff.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writecff.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writecff.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writecff.c 2009-12-24 18:51:08.000000000 +0000 @@ -22,8 +22,8 @@ #include "writecff.h" static const char _svn_version[] = - "$Id: writecff.c 2854 2009-07-14 14:40:06Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writecff.c $"; + "$Id: writecff.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writecff.c $"; #define get_offset(s,n) get_unsigned(s, (n)) #define get_card8(a) a->stream[a->offset++] @@ -3390,7 +3390,7 @@ * I have defined a utility function in luafflib.c that does exactly that. * If it works out ok, I will clean up this code. */ -extern int ff_createcff(char *, unsigned char **, integer *); /* libs/luafontforge/src/luafflib.c */ +extern int ff_createcff(char *, unsigned char **, int *); /* libs/luafontforge/src/luafflib.c */ void writetype1w(PDF pdf, fd_entry * fd) { @@ -3399,7 +3399,7 @@ FILE *fp; ff_entry *ff; unsigned char *tfm_buffer = NULL; - integer tfm_size = 0; + int tfm_size = 0; ff = check_ff_exist(fd->fm->ff_name, 0); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writeenc.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writeenc.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writeenc.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writeenc.c 2009-12-24 18:51:08.000000000 +0000 @@ -21,7 +21,7 @@ #include "ptexlib.h" static const char _svn_version[] = - "$Id: writeenc.c 2628 2009-06-26 07:52:42Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writeenc.c $"; + "$Id: writeenc.c 3282 2009-12-21 21:55:47Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writeenc.c $"; /**********************************************************************/ /* All encoding entries go into AVL tree for fast search by name. */ @@ -88,32 +88,8 @@ /**********************************************************************/ -void epdf_write_enc(PDF pdf, char **glyph_names, integer fe_objnum) -{ - int i, i_old; - assert(glyph_names != NULL); - assert(fe_objnum != 0); - pdf_begin_dict(pdf, fe_objnum, 1); - pdf_puts(pdf, "/Type /Encoding\n"); - pdf_puts(pdf, "/Differences ["); - for (i = 0, i_old = -2; i < 256; i++) - if (glyph_names[i] != notdef) { - if (i == i_old + 1) /* no gap */ - pdf_printf(pdf, "/%s", glyph_names[i]); - else { - if (i_old == -2) - pdf_printf(pdf, "%i/%s", i, glyph_names[i]); - else - pdf_printf(pdf, " %i/%s", i, glyph_names[i]); - } - i_old = i; - } - pdf_puts(pdf, "]\n"); - pdf_end_dict(pdf); -} - void write_enc(PDF pdf, char **glyph_names, struct avl_table *tx_tree, - integer fe_objnum) + int fe_objnum) { int i_old, *p; struct avl_traverser t; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writefont.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writefont.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writefont.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writefont.c 2009-12-24 18:51:08.000000000 +0000 @@ -1,5 +1,5 @@ /* writefont.c - + Copyright 1996-2006 Han The Thanh Copyright 2006-2009 Taco Hoekwater @@ -18,16 +18,16 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ +static const char _svn_version[] = + "$Id: writefont.c 3285 2009-12-23 19:37:18Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writefont.c $"; + #include "ptexlib.h" #include "luatexfont.h" -static const char _svn_version[] = - "$Id: writefont.c 3246 2009-12-10 22:22:21Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writefont.c $"; - void write_cid_fontdictionary(PDF pdf, fo_entry * fo, internalfontnumber f); void create_cid_fontdictionary(PDF pdf, - fm_entry * fm, integer font_objnum, + fm_entry * fm, int font_objnum, internalfontnumber f); const key_entry font_key[FONT_KEYS_NUM] = { @@ -58,15 +58,11 @@ static int comp_fd_entry(const void *pa, const void *pb, void *p) { - int i; const fd_entry *p1 = (const fd_entry *) pa, *p2 = (const fd_entry *) pb; (void) p; assert(p1->fm != NULL && is_fontfile(p1->fm) && p2->fm != NULL && is_fontfile(p2->fm)); - if ((i = strcmp(p1->fm->ff_name, p2->fm->ff_name)) != 0) - return i; - cmp_return(p1->fm->extend, p2->fm->extend); - return 0; + return strcmp(p1->fm->ff_name, p2->fm->ff_name); } /**********************************************************************/ @@ -229,13 +225,12 @@ /**********************************************************************/ -fd_entry *lookup_fd_entry(char *s, integer extend) +fd_entry *lookup_fd_entry(char *s) { fd_entry fd; fm_entry fm; assert(s != NULL); fm.ff_name = s; - fm.extend = extend; fd.fm = &fm; if (fd_tree == NULL) { fd_tree = avl_create(comp_fd_entry, NULL, &avl_xallocator); @@ -249,7 +244,7 @@ assert(fo != NULL); assert(fo->fm != NULL); assert(is_fontfile(fo->fm)); - return lookup_fd_entry(fo->fm->ff_name, fo->fm->extend); + return lookup_fd_entry(fo->fm->ff_name); } void register_fd_entry(fd_entry * fd) @@ -260,7 +255,7 @@ assert(fd_tree != NULL); } assert(fd != NULL && fd->fm != NULL && is_fontfile(fd->fm)); - assert(lookup_fd_entry(fd->fm->ff_name, fd->fm->extend) == NULL); /* font descriptor not yet registered */ + assert(lookup_fd_entry(fd->fm->ff_name) == NULL); /* font descriptor not yet registered */ aa = avl_probe(fd_tree, fd); assert(aa != NULL); } @@ -279,24 +274,6 @@ assert(fo->fd->gl_tree != NULL); } -integer get_fd_objnum(fd_entry * fd) -{ - assert(fd->fd_objnum != 0); - return fd->fd_objnum; -} - -integer get_fn_objnum(PDF pdf, fd_entry * fd) -{ - if (fd->fn_objnum == 0) - fd->fn_objnum = pdf_new_objnum(pdf); - return fd->fn_objnum; -} - -void embed_whole_font(fd_entry * fd) -{ - fd->all_glyphs = true; -} - /**********************************************************************/ /* * For all used characters of TeX font f, get corresponding glyph names @@ -505,7 +482,7 @@ static void write_fontdescriptor(PDF pdf, fd_entry * fd) { static const int std_flags[] = { - /* indices for << start with 0, but bits start with 1, so the numbers + /* indices for << start with 0, but bits start with 1, so the numbers * for << are 1 lower than the bits in table 5.20 */ /* *INDENT-OFF* */ 1 + 2 + (1 << 5), /* Courier */ @@ -585,7 +562,7 @@ assert(0); } } - /* TODO: Optional keys for CID fonts. + /* TODO: Optional keys for CID fonts. The most interesting ones are /Style << /Panose <12-byte string>>> @@ -686,7 +663,7 @@ /**********************************************************************/ -void create_fontdictionary(PDF pdf, fm_entry * fm, integer font_objnum, +void create_fontdictionary(PDF pdf, fm_entry * fm, int font_objnum, internalfontnumber f) { fo_entry *fo = new_fo_entry(); @@ -769,7 +746,7 @@ extern char *FindResourceTtfFont(char *filename, char *fontname); -void do_pdf_font(PDF pdf, integer font_objnum, internalfontnumber f) +void do_pdf_font(PDF pdf, int font_objnum, internalfontnumber f) { int del_file = 0; fm_entry *fm; @@ -798,7 +775,7 @@ /* In case of a .dfont, we will extract the correct ttf here, and adjust fm->ff_name to point to the temporary file. This file will be deleted later. Todo: keep a nicer name - somewhere for the terminal message. + somewhere for the terminal message. */ char *s = FindResourceTtfFont(fm->ff_name, fm->ps_name); if (s != NULL) { @@ -812,9 +789,11 @@ } fm->encname = font_encodingname(f); /* for the CIDSystemInfo */ fm->slant = font_slant(f); /* slant factor */ + set_slantset(fm); fm->extend = font_extend(f); /* extension factor */ + set_extendset(fm); fm->fd_flags = 4; /* can perhaps be done better */ - fm->in_use = true; + set_inuse(fm); switch (font_format(f)) { case opentype_format: @@ -852,18 +831,15 @@ fm = hasfmentry(f) ? (fm_entry *) font_map(f) : NULL; if (fm == NULL || (fm->ps_name == NULL && fm->ff_name == NULL)) writet3(pdf, font_objnum, f); - else { - font_slant(f) = fm->slant; /* slant factor */ - font_extend(f) = fm->extend; /* extend factor */ + else create_fontdictionary(pdf, fm, font_objnum, f); - } } } /**********************************************************************/ -/* +/* The glyph width is included in |glw_entry|, because that width depends on the value it has in the font where it is actually typeset from, not the font that is the 'owner' of the fd entry. @@ -898,7 +874,7 @@ } /* - The values |font_bc()| and |font_ec()| are potentially large + The values |font_bc()| and |font_ec()| are potentially large character ids, but the strings that are written out use CID indexes, and those are limited to 16-bit values. */ @@ -928,13 +904,13 @@ } } -/* +/* It is possible to compress the widths array even better, by using the - alternate 'range' syntax and possibly even using /DW to set + alternate 'range' syntax and possibly even using /DW to set a default value. - + There is a some optimization here already: glyphs that are - not used do not appear in the widths array at all. + not used do not appear in the widths array at all. We have to make sure that we do not output an (incorrect!) width for a character that exists in the font, but is not used @@ -984,7 +960,7 @@ void create_cid_fontdictionary(PDF pdf, - fm_entry * fm, integer font_objnum, + fm_entry * fm, int font_objnum, internalfontnumber f) { fo_entry *fo = new_fo_entry(); @@ -996,7 +972,7 @@ create_cid_fontdescriptor(fo, f); mark_cid_subset_glyphs(fo, f); if (is_subsetted(fo->fm)) { - /* + /* this is a bit sneaky. |make_subset_tag()| actually expects the glyph tree to contain strings instead of |glw_entry| items. However, all calculations are done using explicit typecasts, so it works out ok. @@ -1049,7 +1025,7 @@ pdf_printf(pdf, ">>\n"); /* I doubt there is anything useful that could be written here */ - /* + /* if (pdf_font_attr(fo->tex_font) != get_nullstr()) { pdf_print(pdf_font_attr(fo->tex_font)); pdf_puts(pdf,"\n"); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writet1.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writet1.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writet1.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writet1.c 2009-12-24 18:51:08.000000000 +0000 @@ -1,5 +1,5 @@ /* writet1.c - + Copyright 1996-2006 Han The Thanh Copyright 2006-2009 Taco Hoekwater @@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ +static const char _svn_version[] = + "$Id: writet1.c 3272 2009-12-20 18:58:08Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writet1.c $"; + #include "ptexlib.h" #include - -static const char _svn_version[] = - "$Id: writet1.c 3250 2009-12-12 14:52:43Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writet1.c $"; - #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 @@ -44,13 +44,13 @@ strncpy(pdf->fb_array + t1_fontname_offset, fm_cur->subset_tag, 6) #define fixedcontent false -integer t1_length1, t1_length2, t1_length3; -static integer t1_save_offset; -static integer t1_fontname_offset; +int t1_length1, t1_length2, t1_length3; +static int t1_save_offset; +static int t1_fontname_offset; static unsigned char *t1_buffer = NULL; -static integer t1_size = 0; -static integer t1_curbyte = 0; +static int t1_size = 0; +static int t1_curbyte = 0; #define t1_read_file() \ readbinfile(t1_file,&t1_buffer,&t1_size) @@ -69,8 +69,8 @@ #define t1_cleartomark() t1_prefix("cleartomark") static unsigned char *enc_buffer = NULL; -static integer enc_size = 0; -static integer enc_curbyte = 0; +static int enc_size = 0; +static int enc_curbyte = 0; #define enc_open(a) \ (enc_file = fopen((char *)(a), FOPEN_RBIN_MODE)) @@ -627,17 +627,18 @@ t1_in_eexec = 2; } -/* macros for various transforms; currently only slant and extend are used */ +/* macros for various transforms; unused, left for reference */ -#define do_xshift(x,a) {x[4]+=a;} -#define do_yshift(x,a) {x[5]+=a;} -#define do_xscale(x,a) {x[0]*=a; x[2]*=a; x[4]*=a;} -#define do_yscale(x,a) {x[1]*=a; x[3]*=a; x[5]*=a;} -#define do_extend(x,a) {do_xscale(x,a);} -#define do_scale(x,a) {do_xscale(x,a); do_yscale(x,a);} -#define do_slant(x,a) {x[0]+=x[1]*(a); x[2]+=x[3]*(a); x[4]+=x[5]*(a);} -#define do_shear(x,a) {x[1]+=x[0]*(a); x[3]+=x[2]*(a); x[5]+=x[4]*(a);} -#define do_rotate(x,a) \ +#ifdef T1TRANSFORMMACROS +# define do_xshift(x,a) {x[4]+=a;} +# define do_yshift(x,a) {x[5]+=a;} +# define do_xscale(x,a) {x[0]*=a; x[2]*=a; x[4]*=a;} +# define do_yscale(x,a) {x[1]*=a; x[3]*=a; x[5]*=a;} +# define do_extend(x,a) {do_xscale(x,a);} +# define do_scale(x,a) {do_xscale(x,a); do_yscale(x,a);} +# define do_slant(x,a) {x[0]+=x[1]*(a); x[2]+=x[3]*(a); x[4]+=x[5]*(a);} +# define do_shear(x,a) {x[1]+=x[0]*(a); x[3]+=x[2]*(a); x[5]+=x[4]*(a);} +# define do_rotate(x,a) \ {float t, u=cos(a), v=sin(a); \ t =x[0]*u+x[1]*-v; \ x[1] =x[0]*v+x[1]* u; x[0]=t; \ @@ -645,81 +646,13 @@ x[3] =x[2]*v+x[3]* u; x[2]=t; \ t =x[4]*u+x[5]*-v; \ x[5] =x[4]*v+x[5]* u; x[4]=t;} - -static void t1_modify_fm(void) -{ - /* - * font matrix is given as six numbers a0..a5, which stands for the matrix - * - * a0 a1 0 - * M = a2 a3 0 - * a4 a5 1 - * - * ExtendFont is given as - * - * e 0 0 - * E = 0 1 0 - * 0 0 1 - * - * SlantFont is given as - * - * 1 0 0 - * S = s 1 0 - * 0 0 1 - * - * The slant transform must be done _before_ the extend transform - * for compatibility! - */ - float a[6]; - int i, c; - char *p, *q, *r; - if ((p = strchr(t1_line_array, '[')) == 0) - if ((p = strchr(t1_line_array, '{')) == 0) { - remove_eol(p, t1_line_array); - pdftex_fail("FontMatrix: an array expected: `%s'", t1_line_array); - } - c = *p++; /* save the character '[' resp. '{' */ - strncpy(t1_buf_array, t1_line_array, (size_t) (p - t1_line_array)); - r = t1_buf_array + (p - t1_line_array); - for (i = 0; i < 6; i++) { - a[i] = t1_scan_num(p, &q); - p = q; - } - if (fm_extend(fd_cur->fm) != 1000) - do_extend(a, fm_extend(fd_cur->fm) * 1E-3); - for (i = 0; i < 6; i++) { - sprintf(r, "%g ", a[i]); - r = strend(r); - } - if (c == '[') { - while (*p != ']' && *p != 0) - p++; - } else { - while (*p != '}' && *p != 0) - p++; - } - if (*p == 0) { - remove_eol(p, t1_line_array); - pdftex_fail - ("FontMatrix: cannot find the corresponding character to '%c': `%s'", - c, t1_line_array); - } - strcpy(r, p); - strcpy(t1_line_array, t1_buf_array); - t1_line_ptr = eol(t1_line_array); -} +#endif static void t1_scan_keys(PDF pdf) { int i, k; char *p, *q, *r; key_entry *key; - if (fm_extend(fd_cur->fm) != 1000) { - if (t1_prefix("/FontMatrix")) { - t1_modify_fm(); - return; - } - } if (t1_prefix("/FontType")) { p = t1_line_array + strlen("FontType") + 1; if ((i = t1_scan_num(p, 0)) != 1) @@ -743,9 +676,6 @@ r = ++p; /* skip the slash */ for (q = t1_buf_array; *p != ' ' && *p != 10; *q++ = *p++); *q = 0; - if (fm_extend(fd_cur->fm) != 1000) { - sprintf(q, "-Extend_%i", (int) fm_extend(fd_cur->fm)); - } xfree(fd_cur->fontname); fd_cur->fontname = xstrdup(t1_buf_array); /* at this moment we cannot call make_subset_tag() yet, as the encoding @@ -760,8 +690,7 @@ } return; } - if ((k == STEMV_CODE || k == FONTBBOX1_CODE) - && (*p == '[' || *p == '{')) + if ((k == STEMV_CODE || k == FONTBBOX1_CODE) && (*p == '[' || *p == '{')) p++; if (k == FONTBBOX1_CODE) { for (i = 0; i < 4; i++, k++) { @@ -857,8 +786,7 @@ counter++; } if (*r != 10 && *r != '%') { - if (str_prefix(r, "] def") - || str_prefix(r, "] readonly def")) + if (str_prefix(r, "] def") || str_prefix(r, "] readonly def")) break; else { remove_eol(r, t1_line_array); @@ -1062,7 +990,7 @@ #define CC_STACK_SIZE 24 -static integer cc_stack[CC_STACK_SIZE], *stack_ptr = cc_stack; +static int cc_stack[CC_STACK_SIZE], *stack_ptr = cc_stack; static cc_entry cc_tab[CS_MAX]; static boolean is_cc_init = false; @@ -1078,22 +1006,6 @@ goto cs_error; \ } -/* -static integer cc_get(integer index) -{ - if (index < 0) { - if (stack_ptr + index < cc_stack ) - stack_error(stack_ptr - cc_stack + index); - return *(stack_ptr + index); - } - else { - if (cc_stack + index >= stack_ptr) - stack_error(index); - return cc_stack[index]; - } -} -*/ - #define cc_get(N) ((N) < 0 ? *(stack_ptr + (N)) : *(cc_stack + (N))) #define cc_push(V) *stack_ptr++ = V @@ -1200,10 +1112,10 @@ byte *data; int i, b, cs_len; int last_cmd = 0; - integer a, a1, a2; + int a, a1, a2; unsigned short cr; - static integer lastargOtherSubr3 = 3; /* the argument of last call to - OtherSubrs[3] */ + static int lastargOtherSubr3 = 3; /* the argument of last call to + OtherSubrs[3] */ cs_entry *ptr; cc_entry *cc; if (cs_name == NULL) { @@ -1255,7 +1167,7 @@ a |= (cs_getchar() & 0xff) << 16; a |= (cs_getchar() & 0xff) << 8; a |= (cs_getchar() & 0xff) << 0; - if (sizeof(integer) > 4 && (a & 0x80000000)) + if (sizeof(int) > 4 && (a & 0x80000000)) a |= ~0x7FFFFFFF; } cc_push(a); @@ -1578,7 +1490,7 @@ if (is_subr) { cr = 4330; cs_len = 0; - /* at this point we have t1_lenIV >= 0; + /* at this point we have t1_lenIV >= 0; * a negative value would be caught in t1_scan_param() */ return_cs = xtalloc(t1_lenIV + 1, byte); for (cs_len = 0, r = return_cs; cs_len < t1_lenIV; cs_len++, r++) @@ -1660,8 +1572,9 @@ static void t1_subset_charstrings(PDF pdf) { cs_entry *ptr; - cs_size_pos = strstr(t1_line_array, charstringname) + strlen(charstringname) - - t1_line_array + 1; + cs_size_pos = + strstr(t1_line_array, + charstringname) + strlen(charstringname) - t1_line_array + 1; /* cs_size_pos points to the number indicating dict size after "/CharStrings" */ cs_size = t1_scan_num(t1_line_array + cs_size_pos, 0); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writet3.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writet3.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writet3.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writet3.c 2009-12-24 18:51:08.000000000 +0000 @@ -25,7 +25,7 @@ #include "luatexfont.h" static const char _svn_version[] = - "$Id: writet3.c 3236 2009-12-05 11:43:29Z hhenkel $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writet3.c $"; + "$Id: writet3.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writet3.c $"; #define T3_BUF_SIZE 1024 @@ -35,24 +35,24 @@ FILE *t3_file; static boolean t3_image_used; -static integer t3_char_procs[256]; +static int t3_char_procs[256]; static float t3_char_widths[256]; static int t3_glyph_num; static float t3_font_scale; -static integer t3_b0, t3_b1, t3_b2, t3_b3; +static int t3_b0, t3_b1, t3_b2, t3_b3; static boolean is_pk_font; /* not static because used by pkin.c */ unsigned char *t3_buffer = NULL; -integer t3_size = 0; -integer t3_curbyte = 0; +int t3_size = 0; +int t3_curbyte = 0; #define t3_check_eof() \ if (t3_eof()) \ pdftex_fail("unexpected end of file"); -static void update_bbox(integer llx, integer lly, integer urx, integer ury, +static void update_bbox(int llx, int lly, int urx, int ury, boolean is_first_glyph) { if (is_first_glyph) { @@ -72,8 +72,8 @@ } } -static integer get_pk_font_scale(internalfontnumber f, int precision, - int scale_factor) +static int get_pk_font_scale(internalfontnumber f, int precision, + int scale_factor) { return divide_scaled(scale_factor, @@ -81,8 +81,8 @@ precision + 2), 0); } -static integer pk_char_width(internalfontnumber f, scaled w, int precision, - int scale_factor) +static int pk_char_width(internalfontnumber f, scaled w, int precision, + int scale_factor) { return divide_scaled(divide_scaled(w, pdf_font_size(f), 7), @@ -92,14 +92,14 @@ static boolean writepk(PDF pdf, internal_font_number f) { kpse_glyph_file_type font_ret; - integer llx, lly, urx, ury; - integer cw, rw, i, j; + int llx, lly, urx, ury; + int cw, rw, i, j; halfword *row; char *name; char *ftemp = NULL; chardesc cd; boolean is_null_glyph, check_preamble; - integer dpi; + int dpi; int callback_id = 0; int file_opened = 0; int mallocsize = 0; @@ -225,9 +225,9 @@ { int i; - integer wptr, eptr, cptr; + int wptr, eptr, cptr; int first_char, last_char; - integer pk_font_scale; + int pk_font_scale; boolean is_notdef; t3_glyph_num = 0; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writettf.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writettf.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writettf.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writettf.c 2009-12-24 18:51:08.000000000 +0000 @@ -23,7 +23,7 @@ #include static const char _svn_version[] = - "$Id: writettf.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writettf.c $"; + "$Id: writettf.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writettf.c $"; #define DEFAULT_NTABS 14 #define NEW_CMAP_SIZE 2 @@ -35,8 +35,8 @@ /* #define INFILE ttf_file */ unsigned char *ttf_buffer = NULL; -integer ttf_size = 0; -integer ttf_curbyte = 0; +int ttf_size = 0; +int ttf_curbyte = 0; typedef struct { char *name; /* name of glyph */ @@ -94,7 +94,7 @@ static struct avl_table *ttf_cmap_tree = NULL; -integer ttf_length; +int ttf_length; #include "macnames.c" @@ -926,7 +926,7 @@ dirtab_entry *tab; TTF_ULONG i, k; char *p; - const integer save_offset = ttf_offset(); + const int save_offset = ttf_offset(); ttf_seek_outbuf(TABDIR_OFF); if (is_subsetted(fd_cur->fm)) { for (i = 0; i < DEFAULT_NTABS; i++) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writettf.h luatex-0.50.0/source/texk/web2c/luatexdir/font/writettf.h --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writettf.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writettf.h 2009-12-24 18:51:08.000000000 +0000 @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: writettf.h 3112 2009-11-09 16:16:10Z taco $ */ +/* $Id: writettf.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef WRITETTF_H # define WRITETTF_H 1 @@ -146,8 +146,8 @@ extern fd_entry *fd_cur; /* pointer to the current font descriptor */ extern unsigned char *ttf_buffer; -extern integer ttf_size; -extern integer ttf_curbyte; +extern int ttf_size; +extern int ttf_curbyte; extern glyph_entry *glyph_tab; extern dirtab_entry *dir_tab; extern dirtab_entry *ttf_name_lookup(const char *s, boolean required); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writetype0.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writetype0.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writetype0.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writetype0.c 2009-12-24 18:51:08.000000000 +0000 @@ -22,7 +22,7 @@ #include "writecff.h" static const char _svn_version[] = - "$Id: writetype0.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writetype0.c $"; + "$Id: writetype0.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writetype0.c $"; void writetype0(PDF pdf, fd_entry * fd) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/font/writetype2.c luatex-0.50.0/source/texk/web2c/luatexdir/font/writetype2.c --- luatex-0.47.0/source/texk/web2c/luatexdir/font/writetype2.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/font/writetype2.c 2009-12-24 18:51:08.000000000 +0000 @@ -25,11 +25,10 @@ #include "tt_glyf.h" static const char _svn_version[] = - "$Id: writetype2.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/font/writetype2.c $"; + "$Id: writetype2.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/font/writetype2.c $"; /* forward*/ -void make_tt_subset(PDF pdf, fd_entry * fd, unsigned char *buffer, - integer buflen); +void make_tt_subset(PDF pdf, fd_entry * fd, unsigned char *buffer, int buflen); unsigned long cidtogid_obj = 0; @@ -254,8 +253,7 @@ extern int ff_get_ttc_index(char *ffname, char *psname); /* libs/luafontforge/src/luafflib.c */ -void make_tt_subset(PDF pdf, fd_entry * fd, unsigned char *buffer, - integer buflen) +void make_tt_subset(PDF pdf, fd_entry * fd, unsigned char *buffer, int buflen) { long i, cid; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/epdf.c luatex-0.50.0/source/texk/web2c/luatexdir/image/epdf.c --- luatex-0.47.0/source/texk/web2c/luatexdir/image/epdf.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/epdf.c 2009-12-24 18:50:48.000000000 +0000 @@ -18,61 +18,12 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -#include "ptexlib.h" - -#include - static const char _svn_version[] = - "$Id: epdf.c 3246 2009-12-10 22:22:21Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/image/epdf.c $"; - -fd_entry *epdf_create_fontdescriptor(fm_entry * fm, int stemV, int obj_num) -{ - fd_entry *fd; - if ((fd = lookup_fd_entry(fm->ff_name, fm->extend)) == NULL) { - fm->in_use = true; - fd = new_fd_entry(); - fd->fm = fm; - register_fd_entry(fd); - fd->fd_objnum = obj_num; - assert(fm->ps_name != NULL); - fd->fontname = xstrdup(fm->ps_name); /* just fallback */ - // stemV must be copied - fd->font_dim[STEMV_CODE].val = stemV; - fd->font_dim[STEMV_CODE].set = true; - fd->gl_tree = avl_create(comp_string_entry, NULL, &avl_xallocator); - assert(fd->gl_tree != NULL); - } - return fd; -} - -/*********************************************************************** - * Mark glyphs used by embedded PDF file: - * 1. build fontdescriptor, if not yet existing - * 2. mark glyphs directly there - * - * Input charset from xpdf is a string of glyph names including - * leading slashes, but without blanks between them, like: /a/b/c -***********************************************************************/ + "$Id: epdf.c 3282 2009-12-21 21:55:47Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/image/epdf.c $"; -void epdf_mark_glyphs(fd_entry * fd, char *charset) -{ - char *p, *q, *s; - char *glyph; - void **aa; - if (charset == NULL) - return; - assert(fd != NULL); - for (s = charset + 1, q = charset + strlen(charset); s < q; s = p + 1) { - for (p = s; *p != '\0' && *p != '/'; p++); - *p = '\0'; - if ((char *) avl_find(fd->gl_tree, s) == NULL) { - glyph = xstrdup(s); - aa = avl_probe(fd->gl_tree, glyph); - assert(aa != NULL); - } - } -} +#include "ptexlib.h" +#include void epdf_free(void) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/epdf.h luatex-0.50.0/source/texk/web2c/luatexdir/image/epdf.h --- luatex-0.47.0/source/texk/web2c/luatexdir/image/epdf.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/epdf.h 2009-12-24 18:50:48.000000000 +0000 @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: epdf.h 3256 2009-12-15 22:39:14Z hhenkel $ */ +/* $Id: epdf.h 3285 2009-12-23 19:37:18Z hhenkel $ */ extern "C" { @@ -38,7 +38,6 @@ #endif #include /* define SIZEOF_LONG */ -#include /* define type integer */ #define xfree(p) do { if (p != NULL) free(p); p = NULL; } while (0) @@ -47,23 +46,20 @@ #include "../utils/avlstuff.h" #include "../pdf/pdftypes.h" - extern void pdf_room(PDF, integer); + extern void pdf_room(PDF, int); #define pdf_out(B,A) do { pdf_room(B,1); B->buf[B->ptr++] = A; } while (0) extern void unrefPdfDocument(char *); extern void *epdf_xref; - extern integer epdf_lastGroupObjectNum; - extern integer pool_ptr; + extern int epdf_lastGroupObjectNum; + extern int pool_ptr; extern char notdef[]; extern int is_subsetable(struct fm_entry *); - extern struct fm_entry *lookup_fontmap(char *); - extern integer get_fontfile(struct fm_entry *); - extern integer get_fontname(struct fm_entry *); - extern integer pdf_new_objnum(PDF); - extern void read_pdf_info(PDF, image_dict *, integer, integer, - img_readtype_e); - extern void embed_whole_font(struct fd_entry *); + extern int get_fontfile(struct fm_entry *); + extern int get_fontname(struct fm_entry *); + extern int pdf_new_objnum(PDF); + extern void read_pdf_info(PDF, image_dict *, int, int, img_readtype_e); extern void epdf_check_mem(void); extern void epdf_free(void); __attribute__ ((format(printf, 2, 3))) @@ -80,17 +76,7 @@ extern void write_epdf(PDF, image_dict *); extern void write_additional_epdf_objects(PDF, char *); - extern void pdf_begin_obj(PDF, integer, bool); - -/* epdf.c */ - extern void epdf_mark_glyphs(struct fd_entry *, char *); - extern struct fd_entry *epdf_create_fontdescriptor(struct fm_entry *, int, - int); - extern int get_fd_objnum(struct fd_entry *); - extern int get_fn_objnum(PDF, struct fd_entry *); - -/* write_enc.c */ - extern void epdf_write_enc(PDF, char **, integer); + extern void pdf_begin_obj(PDF, int, bool); /* utils.c */ extern char *convertStringToPDFString(char *in, int len); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/image.h luatex-0.50.0/source/texk/web2c/luatexdir/image/image.h --- luatex-0.47.0/source/texk/web2c/luatexdir/image/image.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/image.h 2009-12-24 18:50:48.000000000 +0000 @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: image.h 3256 2009-12-15 22:39:14Z hhenkel $ */ +/* $Id: image.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef IMAGE_H # define IMAGE_H @@ -34,8 +34,8 @@ # define IMAGE_COLOR_C 2 # define IMAGE_COLOR_I 4 -extern integer zround(double); /* from zround.c */ -# define bp2int(p) zround(p * (one_hundred_bp / 100.0)) +extern int do_zround (double r); /* from utils.c */ +# define bp2int(p) do_zround(p * (one_hundred_bp / 100.0)) # define int2bp(i) (i * 100.0 / one_hundred_bp) # define TYPE_IMG "image" @@ -84,21 +84,21 @@ /**********************************************************************/ typedef struct { - integer objnum; - integer index; /* /Im1, /Im2, ... */ + int objnum; + int index; /* /Im1, /Im2, ... */ scaled_whd dimen; /* TeX dimensions given to \pdfximage */ - integer transform; /* transform given to \pdfximage */ - integer x_size; /* dimensions in pixel counts as in JPG/PNG/JBIG2 file */ - integer y_size; - integer x_orig; /* origin in sp for PDF files */ - integer y_orig; - integer x_res; /* pixel resolution as in JPG/PNG/JBIG2 file */ - integer y_res; - integer rotation; /* rotation (multiples of 90 deg.) for PDF files */ - integer colorspace; /* number of /ColorSpace object */ - integer group_ref; /* if it's <=0, the page has no group */ - integer total_pages; - integer page_num; /* requested page (by number) */ + int transform; /* transform given to \pdfximage */ + int x_size; /* dimensions in pixel counts as in JPG/PNG/JBIG2 file */ + int y_size; + int x_orig; /* origin in sp for PDF files */ + int y_orig; + int x_res; /* pixel resolution as in JPG/PNG/JBIG2 file */ + int y_res; + int rotation; /* rotation (multiples of 90 deg.) for PDF files */ + int colorspace; /* number of /ColorSpace object */ + int group_ref; /* if it's <=0, the page has no group */ + int total_pages; + int page_num; /* requested page (by number) */ char *pagename; /* requested page (by name) */ char *filename; /* requested raw file name */ char *filepath; /* full file path after kpathsea */ @@ -108,9 +108,9 @@ int color_space; /* used color space. See JPG_ constants */ int color_depth; /* color depth */ pdfboxspec_e page_box_spec; /* PDF page box spec.: media/crop/bleed/trim/art */ - integer bbox[4]; + int bbox[4]; dict_state state; - integer flags; + int flags; union { pdf_stream_struct *pdfstream; png_img_struct *png; @@ -188,7 +188,7 @@ typedef struct { scaled_whd dimen; /* requested/actual TeX dimensions */ - integer transform; + int transform; image_dict *dict; int dict_ref; /* luaL_ref() reference */ } image; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc luatex-0.50.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc --- luatex-0.47.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc 2009-12-24 18:50:48.000000000 +0000 @@ -19,8 +19,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: pdftoepdf.cc 3257 2009-12-15 23:19:55Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc $"; + "$Id: pdftoepdf.cc 3294 2009-12-24 14:37:58Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc $"; #include #include @@ -105,24 +105,12 @@ // are not fetched during copying, but get a new object number from // LuaTeX and then will be appended into a linked list. -enum InObjType { objFont, objFontDesc, objOther }; - struct InObj { Ref ref; // ref in original PDF - InObjType type; // object type - integer num; // new object number in output PDF - fd_entry *fd; // pointer to /FontDescriptor object structure - integer enc_objnum; // Encoding for objFont + int num; // new object number in output PDF InObj *next; // next entry in list of indirect objects }; -struct UsedEncoding { - integer enc_objnum; - GfxFont *font; - UsedEncoding *next; -}; - -static UsedEncoding *encodingList; static GBool isInit = gFalse; static bool groupIsIndirect; static PdfObject lastGroup; @@ -137,8 +125,8 @@ char *checksum; // for reopening PDFDoc *doc; XRef *xref; - InObj *inObjList; - avl_table *ObjMapTree; + InObj *inObjList; // temporary linked list + avl_table *ObjMapTree; // permanent over luatex run int occurences; // number of references to the PdfDocument; it can be deleted when occurences == 0 }; @@ -268,47 +256,20 @@ } } -static int addEncoding(GfxFont * gfont, int obj_num) -{ - UsedEncoding *n; - n = new UsedEncoding; - n->next = encodingList; - encodingList = n; - n->font = gfont; - n->enc_objnum = obj_num; - return n->enc_objnum; -} - -#define addFont(ref, fd, enc_objnum) \ - addInObj(pdf, pdf_doc, objFont, ref, fd, enc_objnum) - -// addFontDesc is only used to avoid writing the original FontDescriptor -// from the PDF file. - -#define addFontDesc(ref, fd) \ - addInObj(pdf, pdf_doc, objFontDesc, ref, fd, 0) - -#define addOther(ref) \ - addInObj(pdf, pdf_doc, objOther, ref, NULL, 0) - -static int addInObj(PDF pdf, PdfDocument * pdf_doc, InObjType type, Ref ref, - fd_entry * fd, integer e) +static int addInObj(PDF pdf, PdfDocument * pdf_doc, Ref ref) { ObjMap *obj_map; InObj *p, *q, *n; - assert(ref.num != 0); + if (ref.num == 0) { + pdftex_fail("PDF inclusion: reference to invalid object" + " (is the included pdf broken?)"); + } if ((obj_map = findObjMap(pdf_doc, ref)) != NULL) return obj_map->out_num; n = new InObj; n->ref = ref; - n->type = type; n->next = NULL; - n->fd = fd; - n->enc_objnum = e; - if (type == objFontDesc) - n->num = get_fd_objnum(fd); - else - n->num = pdf_new_objnum(pdf); + n->num = pdf_new_objnum(pdf); addObjMap(pdf_doc, ref, n->num); if (pdf_doc->inObjList == NULL) pdf_doc->inObjList = n; @@ -366,31 +327,6 @@ copyDictEntry(pdf, pdf_doc, obj, i); } -static void copyFontDict(PDF pdf, PdfDocument * pdf_doc, Object * obj, - InObj * r) -{ - int i, l; - char *key; - if (!obj->isDict()) - pdftex_fail("PDF inclusion: invalid dict type <%s>", - obj->getTypeName()); - pdf_puts(pdf, "<<\n"); - assert(r->type == objFont); // FontDescriptor is in fd_tree - for (i = 0, l = obj->dictGetLength(); i < l; ++i) { - key = obj->dictGetKey(i); - if (strncmp("FontDescriptor", key, strlen("FontDescriptor")) == 0 - || strncmp("BaseFont", key, strlen("BaseFont")) == 0 - || strncmp("Encoding", key, strlen("Encoding")) == 0) - continue; // skip original values - copyDictEntry(pdf, pdf_doc, obj, i); - } - // write new FontDescriptor, BaseFont, and Encoding - pdf_printf(pdf, "/FontDescriptor %d 0 R\n", (int) get_fd_objnum(r->fd)); - pdf_printf(pdf, "/BaseFont %d 0 R\n", (int) get_fn_objnum(pdf, r->fd)); - pdf_printf(pdf, "/Encoding %d 0 R\n", (int) r->enc_objnum); - pdf_puts(pdf, ">>"); -} - static void copyStream(PDF pdf, Stream * str) { int c; @@ -401,115 +337,9 @@ } } -static void copyProcSet(PDF pdf, Object * obj) -{ - int i, l; - PdfObject procset; - if (!obj->isArray()) - pdftex_fail("PDF inclusion: invalid ProcSet array type <%s>", - obj->getTypeName()); - pdf_puts(pdf, "/ProcSet [ "); - for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { - obj->arrayGetNF(i, &procset); - if (!procset->isName()) - pdftex_fail("PDF inclusion: invalid ProcSet entry type <%s>", - procset->getTypeName()); - copyName(pdf, procset->getName()); - pdf_puts(pdf, " "); - } - pdf_puts(pdf, "]\n"); -} - -#define REPLACE_TYPE1C true - -static void copyFont(PDF pdf, PdfDocument * pdf_doc, char *tag, - Object * fontRef) -{ - ObjMap *obj_map; - PdfObject fontdict, subtype, basefont, fontdescRef, fontdesc, charset, - fontfile, ffsubtype, stemV; - GfxFont *gfont; - fd_entry *fd; - fm_entry *fontmap; - // Check whether the font has already been embedded before analysing it. - Ref ref = fontRef->getRef(); - if ((obj_map = findObjMap(pdf_doc, ref)) != NULL) { - copyName(pdf, tag); - pdf_printf(pdf, " %d 0 R ", obj_map->out_num); - return; - } - // Only handle included Type1 (and Type1C) fonts; anything else will be copied. - // Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true. - if ((pdf->inclusion_copy_font != 0) - && fontRef->fetch(pdf_doc->xref, &fontdict)->isDict() - && fontdict->dictLookup((char *) "Subtype", &subtype)->isName() - && !strcmp(subtype->getName(), "Type1") - && fontdict->dictLookup((char *) "BaseFont", &basefont)->isName() - && fontdict->dictLookupNF((char *) "FontDescriptor", - &fontdescRef)->isRef() - && fontdescRef->fetch(pdf_doc->xref, &fontdesc)->isDict() - && (fontdesc->dictLookup((char *) "FontFile", &fontfile)->isStream() - || (REPLACE_TYPE1C - && fontdesc->dictLookup((char *) "FontFile3", - &fontfile)->isStream() - && fontfile->streamGetDict()->lookup((char *) "Subtype", - &ffsubtype)->isName() - && !strcmp(ffsubtype->getName(), "Type1C"))) - && (fontmap = lookup_fontmap(basefont->getName())) != NULL) { - // copy the value of /StemV - fontdesc->dictLookup((char *) "StemV", &stemV); - fd = epdf_create_fontdescriptor(fontmap, stemV->getInt(), - pdf_new_objnum(pdf)); - if (fontdesc->dictLookup((char *) "CharSet", &charset) - && charset->isString() && is_subsetable(fontmap)) - epdf_mark_glyphs(fd, charset->getString()->getCString()); - else - embed_whole_font(fd); - addFontDesc(fontdescRef->getRef(), fd); - copyName(pdf, tag); - gfont = GfxFont::makeFont(pdf_doc->xref, tag, fontRef->getRef(), - fontdict->getDict()); - pdf_printf(pdf, " %d 0 R ", addFont(fontRef->getRef(), fd, - addEncoding(gfont, - pdf_new_objnum(pdf)))); - } else { - copyName(pdf, tag); - pdf_puts(pdf, " "); - copyObject(pdf, pdf_doc, fontRef); - } -} - -static void copyFontResources(PDF pdf, PdfDocument * pdf_doc, Object * obj) -{ - PdfObject fontRef; - int i, l; - if (!obj->isDict()) - pdftex_fail("PDF inclusion: invalid font resources dict type <%s>", - obj->getTypeName()); - pdf_puts(pdf, "/Font << "); - for (i = 0, l = obj->dictGetLength(); i < l; ++i) { - obj->dictGetValNF(i, &fontRef); - if (fontRef->isRef() || - (fontRef->isDict() && (pdf->inclusion_copy_font == 0))) - copyFont(pdf, pdf_doc, obj->dictGetKey(i), &fontRef); - else - pdftex_fail("PDF inclusion: invalid font in reference type <%s>", - fontRef->getTypeName()); - } - pdf_puts(pdf, ">>\n"); -} - static void copyOtherResources(PDF pdf, PdfDocument * pdf_doc, Object * obj, char *key) { - // copies all other resources (write_epdf handles Fonts and ProcSets), - // but gives a warning if an object is not a dictionary. - - if (!obj->isDict()) - //FIXME: Write the message only to the log file - pdftex_warn("PDF inclusion: invalid other resource which is no dict" - " (key '%s', type <%s>); copying it anyway.", - key, obj->getTypeName()); copyName(pdf, key); pdf_puts(pdf, " "); copyObject(pdf, pdf_doc, obj); @@ -577,7 +407,6 @@ { PdfObject obj1; int i, l, c; - Ref ref; char *p; GString *s; if (obj->isBool()) { @@ -641,13 +470,7 @@ pdf_puts(pdf, "\n"); pdf_puts(pdf, "endstream"); // can't simply write pdf_end_stream() } else if (obj->isRef()) { - ref = obj->getRef(); - if (ref.num == 0) { - pdftex_fail - ("PDF inclusion: reference to invalid object" - " (is the included pdf broken?)"); - } else - pdf_printf(pdf, "%d 0 R", addOther(ref)); + pdf_printf(pdf, "%d 0 R", addInObj(pdf, pdf_doc, obj->getRef())); } else { pdftex_fail("PDF inclusion: type <%s> cannot be copied", obj->getTypeName()); @@ -660,21 +483,13 @@ for (r = pdf_doc->inObjList; r != NULL;) { Object obj1; pdf_doc->xref->fetch(r->ref.num, r->ref.gen, &obj1); - if (r->type == objFont) { - assert(!obj1.isStream()); + if (obj1.isStream()) + pdf_begin_obj(pdf, r->num, 0); + else pdf_begin_obj(pdf, r->num, 2); // \pdfobjcompresslevel = 2 is for this - copyFontDict(pdf, pdf_doc, &obj1, r); - pdf_puts(pdf, "\n"); - pdf_end_obj(pdf); - } else if (r->type != objFontDesc) { // /FontDescriptor is written via write_fontdescriptor() - if (obj1.isStream()) - pdf_begin_obj(pdf, r->num, 0); - else - pdf_begin_obj(pdf, r->num, 2); // \pdfobjcompresslevel = 2 is for this - copyObject(pdf, pdf_doc, &obj1); - pdf_puts(pdf, "\n"); - pdf_end_obj(pdf); - } + copyObject(pdf, pdf_doc, &obj1); + pdf_puts(pdf, "\n"); + pdf_end_obj(pdf); obj1.free(); n = r->next; delete r; @@ -682,35 +497,9 @@ } } -static void writeEncodings(PDF pdf) -{ - UsedEncoding *r, *n; - char *glyphNames[256], *s; - int i; - for (r = encodingList; r != NULL; r = r->next) { - for (i = 0; i < 256; i++) { - if (r->font->isCIDFont()) { - pdftex_fail - ("PDF inclusion: CID fonts are not supported" - " (try to disable font replacement to fix this)"); - } - if ((s = ((Gfx8BitFont *) r->font)->getCharName(i)) != NULL) - glyphNames[i] = s; - else - glyphNames[i] = notdef; - } - epdf_write_enc(pdf, glyphNames, r->enc_objnum); - } - for (r = encodingList; r != NULL; r = n) { - n = r->next; - delete r->font; - delete r; - } -} - // get the pagebox coordinates according to the pagebox_spec -static PDFRectangle *get_pagebox(Page * page, integer pagebox_spec) +static PDFRectangle *get_pagebox(Page * page, int pagebox_spec) { switch (pagebox_spec) { case PDF_BOX_SPEC_MEDIA: @@ -763,8 +552,8 @@ void read_pdf_info(PDF pdf, - image_dict * idict, integer minor_pdf_version_wanted, - integer pdf_inclusion_errorlevel, img_readtype_e readtype) + image_dict * idict, int minor_pdf_version_wanted, + int pdf_inclusion_errorlevel, img_readtype_e readtype) { PdfDocument *pdf_doc; Page *page; @@ -881,7 +670,7 @@ if (groupIsIndirect) { // FIXME: Here we already copy the object. It would be // better to do this only after write_epdf, otherwise we - // may copy ununsed /Group objects + // may copy unused /Group objects copyObject(pdf, pdf_doc, &lastGroup); epdf_lastGroupObjectNum = getNewObjectNumber(pdf_doc, lastGroup->getRef()); @@ -925,7 +714,6 @@ free(checksum); pdf_doc->xref = pdf_doc->doc->getXRef(); (void) pdf_doc->doc->getCatalog()->getPage(img_pagenum(idict)); - encodingList = NULL; page = pdf_doc->doc->getCatalog()->getPage(img_pagenum(idict)); PDFRectangle *pagebox; float bbox[4]; @@ -945,7 +733,7 @@ if (info.isRef()) { // the info dict must be indirect (PDF Ref p. 61) pdf_printf(pdf, "/%s.InfoDict ", pdfkeyprefix); - pdf_printf(pdf, "%d 0 R\n", addOther(info.getRef())); + pdf_printf(pdf, "%d 0 R\n", addInObj(pdf, pdf_doc, info.getRef())); } if (img_is_bbox(idict)) { bbox[0] = int2bp(img_bbox(idict)[0]); @@ -1024,12 +812,7 @@ for (i = 0, l = obj1->dictGetLength(); i < l; ++i) { obj1->dictGetVal(i, &obj2); key = obj1->dictGetKey(i); - if (strcmp("Font", key) == 0) - copyFontResources(pdf, pdf_doc, &obj2); - else if (strcmp("ProcSet", key) == 0) - copyProcSet(pdf, &obj2); - else - copyOtherResources(pdf, pdf_doc, &obj2, key); + copyOtherResources(pdf, pdf_doc, &obj2, key); } pdf_puts(pdf, ">>\n"); } @@ -1083,8 +866,6 @@ } // write out all indirect objects writeRefs(pdf, pdf_doc); - // write out all used encodings (and delete list) - writeEncodings(pdf); } // this relay function is needed to keep some destructor quiet (???) diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/pdftoepdf.h luatex-0.50.0/source/texk/web2c/luatexdir/image/pdftoepdf.h --- luatex-0.47.0/source/texk/web2c/luatexdir/image/pdftoepdf.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/pdftoepdf.h 2009-12-24 18:50:48.000000000 +0000 @@ -18,22 +18,22 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdftoepdf.h 3256 2009-12-15 22:39:14Z hhenkel $ */ +/* $Id: pdftoepdf.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFTOEPDF_H # define PDFTOEPDF_H # include "image.h" -void read_pdf_info(PDF, image_dict *, integer, integer, img_readtype_e); +void read_pdf_info(PDF, image_dict *, int, int, img_readtype_e); void unrefPdfDocument(char *); void write_additional_epdf_objects(PDF, char *); void write_epdf(PDF, image_dict *); void epdf_check_mem(void); /* epdf.c --- this should go in an own header file */ -extern integer get_fontfile_num(int); -extern integer get_fontname_num(int); +extern int get_fontfile_num(int); +extern int get_fontname_num(int); extern void epdf_free(void); #endif /* PDFTOEPDF_H */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/writeimg.c luatex-0.50.0/source/texk/web2c/luatexdir/image/writeimg.c --- luatex-0.47.0/source/texk/web2c/luatexdir/image/writeimg.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/writeimg.c 2009-12-24 18:50:48.000000000 +0000 @@ -19,8 +19,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: writeimg.c 3256 2009-12-15 22:39:14Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/image/writeimg.c $"; + "$Id: writeimg.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/image/writeimg.c $"; #include #include "ptexlib.h" @@ -122,7 +122,7 @@ #define HEADER_PDF "%PDF-1." #define MAX_HEADER (sizeof(HEADER_PNG)-1) -integer epdf_lastGroupObjectNum; +int epdf_lastGroupObjectNum; static void check_type_by_header(image_dict * idict) { @@ -285,8 +285,7 @@ /**********************************************************************/ void read_img(PDF pdf, - image_dict * idict, integer minor_version, - integer inclusion_errorlevel) + image_dict * idict, int minor_version, int inclusion_errorlevel) { char *filepath; int callback_id; @@ -340,10 +339,10 @@ img_state(idict) = DICT_FILESCANNED; } -static image_dict *read_image(PDF pdf, char *file_name, integer page_num, - char *page_name, integer colorspace, - integer page_box, integer minor_version, - integer inclusion_errorlevel) +static image_dict *read_image(PDF pdf, char *file_name, int page_num, + char *page_name, int colorspace, + int page_box, int minor_version, + int inclusion_errorlevel) { image *a = new_image(); image_dict *idict = img_dict(a) = new_image_dict(); @@ -384,7 +383,7 @@ { scaled_whd alt_rule; image_dict *idict; - integer transform = 0, page = 1, pagebox, colorspace = 0; + int transform = 0, page = 1, pagebox, colorspace = 0; char *named = NULL, *attr = NULL, *file_name = NULL; alt_rule = scan_alt_rule(); /* scans || to |alt_rule| */ if (scan_keyword("attr")) { @@ -430,7 +429,7 @@ void scan_pdfrefximage(PDF pdf) { - integer transform = 0; /* one could scan transform as well */ + int transform = 0; /* one could scan transform as well */ image_dict *idict; scaled_whd alt_rule, dim; alt_rule = scan_alt_rule(); /* scans || to |alt_rule| */ @@ -510,11 +509,11 @@ // But one needs rotation info to swap width and height. // img_rotation() comes from the optional /Rotate key in the PDF file. -scaled_whd scale_img(image_dict * idict, scaled_whd alt_rule, integer transform) +scaled_whd scale_img(image_dict * idict, scaled_whd alt_rule, int transform) { - integer x, y, xr, yr, tmp; /* size and resolution of image */ + int x, y, xr, yr, tmp; /* size and resolution of image */ scaled_whd nat; /* natural size corresponding to image resolution */ - integer default_res; + int default_res; assert(idict != NULL); if ((img_type(idict) == IMG_TYPE_PDF || img_type(idict) == IMG_TYPE_PDFSTREAM) && img_is_bbox(idict)) { @@ -606,7 +605,7 @@ } /* write an image */ -void pdf_write_image(PDF pdf, integer n) +void pdf_write_image(PDF pdf, int n) { pdf_begin_dict(pdf, n, 0); if (pdf->draftmode == 0) @@ -693,7 +692,7 @@ #define dumpcharptr(a) \ do { \ - integer x; \ + int x; \ if (a!=NULL) { \ x = strlen(a)+1; \ dumpinteger(x); dump_things(*a, x); \ @@ -704,7 +703,7 @@ #define undumpcharptr(s) \ do { \ - integer x; \ + int x; \ char *a; \ undumpinteger (x); \ if (x>0) { \ @@ -751,8 +750,7 @@ } } -void undumpimagemeta(PDF pdf, integer pdfversion, - integer pdfinclusionerrorlevel) +void undumpimagemeta(PDF pdf, int pdfversion, int pdfinclusionerrorlevel) { int cur_index, i; image_dict *idict; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/writeimg.h luatex-0.50.0/source/texk/web2c/luatexdir/image/writeimg.h --- luatex-0.47.0/source/texk/web2c/luatexdir/image/writeimg.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/writeimg.h 2009-12-24 18:50:48.000000000 +0000 @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: writeimg.h 3156 2009-11-16 15:38:26Z hhenkel $ */ +/* $Id: writeimg.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef WRITEIMG_H # define WRITEIMG_H @@ -35,18 +35,18 @@ /*void init_image_dict(image_dict *);*/ image_dict *new_image_dict(void); void free_image_dict(image_dict * p); -void read_img(PDF, image_dict *, integer, integer); +void read_img(PDF, image_dict *, int, int); void scan_pdfximage(PDF pdf); void scan_pdfrefximage(PDF pdf); scaled_whd tex_scale(scaled_whd nat, scaled_whd tex); -scaled_whd scale_img(image_dict *, scaled_whd, integer); +scaled_whd scale_img(image_dict *, scaled_whd, int); void write_img(PDF, image_dict *); -void pdf_write_image(PDF pdf, integer n); +void pdf_write_image(PDF pdf, int n); void check_pdfstream_dict(image_dict *); void write_pdfstream(PDF, image_dict *); void idict_to_array(image_dict *); void dumpimagemeta(void); -void undumpimagemeta(PDF, integer, integer); +void undumpimagemeta(PDF, int, int); scaled_whd scan_alt_rule(void); #endif /* WRITEIMG_H */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/writejbig2.c luatex-0.50.0/source/texk/web2c/luatexdir/image/writejbig2.c --- luatex-0.47.0/source/texk/web2c/luatexdir/image/writejbig2.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/writejbig2.c 2009-12-24 18:50:48.000000000 +0000 @@ -82,7 +82,7 @@ static const char _svn_version[] = "$Id: writejbig2.c 3237 2009-12-05 11:50:15Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/image/writejbig2.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/image/writejbig2.c $"; #undef DEBUG diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/writejpg.c luatex-0.50.0/source/texk/web2c/luatexdir/image/writejpg.c --- luatex-0.47.0/source/texk/web2c/luatexdir/image/writejpg.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/writejpg.c 2009-12-24 18:50:48.000000000 +0000 @@ -23,8 +23,8 @@ #include "image.h" static const char _svn_version[] = - "$Id: writejpg.c 2756 2009-07-06 15:11:59Z oneiros $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/image/writejpg.c $"; + "$Id: writejpg.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/image/writejpg.c $"; #define JPG_GRAY 1 /* Gray color space, use /DeviceGray */ #define JPG_RGB 3 /* RGB color space, use /DeviceRGB */ @@ -234,7 +234,7 @@ static void reopen_jpg(PDF pdf, image_dict * idict) { - integer width, height, xres, yres; + int width, height, xres, yres; width = img_xsize(idict); height = img_ysize(idict); xres = img_xres(idict); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/image/writepng.c luatex-0.50.0/source/texk/web2c/luatexdir/image/writepng.c --- luatex-0.47.0/source/texk/web2c/luatexdir/image/writepng.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/image/writepng.c 2009-12-24 18:50:48.000000000 +0000 @@ -23,8 +23,8 @@ #include "image.h" static const char _svn_version[] = - "$Id: writepng.c 3237 2009-12-05 11:50:15Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/image/writepng.c $"; + "$Id: writepng.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/image/writepng.c $"; static int transparent_page_group = -1; @@ -172,7 +172,7 @@ png_structp png_p = img_png_png_ptr(idict); png_infop info_p = img_png_info_ptr(idict); png_bytep row, r, *rows; - integer palette_objnum = 0; + int palette_objnum = 0; if (img_colorspace(idict) != 0) { pdf_printf(pdf, "%i 0 R\n", (int) img_colorspace(idict)); } else { @@ -247,10 +247,10 @@ png_structp png_p = img_png_png_ptr(idict); png_infop info_p = img_png_info_ptr(idict); png_bytep row, r, *rows; - integer smask_objnum = 0; + int smask_objnum = 0; png_bytep smask; - integer smask_ptr = 0; - integer smask_size = 0; + int smask_ptr = 0; + int smask_size = 0; int bitdepth; if (img_colorspace(idict) != 0) { pdf_printf(pdf, "%i 0 R\n", (int) img_colorspace(idict)); @@ -346,10 +346,10 @@ png_structp png_p = img_png_png_ptr(idict); png_infop info_p = img_png_info_ptr(idict); png_bytep row, r, *rows; - integer smask_objnum = 0; + int smask_objnum = 0; png_bytep smask; - integer smask_ptr = 0; - integer smask_size = 0; + int smask_ptr = 0; + int smask_size = 0; int bitdepth; if (img_colorspace(idict) != 0) { pdf_printf(pdf, "%i 0 R\n", (int) img_colorspace(idict)); @@ -509,7 +509,7 @@ static void reopen_png(PDF pdf, image_dict * idict) { - integer width, height, xres, yres; + int width, height, xres, yres; width = img_xsize(idict); /* do consistency check */ height = img_ysize(idict); xres = img_xres(idict); @@ -526,7 +526,7 @@ { double gamma, checked_gamma; int i; - integer palette_objnum = 0; + int palette_objnum = 0; png_structp png_p; png_infop info_p; assert(idict != NULL); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lang/texlang.c luatex-0.50.0/source/texk/web2c/luatexdir/lang/texlang.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lang/texlang.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lang/texlang.c 2009-12-24 18:50:48.000000000 +0000 @@ -26,7 +26,7 @@ static const char _svn_version[] = - "$Id: texlang.c 3005 2009-08-16 20:48:36Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lang/texlang.c $"; + "$Id: texlang.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lang/texlang.c $"; /* functions from the fontforge unicode library */ @@ -157,14 +157,14 @@ } } -void set_pre_hyphen_char(integer n, integer v) +void set_pre_hyphen_char(int n, int v) { struct tex_language *l = get_language((int) n); if (l != NULL) l->pre_hyphen_char = (int) v; } -void set_post_hyphen_char(integer n, integer v) +void set_post_hyphen_char(int n, int v) { struct tex_language *l = get_language((int) n); if (l != NULL) @@ -172,14 +172,14 @@ } -void set_pre_exhyphen_char(integer n, integer v) +void set_pre_exhyphen_char(int n, int v) { struct tex_language *l = get_language((int) n); if (l != NULL) l->pre_exhyphen_char = (int) v; } -void set_post_exhyphen_char(integer n, integer v) +void set_post_exhyphen_char(int n, int v) { struct tex_language *l = get_language((int) n); if (l != NULL) @@ -188,37 +188,37 @@ -integer get_pre_hyphen_char(integer n) +int get_pre_hyphen_char(int n) { struct tex_language *l = get_language((int) n); if (l == NULL) return -1; - return (integer) l->pre_hyphen_char; + return (int) l->pre_hyphen_char; } -integer get_post_hyphen_char(integer n) +int get_post_hyphen_char(int n) { struct tex_language *l = get_language((int) n); if (l == NULL) return -1; - return (integer) l->post_hyphen_char; + return (int) l->post_hyphen_char; } -integer get_pre_exhyphen_char(integer n) +int get_pre_exhyphen_char(int n) { struct tex_language *l = get_language((int) n); if (l == NULL) return -1; - return (integer) l->pre_exhyphen_char; + return (int) l->pre_exhyphen_char; } -integer get_post_exhyphen_char(integer n) +int get_post_exhyphen_char(int n) { struct tex_language *l = get_language((int) n); if (l == NULL) return -1; - return (integer) l->post_exhyphen_char; + return (int) l->post_exhyphen_char; } void load_patterns(struct tex_language *lang, unsigned char *buffer) @@ -950,7 +950,7 @@ void dump_one_language(int i) { char *s = NULL; - integer x = 0; + int x = 0; struct tex_language *lang; lang = tex_languages[i]; dump_int(lang->id); @@ -977,7 +977,7 @@ void dump_language_data(void) { - integer i; + int i; dump_int(next_lang_id); for (i = 0; i < next_lang_id; i++) { if (tex_languages[i]) { @@ -993,7 +993,7 @@ void undump_one_language(int i) { char *s = NULL; - integer x = 0; + int x = 0; struct tex_language *lang = get_language(i); undump_int(x); lang->id = x; @@ -1025,7 +1025,7 @@ void undump_language_data(void) { - integer i, x, numlangs; + int i, x, numlangs; undump_int(numlangs); next_lang_id = numlangs; for (i = 0; i < numlangs; i++) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lang/texlang.h luatex-0.50.0/source/texk/web2c/luatexdir/lang/texlang.h --- luatex-0.47.0/source/texk/web2c/luatexdir/lang/texlang.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lang/texlang.h 2009-12-24 18:50:48.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: texlang.h 2856 2009-07-14 20:51:50Z oneiros $ */ +/* $Id: texlang.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXLANG_H # define TEXLANG_H @@ -55,15 +55,15 @@ extern char *clean_hyphenation(char *buffer, char **cleaned); extern void hnj_hyphenation(halfword head, halfword tail); -extern void set_pre_hyphen_char(integer lan, integer val); -extern void set_post_hyphen_char(integer lan, integer val); -extern integer get_pre_hyphen_char(integer lan); -extern integer get_post_hyphen_char(integer lan); - -extern void set_pre_exhyphen_char(integer lan, integer val); -extern void set_post_exhyphen_char(integer lan, integer val); -extern integer get_pre_exhyphen_char(integer lan); -extern integer get_post_exhyphen_char(integer lan); +extern void set_pre_hyphen_char(int lan, int val); +extern void set_post_hyphen_char(int lan, int val); +extern int get_pre_hyphen_char(int lan); +extern int get_post_hyphen_char(int lan); + +extern void set_pre_exhyphen_char(int lan, int val); +extern void set_post_exhyphen_char(int lan, int val); +extern int get_pre_exhyphen_char(int lan); +extern int get_post_exhyphen_char(int lan); extern halfword compound_word_break(halfword t, int clang); extern void dump_language_data(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/lcallbacklib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/lcallbacklib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/lcallbacklib.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/lcallbacklib.c 2009-12-24 18:50:48.000000000 +0000 @@ -21,7 +21,7 @@ #include static const char _svn_version[] = - "$Id: lcallbacklib.c 2898 2009-07-21 06:26:12Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/lcallbacklib.c $"; + "$Id: lcallbacklib.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/lcallbacklib.c $"; extern int do_run_callback(int special, char *values, va_list vl); extern int lua_traceback(lua_State * L); @@ -107,7 +107,7 @@ return; } -void get_lua_number(char *table, char *name, integer * target) +void get_lua_number(char *table, char *name, int * target) { int stacktop; stacktop = lua_gettop(Luas); @@ -123,7 +123,7 @@ return; } -void get_saved_lua_number(int r, char *name, integer * target) +void get_saved_lua_number(int r, char *name, int * target) { int stacktop; stacktop = lua_gettop(Luas); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/lfontlib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/lfontlib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/lfontlib.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/lfontlib.c 2009-12-24 18:50:48.000000000 +0000 @@ -22,7 +22,7 @@ static const char _svn_version[] = - "$Id: lfontlib.c 3253 2009-12-14 08:44:11Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/lfontlib.c $"; + "$Id: lfontlib.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/lfontlib.c $"; #define TIMERS 0 @@ -51,7 +51,7 @@ if (lua_isstring(L, 1)) { cnom = (char *) lua_tostring(L, 1); if (lua_isnumber(L, 2)) { - s = (integer) lua_tonumber(L, 2); + s = (int) lua_tonumber(L, 2); if (strlen(cnom)) { f = get_fontid(); if (read_tfm_info(f, cnom, s)) { @@ -261,7 +261,7 @@ char *s; size_t ff; int cur_cs; - integer f; + int f; if (lua_type(L, 1) == LUA_TSTRING) { s = (char *) lua_tolstring(L, 1, &ff); cur_cs = string_lookup(s, ff); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/limglib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/limglib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/limglib.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/limglib.c 2009-12-24 18:50:48.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: limglib.c 3217 2009-12-03 16:52:01Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/limglib.c $"; + "$Id: limglib.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/limglib.c $"; #include #include @@ -449,11 +449,11 @@ lua_setmetatable(L, -2); /* b */ b = *bb = new_image(); if (!is_wd_running(a)) - img_width(b) = zround(img_width(a) * scale); + img_width(b) = do_zround(img_width(a) * scale); if (!is_ht_running(a)) - img_height(b) = zround(img_height(a) * scale); + img_height(b) = do_zround(img_height(a) * scale); if (!is_dp_running(a)) - img_depth(b) = zround(img_depth(a) * scale); + img_depth(b) = do_zround(img_depth(a) * scale); img_transform(b) = img_transform(a); img_dict(b) = img_dict(a); if (img_dictref(a) != LUA_NOREF) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/lkpselib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/lkpselib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/lkpselib.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/lkpselib.c 2009-12-24 18:50:48.000000000 +0000 @@ -25,7 +25,7 @@ #include static const char _svn_version[] = - "$Id: lkpselib.c 3173 2009-11-19 07:47:02Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/lkpselib.c $"; + "$Id: lkpselib.c 3173 2009-11-19 07:47:02Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/lkpselib.c $"; static const int filetypes[] = { kpse_gf_format, diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/llanglib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/llanglib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/llanglib.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/llanglib.c 2009-12-24 18:50:48.000000000 +0000 @@ -23,7 +23,7 @@ static const char _svn_version[] = - "$Id: llanglib.c 2869 2009-07-16 11:31:18Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/llanglib.c $"; + "$Id: llanglib.c 2869 2009-07-16 11:31:18Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/llanglib.c $"; #define LANG_METATABLE "luatex.lang" diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/llualib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/llualib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/llualib.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/llualib.c 2009-12-24 18:50:48.000000000 +0000 @@ -21,7 +21,7 @@ #include static const char _svn_version[] = - "$Id: llualib.c 2869 2009-07-16 11:31:18Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/llualib.c $"; + "$Id: llualib.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/llualib.c $"; #define LOAD_BUF_SIZE 256 #define UINT_MAX32 0xFFFFFFFF @@ -35,7 +35,7 @@ static bytecode *lua_bytecode_registers = NULL; -integer luabytecode_max = -1; +int luabytecode_max = -1; unsigned int luabytecode_bytes = 0; char *luanames[65536] = { NULL }; @@ -51,8 +51,8 @@ void dump_luac_registers(void) { - integer x; - integer k, n; + int x; + int k, n; bytecode b; dump_int(luabytecode_max); if (lua_bytecode_registers != NULL) { @@ -86,8 +86,8 @@ void undump_luac_registers(void) { - integer x; - integer k, n; + int x; + int k, n; unsigned int i; bytecode b; undump_int(luabytecode_max); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/lnodelib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/lnodelib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/lnodelib.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/lnodelib.c 2009-12-24 18:50:48.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: lnodelib.c 3218 2009-12-04 08:21:56Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/lnodelib.c $"; + "$Id: lnodelib.c 3265 2009-12-18 16:21:40Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/lnodelib.c $"; #include "lua/luatex-api.h" #include @@ -167,7 +167,7 @@ static int lua_nodelib_id(lua_State * L) { - integer i = get_node_type_id(L, 1); + int i = get_node_type_id(L, 1); if (i >= 0) { lua_pushnumber(L, i); } else { @@ -179,7 +179,7 @@ static int lua_nodelib_subtype(lua_State * L) { - integer i = get_node_subtype_id(L, 1); + int i = get_node_subtype_id(L, 1); if (i >= 0) { lua_pushnumber(L, i); } else { @@ -192,7 +192,7 @@ static int lua_nodelib_type(lua_State * L) { - integer i = get_node_type_id(L, 1); + int i = get_node_type_id(L, 1); if (i >= 0) { lua_pushstring(L, node_data[i].name); } else { @@ -476,7 +476,7 @@ { halfword n, p; char *s; - integer w = 0; + int w = 0; int m = 1; int d = -1; n = *(check_isnode(L, 1)); @@ -566,7 +566,7 @@ { halfword n, p; char *s; - integer w = 0; + int w = 0; int m = 1; int d = -1; n = *(check_isnode(L, 1)); @@ -617,10 +617,7 @@ w = luaL_checkoption(L, 2, "text", math_style_names); luaL_checkany(L, 3); m = lua_toboolean(L, 3); - cur_mlist = n; - cur_style = w; - mlist_penalties = m; - mlist_to_hlist(); + mlist_to_hlist_args(n, w, m); lua_nodelib_push_fast(L, vlink(temp_head)); return 1; } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/loslibext.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/loslibext.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/loslibext.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/loslibext.c 2009-12-24 18:50:48.000000000 +0000 @@ -25,7 +25,7 @@ #include static const char _svn_version[] = - "$Id: loslibext.c 3196 2009-11-29 10:54:29Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/loslibext.c $"; + "$Id: loslibext.c 3288 2009-12-24 10:05:46Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/loslibext.c $"; #if defined(_WIN32) || defined(WIN32) || defined(__NT__) # define MKDIR(a,b) mkdir(a) @@ -81,6 +81,9 @@ # elif defined(__MACH__) && defined(__APPLE__) # undef OS_PLATNAME # define OS_PLATNAME "macosx" +# elif defined(__GNU__) +# undef OS_PLATNAME +# define OS_PLATNAME "gnu" # endif #endif @@ -117,7 +120,7 @@ static int exec_command(const char *file, char *const *argv, char *const *envp) { - char path[PATH_MAX]; + char *path; const char *searchpath, *esp; size_t prefixlen, filelen, totallen; @@ -125,6 +128,7 @@ return execve(file, argv, envp); filelen = strlen(file); + path = NULL; searchpath = getenv("PATH"); if (!searchpath) @@ -141,14 +145,20 @@ if (prefixlen == 0 || searchpath[prefixlen - 1] == '/') { totallen = prefixlen + filelen; +#ifdef PATH_MAX if (totallen >= PATH_MAX) continue; +#endif + path = malloc(totallen + 1); memcpy(path, searchpath, prefixlen); memcpy(path + prefixlen, file, filelen); } else { totallen = prefixlen + filelen + 1; +#ifdef PATH_MAX if (totallen >= PATH_MAX) continue; +#endif + path = malloc(totallen + 1); memcpy(path, searchpath, prefixlen); path[prefixlen] = '/'; memcpy(path + prefixlen + 1, file, filelen); @@ -156,6 +166,8 @@ path[totallen] = '\0'; execve(path, argv, envp); + free(path); + path = NULL; if (errno == E2BIG || errno == ENOEXEC || errno == ENOMEM || errno == ETXTBSY) break; /* Report this as an error, no more search */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/lpdflib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/lpdflib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/lpdflib.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/lpdflib.c 2009-12-24 18:50:48.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: lpdflib.c 3248 2009-12-11 13:39:41Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/lpdflib.c $"; + "$Id: lpdflib.c 3290 2009-12-24 10:32:15Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/lpdflib.c $"; #include "lua/luatex-api.h" #include @@ -96,7 +96,7 @@ unsigned char *buf = NULL; if ((f = fopen(filename, "rb")) == NULL) luaL_error(L, "pdf.immediateobj() cannot open input file"); - if ((i = readbinfile(f, &buf, (integer *) len)) == 0) + if ((i = readbinfile(f, &buf, (int *)len)) == 0) luaL_error(L, "pdf.immediateobj() cannot read input file"); fclose(f); return buf; @@ -106,7 +106,7 @@ { int n, first_arg = 1; unsigned i; - integer k; + int k; lstring buf, st1, st2, st3; buf.s = st1.s = st2.s = st3.s = NULL; check_o_mode(static_pdf, "immediateobj()", 1 << OMODE_PDF, true); @@ -436,7 +436,7 @@ static int orig_obj(lua_State * L) { int n, first_arg = 1; - integer k; + int k; lstring st; st.s = NULL; n = lua_gettop(L); @@ -500,7 +500,7 @@ static int l_obj(lua_State * L) { int n; - integer k; + int k; n = lua_gettop(L); if (n == 1 && lua_istable(L, 1)) k = table_obj(L); /* new */ @@ -585,7 +585,7 @@ s = tokenlist_to_cstring(pdf_trailer_toks, true, &l); lua_pushlstring(L, s, l); } else { - lua_pushnil(L); + lua_rawget(L,-2); } } else { lua_pushnil(L); @@ -618,6 +618,8 @@ } else if (strcmp(st, "pdfmapfile") == 0) { char *s = (char *) lua_tostring(L, -1); process_map_item(s, MAPFILE); + } else { + lua_rawset(L,-3); } return 0; } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/lstatslib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/lstatslib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/lstatslib.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/lstatslib.c 2009-12-24 18:50:48.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: lstatslib.c 3226 2009-12-04 15:50:51Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/lstatslib.c $"; + "$Id: lstatslib.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/lstatslib.c $"; #include "lua/luatex-api.h" #include @@ -35,7 +35,7 @@ typedef char *(*charfunc) (void); typedef lua_Number(*numfunc) (void); -typedef integer(*intfunc) (void); +typedef int(*intfunc) (void); char *getbanner(void) { @@ -61,7 +61,7 @@ char *getfilename(void) { - integer t = 0; + int t = 0; int level = in_open; while ((level > 0)) { t = input_stack[level--].name_field; @@ -268,7 +268,7 @@ lua_pushstring(L, st); break; case 's': - str = *(integer *) (stats[i].value); + str = *(int *) (stats[i].value); if (str) { char *ss = makecstring(str); lua_pushstring(L, ss); @@ -286,7 +286,7 @@ lua_pushnumber(L, g()); break; case 'g': - lua_pushnumber(L, *(integer *) (stats[i].value)); + lua_pushnumber(L, *(int *) (stats[i].value)); break; case 'B': g = stats[i].value; @@ -299,7 +299,7 @@ lua_pushnil(L); break; case 'b': - lua_pushboolean(L, *(integer *) (stats[i].value)); + lua_pushboolean(L, *(int *) (stats[i].value)); break; default: lua_pushnil(L); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/ltexiolib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/ltexiolib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/ltexiolib.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/ltexiolib.c 2009-12-24 18:50:48.000000000 +0000 @@ -21,7 +21,7 @@ #include static const char _svn_version[] = - "$Id: ltexiolib.c 3217 2009-12-03 16:52:01Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/ltexiolib.c $"; + "$Id: ltexiolib.c 3217 2009-12-03 16:52:01Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/ltexiolib.c $"; typedef void (*texio_printer) (char *); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/ltexlib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/ltexlib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/ltexlib.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/ltexlib.c 2009-12-24 18:50:48.000000000 +0000 @@ -23,7 +23,7 @@ static const char _svn_version[] = - "$Id: ltexlib.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/ltexlib.c $"; + "$Id: ltexlib.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/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 @@ -42,7 +42,7 @@ unsigned int tsize; void *next; boolean partial; - integer cattable; + int cattable; } rope; typedef struct { @@ -61,7 +61,7 @@ static spindle *spindles = NULL; static int spindle_index = 0; -static void luac_store(lua_State * L, int i, int partial, integer cattable) +static void luac_store(lua_State * L, int i, int partial, int cattable) { char *st, *sttemp; size_t tsize; @@ -92,7 +92,7 @@ static int do_luacprint(lua_State * L, int partial, int deftable) { int i, n; - integer cattable = (integer) deftable; + int cattable = deftable; int startstrings = 1; n = lua_gettop(L); if (cattable != NO_CAT_TABLE) { @@ -138,9 +138,9 @@ return do_luacprint(L, PARTIAL_LINE, DEFAULT_CAT_TABLE); } -integer luacstring_cattable(void) +int luacstring_cattable(void) { - return (integer) read_spindle.tail->cattable; + return (int) read_spindle.tail->cattable; } int luacstring_partial(void) @@ -273,10 +273,10 @@ } -integer get_item_index(lua_State * L, int i, integer base) +int get_item_index(lua_State * L, int i, int base) { size_t kk; - integer k; + int k; int cur_cs; char *s; if (lua_type(L, i) == LUA_TSTRING) { @@ -288,7 +288,7 @@ k = (equiv(cur_cs) - base); } } else { - k = (integer) luaL_checkinteger(L, i); + k = (int) luaL_checkinteger(L, i); } return k; } @@ -297,8 +297,8 @@ static int vsetdimen(lua_State * L, int is_global) { int i, j, err; - integer k; - integer save_global_defs = int_par(global_defs_code); + int k; + int save_global_defs = int_par(global_defs_code); if (is_global) int_par(global_defs_code) = 1; i = lua_gettop(L); @@ -338,7 +338,7 @@ static int getdimen(lua_State * L) { int j; - integer k; + int k; k = get_item_index(L, lua_gettop(L), scaled_base); check_index_range(k, "getdimen"); j = get_tex_dimen_register(k); @@ -350,8 +350,8 @@ { int i, err; halfword *j; - integer k; - integer save_global_defs = int_par(global_defs_code); + int k; + int save_global_defs = int_par(global_defs_code); if (is_global) int_par(global_defs_code) = 1; i = lua_gettop(L); @@ -382,7 +382,7 @@ int getskip(lua_State * L) { halfword j; - integer k; + int k; k = get_item_index(L, lua_gettop(L), skip_base); check_index_range(k, "getskip"); j = get_tex_skip_register(k); @@ -395,8 +395,8 @@ static int vsetcount(lua_State * L, int is_global) { int i, j, err; - integer k; - integer save_global_defs = int_par(global_defs_code); + int k; + int save_global_defs = int_par(global_defs_code); if (is_global) int_par(global_defs_code) = 1; i = lua_gettop(L); @@ -427,7 +427,7 @@ static int getcount(lua_State * L) { int j; - integer k; + int k; k = get_item_index(L, lua_gettop(L), count_base); check_index_range(k, "getcount"); j = get_tex_count_register(k); @@ -439,8 +439,8 @@ static int vsetattribute(lua_State * L, int is_global) { int i, j, err; - integer k; - integer save_global_defs = int_par(global_defs_code); + int k; + int save_global_defs = int_par(global_defs_code); if (is_global) int_par(global_defs_code) = 1; i = lua_gettop(L); @@ -471,7 +471,7 @@ static int getattribute(lua_State * L) { int j; - integer k; + int k; k = get_item_index(L, lua_gettop(L), attribute_base); check_index_range(k, "getattribute"); j = get_tex_attribute_register(k); @@ -482,9 +482,9 @@ int vsettoks(lua_State * L, int is_global) { int i, err; - integer k; + int k; lstring str; - integer save_global_defs = int_par(global_defs_code); + int save_global_defs = int_par(global_defs_code); if (is_global) int_par(global_defs_code) = 1; i = lua_gettop(L); @@ -518,7 +518,7 @@ static int gettoks(lua_State * L) { - integer k; + int k; str_number t; char *ss; k = get_item_index(L, lua_gettop(L), toks_base); @@ -534,7 +534,7 @@ static int get_box_id(lua_State * L, int i) { char *s; - integer cur_cs, cur_cmd; + int cur_cs, cur_cmd; size_t k = 0; int j = -1; if (lua_type(L, i) == LUA_TSTRING) { @@ -564,7 +564,7 @@ static int vsetbox(lua_State * L, int is_global) { int i, j, k, err; - integer save_global_defs = int_par(global_defs_code); + int save_global_defs = int_par(global_defs_code); if (is_global) int_par(global_defs_code) = 1; k = get_box_id(L, -2); @@ -648,7 +648,7 @@ static int vsetboxdim(lua_State * L, int whichdim, int is_global) { int i, j, k, err; - integer save_global_defs = int_par(global_defs_code); + int save_global_defs = int_par(global_defs_code); if (is_global) int_par(global_defs_code) = 1; i = lua_gettop(L); @@ -787,7 +787,7 @@ int do_convert(lua_State * L, int cur_code) { int texstr; - integer i = -1; + int i = -1; char *str = NULL; switch (cur_code) { case pdf_creation_date_code: /* ? */ @@ -1413,7 +1413,7 @@ halfword prim_val = prim_lookup(s); if (prim_val != undefined_primitive) { char *newprim; - integer val; + int val; size_t newl; halfword cur_cmd = get_prim_eq_type(prim_val); halfword cur_chr = get_prim_equiv(prim_val); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/ltokenlib.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/ltokenlib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/ltokenlib.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/ltokenlib.c 2009-12-24 18:50:48.000000000 +0000 @@ -21,7 +21,7 @@ #include static const char _svn_version[] = - "$Id: ltokenlib.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/ltokenlib.c $"; + "$Id: ltokenlib.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/ltokenlib.c $"; extern int get_command_id(char *); @@ -32,7 +32,7 @@ #define is_active_string(s) (strlen((char *)s)>3 && *s==0xEF && *(s+1)==0xBF && *(s+2)==0xBF) -static unsigned char *get_cs_text(integer cs) +static unsigned char *get_cs_text(int cs) { if (cs == null_cs) return (unsigned char *) xstrdup("\\csname\\endcsname"); @@ -45,7 +45,7 @@ static int test_expandable(lua_State * L) { - integer cmd = -1; + int cmd = -1; if (is_valid_token(L, -1)) { get_token_cmd(L, -1); if (lua_isnumber(L, -1)) { @@ -67,7 +67,7 @@ static int test_protected(lua_State * L) { - integer chr = -1; + int chr = -1; if (is_valid_token(L, -1)) { get_token_chr(L, -1); if (lua_isnumber(L, -1)) { @@ -90,7 +90,7 @@ { if (is_valid_token(L, -1)) { unsigned char *s; - integer cs = 0; + int cs = 0; get_token_cs(L, -1); if (lua_isnumber(L, -1)) { cs = lua_tointeger(L, -1); @@ -217,7 +217,7 @@ { char *s; size_t l; - integer cs, cmd, chr; + int cs, cmd, chr; int save_nncs; if (lua_isstring(L, -1)) { s = (char *) lua_tolstring(L, -1, &l); @@ -239,7 +239,7 @@ static int run_build(lua_State * L) { - integer cmd, chr, cs; + int cmd, chr, cs; if (lua_isnumber(L, 1)) { cs = 0; chr = lua_tointeger(L, 1); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/luagen.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/luagen.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/luagen.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/luagen.c 2009-12-24 18:50:48.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: luagen.c 3078 2009-10-25 22:52:31Z oneiros $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/luagen.c $"; + "$Id: luagen.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/luagen.c $"; #include "ptexlib.h" #include "../pdf/pdfpage.h" @@ -35,7 +35,7 @@ } void lua_place_glyph(PDF pdf __attribute__ ((unused)), internal_font_number f - __attribute__ ((unused)), integer c) + __attribute__ ((unused)), int c) { printf("%c", (int) c); } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/luagen.h luatex-0.50.0/source/texk/web2c/luatexdir/lua/luagen.h --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/luagen.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/luagen.h 2009-12-24 18:50:48.000000000 +0000 @@ -17,11 +17,11 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: luagen.h 2987 2009-08-11 22:39:54Z hhenkel $ */ +/* $Id: luagen.h 3261 2009-12-18 11:38:21Z taco $ */ extern void lua_begin_page(PDF pdf); extern void lua_end_page(PDF pdf); -extern void lua_place_glyph(PDF pdf, internal_font_number f, integer c); +extern void lua_place_glyph(PDF pdf, internal_font_number f, int c); extern void lua_place_rule(PDF pdf, scaledpos size); extern void finish_lua_file(PDF pdf); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/luainit.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/luainit.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/luainit.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/luainit.c 2009-12-24 18:50:48.000000000 +0000 @@ -23,7 +23,7 @@ #include static const char _svn_version[] = - "$Id: luainit.c 3188 2009-11-23 14:46:20Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/luainit.c $"; + "$Id: luainit.c 3188 2009-11-23 14:46:20Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/luainit.c $"; /* TH: TODO * diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/luanode.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/luanode.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/luanode.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/luanode.c 2009-12-24 18:50:48.000000000 +0000 @@ -22,7 +22,7 @@ static const char _svn_version[] = - "$Id: luanode.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/luanode.c $"; + "$Id: luanode.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/luanode.c $"; static char *group_code_names[] = { "", @@ -205,7 +205,7 @@ int extrainfo, int pack_direction) { halfword ret; - integer callback_id; + int callback_id; lua_State *L = Luas; if (head_node == null) return head_node; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/luastuff.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/luastuff.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/luastuff.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/luastuff.c 2009-12-24 18:50:48.000000000 +0000 @@ -19,7 +19,7 @@ static const char _svn_version[] = "$Id: luastuff.c 3217 2009-12-03 16:52:01Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/luastuff.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/luastuff.c $"; #include "lua/luatex-api.h" #include diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/luatex.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/luatex.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/luatex.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/luatex.c 2009-12-24 18:50:48.000000000 +0000 @@ -22,4 +22,4 @@ #include static const char _svn_version[] = - "$Id: luatex.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/luatex.c $"; + "$Id: luatex.c 3187 2009-11-22 22:29:05Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/luatex.c $"; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/luatoken.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/luatoken.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/luatoken.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/luatoken.c 2009-12-24 18:50:48.000000000 +0000 @@ -23,7 +23,7 @@ static const char _svn_version[] = - "$Id: luatoken.c 3078 2009-10-25 22:52:31Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/luatoken.c $"; + "$Id: luatoken.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/luatoken.c $"; command_item command_names[] = { {"relax", relax_cmd, NULL}, @@ -244,7 +244,7 @@ char *s; unsigned j; size_t l; - integer cs; + int cs; int save_nncs; int ret; ret = 0; @@ -352,7 +352,7 @@ } } -void do_get_token_lua(integer callback_id) +void do_get_token_lua(int callback_id) { lua_State *L = Luas; while (1) { @@ -369,7 +369,7 @@ if (lua_istable(L, -1)) { lua_rawgeti(L, -1, 1); if (lua_istable(L, -1)) { /* container, result, result[1] */ - integer p, q, r; + int p, q, r; int i, j; lua_pop(L, 1); /* container, result */ /* build a token list */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/lua/texluac.c luatex-0.50.0/source/texk/web2c/luatexdir/lua/texluac.c --- luatex-0.47.0/source/texk/web2c/luatexdir/lua/texluac.c 2009-12-18 09:37:53.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/lua/texluac.c 2009-12-24 18:50:48.000000000 +0000 @@ -46,7 +46,7 @@ #include <../lua51/lundump.h> static const char _svn_version[] = - "$Id: texluac.c 2897 2009-07-20 08:55:27Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/lua/texluac.c $"; + "$Id: texluac.c 2897 2009-07-20 08:55:27Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/lua/texluac.c $"; #define PROGNAME "texluac" /* default program name */ #define OUTPUT PROGNAME ".out" /* default output file */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c luatex-0.50.0/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c --- luatex-0.47.0/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c 2009-12-18 09:38:01.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c 2009-12-24 18:50:51.000000000 +0000 @@ -28,8 +28,8 @@ #include static const char __svn_version[] = - "$Id: ffdummies.c 3083 2009-10-25 23:17:31Z oneiros $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c $"; + "$Id: ffdummies.c 3278 2009-12-21 11:26:19Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c $"; char **gww_errors = NULL; @@ -52,10 +52,22 @@ static void LUAUI_IError(const char *format, ...) { va_list ap; + size_t l; + char buffer[400], *str; + l = strlen("Internal Error: "); + snprintf(buffer, sizeof(buffer), "Internal Error: "); va_start(ap, format); - fprintf(stderr, "Internal Error: "); - vfprintf(stderr, format, ap); + vsnprintf(buffer+l, sizeof(buffer)-l, format, ap); va_end(ap); + str = xstrdup((char *) buffer); + gww_errors = realloc(gww_errors, (gww_error_count + 2) * sizeof(char *)); + if (gww_errors == NULL) { + perror("memory allocation failed"); + exit(EXIT_FAILURE); + } + gww_errors[gww_error_count] = str; + gww_error_count++; + gww_errors[gww_error_count] = NULL; } __attribute__ ((format(printf, 1, 0))) diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c luatex-0.50.0/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c --- luatex-0.47.0/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c 2009-12-18 09:38:01.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c 2009-12-24 18:50:51.000000000 +0000 @@ -33,7 +33,7 @@ static const char __svn_version[] = "$Id: luafflib.c 3187 2009-11-22 22:29:05Z oneiros $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c $"; extern char **gww_errors; extern int gww_error_count; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/luamd5/md5.c luatex-0.50.0/source/texk/web2c/luatexdir/luamd5/md5.c --- luatex-0.47.0/source/texk/web2c/luatexdir/luamd5/md5.c 2009-12-18 09:37:59.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/luamd5/md5.c 2009-12-24 18:50:50.000000000 +0000 @@ -6,13 +6,14 @@ #include +#include #include "md5.h" #define WORD 32 #define MASK 0xFFFFFFFF -typedef unsigned long WORD32; +typedef uint32_t WORD32; /** diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/luatex.c luatex-0.50.0/source/texk/web2c/luatexdir/luatex.c --- luatex-0.47.0/source/texk/web2c/luatexdir/luatex.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/luatex.c 2009-12-24 18:51:10.000000000 +0000 @@ -12,15 +12,15 @@ #include "luatex.h" static const char __svn_version[] = - "$Id: luatex.c 3217 2009-12-03 16:52:01Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/luatex.c $"; + "$Id: luatex.c 3295 2009-12-24 14:43:31Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/luatex.c $"; #define TeX -int luatex_version = 47; /* \.{\\luatexversion} */ +int luatex_version = 50; /* \.{\\luatexversion} */ int luatex_revision = '0'; /* \.{\\luatexrevision} */ int luatex_date_info = -extra_version_info; /* the compile date is negated */ -char *luatex_version_string = "beta-0.47.0"; +char *luatex_version_string = "beta-0.50.0"; char *engine_name = "luatex"; /* the name of this engine */ @@ -725,8 +725,8 @@ good a place as any. */ void -get_date_and_time(integer * minutes, integer * day, - integer * month, integer * year) +get_date_and_time(int * minutes, int * day, + int * month, int * year) { time_t myclock = time((time_t *) 0); struct tm *tmptr = localtime(&myclock); @@ -770,7 +770,7 @@ /* Getting a high resolution time. */ -void get_seconds_and_micros(integer * seconds, integer * micros) +void get_seconds_and_micros(int * seconds, int * micros) { #if defined (HAVE_GETTIMEOFDAY) struct timeval tv; @@ -792,7 +792,7 @@ /* Generating a better seed numbers */ -integer getrandomseed() +int getrandomseed() { #if defined (HAVE_GETTIMEOFDAY) struct timeval tv; @@ -866,7 +866,7 @@ void calledit(packedASCIIcode * filename, - poolpointer fnstart, integer fnlength, integer linenumber) + poolpointer fnstart, int fnlength, int linenumber) { char *temp, *command; char c; @@ -1060,13 +1060,13 @@ /* Look up VAR_NAME in texmf.cnf; assign either the value found there or DFLT to *VAR. */ -void setupboundvariable(integer * var, const_string var_name, integer dflt) +void setupboundvariable(int * var, const_string var_name, int dflt) { string expansion = kpse_var_value(var_name); *var = dflt; if (expansion) { - integer conf_val = atoi(expansion); + int conf_val = atoi(expansion); /* It's ok if the cnf file specifies 0 for extra_mem_{top,bot}, etc. But negative numbers are always wrong. */ if (conf_val < 0 || (conf_val == 0 && dflt > 0)) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/NEWS luatex-0.50.0/source/texk/web2c/luatexdir/NEWS --- luatex-0.47.0/source/texk/web2c/luatexdir/NEWS 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/NEWS 2009-12-24 18:51:10.000000000 +0000 @@ -1,4 +1,60 @@ ============================================================== +Luatex beta-0.50.0 was released 20091224 +============================================================== + +New features: + +* 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. + +* The embedded Metapost library is now at version 1.209. + +Dropped features: + +* It is no longer possible for fonts from embedded pdf files + to be replaced by / merged with the document fonts of the + enveloping pdf. This regression may be temporary, depending + on how the rewritten font backend will look after beta 0.60. + +Bug fixes: + +* Use of \middle confused the \mathstyle operation. + +* \pdfcolorstack handling was broken. + +* 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 + 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 + is only used to tuck in the subscript and for nothing else. + +* luafontloader.open() no longer writes directly to stderr in + case of internal font errors. + +* Any .objnum could not be assigned to. + +* The lua 'pdf' table could not be assigned to. + +* 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 + backend segfaults were a side-effect of the string pool + patches). + +============================================================== Luatex beta-0.47.0 was released 20091218 ============================================================== @@ -1231,7 +1287,7 @@ we probably introduced new problems as well). * Most (all?) files now have a corrected Copyright header, - and link in $Id: NEWS 3259 2009-12-18 09:26:22Z taco $ and $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/NEWS $ into the object file. + and link in $Id: NEWS 3295 2009-12-24 14:43:31Z taco $ and $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/NEWS $ into the object file. * Some unnecessary files were removed from the distribution. diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocp.c luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocp.c --- luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocp.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocp.c 2009-12-24 18:50:48.000000000 +0000 @@ -21,12 +21,12 @@ static const char _svn_version[] = - "$Id: ocp.c 3221 2009-12-04 10:49:35Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/ocp/ocp.c $"; + "$Id: ocp.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/ocp/ocp.c $"; int **ocp_tables; static int ocp_entries = 0; -integer ocp_maxint = 10000000; +int ocp_maxint = 10000000; /* When the user defines \.{\\ocp\\f}, say, \TeX\ assigns an internal number @@ -141,7 +141,7 @@ void dump_ocp_info(void) { - integer k; + int k; dump_int(123456); dump_int(ocp_ptr); for (k = null_ocp; k <= ocp_ptr; k++) { @@ -182,8 +182,8 @@ void undump_ocp_info(void) { - integer k; - integer x; + int k; + int x; undump_int(x); assert(x == 123456); undump_int(ocp_ptr); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocp.h luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocp.h --- luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocp.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocp.h 2009-12-24 18:50:48.000000000 +0000 @@ -17,18 +17,18 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: ocp.h 2830 2009-07-14 07:09:38Z taco $ */ +/* $Id: ocp.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef OCP_H # define OCP_H 1 -typedef integer internal_ocp_number; -typedef integer ocp_index; +typedef int internal_ocp_number; +typedef int ocp_index; extern int **ocp_tables; -extern integer ocp_maxint; +extern int ocp_maxint; extern internal_ocp_number ocp_ptr; /* largest internal ocp number in use */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocplist.c luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocplist.c --- luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocplist.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocplist.c 2009-12-24 18:50:48.000000000 +0000 @@ -21,7 +21,7 @@ static const char _svn_version[] = - "$Id: ocplist.c 2886 2009-07-17 13:47:29Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/ocp/ocplist.c $"; + "$Id: ocplist.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/ocp/ocplist.c $"; memory_word *ocp_list_info; /* the big collection of ocp list data */ ocp_list_index ocp_listmem_ptr; /* first unused word of |ocp_list_info| */ @@ -46,7 +46,7 @@ } -void initialize_ocplist_arrays(integer ocp_list_size) +void initialize_ocplist_arrays(int ocp_list_size) { ocp_list_info = xmallocarray(memory_word, ocp_list_size); memset(ocp_list_info, 0, sizeof(memory_word) * ocp_list_size); @@ -311,7 +311,7 @@ void dump_ocplist_info(void) { - integer k; + int k; dump_int(ocp_listmem_ptr); for (k = 0; k <= ocp_listmem_ptr - 1; k++) dump_wd(ocp_list_info[k]); @@ -332,7 +332,7 @@ void undump_ocplist_info(void) { - integer k; + int k; initialize_ocplist_arrays(ocp_list_size); undump_int(ocp_listmem_ptr); for (k = 0; k <= ocp_listmem_ptr - 1; k++) diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocplist.h luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocplist.h --- luatex-0.47.0/source/texk/web2c/luatexdir/ocp/ocplist.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ocp/ocplist.h 2009-12-24 18:50:48.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: ocplist.h 2483 2009-06-14 00:18:34Z oneiros $ */ +/* $Id: ocplist.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef OCPLIST_H @@ -28,9 +28,9 @@ # define number_ocp_lists 32768 # define null_ocp_list ocp_list_base -typedef integer internal_ocp_list_number; -typedef integer ocp_list_index; /* index into |ocp_list_info| */ -typedef integer ocp_lstack_index; /* index into |ocp_lstack_info| */ +typedef int internal_ocp_list_number; +typedef int ocp_list_index; /* index into |ocp_list_info| */ +typedef int ocp_lstack_index; /* index into |ocp_lstack_info| */ extern memory_word *ocp_list_info; extern memory_word *ocp_lstack_info; @@ -57,7 +57,7 @@ extern void initialize_init_ocplists(void); -extern void initialize_ocplist_arrays(integer ocp_list_size); +extern void initialize_ocplist_arrays(int ocp_list_size); extern ocp_list_index make_ocp_list_node(ocp_lstack_index llstack, scaled llstack_no, diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ocp/readocp.c luatex-0.50.0/source/texk/web2c/luatexdir/ocp/readocp.c --- luatex-0.47.0/source/texk/web2c/luatexdir/ocp/readocp.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ocp/readocp.c 2009-12-24 18:50:48.000000000 +0000 @@ -21,7 +21,7 @@ static const char _svn_version[] = - "$Id: readocp.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/ocp/readocp.c $"; + "$Id: readocp.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/ocp/readocp.c $"; extern int program_name_set; /* in lkpselib.c */ @@ -37,8 +37,8 @@ static unsigned char *ocp_buffer = NULL; /* byte buffer for ocp files */ -static integer ocp_size = 0; /* total size of the ocp file */ -static integer ocp_cur = 0; /* index into |ocp_buffer| */ +static int ocp_size = 0; /* total size of the ocp file */ +static int ocp_cur = 0; /* index into |ocp_buffer| */ void init_null_ocp(str_number a, str_number n) { @@ -107,19 +107,19 @@ { boolean file_opened; /* was |ocp_file| successfully opened? */ boolean res; - integer callback_id; + int callback_id; char *cnam; /* C version of file name */ internal_ocp_number f; /* the new ocp's number */ internal_ocp_number g; /* the number to return */ - integer ocpword; + int ocpword; ocp_index ocpmem_run_ptr; - integer ocp_length, real_ocp_length; /* length of ocp file */ + int ocp_length, real_ocp_length; /* length of ocp file */ ocp_index previous_address; - integer temp_ocp_input; - integer temp_ocp_output; - integer temp_ocp_no_tables; - integer temp_ocp_no_states; - integer i, new_offset, room_for_tables, room_for_states; + int temp_ocp_input; + int temp_ocp_output; + int temp_ocp_no_tables; + int temp_ocp_no_states; + int i, new_offset, room_for_tables, room_for_states; g = null_ocp; f = null_ocp; cnam = NULL; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ocp/runocp.c luatex-0.50.0/source/texk/web2c/luatexdir/ocp/runocp.c --- luatex-0.47.0/source/texk/web2c/luatexdir/ocp/runocp.c 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ocp/runocp.c 2009-12-24 18:50:48.000000000 +0000 @@ -23,7 +23,7 @@ static const char _svn_version[] = - "$Id: runocp.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/ocp/runocp.c $"; + "$Id: runocp.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/ocp/runocp.c $"; memory_word active_info[(active_mem_size + 1)]; active_index active_min_ptr = 0; /* first unused word of |active_info| */ @@ -149,9 +149,9 @@ halfword otp_input_ocp; boolean otp_finished; -integer otp_ext_str; -integer otp_ext_str_arg; -integer otp_ext_i; +int otp_ext_str; +int otp_ext_str_arg; +int otp_ext_i; #define otp_set_instruction() do { \ if (otp_pc>=ocp_state_no(otp_input_ocp,otp_cur_state)) { \ @@ -708,7 +708,7 @@ void run_ocp(void) { - integer t = 0; + int t = 0; halfword otp_i; halfword otp_counter; /* The OTP input buffer is an array of 16-bit values. @@ -863,7 +863,7 @@ } -void initialize_ocp_buffers(integer ocp_buf_size, integer ocp_stack_size) +void initialize_ocp_buffers(int ocp_buf_size, int ocp_stack_size) { otp_init_input_buf = xmallocarray(quarterword, ocp_buf_size); otp_input_buf = xmallocarray(quarterword, ocp_buf_size); @@ -873,7 +873,7 @@ otp_states = xmallocarray(halfword, ocp_stack_size); } -boolean is_last_ocp(scaled llstack_no, integer counter) +boolean is_last_ocp(scaled llstack_no, int counter) { active_min_ptr = equiv(ocp_active_min_ptr_base); active_max_ptr = equiv(ocp_active_max_ptr_base); @@ -892,7 +892,7 @@ void print_active_ocps(void) { - integer i; + int i; tprint_nl("Active ocps: ["); i = active_min_ptr; while (i < active_max_ptr) { @@ -910,11 +910,11 @@ tprint("]"); } -void add_ocp_stack(integer min_index, scaled min_value) +void add_ocp_stack(int min_index, scaled min_value) { ocp_lstack_index p; scaled llstack_no; - integer counter; + int counter; scaled m; m = min_value; /* TH: whatever this is .. */ p = ocp_list_lstack(holding[min_index]); @@ -932,11 +932,11 @@ void active_compile(void) { - integer i; - integer min_index; + int i; + int min_index; scaled min_stack_ocp; scaled old_min; - integer max_active; + int max_active; scaled stack_value; active_min_ptr = active_max_ptr; min_stack_ocp = ocp_maxint; @@ -972,7 +972,7 @@ { halfword ocp_list_no; halfword old_number; - integer i; + int i; scan_ocp_list_ident(); ocp_list_no = cur_val; old_number = equiv(ocp_active_number_base); @@ -997,7 +997,7 @@ void do_pop_ocp_list(small_number a) { halfword old_number; - integer i; + int i; old_number = equiv(ocp_active_number_base); if (old_number == 0) { print_err("No active ocp lists to be popped"); @@ -1031,7 +1031,7 @@ void dump_active_ocp_info(void) { - integer k; + int k; dump_int(active_min_ptr); dump_int(active_max_ptr); for (k = 0; k <= active_max_ptr - 1; k++) @@ -1045,7 +1045,7 @@ void undump_active_ocp_info(void) { - integer k; + int k; undump_int(active_min_ptr); /* undump_size(0)(active_mem_size)('active start point')(active_min_ptr); */ undump_int(active_max_ptr); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ocp/runocp.h luatex-0.50.0/source/texk/web2c/luatexdir/ocp/runocp.h --- luatex-0.47.0/source/texk/web2c/luatexdir/ocp/runocp.h 2009-12-18 09:37:54.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ocp/runocp.h 2009-12-24 18:50:48.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: runocp.h 2483 2009-06-14 00:18:34Z oneiros $ */ +/* $Id: runocp.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef RUNOCP_H @@ -25,7 +25,7 @@ # define active_mem_size 50000 /* number of words of |active_info| for active ocps */ -typedef integer active_index; +typedef int active_index; extern memory_word active_info[(active_mem_size + 1)]; extern active_index active_min_ptr; @@ -36,10 +36,10 @@ # define active_counter(A) active_info[(A)].hh.u.B1 # define active_lstack_no(A) active_info[(A)+1].cint -extern boolean is_last_ocp(scaled llstack_no, integer counter); +extern boolean is_last_ocp(scaled llstack_no, int counter); extern void print_active_ocps(void); -extern void add_ocp_stack(integer min_index, scaled min_value); +extern void add_ocp_stack(int min_index, scaled min_value); extern void active_compile(void); extern void run_ocp(void); @@ -52,10 +52,10 @@ extern void dump_active_ocp_info(void); extern void undump_active_ocp_info(void); -extern void initialize_ocp_buffers(integer ocp_buf_size, - integer ocp_stack_size); +extern void initialize_ocp_buffers(int ocp_buf_size, + int ocp_stack_size); /* for ocplist.h */ -/* typedef integer ocp_list_index ; */ +/* typedef int ocp_list_index ; */ #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pagetree.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pagetree.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pagetree.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pagetree.c 2009-12-24 18:51:10.000000000 +0000 @@ -20,8 +20,8 @@ #include "ptexlib.h" static const char __svn_version[] = - "$Id: pagetree.c 3234 2009-12-05 09:56:09Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pagetree.c $"; + "$Id: pagetree.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pagetree.c $"; /**********************************************************************/ /* Page diversions */ @@ -35,15 +35,15 @@ static struct avl_table *divert_list_tree = NULL; typedef struct pages_entry_ { - integer objnum; /* object number of this /Pages object */ - integer number_of_pages; /* total number of all pages below */ - integer number_of_kids; /* number of direct kid objects */ - integer kids[PAGES_TREE_KIDSMAX]; /* array of kid object numbers */ + int objnum; /* object number of this /Pages object */ + int number_of_pages; /* total number of all pages below */ + int number_of_kids; /* number of direct kid objects */ + int kids[PAGES_TREE_KIDSMAX]; /* array of kid object numbers */ struct pages_entry_ *next; } pages_entry; typedef struct divert_list_entry_ { - integer divnum; + int divnum; pages_entry *first; pages_entry *last; } divert_list_entry; @@ -91,7 +91,7 @@ } } -static divert_list_entry *get_divert_list(integer divnum) +static divert_list_entry *get_divert_list(int divnum) { divert_list_entry *d, tmp; void **aa; @@ -108,7 +108,7 @@ /* pdf_do_page_divert() returns the current /Parent object number */ -integer pdf_do_page_divert(PDF pdf, integer objnum, integer divnum) +int pdf_do_page_divert(PDF pdf, int objnum, int divnum) { divert_list_entry *d; pages_entry *p; @@ -165,7 +165,7 @@ /* undivert from diversion into diversion */ -void pdf_do_page_undivert(integer divnum, integer curdivnum) +void pdf_do_page_undivert(int divnum, int curdivnum) { divert_list_entry *d, *dto, tmp; struct avl_traverser t; @@ -230,7 +230,7 @@ /* loop over all /Pages objects, output them, create their parents, * recursing bottom up, return the /Pages root object number */ -static integer output_pages_list(PDF pdf, pages_entry * pe) +static int output_pages_list(PDF pdf, pages_entry * pe) { pages_entry *p, *q, *r; assert(pe != NULL); @@ -251,7 +251,7 @@ return output_pages_list(pdf, r); /* recurse through next higher level */ } -integer output_pages_tree(PDF pdf) +int output_pages_tree(PDF pdf) { divert_list_entry *d; pdf_do_page_undivert(0, 0); /* concatenate all diversions into diversion 0 */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pagetree.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pagetree.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pagetree.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pagetree.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,13 +17,13 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pagetree.h 2684 2009-06-29 13:01:53Z taco $ */ +/* $Id: pagetree.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PAGETREE_H # define PAGETREE_H -integer output_pages_tree(PDF); -integer pdf_do_page_divert(PDF, integer, integer); -void pdf_do_page_undivert(integer, integer); +int output_pages_tree(PDF); +int pdf_do_page_divert(PDF, int, int); +void pdf_do_page_undivert(int, int); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfaction.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfaction.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfaction.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfaction.c 2009-12-24 18:51:10.000000000 +0000 @@ -23,8 +23,8 @@ static const char __svn_version[] = - "$Id: pdfaction.c 3233 2009-12-05 07:19:29Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfaction.c $"; + "$Id: pdfaction.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfaction.c $"; halfword new_action_node(void) @@ -51,7 +51,7 @@ halfword scan_action(PDF pdf) { - integer p; + int p; (void) pdf; p = new_action_node(); if (scan_keyword("user")) @@ -80,10 +80,10 @@ pdf_error("ext1", "page number must be positive"); set_pdf_action_id(p, cur_val); set_pdf_action_named_id(p, 0); - scan_pdf_ext_toks(); + scan_pdf_ext_toks(); set_pdf_action_tokens(p, def_ref); } else if (scan_keyword("name")) { - scan_pdf_ext_toks(); + scan_pdf_ext_toks(); set_pdf_action_named_id(p, 1); set_pdf_action_id(p, def_ref); } else if (scan_keyword("num")) { @@ -127,7 +127,7 @@ void write_action(PDF pdf, halfword p) { char *s; - integer d = 0; + int d = 0; if (pdf_action_type(p) == pdf_action_user) { pdf_print_toks_ln(pdf, pdf_action_tokens(p)); return; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfannot.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfannot.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfannot.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfannot.c 2009-12-24 18:51:10.000000000 +0000 @@ -1,5 +1,5 @@ /* pdfannot.c - + Copyright 2009 Taco Hoekwater This file is part of LuaTeX. @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdfannot.c 3229 2009-12-04 21:09:46Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfannot.c $"; + "$Id: pdfannot.c 3280 2009-12-21 20:46:06Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfannot.c $"; #include "ptexlib.h" @@ -41,6 +41,7 @@ alt_rule.ht = height(p); alt_rule.dp = depth(p); set_rect_dimens(pdf, p, parent_box, cur, alt_rule, 0); + obj_annot_ptr(pdf, pdf_annot_objnum(p)) = p; append_object_list(pdf, obj_type_annot, pdf_annot_objnum(p)); } @@ -65,7 +66,7 @@ void scan_annot(PDF pdf) { - integer k; + int k; if (scan_keyword("reserveobjnum")) { pdf_create_obj(pdf, obj_type_annot, pdf->sys_obj_ptr + 1); k = pdf->sys_obj_ptr; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.c 2009-12-24 18:51:10.000000000 +0000 @@ -20,8 +20,8 @@ #include "ptexlib.h" static const char __svn_version[] = - "$Id: pdfcolorstack.c 3218 2009-12-04 08:21:56Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.c $"; + "$Id: pdfcolorstack.c 3266 2009-12-18 16:33:17Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.c $"; /*************************************************/ @@ -107,7 +107,7 @@ A new color stack is setup with the given parameters. The stack number is returned or -1 in case of error (no room). */ -int newcolorstack(integer s, integer literal_mode, boolean page_start) +int newcolorstack(int s, int literal_mode, boolean page_start) { colstack_type *colstack; int colstack_num; @@ -165,7 +165,7 @@ selector = save_selector; } -integer colorstackset(int colstack_no, str_number s) +int colorstackset(int colstack_no, str_number s) { colstack_type *colstack = get_colstack(colstack_no); @@ -179,7 +179,7 @@ return colstack->literal_mode; } -integer colorstackcurrent(int colstack_no) +int colorstackcurrent(int colstack_no) { colstack_type *colstack = get_colstack(colstack_no); @@ -191,7 +191,7 @@ return colstack->literal_mode; } -static integer colorstackpush(int colstack_no, str_number s) +static int colorstackpush(int colstack_no, str_number s) { colstack_type *colstack = get_colstack(colstack_no); char *str; @@ -206,7 +206,7 @@ if (*str == 0) { colstack->page_current = NULL; } else { - colstack->page_current = str; + colstack->page_current = xstrdup(str); } free(str); } else { @@ -220,14 +220,14 @@ if (*str == 0) { colstack->form_current = NULL; } else { - colstack->form_current = str; + colstack->form_current = xstrdup(str); } free(str); } return colstack->literal_mode; } -integer colorstackpop(int colstack_no) +int colorstackpop(int colstack_no) { colstack_type *colstack = get_colstack(colstack_no); @@ -278,7 +278,7 @@ } } -integer colorstackskippagestart(int colstack_no) +int colorstackskippagestart(int colstack_no) { colstack_type *colstack = get_colstack(colstack_no); @@ -297,11 +297,11 @@ void pdf_out_colorstack(PDF pdf, halfword p) { - integer old_setting; + int old_setting; str_number s; - integer cmd; - integer stack_no; - integer literal_mode; + int cmd; + int stack_no; + int literal_mode; cmd = pdf_colorstack_cmd(p); stack_no = pdf_colorstack_stack(p); literal_mode = 0; @@ -318,7 +318,7 @@ case colorstack_push: old_setting = selector; selector = new_string; - show_token_list(token_link(pdf_colorstack_data(p)), null,-1); + show_token_list(token_link(pdf_colorstack_data(p)), null, -1); selector = old_setting; s = make_string(); if (cmd == colorstack_set) @@ -348,10 +348,10 @@ void pdf_out_colorstack_startpage(PDF pdf) { - integer i; - integer max; - integer start_status; - integer literal_mode; + int i; + int max; + int start_status; + int literal_mode; str_number s; i = 0; max = colorstackused(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfcolorstack.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfcolorstack.h 3217 2009-12-03 16:52:01Z taco $ */ +/* $Id: pdfcolorstack.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFCOLORSTACK_H # define PDFCOLORSTACK_H @@ -31,11 +31,11 @@ # define STACK_INCREMENT 8 -int newcolorstack(integer s, integer literal_mode, boolean pagestart); +int newcolorstack(int s, int literal_mode, boolean pagestart); int colorstackused(void); -integer colorstackpop(int colstack_no); -integer colorstackcurrent(int colstack_no); -integer colorstackskippagestart(int colstack_no); +int colorstackpop(int colstack_no); +int colorstackcurrent(int colstack_no); +int colorstackskippagestart(int colstack_no); void colorstackpagestart(void); extern void pdf_out_colorstack(PDF pdf, halfword p); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfdest.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfdest.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfdest.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfdest.c 2009-12-24 18:51:10.000000000 +0000 @@ -22,8 +22,8 @@ static const char __svn_version[] = - "$Id: pdfdest.c 3106 2009-11-08 12:04:04Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfdest.c $"; + "$Id: pdfdest.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfdest.c $"; #define pdf_dest_margin dimen_par(pdf_dest_margin_code) @@ -39,9 +39,9 @@ pdf->dest_names = xmallocarray(dest_name_entry, inf_dest_names_size); /* will grow dynamically */ } -void append_dest_name(PDF pdf, char *s, integer n) +void append_dest_name(PDF pdf, char *s, int n) { - integer a; + int a; if (pdf->dest_names_ptr == sup_dest_names_size) overflow("number of destination names (dest_names_size)", pdf->dest_names_size); @@ -65,7 +65,7 @@ with the same identifier already exists and give a warning if needed. */ -void warn_dest_dup(integer id, small_number byname, char *s1, char *s2) +void warn_dest_dup(int id, small_number byname, char *s1, char *s2) { pdf_warning(s1, "destination with the same identifier (", false, false); if (byname > 0) { @@ -86,7 +86,7 @@ { scaledpos pos = pdf->posstruct->pos; scaled_whd alt_rule; - integer k; + int k; if (!is_shipping_page) pdf_error("ext4", "destinations cannot be inside an XForm"); if (doing_leaders) @@ -142,7 +142,7 @@ pdf_error("ext5", "destination has been already written (this shouldn't happen)"); } else { - integer i; + int i; i = obj_dest_ptr(pdf, k->info); if (pdf_dest_named_id(i) > 0) { pdf_begin_dict(pdf, k->info, 1); @@ -213,7 +213,7 @@ void scan_pdfdest(PDF pdf) { halfword q; - integer k; + int k; str_number i; scaled_whd alt_rule; q = cur_list.tail_field; @@ -311,15 +311,15 @@ */ -integer output_name_tree(PDF pdf) +int output_name_tree(PDF pdf) { boolean is_names = true; /* flag for name tree output: is it Names or Kids? */ - integer b = 0, j, l; - integer k = 0; /* index of current child of |l|; if |k < pdf_dest_names_ptr| + int b = 0, j, l; + int k = 0; /* index of current child of |l|; if |k < pdf_dest_names_ptr| then this is pointer to |dest_names| array; otherwise it is the pointer to |obj_tab| (object number) */ - integer dests = 0; - integer names_head = 0, names_tail = 0; + int dests = 0; + int names_head = 0, names_tail = 0; if (pdf->dest_names_ptr == 0) { goto DONE; } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfdest.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfdest.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfdest.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfdest.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfdest.h 2789 2009-07-08 20:42:52Z oneiros $ */ +/* $Id: pdfdest.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFDEST_H # define PDFDEST_H @@ -51,15 +51,15 @@ # define inf_dest_names_size 1000 /* min size of the destination names table for PDF output */ # define sup_dest_names_size 131072 /* max size of the destination names table for PDF output */ -extern void append_dest_name(PDF, char *, integer); +extern void append_dest_name(PDF, char *, int); extern void do_dest(PDF pdf, halfword p, halfword parent_box, scaledpos cur); -extern void warn_dest_dup(integer id, small_number byname, char *s1, char *s2); +extern void warn_dest_dup(int id, small_number byname, char *s1, char *s2); extern void write_out_pdf_mark_destinations(PDF); extern void scan_pdfdest(PDF); extern void init_dest_names(PDF); extern void sort_dest_names(PDF); -extern integer output_name_tree(PDF); +extern int output_name_tree(PDF); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdffont.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdffont.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdffont.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdffont.c 2009-12-24 18:51:10.000000000 +0000 @@ -22,12 +22,12 @@ static const char __svn_version[] = - "$Id: pdffont.c 3221 2009-12-04 10:49:35Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdffont.c $"; + "$Id: pdffont.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdffont.c $"; #define font_id_text(A) cs_text(font_id_base+(A)) /* a frozen font identifier's name */ -integer pk_dpi; /* PK pixel density value from \.{texmf.cnf} */ +int pk_dpi; /* PK pixel density value from \.{texmf.cnf} */ /* As \pdfTeX{} should also act as a back-end driver, it needs to support virtual @@ -41,7 +41,7 @@ /* The following code typesets a character to PDF output */ -void output_one_char(PDF pdf, internal_font_number ffi, integer c) +void output_one_char(PDF pdf, internal_font_number ffi, int c) { scaled_whd ci; /* the real width, height and depth of the character */ ci = get_charinfo_whd(ffi, c); @@ -68,7 +68,7 @@ } /* mark |f| as a used font; set |font_used(f)|, |pdf_font_size(f)| and |pdf_font_num(f)| */ -void pdf_use_font(internal_font_number f, integer fontnum) +void pdf_use_font(internal_font_number f, int fontnum) { set_pdf_font_size(f, font_size(f)); set_font_used(f, true); @@ -88,7 +88,7 @@ void pdf_init_font(PDF pdf, internal_font_number f) { internal_font_number k, b; - integer i; + int i; assert(!font_used(f)); /* if |f| is auto expanded then ensure the base font is initialized */ @@ -132,7 +132,7 @@ { pdf_object_list *p; internal_font_number k; - integer ff; /* for use with |set_ff| */ + int ff; /* for use with |set_ff| */ if (!font_used(f)) pdf_init_font(pdf, f); @@ -155,8 +155,7 @@ /* Here come some subroutines to deal with expanded fonts for HZ-algorithm. */ -void copy_expand_params(internal_font_number k, internal_font_number f, - integer e) +void copy_expand_params(internal_font_number k, internal_font_number f, int e) { /* set expansion-related parameters for an expanded font |k|, based on the base font |f| and the expansion amount |e| */ set_pdf_font_expand_ratio(k, e); @@ -184,7 +183,7 @@ return null_font; } -internal_font_number load_expand_font(internal_font_number f, integer e) +internal_font_number load_expand_font(internal_font_number f, int e) { /* loads font |f| expanded by |e| thousandths into font memory; |e| is nonzero and is a multiple of |pdf_font_step(f)| */ str_number s; /* font name */ @@ -203,10 +202,10 @@ return k; } -integer fix_expand_value(internal_font_number f, integer e) +int fix_expand_value(internal_font_number f, int e) { /* return the multiple of |pdf_font_step(f)| that is nearest to |e| */ - integer step; - integer max_expand; + int step; + int max_expand; boolean neg; if (e == 0) return 0; @@ -230,7 +229,7 @@ return e; } -internal_font_number get_expand_font(internal_font_number f, integer e) +internal_font_number get_expand_font(internal_font_number f, int e) { /* look up and create if not found an expanded version of |f|; |f| is an expandable font; |e| is nonzero and is a multiple of |pdf_font_step(f)| */ internal_font_number k; @@ -246,7 +245,7 @@ return k; } -internal_font_number expand_font(internal_font_number f, integer e) +internal_font_number expand_font(internal_font_number f, int e) { /* looks up for font |f| expanded by |e| thousandths, |e| is an arbitrary value between max stretch and max shrink of |f|; if not found then creates it */ if (e == 0) @@ -260,8 +259,8 @@ } void set_expand_params(internal_font_number f, boolean auto_expand, - integer stretch_limit, integer shrink_limit, - integer font_step, integer expand_ratio) + int stretch_limit, int shrink_limit, + int font_step, int expand_ratio) { /* expand a font with given parameters */ set_pdf_font_step(f, font_step); set_pdf_font_auto_expand(f, auto_expand); @@ -275,7 +274,7 @@ void read_expand_font(void) { /* read font expansion spec and load expanded font */ - integer shrink_limit, stretch_limit, font_step; + int shrink_limit, stretch_limit, font_step; internal_font_number f; boolean auto_expand; /* read font expansion parameters */ @@ -396,7 +395,7 @@ void pdf_include_chars(PDF pdf) { str_number s; - unsigned char *k, *j; /* running index */ + unsigned char *k, *j; /* running index */ internal_font_number f; scan_font_ident(); f = cur_val; @@ -408,7 +407,7 @@ scan_pdf_ext_toks(); s = tokens_to_string(def_ref); delete_token_ref(def_ref); - j = str_string(s)+str_length(s); + j = str_string(s) + str_length(s); for (k = str_string(s); k < j; k++) { pdf_mark_char(f, *k); } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdffont.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdffont.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdffont.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdffont.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,32 +17,32 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdffont.h 2904 2009-07-23 21:19:48Z hhenkel $ */ +/* $Id: pdffont.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFFONT_H # define PDFFONT_H -extern void output_one_char(PDF pdf, internal_font_number ffi, integer c); +extern void output_one_char(PDF pdf, internal_font_number ffi, int c); -extern void pdf_use_font(internal_font_number f, integer fontnum); +extern void pdf_use_font(internal_font_number f, int fontnum); extern void pdf_init_font(PDF pdf, internal_font_number f); extern internal_font_number pdf_set_font(PDF pdf, internal_font_number f); -typedef integer *fm_entry_ptr; +typedef int *fm_entry_ptr; -extern integer pk_dpi; /* PK pixel density value from \.{texmf.cnf} */ +extern int pk_dpi; /* PK pixel density value from \.{texmf.cnf} */ extern void copy_expand_params(internal_font_number k, internal_font_number f, - integer e); + int e); extern internal_font_number tfm_lookup(str_number s, scaled fs); -extern internal_font_number load_expand_font(internal_font_number f, integer e); -extern integer fix_expand_value(internal_font_number f, integer e); -extern internal_font_number get_expand_font(internal_font_number f, integer e); -extern internal_font_number expand_font(internal_font_number f, integer e); +extern internal_font_number load_expand_font(internal_font_number f, int e); +extern int fix_expand_value(internal_font_number f, int e); +extern internal_font_number get_expand_font(internal_font_number f, int e); +extern internal_font_number expand_font(internal_font_number f, int e); extern void set_expand_params(internal_font_number f, boolean auto_expand, - integer stretch_limit, integer shrink_limit, - integer font_step, integer expand_ratio); + int stretch_limit, int shrink_limit, + int font_step, int expand_ratio); extern void read_expand_font(void); extern void new_letterspaced_font(small_number a); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfgen.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfgen.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfgen.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfgen.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdfgen.c 3235 2009-12-05 11:36:51Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfgen.c $"; + "$Id: pdfgen.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfgen.c $"; #include "ptexlib.h" #include @@ -38,10 +38,10 @@ static char *jobname_cstr = NULL; /* commandline interface */ -integer pdf_output_option; -integer pdf_output_value; -integer pdf_draftmode_option; -integer pdf_draftmode_value; +int pdf_output_option; +int pdf_output_value; +int pdf_draftmode_option; +int pdf_draftmode_value; halfword pdf_info_toks; /* additional keys of Info dictionary */ halfword pdf_catalog_toks; /* additional keys of Catalog dictionary */ @@ -132,10 +132,10 @@ We use |pdf_get_mem| to allocate memory in |mem| */ -integer pdf_get_mem(PDF pdf, integer s) +int pdf_get_mem(PDF pdf, int s) { /* allocate |s| words in |mem| */ - integer a; - integer ret; + int a; + int ret; if (s > sup_pdf_mem_size - pdf->mem_ptr) overflow("PDF memory size (pdf_mem_size)", pdf->mem_size); if (pdf->mem_ptr + s > pdf->mem_size) { @@ -225,7 +225,7 @@ /* writepdf() always writes by fwrite() */ -static void write_pdf(PDF pdf, integer a, int b) +static void write_pdf(PDF pdf, int a, int b) { (void) fwrite((char *) &pdf->buf[a], sizeof(pdf->buf[a]), (int) ((b) - (a) + 1), pdf->file); @@ -287,7 +287,7 @@ } /* create new \.{/ObjStm} object if required, and set up cross reference info */ -void pdf_os_prepare_obj(PDF pdf, integer i, integer pdf_os_level) +void pdf_os_prepare_obj(PDF pdf, int i, int pdf_os_level) { pdf_os_switch(pdf, ((pdf_os_level > 0) && (pdf->objcompresslevel >= pdf_os_level))); @@ -315,9 +315,9 @@ /* low-level buffer checkers */ /* check that |s| bytes more fit into |pdf_os_buf|; increase it if required */ -static void pdf_os_get_os_buf(PDF pdf, integer s) +static void pdf_os_get_os_buf(PDF pdf, int s) { - integer a; + int a; if (s > sup_pdf_os_buf_size - pdf->ptr) overflow("PDF object stream buffer", pdf->os_buf_size); if (pdf->ptr + s > pdf->os_buf_size) { @@ -336,7 +336,7 @@ } /* make sure that there are at least |n| bytes free in PDF buffer */ -void pdf_room(PDF pdf, integer n) +void pdf_room(PDF pdf, int n) { if (pdf->os_mode && (n + pdf->ptr > pdf->buf_size)) pdf_os_get_os_buf(pdf, n); @@ -428,8 +428,8 @@ void pdf_print_int(PDF pdf, longinteger n) { - register integer k = 0; /* current digit; we assume that $|n|<10^{23}$ */ - integer dig[24]; + register int k = 0; /* current digit; we assume that $|n|<10^{23}$ */ + int dig[24]; if (n < 0) { pdf_out(pdf, '-'); if (n < -0x7FFFFFFF) { /* need to negate |n| more carefully */ @@ -460,7 +460,7 @@ /* print $m/10^d$ as real */ -void pdf_print_real(PDF pdf, integer m, integer d) +void pdf_print_real(PDF pdf, int m, int d) { if (m < 0) { pdf_out(pdf, '-'); @@ -584,7 +584,7 @@ scaled one_bp = ((7227 * 65536) / 72 + 50) / 100; /* $10^0..10^9$ */ -integer ten_pow[10] = { +int ten_pow[10] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; @@ -594,7 +594,7 @@ for optimizations that are not possible in pascal. */ -scaled round_xn_over_d(scaled x, integer n, integer d) +scaled round_xn_over_d(scaled x, int n, int d) { boolean positive; /* was |x>=0|? */ unsigned t, u, v; /* intermediate quantities */ @@ -670,7 +670,7 @@ p->image_procset = 0; } -void append_object_list(PDF pdf, pdf_obj_type t, integer objnum) +void append_object_list(PDF pdf, pdf_obj_type t, int objnum) { pdf_object_list *p; pdf_object_list *item = xmalloc(sizeof(pdf_object_list)); @@ -697,7 +697,7 @@ } /* return zero on failure, or the object */ -pdf_object_list *lookup_object_list(PDF pdf, pdf_obj_type t, integer f) +pdf_object_list *lookup_object_list(PDF pdf, pdf_obj_type t, int f) { pdf_object_list *p; switch (t) { @@ -775,10 +775,10 @@ /* Subroutines to print out various PDF objects */ /* print out an integer with fixed width; used for outputting cross-reference table */ -void pdf_print_fw_int(PDF pdf, longinteger n, integer w) +void pdf_print_fw_int(PDF pdf, longinteger n, int w) { - integer k; /* $0\le k\le23$ */ - integer dig[24]; + int k; /* $0\le k\le23$ */ + int dig[24]; k = 0; do { dig[k] = n % 10; @@ -791,10 +791,10 @@ } /* print out an integer as a number of bytes; used for outputting \.{/XRef} cross-reference stream */ -void pdf_out_bytes(PDF pdf, longinteger n, integer w) +void pdf_out_bytes(PDF pdf, longinteger n, int w) { - integer k; - integer bytes[8]; /* digits in a number being output */ + int k; + int bytes[8]; /* digits in a number being output */ k = 0; do { bytes[k] = n % 256; @@ -808,11 +808,11 @@ /* print out an entry in dictionary with integer value to PDF buffer */ -void pdf_int_entry(PDF pdf, char *s, integer v) +void pdf_int_entry(PDF pdf, char *s, int v) { pdf_printf(pdf, "/%s ", s); pdf_print_int(pdf, v); -} void pdf_int_entry_ln(PDF pdf, char *s, integer v) +} void pdf_int_entry_ln(PDF pdf, char *s, int v) { pdf_int_entry(pdf, s, v); @@ -820,10 +820,10 @@ } /* print out an indirect entry in dictionary */ -void pdf_indirect(PDF pdf, char *s, integer o) +void pdf_indirect(PDF pdf, char *s, int o) { pdf_printf(pdf, "/%s %d 0 R", s, (int) o); -} void pdf_indirect_ln(PDF pdf, char *s, integer o) +} void pdf_indirect_ln(PDF pdf, char *s, int o) { pdf_indirect(pdf, s, o); @@ -1029,7 +1029,7 @@ /**********************************************************************/ /* begin a PDF dictionary object */ -void pdf_begin_dict(PDF pdf, integer i, integer pdf_os_level) +void pdf_begin_dict(PDF pdf, int i, int pdf_os_level) { ensure_output_state(pdf, ST_HEADER_WRITTEN); pdf_os_prepare_obj(pdf, i, pdf_os_level); @@ -1043,7 +1043,7 @@ } /* begin a new PDF dictionary object */ -void pdf_new_dict(PDF pdf, integer t, integer i, integer pdf_os) +void pdf_new_dict(PDF pdf, int t, int i, int pdf_os) { pdf_create_obj(pdf, t, i); pdf_begin_dict(pdf, pdf->obj_ptr, pdf_os); @@ -1121,7 +1121,7 @@ } /* begin a PDF object */ -void pdf_begin_obj(PDF pdf, integer i, integer pdf_os_level) +void pdf_begin_obj(PDF pdf, int i, int pdf_os_level) { ensure_output_state(pdf, ST_HEADER_WRITTEN); pdf_os_prepare_obj(pdf, i, pdf_os_level); @@ -1133,7 +1133,7 @@ } /* begin a new PDF object */ -void pdf_new_obj(PDF pdf, integer t, integer i, integer pdf_os) +void pdf_new_obj(PDF pdf, int t, int i, int pdf_os) { pdf_create_obj(pdf, t, i); pdf_begin_obj(pdf, pdf->obj_ptr, pdf_os); @@ -1150,7 +1150,7 @@ } } -void write_stream_length(PDF pdf, integer length, longinteger offset) +void write_stream_length(PDF pdf, int length, longinteger offset) { if (jobname_cstr == NULL) jobname_cstr = makecstring(job_name); @@ -1436,12 +1436,12 @@ } } -integer fb_offset(PDF pdf) +int fb_offset(PDF pdf) { return pdf->fb_ptr - pdf->fb_array; } -void fb_seek(PDF pdf, integer offset) +void fb_seek(PDF pdf, int offset) { pdf->fb_ptr = pdf->fb_array + offset; } @@ -1457,7 +1457,7 @@ void fb_flush(PDF pdf) { char *p; - integer n; + int n; for (p = pdf->fb_array; p < pdf->fb_ptr;) { n = pdf->buf_size - pdf->ptr; if (pdf->fb_ptr - p < n) @@ -1748,7 +1748,7 @@ void pdf_end_page(PDF pdf, boolean shipping_page) { - integer j, ff; + int j, ff; pdf_resource_struct *res_p = pdf->resources; pdf_resource_struct local_resources; pdf_object_list *ol; @@ -1994,7 +1994,7 @@ static void check_nonexisting_destinations(PDF pdf) { - integer k; + int k; for (k = pdf->head_tab[obj_type_dest]; k != 0; k = obj_link(pdf, k)) { if (obj_dest_ptr(pdf, k) == null) { pdf_warning("dest", NULL, false, false); @@ -2050,7 +2050,7 @@ return true; } -void pdf_print_info(PDF pdf, integer luatex_version, str_number luatex_revision) +void pdf_print_info(PDF pdf, int luatex_version, str_number luatex_revision) { /* print info object */ boolean creator_given, producer_given, creationdate_given, moddate_given, trapped_given; @@ -2107,7 +2107,7 @@ void build_free_object_list(PDF pdf) { - integer k, l; + int k, l; l = 0; set_obj_fresh(pdf, l); /* null object at begin of list of free objects */ for (k = 1; k <= pdf->sys_obj_ptr; k++) { @@ -2126,14 +2126,13 @@ are already written completely to PDF output file. */ -void finish_pdf_file(PDF pdf, integer luatex_version, - str_number luatex_revision) +void finish_pdf_file(PDF pdf, int luatex_version, str_number luatex_revision) { boolean res; - integer i, j, k; - integer root, outlines, threads, names_tree; - integer xref_offset_width; - integer callback_id = callback_defined(stop_run_callback); + int i, j, k; + int root, outlines, threads, names_tree; + int xref_offset_width; + int callback_id = callback_defined(stop_run_callback); if (total_pages == 0) { if (callback_id == 0) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfgen.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfgen.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfgen.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfgen.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfgen.h 3187 2009-11-22 22:29:05Z oneiros $ */ +/* $Id: pdfgen.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFGEN_H # define PDFGEN_H @@ -27,7 +27,7 @@ extern PDF static_pdf; -extern integer pdf_get_mem(PDF pdf, integer s); +extern int pdf_get_mem(PDF pdf, int s); /* We use the similiar subroutines to handle the output buffer for @@ -70,20 +70,20 @@ zip_finish = 2 /* finish \.{ZIP} compression */ } zip_write_states; -extern integer pdf_output_option; -extern integer pdf_output_value; -extern integer pdf_draftmode_option; -extern integer pdf_draftmode_value; +extern int pdf_output_option; +extern int pdf_output_value; +extern int pdf_draftmode_option; +extern int pdf_draftmode_value; extern scaled one_hundred_inch; extern scaled one_inch; extern scaled one_true_inch; extern scaled one_hundred_bp; extern scaled one_bp; -extern integer ten_pow[10]; +extern int ten_pow[10]; extern void pdf_flush(PDF); -extern void pdf_room(PDF, integer); +extern void pdf_room(PDF, int); extern void fix_pdf_minorversion(PDF); @@ -130,7 +130,7 @@ extern void pdf_print_wide_char(PDF, int); extern void pdf_print(PDF, str_number); extern void pdf_print_int(PDF, longinteger); -extern void pdf_print_real(PDF, integer, integer); +extern void pdf_print_real(PDF, int, int); extern void pdf_print_str(PDF, char *); extern void pdf_begin_stream(PDF); @@ -144,8 +144,8 @@ /* This is for the resource lists */ extern void reset_resource_lists(pdf_resource_struct * p); -extern void append_object_list(PDF pdf, pdf_obj_type t, integer f); -extern pdf_object_list *lookup_object_list(PDF pdf, pdf_obj_type t, integer f); +extern void append_object_list(PDF pdf, pdf_obj_type t, int f); +extern pdf_object_list *lookup_object_list(PDF pdf, pdf_obj_type t, int f); void flush_resource_lists(PDF pdf); # define pdf_print_resname_prefix(pdf) do { \ @@ -153,12 +153,12 @@ pdf_puts(pdf,pdf->resname_prefix); \ } while (0) -extern void pdf_print_fw_int(PDF, longinteger, integer); -extern void pdf_out_bytes(PDF, longinteger, integer); -extern void pdf_int_entry(PDF, char *, integer); -extern void pdf_int_entry_ln(PDF, char *, integer); -extern void pdf_indirect(PDF, char *, integer); -extern void pdf_indirect_ln(PDF, char *, integer); +extern void pdf_print_fw_int(PDF, longinteger, int); +extern void pdf_out_bytes(PDF, longinteger, int); +extern void pdf_int_entry(PDF, char *, int); +extern void pdf_int_entry_ln(PDF, char *, int); +extern void pdf_indirect(PDF, char *, int); +extern void pdf_indirect_ln(PDF, char *, int); extern void pdf_print_str_ln(PDF, char *); extern void pdf_str_entry(PDF, char *, char *); extern void pdf_str_entry_ln(PDF, char *, char *); @@ -169,19 +169,19 @@ extern void pdf_print_rect_spec(PDF, halfword); extern void pdf_rectangle(PDF, halfword); -extern void pdf_begin_obj(PDF, integer, integer); -extern void pdf_new_obj(PDF, integer, integer, integer); +extern void pdf_begin_obj(PDF, int, int); +extern void pdf_new_obj(PDF, int, int, int); extern void pdf_end_obj(PDF); -extern void pdf_begin_dict(PDF, integer, integer); -extern void pdf_new_dict(PDF, integer, integer, integer); +extern void pdf_begin_dict(PDF, int, int); +extern void pdf_new_dict(PDF, int, int, int); extern void pdf_end_dict(PDF); extern void pdf_os_switch(PDF pdf, boolean pdf_os); -extern void pdf_os_prepare_obj(PDF pdf, integer i, integer pdf_os_level); +extern void pdf_os_prepare_obj(PDF pdf, int i, int pdf_os_level); extern void pdf_os_write_objstream(PDF); -extern void write_stream_length(PDF, integer, longinteger); +extern void write_stream_length(PDF, int, longinteger); extern void print_creation_date(PDF); extern void print_mod_date(PDF); @@ -189,10 +189,10 @@ extern void remove_pdffile(PDF); -extern integer fb_offset(PDF); +extern int fb_offset(PDF); extern void fb_flush(PDF); extern void fb_putchar(PDF, eight_bits); -extern void fb_seek(PDF, integer); +extern void fb_seek(PDF, int); extern void fb_free(PDF); extern void write_zip(PDF, boolean); @@ -200,7 +200,7 @@ /* functions that do not output stuff */ -extern scaled round_xn_over_d(scaled x, integer n, integer d); +extern scaled round_xn_over_d(scaled x, int n, int d); extern char *convertStringToPDFString(const char *in, int len); extern void init_start_time(PDF); @@ -225,7 +225,7 @@ extern halfword pdf_names_toks; /* additional keys of Names dictionary */ extern halfword pdf_trailer_toks; /* additional keys of Trailer dictionary */ extern void scan_pdfcatalog(PDF pdf); -extern void finish_pdf_file(PDF pdf, integer luatex_version, +extern void finish_pdf_file(PDF pdf, int luatex_version, str_number luatex_revision); extern boolean is_shipping_page; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfglyph.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfglyph.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfglyph.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfglyph.c 2009-12-24 18:51:10.000000000 +0000 @@ -1,5 +1,5 @@ /* pdfglyph.c - + Copyright 2009 Taco Hoekwater This file is part of LuaTeX. @@ -17,13 +17,13 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ +static const char __svn_version[] = + "$Id: pdfglyph.c 3275 2009-12-20 22:20:08Z hhenkel $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfglyph.c $"; + #include "ptexlib.h" #include "pdfpage.h" -static const char __svn_version[] = - "$Id: pdfglyph.c 3246 2009-12-10 22:22:21Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfglyph.c $"; - #define lround(a) (long) floor((a) + 0.5) #define pdf2double(a) ((double) (a).m / ten_pow[(a).e]) @@ -55,20 +55,22 @@ static void setup_fontparameters(PDF pdf, internal_font_number f) { + float slant, extend, expand; pdfstructure *p = pdf->pstruct; pdf->f_cur = f; p->f_pdf = pdf_set_font(pdf, f); + p->fs.m = lround(font_size(f) / one_bp * ten_pow[p->fs.e]); + slant = font_slant(f) / 1000.0; + extend = font_extend(f) / 1000.0; + expand = 1.0 + pdf_font_expand_ratio(f) / 1000.0; p->tj_delta.e = p->cw.e - 1; /* "- 1" makes less corrections inside []TJ */ /* no need to be more precise than TeX (1sp) */ while (p->tj_delta.e > 0 && (double) font_size(f) / ten_pow[p->tj_delta.e + e_tj] < 0.5) p->tj_delta.e--; /* happens for very tiny fonts */ assert(p->cw.e >= p->tj_delta.e); /* else we would need, e. g., ten_pow[-1] */ - p->fs.m = lround(font_size(f) / one_bp * ten_pow[p->fs.e]); - p->hz.m = pdf_font_expand_ratio(f) + ten_pow[p->hz.e]; - p->tm[0].m = - lround(pdf2double(p->hz) * pdf2double(p->ext) * ten_pow[p->tm[0].e]); - p->tm[2].m = lround(font_slant(f) * (font_extend(f) / 1000.0)); /* tm[2].e = 3 */ + p->tm[0].m = lround(expand * extend * ten_pow[p->tm[0].e]); + p->tm[2].m = lround(slant * ten_pow[p->tm[2].e]); p->k2 = ten_pow[e_tj + p->cw.e] / (ten_pow[p->pdf.h.e] * pdf2double(p->fs) * @@ -83,6 +85,8 @@ pdf_printf(pdf, " "); print_pdffloat(pdf, p->fs); pdf_printf(pdf, " Tf "); + p->f_pdf_cur = p->f_pdf; + p->fs_cur.m = p->fs.m; } static void print_tm(PDF pdf, pdffloat * tm) @@ -151,7 +155,7 @@ /**********************************************************************/ -void pdf_place_glyph(PDF pdf, internal_font_number f, integer c) +void pdf_place_glyph(PDF pdf, internal_font_number f, int c) { boolean move; pdfstructure *p = pdf->pstruct; @@ -162,7 +166,8 @@ pdf_goto_textmode(pdf); if (f != pdf->f_cur) setup_fontparameters(pdf, f); - set_font(pdf); + if (p->f_pdf != p->f_pdf_cur || p->fs.m != p->fs_cur.m) + set_font(pdf); set_textmatrix(pdf, pos); begin_chararray(pdf); } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfglyph.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfglyph.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfglyph.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfglyph.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,14 +17,14 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfglyph.h 2739 2009-07-04 22:46:37Z hhenkel $ */ +/* $Id: pdfglyph.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFGLYPH_H # define PDFGLYPH_H void end_chararray(PDF pdf); void end_charmode(PDF pdf); -void pdf_place_glyph(PDF pdf, internal_font_number f, integer c); +void pdf_place_glyph(PDF pdf, internal_font_number f, int c); void pdf_print_charwidth(PDF pdf, internal_font_number f, int i); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfimage.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfimage.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfimage.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfimage.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdfimage.c 3160 2009-11-16 16:29:11Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfimage.c $"; + "$Id: pdfimage.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfimage.c $"; #include "ptexlib.h" @@ -33,7 +33,7 @@ int k; scaledpos tmppos; pdffloat cm[6]; - integer groupref; /* added from web for 1.40.8 */ + int groupref; /* added from web for 1.40.8 */ assert(idict != 0); assert(p != NULL); a[0] = a[3] = 1.0e6; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdflink.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdflink.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdflink.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdflink.c 2009-12-24 18:51:10.000000000 +0000 @@ -22,8 +22,8 @@ static const char __svn_version[] = - "$Id: pdflink.c 3233 2009-12-05 07:19:29Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdflink.c $"; + "$Id: pdflink.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdflink.c $"; #define pdf_link_margin dimen_par(pdf_link_margin_code) @@ -141,7 +141,7 @@ void scan_startlink(PDF pdf) { - integer k; + int k; halfword r; if (abs(cur_list.mode_field) == vmode) pdf_error("ext1", "\\pdfstartlink cannot be used in vertical mode"); @@ -149,7 +149,7 @@ new_annot_whatsit(pdf_start_link_node); set_pdf_link_attr(cur_list.tail_field, null); if (scan_keyword("attr")) { - scan_pdf_ext_toks(); + scan_pdf_ext_toks(); set_pdf_link_attr(cur_list.tail_field, def_ref); } r = scan_action(pdf); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdflistout.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdflistout.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdflistout.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdflistout.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdflistout.c 3187 2009-11-22 22:29:05Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdflistout.c $"; + "$Id: pdflistout.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdflistout.c $"; #include "ptexlib.h" @@ -166,8 +166,8 @@ /* to me, it looks like the next is needed. but Aleph doesn't do that, so let us not do it either */ real glue_temp; /* glue value before rounding */ /* |w:=w-cur_g; cur_glue:=0;| */ - integer g_sign = glue_sign(this_box); - integer g_order = glue_order(this_box); + int g_sign = glue_sign(this_box); + int g_order = glue_order(this_box); while ((q != null) && (vlink(q) != null)) { q = vlink(q); if (is_char_node(q)) @@ -317,8 +317,8 @@ halfword enddir_ptr; /* temporary pointer to enddir node */ /* label move_past, fin_rule, next_p; */ /* scaled w; temporary value for directional width calculation */ - integer g_order; /* applicable order of infinity for glue */ - integer g_sign; /* selects type of glue */ + int g_order; /* applicable order of infinity for glue */ + int g_sign; /* selects type of glue */ halfword p, q; /* current position in the hlist */ halfword leader_box; /* the leader box being replicated */ scaled leader_wd; /* width of leader box being replicated */ @@ -330,7 +330,7 @@ scaled cur_g = 0; /* rounded equivalent of |cur_glue| times the glue ratio */ scaled_whd rule, ci; int i; /* index to scan |pdf_link_stack| */ - integer save_loc = 0; /* DVI! \.{DVI} byte location upon entry */ + int save_loc = 0; /* DVI! \.{DVI} byte location upon entry */ scaledpos save_dvi = { 0, 0 }; /* DVI! what |dvi| should pop to */ g_order = glue_order(this_box); @@ -791,7 +791,7 @@ scaled top_edge; /* the top coordinate for this box */ scaled edge; /* bottom boundary of leader space */ glue_ord g_order; /* applicable order of infinity for glue */ - integer g_sign; /* selects type of glue */ + int g_sign; /* selects type of glue */ halfword p; /* current position in the vlist */ halfword leader_box; /* the leader box being replicated */ scaled leader_ht; /* height of leader box being replicated */ @@ -801,7 +801,7 @@ real cur_glue = 0.0; /* glue seen so far */ scaled cur_g = 0; /* rounded equivalent of |cur_glue| times the glue ratio */ scaled_whd rule; - integer save_loc = 0; /* DVI! \.{DVI} byte location upon entry */ + int save_loc = 0; /* DVI! \.{DVI} byte location upon entry */ scaledpos save_dvi = { 0, 0 }; /* DVI! what |dvi| should pop to */ g_order = glue_order(this_box); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfliteral.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfliteral.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfliteral.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfliteral.c 2009-12-24 18:51:10.000000000 +0000 @@ -20,12 +20,12 @@ #include "ptexlib.h" static const char __svn_version[] = - "$Id: pdfliteral.c 3217 2009-12-03 16:52:01Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfliteral.c $"; + "$Id: pdfliteral.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfliteral.c $"; void pdf_special(PDF pdf, halfword p) { - integer old_setting; /* holds print |selector| */ + int old_setting; /* holds print |selector| */ str_number s; old_setting = selector; selector = new_string; @@ -46,7 +46,7 @@ void pdf_out_literal(PDF pdf, halfword p) { - integer old_setting; /* holds print |selector| */ + int old_setting; /* holds print |selector| */ str_number s; if (pdf_literal_type(p) == normal) { old_setting = selector; @@ -92,7 +92,7 @@ return true; } -void pdf_literal(PDF pdf, str_number s, integer literal_mode, boolean warn) +void pdf_literal(PDF pdf, str_number s, int literal_mode, boolean warn) { pool_pointer j = 0; /* current character code position, initialized to make the compiler happy */ if (s >= STRING_OFFSET) { /* needed for |out_save| */ @@ -137,11 +137,11 @@ unsigned char *ss = str_string(s); int l = str_length(s) - j; if (l < max_single_pdf_print) { - pdf_out_block(pdf, (ss+j), l); + pdf_out_block(pdf, (ss + j), l); } else { - + while (l--) - pdf_out(pdf, *(ss+j++)); + pdf_out(pdf, *(ss + j++)); } } else { assert(s < 256); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfliteral.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfliteral.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfliteral.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfliteral.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfliteral.h 2607 2009-06-25 12:14:10Z oneiros $ */ +/* $Id: pdfliteral.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFLITERAL_H # define PDFLITERAL_H @@ -27,8 +27,7 @@ # define set_pdf_literal_type(A,B) pdf_literal_type(A)=B # define set_pdf_literal_data(A,B) pdf_literal_data(A)=B -extern void pdf_literal(PDF pdf, str_number s, integer literal_mode, - boolean warn); +extern void pdf_literal(PDF pdf, str_number s, int literal_mode, boolean warn); extern void pdf_special(PDF pdf, halfword p); extern void pdf_out_literal(PDF pdf, halfword p); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfobj.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfobj.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfobj.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfobj.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,23 +18,24 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdfobj.c 3248 2009-12-11 13:39:41Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfobj.c $"; + "$Id: pdfobj.c 3298 2009-12-24 15:54:33Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfobj.c $"; #include "ptexlib.h" #include "lua/luatex-api.h" -integer pdf_last_obj; +int pdf_last_obj; /* write a raw PDF object */ -void pdf_write_obj(PDF pdf, integer k) +void pdf_write_obj(PDF pdf, int k) { lstring data, st; - size_t i; /* index into |data.s| */ + size_t i, li; /* index into |data.s| */ int saved_compress_level = pdf->compress_level; int os_level = 1; /* gives compressed objects for \pdfobjcompresslevel > 0 */ int l = 0; /* possibly a lua registry reference */ + int ll = 0; data.s = st.s = NULL; if (obj_obj_pdfcompresslevel(pdf, k) > -1) /* -1 = "unset" */ pdf->compress_level = obj_obj_pdfcompresslevel(pdf, k); @@ -46,10 +47,11 @@ if (l != LUA_NOREF) { lua_rawgeti(Luas, LUA_REGISTRYINDEX, l); assert(lua_isstring(Luas, -1)); - st.s = (unsigned char *) lua_tolstring(Luas, -1, &st.l); + st.s = (unsigned char *) lua_tolstring(Luas, -1, &li); + st.l = (unsigned)li; for (i = 0; i < st.l; i++) pdf_out(pdf, st.s[i]); - if (st.s[st.l - 1] != '\n') + if (st.s[(int) st.l - 1] != '\n') pdf_out(pdf, '\n'); luaL_unref(Luas, LUA_REGISTRYINDEX, l); obj_obj_stream_attr(pdf, k) = LUA_NOREF; @@ -60,39 +62,42 @@ l = obj_obj_data(pdf, k); lua_rawgeti(Luas, LUA_REGISTRYINDEX, l); assert(lua_isstring(Luas, -1)); - st.s = (unsigned char *) lua_tolstring(Luas, -1, &st.l); + st.s = (unsigned char *) lua_tolstring(Luas, -1, &li); + st.l = (unsigned)li; if (obj_obj_is_file(pdf, k)) { boolean res = false; /* callback status value */ char *fnam = NULL; /* callback found filename */ - integer callback_id; + int callback_id; /* st.s is also '\0'-terminated, even as lstring */ - fnam = luatex_find_file((char *)st.s, find_data_file_callback); + fnam = luatex_find_file((char *) st.s, find_data_file_callback); callback_id = callback_defined(read_data_file_callback); if (fnam && callback_id > 0) { boolean file_opened = false; res = run_callback(callback_id, "S->bSd", fnam, - &file_opened, &data.s, &data.l); + &file_opened, &data.s, &ll); + data.l = (unsigned)ll; if (!file_opened) pdf_error("ext5", "cannot open file for embedding"); } else { byte_file f; /* the data file's FILE* */ if (!fnam) - fnam = (char *)st.s; + fnam = (char *) st.s; if (!luatex_open_input (&f, fnam, kpse_tex_format, FOPEN_RBIN_MODE, true)) pdf_error("ext5", "cannot open file for embedding"); - res = read_data_file(f, (unsigned char **)&data.s, (integer *)&data.l); + res = read_data_file(f, &data.s, &ll); + data.l = (unsigned)ll; close_file(f); } - if (!data.l) + if ((int) data.l == 0) pdf_error("ext5", "empty file for embedding"); if (!res) pdf_error("ext5", "error reading file for embedding"); tprint("<<"); - tprint((char *)st.s); + tprint((char *) st.s); for (i = 0; i < data.l; i++) pdf_out(pdf, data.s[i]); - if (!obj_obj_is_stream(pdf, k) && data.s[data.l - 1] != '\n') + if (!obj_obj_is_stream(pdf, k) && data.s[(int) data.l - 1] != '\n') pdf_out(pdf, '\n'); if (data.s != NULL) xfree(data.s); @@ -100,7 +105,7 @@ } else { for (i = 0; i < st.l; i++) pdf_out(pdf, st.s[i]); - if (!obj_obj_is_stream(pdf, k) && st.s[st.l - 1] != '\n') + if (!obj_obj_is_stream(pdf, k) && st.s[(int) st.l - 1] != '\n') pdf_out(pdf, '\n'); } if (obj_obj_is_stream(pdf, k)) @@ -112,7 +117,7 @@ pdf->compress_level = saved_compress_level; } -void init_obj_obj(PDF pdf, integer k) +void init_obj_obj(PDF pdf, int k) { obj_obj_stream_attr(pdf, k) = LUA_NOREF; obj_obj_data(pdf, k) = LUA_NOREF; @@ -131,7 +136,7 @@ void scan_obj(PDF pdf) { - integer k; + int k; lstring *st = NULL; if (scan_keyword("reserveobjnum")) { /* Scan an optional space */ @@ -165,7 +170,7 @@ scan_pdf_ext_toks(); st = tokenlist_to_lstring(def_ref, true); flush_list(def_ref); - lua_pushlstring(Luas, (char *)st->s, st->l); + lua_pushlstring(Luas, (char *) st->s, st->l); obj_obj_stream_attr(pdf, k) = luaL_ref(Luas, LUA_REGISTRYINDEX); free_lstring(st); st = NULL; @@ -176,7 +181,7 @@ scan_pdf_ext_toks(); st = tokenlist_to_lstring(def_ref, true); flush_list(def_ref); - lua_pushlstring(Luas, (char *)st->s, st->l); + lua_pushlstring(Luas, (char *) st->s, st->l); obj_obj_data(pdf, k) = luaL_ref(Luas, LUA_REGISTRYINDEX); free_lstring(st); st = NULL; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfobj.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfobj.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfobj.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfobj.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfobj.h 3229 2009-12-04 21:09:46Z hhenkel $ */ +/* $Id: pdfobj.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFOBJ_H # define PDFOBJ_H @@ -55,10 +55,10 @@ /**********************************************************************/ -extern integer pdf_last_obj; +extern int pdf_last_obj; -extern void init_obj_obj(PDF pdf, integer k); -extern void pdf_write_obj(PDF pdf, integer n); +extern void init_obj_obj(PDF pdf, int k); +extern void pdf_write_obj(PDF pdf, int n); extern void scan_obj(PDF pdf); extern void scan_refobj(PDF pdf); extern void pdf_ref_obj(PDF pdf, halfword p); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfoutline.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfoutline.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfoutline.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfoutline.c 2009-12-24 18:51:10.000000000 +0000 @@ -22,8 +22,8 @@ static const char __svn_version[] = - "$Id: pdfoutline.c 3233 2009-12-05 07:19:29Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfoutline.c $"; + "$Id: pdfoutline.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfoutline.c $"; /* Data structure of outlines; it's not able to write out outline entries before all outline entries are defined, so memory allocated for outline @@ -56,10 +56,10 @@ #define set_obj_outline_parent(pdf,A,B) obj_outline_parent(pdf,A)=B #define set_obj_outline_attr(pdf,A,B) obj_outline_attr(pdf,A)=B -static integer open_subentries(PDF pdf, halfword p) +static int open_subentries(PDF pdf, halfword p) { - integer k, c; - integer l, r; + int k, c; + int l, r; k = 0; if (obj_outline_first(pdf, p) != 0) { l = obj_outline_first(pdf, p); @@ -83,9 +83,9 @@ } /* return number of outline entries in the same level with |p| */ -static integer outline_list_count(PDF pdf, pointer p) +static int outline_list_count(PDF pdf, pointer p) { - integer k = 1; + int k = 1; while (obj_outline_prev(pdf, p) != 0) { incr(k); p = obj_outline_prev(pdf, p); @@ -96,9 +96,9 @@ void scan_pdfoutline(PDF pdf) { halfword p, q, r; - integer i, j, k; + int i, j, k; if (scan_keyword("attr")) { - scan_pdf_ext_toks(); + scan_pdf_ext_toks(); r = def_ref; } else { r = 0; @@ -173,10 +173,10 @@ /* In the end we must flush PDF objects that cannot be written out immediately after shipping out pages. */ -integer print_outlines(PDF pdf) +int print_outlines(PDF pdf) { - integer k, l, a; - integer outlines; + int k, l, a; + int outlines; if (pdf->first_outline != 0) { pdf_new_dict(pdf, obj_type_others, 0, 1); outlines = pdf->obj_ptr; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfoutline.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfoutline.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfoutline.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfoutline.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfoutline.h 2796 2009-07-10 08:52:05Z taco $ */ +/* $Id: pdfoutline.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFOUTLINE_H # define PDFOUTLINE_H extern void scan_pdfoutline(PDF pdf); -extern integer print_outlines(PDF pdf); +extern int print_outlines(PDF pdf); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfpage.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfpage.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfpage.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfpage.c 2009-12-24 18:51:10.000000000 +0000 @@ -1,5 +1,5 @@ /* pdfpage.c - + Copyright 2006-2009 Taco Hoekwater This file is part of LuaTeX. @@ -17,6 +17,10 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ +static const char __svn_version[] = + "$Id: pdfpage.c 3275 2009-12-20 22:20:08Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfpage.c $"; + #include #include #include @@ -24,10 +28,6 @@ #include "ptexlib.h" -static const char __svn_version[] = - "$Id: pdfpage.c 3220 2009-12-04 10:45:36Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfpage.c $"; - #define lround(a) (long) floor((a) + 0.5) /* eternal constants */ @@ -46,9 +46,7 @@ setpdffloat(p->pdf.h, 0, decimal_digits); setpdffloat(p->pdf.v, 0, decimal_digits); p->cw.e = 1; - p->fs.e = decimal_digits + 2; /* "+ 2" makes less corrections inside []TJ */ - setpdffloat(p->hz, 1000, 3); /* m = 1000 = default = unexpanded, e must be 3 */ - setpdffloat(p->ext, 1000, 3); /* m = 1000 = default = unextended, e must be 3 */ + p->fs_cur.e = p->fs.e = decimal_digits + 2; /* "+ 2" makes less corrections inside []TJ */ /* for placement outside BT...ET */ setpdffloat(p->cm[0], 1, 0); setpdffloat(p->cm[1], 0, 0); @@ -64,7 +62,8 @@ setpdffloat(p->tm[4], 0, decimal_digits); /* mantissa holds delta from pdf_bt_pos.h */ setpdffloat(p->tm[5], 0, decimal_digits); /* mantissa holds delta from pdf_bt_pos.v */ /* */ - p->f_pdf = null_font; + p->f_pdf_cur = p->f_pdf = null_font; + p->fs_cur.m = p->fs.m = 0; p->wmode = WMODE_H; p->mode = PMODE_PAGE; p->ishex = 0; @@ -227,6 +226,8 @@ p->pdf_bt_pos = p->pdf; pdf_puts(pdf, "BT\n"); p->mode = PMODE_TEXT; + p->f_pdf_cur = null_font; /* forces Tf operator */ + p->fs_cur.m = 0; } static void end_text(PDF pdf) diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfrule.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfrule.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfrule.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfrule.c 2009-12-24 18:51:10.000000000 +0000 @@ -19,7 +19,7 @@ static const char __svn_version[] = "$Id: pdfrule.c 3042 2009-08-26 19:52:59Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfrule.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfrule.c $"; #include "ptexlib.h" #include "pdfpage.h" diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfsaverestore.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfsaverestore.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfsaverestore.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfsaverestore.c 2009-12-24 18:51:10.000000000 +0000 @@ -19,7 +19,7 @@ static const char __svn_version[] = "$Id: pdfsaverestore.c 3003 2009-08-16 19:55:55Z hhenkel $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfsaverestore.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfsaverestore.c $"; #include "ptexlib.h" diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfsetmatrix.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfsetmatrix.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfsetmatrix.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfsetmatrix.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdfsetmatrix.c 3217 2009-12-03 16:52:01Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfsetmatrix.c $"; + "$Id: pdfsetmatrix.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfsetmatrix.c $"; #include "ptexlib.h" @@ -214,12 +214,12 @@ void pdf_out_setmatrix(PDF pdf, halfword p) { scaledpos pos = pdf->posstruct->pos; - integer old_setting; /* holds print |selector| */ + int old_setting; /* holds print |selector| */ str_number s; old_setting = selector; selector = new_string; show_token_list(token_link(pdf_setmatrix_data(p)), null, -1); - pdfsetmatrix((char *)cur_string, pos); + pdfsetmatrix((char *) cur_string, pos); tprint(" 0 0 cm"); selector = old_setting; s = make_string(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfshipout.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfshipout.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfshipout.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfshipout.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdfshipout.c 3143 2009-11-16 06:46:43Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfshipout.c $"; + "$Id: pdfshipout.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfshipout.c $"; #include "ptexlib.h" @@ -52,9 +52,9 @@ void ship_out(PDF pdf, halfword p, boolean shipping_page) { /* output the box |p| */ - integer j, k; /* indices to first ten count registers */ - integer post_callback_id; - integer pre_callback_id; + int j, k; /* indices to first ten count registers */ + int post_callback_id; + int pre_callback_id; posstructure refpoint; /* the origin pos. on the page */ scaledpos cur = { 0, 0 }; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdftables.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdftables.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdftables.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdftables.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdftables.c 3247 2009-12-10 23:57:37Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdftables.c $"; + "$Id: pdftables.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdftables.c $"; #include "ptexlib.h" @@ -67,7 +67,7 @@ return 1; } -static void avl_put_obj(PDF pdf, integer t, oentry * oe) +static void avl_put_obj(PDF pdf, int t, oentry * oe) { void **pp; assert(t >= 0 || t <= PDF_OBJ_TYPE_MAX || obj_in_tree[t] == 1); @@ -81,7 +81,7 @@ pdftex_fail("avlstuff.c: avl_probe() out of memory in insertion"); } -static void avl_put_int_obj(PDF pdf, integer int0, integer objptr, integer t) +static void avl_put_int_obj(PDF pdf, int int0, int objptr, int t) { oentry *oe; oe = xtalloc(1, oentry); @@ -91,7 +91,7 @@ avl_put_obj(pdf, t, oe); } -static void avl_put_str_obj(PDF pdf, char *str0, integer objptr, integer t) +static void avl_put_str_obj(PDF pdf, char *str0, int objptr, int t) { oentry *oe; oe = xtalloc(1, oentry); @@ -101,7 +101,7 @@ avl_put_obj(pdf, t, oe); } -static integer avl_find_int_obj(PDF pdf, integer t, integer i) +static int avl_find_int_obj(PDF pdf, int t, int i) { oentry *p; oentry tmp; @@ -116,7 +116,7 @@ return p->objptr; } -static integer avl_find_str_obj(PDF pdf, integer t, char *s) +static int avl_find_str_obj(PDF pdf, int t, char *s) { oentry *p; oentry tmp; @@ -134,9 +134,9 @@ /**********************************************************************/ /* create an object with type |t| and identifier |i| */ -void pdf_create_obj(PDF pdf, integer t, integer i) +void pdf_create_obj(PDF pdf, int t, int i) { - integer a; + int a; char *ss = NULL; if (pdf->sys_obj_ptr == sup_obj_tab_size) overflow("indirect objects table size", pdf->obj_tab_size); @@ -169,10 +169,10 @@ } } -integer find_obj(PDF pdf, integer t, integer i, boolean byname) +int find_obj(PDF pdf, int t, int i, boolean byname) { char *ss = NULL; - integer ret; + int ret; assert(i >= 0); /* no tricks */ if (byname) { ss = makecstring(i); @@ -193,9 +193,9 @@ |vlist_out|. */ -integer get_obj(PDF pdf, integer t, integer i, boolean byname) +int get_obj(PDF pdf, int t, int i, boolean byname) { - integer r; + int r; str_number s; assert(i >= 0); if (byname > 0) { @@ -222,13 +222,13 @@ } /* create a new object and return its number */ -integer pdf_new_objnum(PDF pdf) +int pdf_new_objnum(PDF pdf) { pdf_create_obj(pdf, obj_type_others, 0); return pdf->obj_ptr; } -void check_obj_exists(PDF pdf, integer t, integer objnum) +void check_obj_exists(PDF pdf, int t, int objnum) { if (objnum < 0 || objnum > pdf->obj_ptr) pdf_error("ext1", "cannot find referenced object"); @@ -311,7 +311,7 @@ void dump_pdftex_data(PDF pdf) { - integer k, x; + int k, x; pdf_object_list *l; dumpimagemeta(); /* the image information array */ dump_int(pdf->mem_size); @@ -388,7 +388,7 @@ void undump_pdftex_data(PDF pdf) { - integer k, x; + int k, x; undumpimagemeta(pdf, pdf_minor_version, pdf_inclusion_errorlevel); /* the image information array */ undump_int(pdf->mem_size); pdf->mem = xreallocarray(pdf->mem, int, pdf->mem_size); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdftables.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdftables.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdftables.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdftables.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdftables.h 3235 2009-12-05 11:36:51Z hhenkel $ */ +/* $Id: pdftables.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFTABLES_H # define PDFTABLES_H @@ -29,11 +29,11 @@ typedef struct { union { - integer int0; + int int0; char *str0; } u; union_type u_type; /* integer or char * in union above */ - integer objptr; + int objptr; } oentry; /* @@ -97,11 +97,11 @@ # define inf_pk_dpi 72 /* min PK pixel density value from \.{texmf.cnf} */ # define sup_pk_dpi 8000 /* max PK pixel density value from \.{texmf.cnf} */ -extern integer find_obj(PDF pdf, integer t, integer i, boolean byname); -extern void check_obj_exists(PDF pdf, integer t, integer n); -extern integer get_obj(PDF pdf, integer t, integer i, boolean byname); -extern void pdf_create_obj(PDF pdf, integer t, integer i); -extern integer pdf_new_objnum(PDF pdf); +extern int find_obj(PDF pdf, int t, int i, boolean byname); +extern void check_obj_exists(PDF pdf, int t, int n); +extern int get_obj(PDF pdf, int t, int i, boolean byname); +extern void pdf_create_obj(PDF pdf, int t, int i); +extern int pdf_new_objnum(PDF pdf); extern void set_rect_dimens(PDF pdf, halfword p, halfword parent_box, scaledpos cur, scaled_whd alt_rule, scaled margin); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfthread.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfthread.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfthread.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfthread.c 2009-12-24 18:51:10.000000000 +0000 @@ -20,8 +20,8 @@ #include "ptexlib.h" static const char __svn_version[] = - "$Id: pdfthread.c 3234 2009-12-05 09:56:09Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfthread.c $"; + "$Id: pdfthread.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfthread.c $"; #define pdf_thread_margin dimen_par(pdf_thread_margin_code) #define page_width dimen_par(page_width_code) @@ -31,7 +31,7 @@ void append_bead(PDF pdf, halfword p) { - integer a, b, c, t; + int a, b, c, t; if (!is_shipping_page) pdf_error("ext4", "threads cannot be inside an XForm"); t = get_obj(pdf, obj_type_thread, pdf_thread_id(p), pdf_thread_named_id(p)); @@ -136,7 +136,7 @@ /* The following function are needed for outputing article thread. */ -void thread_title(PDF pdf, integer t) +void thread_title(PDF pdf, int t) { pdf_printf(pdf, "/Title ("); if (obj_info(pdf, t) < 0) @@ -146,7 +146,7 @@ pdf_printf(pdf, ")\n"); } -void pdf_fix_thread(PDF pdf, integer t) +void pdf_fix_thread(PDF pdf, int t) { halfword a; pdf_warning("thread", "destination", false, false); @@ -181,10 +181,10 @@ pdf_end_dict(pdf); } -void out_thread(PDF pdf, integer t) +void out_thread(PDF pdf, int t) { halfword a, b; - integer last_attr; + int last_attr; if (obj_thread_first(pdf, t) == 0) { pdf_fix_thread(pdf, t); return; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfthread.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfthread.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfthread.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfthread.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfthread.h 2978 2009-08-09 09:03:39Z hhenkel $ */ +/* $Id: pdfthread.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFTHREAD_H # define PDFTHREADH @@ -59,9 +59,9 @@ extern void end_thread(PDF pdf, halfword p); extern void scan_thread_id(void); -extern void thread_title(PDF pdf, integer t); -extern void pdf_fix_thread(PDF pdf, integer t); -extern void out_thread(PDF pdf, integer t); +extern void thread_title(PDF pdf, int t); +extern void pdf_fix_thread(PDF pdf, int t); +extern void out_thread(PDF pdf, int t); extern void check_running_thread(PDF pdf, halfword this_box, scaledpos cur); extern void print_beads_list(PDF pdf); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdftypes.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdftypes.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdftypes.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdftypes.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdftypes.h 3235 2009-12-05 11:36:51Z hhenkel $ */ +/* $Id: pdftypes.h 3275 2009-12-20 22:20:08Z hhenkel $ */ #ifndef PDFTYPES_H # define PDFTYPES_H @@ -30,7 +30,7 @@ here (C++ has a boolean type built-in that is not compatible). Also, I have plans to convert the backend code into a C library for use with e.g. standalone lua. Together, this means that it is best only to use the standard C types and -the types explicitly defined in this header, and stay away from types like +the types explicitly defined in this header, and stay away from types like |integer| and |eight_bits| that are used elsewhere in the \LUATEX\ sources. */ @@ -50,7 +50,7 @@ pdffloat v; } pdfpos; -# define scaled integer +# define scaled int typedef struct scaledpos_ { scaled h; @@ -100,13 +100,13 @@ cw.e = fractional digits in /Widths array */ pdffloat tj_delta; /* rel. movement in [(..)..]TJ array (glyph raster) */ pdffloat fs; /* font size in PDF units */ - pdffloat hz; /* HZ expansion factor */ - pdffloat ext; /* ExtendFont factor */ + pdffloat fs_cur; /* to check if fs.m has changed and Tf needed */ pdffloat cm[6]; /* cm array */ pdffloat tm[6]; /* Tm array */ double k1; /* conv. factor from TeX sp to PDF page raster */ double k2; /* conv. factor from PDF page raster to TJ array raster */ int f_pdf; /* /F* font number, of unexpanded base font! */ + int f_pdf_cur; /* to check if f_pdf has changed and Tf needed */ writing_mode wmode; /* PDF writing mode WMode (horizontal/vertical) */ pos_mode mode; /* current positioning mode */ int ishex; /* Whether the current char string is <> or () */ @@ -114,30 +114,30 @@ typedef struct obj_entry_ { union { - integer int0; + int int0; char *str0; } u; - integer int1; + int int1; off_t int2; - integer int3; + int int3; union { - integer int4; + int int4; char *str4; } v; - integer objtype; /* integer int5 */ + int objtype; /* integer int5 */ } obj_entry; typedef struct dest_name_entry_ { char *objname; /* destination name */ - integer objnum; /* destination object number */ + int objnum; /* destination object number */ } dest_name_entry; # define pdf_max_link_level 10 /* maximum depth of link nesting */ typedef struct pdf_link_stack_record { - integer nesting_level; - integer link_node; /* holds a copy of the corresponding |pdf_start_link_node| */ - integer ref_link_node; /* points to original |pdf_start_link_node|, or a + int nesting_level; + int link_node; /* holds a copy of the corresponding |pdf_start_link_node| */ + int ref_link_node; /* points to original |pdf_start_link_node|, or a copy of |link_node| created by |append_link| in case of multi-line link */ } pdf_link_stack_record; @@ -175,9 +175,9 @@ pdf_object_list *link_list; /* the pdf links */ pdf_object_list *bead_list; /* the thread beads */ pdf_object_list *annot_list; /* the pdf annotations */ - integer text_procset; /* |pdf_text_procset| */ - integer image_procset; /* |pdf_image_procset| */ - integer last_resources; /* halfword to most recently generated Resources object. */ + int text_procset; /* |pdf_text_procset| */ + int image_procset; /* |pdf_image_procset| */ + int last_resources; /* halfword to most recently generated Resources object. */ } pdf_resource_struct; typedef struct pdf_output_file_ { @@ -236,7 +236,7 @@ z_stream c_stream; /* compression stream */ int zip_write_state; /* which state of compression we are in */ - int pk_scale_factor; /* this is just a preprocessed value that depends on + int pk_scale_factor; /* this is just a preprocessed value that depends on |pk_resolution| and |decimal_digits| */ int img_page_group_val; /* page group information pointer from included pdf or png images */ @@ -266,32 +266,32 @@ int last_byte; /* byte most recently written to PDF file; for \.{endstream} in new line */ /* integer last_resources; halfword to most recently generated Resources object. - TH: this used to be a local in pdf_shipout, but I would like to + TH: this used to be a local in pdf_shipout, but I would like to be able to split that function into a pre- and post part */ - integer obj_count; - integer xform_count; - integer ximage_count; + int obj_count; + int xform_count; + int ximage_count; pdf_resource_struct *resources; /* the variables from pdfdest */ - integer dest_names_size; - integer dest_names_ptr; + int dest_names_size; + int dest_names_ptr; dest_name_entry *dest_names; /* the (static) variables from pdfoutline */ - integer first_outline; - integer last_outline; - integer parent_outline; + int first_outline; + int last_outline; + int parent_outline; /* the pdf link stack */ pdf_link_stack_record link_stack[(pdf_max_link_level + 1)]; - integer link_stack_ptr; + int link_stack_ptr; /* the thread data */ - integer last_thread; /* pointer to the last thread */ + int last_thread; /* pointer to the last thread */ scaled_whd thread; - integer last_thread_id; /* identifier of the last thread */ + int last_thread_id; /* identifier of the last thread */ int last_thread_named_id; /* is identifier of the last thread named */ - integer thread_level; /* depth of nesting of box containing the last thread */ + int thread_level; /* depth of nesting of box containing the last thread */ int f_cur; /* TeX font number */ } pdf_output_file; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfxform.c luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfxform.c --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfxform.c 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfxform.c 2009-12-24 18:51:10.000000000 +0000 @@ -18,15 +18,15 @@ with LuaTeX; if not, see . */ static const char __svn_version[] = - "$Id: pdfxform.c 3229 2009-12-04 21:09:46Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/pdf/pdfxform.c $"; + "$Id: pdfxform.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/pdf/pdfxform.c $"; #include "ptexlib.h" #include "pdfpage.h" #define box(A) eqtb[box_base+(A)].hh.rh -integer pdf_cur_form; /* the form being output */ +int pdf_cur_form; /* the form being output */ void pdf_place_form(PDF pdf, halfword p) { @@ -34,7 +34,7 @@ scaled x, y; pdffloat cm[6]; pdfstructure *q = pdf->pstruct; - integer r = 6, objnum = pdf_xform_objnum(p); + int r = 6, objnum = pdf_xform_objnum(p); nat.wd = obj_xform_width(pdf, objnum); nat.ht = obj_xform_height(pdf, objnum); nat.dp = obj_xform_depth(pdf, objnum); @@ -66,7 +66,7 @@ void scan_pdfxform(PDF pdf) { - integer k; + int k; halfword p; incr(pdf->xform_count); pdf_create_obj(pdf, obj_type_xform, pdf->xform_count); @@ -100,7 +100,7 @@ void scan_pdfrefxform(PDF pdf) { - integer transform = 0; + int transform = 0; scaled_whd alt_rule, dim, nat; alt_rule = scan_alt_rule(); /* scans || to |alt_rule| */ scan_int(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfxform.h luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfxform.h --- luatex-0.47.0/source/texk/web2c/luatexdir/pdf/pdfxform.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/pdf/pdfxform.h 2009-12-24 18:51:10.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: pdfxform.h 3179 2009-11-19 19:24:42Z hhenkel $ */ +/* $Id: pdfxform.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PDFXFORM_H # define PDFXFORM_H @@ -46,7 +46,7 @@ # define set_obj_xform_attr(pdf,A,B) obj_xform_attr(pdf,A)=B # define set_obj_xform_resources(pdf,A,B) obj_xform_resources(pdf,A)=B -extern integer pdf_cur_form; /* the form being output */ +extern int pdf_cur_form; /* the form being output */ void pdf_place_form(PDF pdf, halfword p); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/ptexlib.h luatex-0.50.0/source/texk/web2c/luatexdir/ptexlib.h --- luatex-0.47.0/source/texk/web2c/luatexdir/ptexlib.h 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/ptexlib.h 2009-12-24 18:51:10.000000000 +0000 @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: ptexlib.h 3229 2009-12-04 21:09:46Z hhenkel $ */ +/* $Id: ptexlib.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PTEXLIB_H # define PTEXLIB_H @@ -274,13 +274,13 @@ /* lua/ltexlib.c */ void luacstring_start(int n); void luacstring_close(int n); -integer luacstring_cattable(void); +int luacstring_cattable(void); int luacstring_input(void); int luacstring_partial(void); int luacstring_final_line(void); /* lua/luatoken.c */ -void do_get_token_lua(integer callback_id); +void do_get_token_lua(int callback_id); /* lua/luanode.c */ int visible_last_node_type(int n); @@ -298,7 +298,7 @@ extern void check_texconfig_init(void); -scaled divide_scaled(scaled s, scaled m, integer dd); +scaled divide_scaled(scaled s, scaled m, int dd); scaled divide_scaled_n(double s, double m, double d); # include "tex/texdeffont.h" @@ -354,11 +354,11 @@ extern boolean get_callback(lua_State * L, int i); extern void get_saved_lua_boolean(int i, char *name, boolean * target); -extern void get_saved_lua_number(int i, char *name, integer * target); +extern void get_saved_lua_number(int i, char *name, int * target); extern void get_saved_lua_string(int i, char *name, char **target); extern void get_lua_boolean(char *table, char *name, boolean * target); -extern void get_lua_number(char *table, char *name, integer * target); +extern void get_lua_number(char *table, char *name, int * target); extern void get_lua_string(char *table, char *name, char **target); extern char *get_lua_name(int i); @@ -378,9 +378,9 @@ extern volatile memory_word *varmem; extern halfword var_mem_min; extern halfword var_mem_max; -extern halfword get_node(integer s); -extern void free_node(halfword p, integer s); -extern void init_node_mem(integer s); +extern halfword get_node(int s); +extern void free_node(halfword p, int s); +extern void init_node_mem(int s); extern void dump_node_mem(void); extern void undump_node_mem(void); @@ -388,14 +388,14 @@ /* This routine has to return four values. */ # define dateandtime(i,j,k,l) get_date_and_time (&(i), &(j), &(k), &(l)) -extern void get_date_and_time(integer *, integer *, integer *, integer *); +extern void get_date_and_time(int *, int *, int *, int *); /* Get high-res time info. */ # define seconds_and_micros(i,j) get_seconds_and_micros (&(i), &(j)) -extern void get_seconds_and_micros(integer *, integer *); +extern void get_seconds_and_micros(int *, int *); /* This routine has to return a scaled value. */ -extern integer getrandomseed(void); +extern int getrandomseed(void); /* Copy command-line arguments into the buffer, despite the name. */ extern void topenin(void); @@ -407,7 +407,7 @@ /* extern void calledit (); */ /* Set an array size from texmf.cnf. */ -extern void setupboundvariable(integer *, const_string, integer); +extern void setupboundvariable(int *, const_string, int); /* here are a few functions that used to be in coerce.h */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/align.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/align.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/align.c 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/align.c 2009-12-24 18:51:05.000000000 +0000 @@ -41,7 +41,7 @@ #define overfull_rule dimen_par(overfull_rule_code) static const char _svn_version[] = - "$Id: align.c 3155 2009-11-16 15:13:58Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/align.c $"; + "$Id: align.c 3155 2009-11-16 15:13:58Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/align.c $"; /* It's sort of a miracle whenever \.{\\halign} and \.{\\valign} work, because diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/arithmetic.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/arithmetic.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/arithmetic.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/arithmetic.c 2009-12-24 18:51:05.000000000 +0000 @@ -20,8 +20,8 @@ #include static const char _svn_version[] = - "$Id: arithmetic.c 2817 2009-07-12 00:45:27Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/arithmetic.c $"; + "$Id: arithmetic.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/arithmetic.c $"; /* The principal computations performed by \TeX\ are done entirely in terms of @@ -49,7 +49,7 @@ */ -integer half(integer x) +int half(int x) { if (odd(x)) return ((x + 1) / 2); @@ -65,7 +65,7 @@ scaled round_decimals(int k) { /* converts a decimal fraction */ - integer a; /* the accumulator */ + int a; /* the accumulator */ a = 0; while (k-- > 0) { a = (a + dig[k] * two) / 10; @@ -143,7 +143,7 @@ multiply integers. */ -scaled mult_and_add(integer n, scaled x, scaled y, scaled max_answer) +scaled mult_and_add(int n, scaled x, scaled y, scaled max_answer) { if (n == 0) return y; @@ -161,7 +161,7 @@ /* We also need to divide scaled dimensions by integers. */ -scaled x_over_n(scaled x, integer n) +scaled x_over_n(scaled x, int n) { boolean negative; /* should |tex_remainder| be negated? */ negative = false; @@ -198,7 +198,7 @@ this subroutine simulates 1.5-precision arithmetic. */ -scaled xn_over_d(scaled x, integer n, integer d) +scaled xn_over_d(scaled x, int n, int d) { nonnegative_integer t, u, v; /* intermediate quantities */ boolean positive = true; /* was |x>=0|? */ @@ -245,7 +245,7 @@ halfword badness(scaled t, scaled s) { /* compute badness, given |t>=0| */ - integer r; /* approximation to $\alpha t/s$, where $\alpha^3\approx + int r; /* approximation to $\alpha t/s$, where $\alpha^3\approx 100\cdot2^{18}$ */ if (t == 0) { return 0; @@ -313,7 +313,7 @@ been consumed. */ -static integer randoms[55]; /* the last 55 random values generated */ +static int randoms[55]; /* the last 55 random values generated */ static int j_random; /* the number of unused |randoms| */ scaled random_seed; /* the default random seed */ @@ -366,11 +366,11 @@ */ -static integer make_frac(integer p, integer q) +static int make_frac(int p, int q) { - integer f; /* the fraction bits, with a leading 1 bit */ - integer n; /* the integer part of $\vert p/q\vert$ */ - register integer be_careful; /* disables certain compiler optimizations */ + int f; /* the fraction bits, with a leading 1 bit */ + int n; /* the integer part of $\vert p/q\vert$ */ + register int be_careful; /* disables certain compiler optimizations */ boolean negative = false; /* should the result be negated? */ if (p < 0) { negate(p); @@ -430,11 +430,11 @@ } } -static integer take_frac(integer q, integer f) +static int take_frac(int q, int f) { - integer p; /* the fraction so far */ - integer n; /* additional multiple of $q$ */ - register integer be_careful; /* disables certain compiler optimizations */ + int p; /* the fraction so far */ + int n; /* additional multiple of $q$ */ + register int be_careful; /* disables certain compiler optimizations */ boolean negative = false; /* should the result be negated? */ /* Reduce to the case that |f>=0| and |q>0| */ if (f < 0) { @@ -504,8 +504,8 @@ nearest integer. */ -static integer two_to_the[31]; /* powers of two */ -static integer spec_log[29]; /* special logarithms */ +static int two_to_the[31]; /* powers of two */ +static int spec_log[29]; /* special logarithms */ void initialize_arithmetic(void) { @@ -532,10 +532,10 @@ } -static integer m_log(integer x) +static int m_log(int x) { - integer y, z; /* auxiliary registers */ - integer k; /* iteration counter */ + int y, z; /* auxiliary registers */ + int k; /* iteration counter */ if (x <= 0) { /* Handle non-positive logarithm */ print_err("Logarithm of "); @@ -579,9 +579,9 @@ The result is $+1$, 0, or~$-1$ in the three respective cases. */ -static integer ab_vs_cd(integer a, integer b, integer c, integer d) +static int ab_vs_cd(int a, int b, int c, int d) { - integer q, r; /* temporary registers */ + int q, r; /* temporary registers */ /* Reduce to the case that |a,c>=0|, |b,d>0| */ if (a < 0) { negate(a); @@ -639,7 +639,7 @@ static void new_randoms(void) { int k; /* index into |randoms| */ - integer x; /* accumulator */ + int x; /* accumulator */ for (k = 0; k <= 23; k++) { x = randoms[k] - randoms[k + 31]; if (x < 0) @@ -658,9 +658,9 @@ /* To initialize the |randoms| table, we call the following routine. */ -void init_randoms(integer seed) +void init_randoms(int seed) { - integer j, jj, k; /* more or less random integers */ + int j, jj, k; /* more or less random integers */ int i; /* index into |randoms| */ j = abs(seed); while (j >= fraction_one) @@ -688,9 +688,9 @@ values between 0 and~|x|, because it rounds its answers. */ -integer unif_rand(integer x) +int unif_rand(int x) { - integer y; /* trial value */ + int y; /* trial value */ next_random(); y = take_frac(abs(x), randoms[j_random]); if (y == abs(x)) @@ -707,9 +707,9 @@ {\sl The Art of Computer Programming\/}). */ -integer norm_rand(void) +int norm_rand(void) { - integer x, u, l; /* what the book would call $2^{16}X$, $2^{28}U$, and $-2^{24}\ln U$ */ + int x, u, l; /* what the book would call $2^{16}X$, $2^{28}U$, and $-2^{24}\ln U$ */ do { do { next_random(); @@ -728,7 +728,7 @@ breakpoint for debugging. */ -integer fix_int(integer val, integer min, integer max) +int fix_int(int val, int min, int max) { return (val < min ? min : (val > max ? max : val)); } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/arithmetic.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/arithmetic.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/arithmetic.h 2009-12-18 09:38:08.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/arithmetic.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: arithmetic.h 2899 2009-07-21 23:03:53Z oneiros $ */ +/* $Id: arithmetic.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef ARITHMETIC_H # define ARITHMETIC_H @@ -30,7 +30,7 @@ # define negate(A) (A)=-(A) /* change the sign of a variable */ # undef half -extern integer half(integer x); +extern int half(int x); /* Fixed-point arithmetic is done on {\sl scaled integers\/} that are multiples @@ -49,13 +49,13 @@ extern boolean arith_error; extern scaled tex_remainder; -extern scaled mult_and_add(integer n, scaled x, scaled y, scaled max_answer); +extern scaled mult_and_add(int n, scaled x, scaled y, scaled max_answer); # define nx_plus_y(A,B,C) mult_and_add((A),(B),(C),07777777777) # define mult_integers(A,B) mult_and_add((A),(B),0,017777777777) -extern scaled x_over_n(scaled x, integer n); -extern scaled xn_over_d(scaled x, integer n, integer d); +extern scaled x_over_n(scaled x, int n); +extern scaled xn_over_d(scaled x, int n, int d); # define inf_bad 10000 /* infinitely bad value */ @@ -72,10 +72,10 @@ extern scaled random_seed; /* the default random seed */ -extern void init_randoms(integer seed); -extern integer unif_rand(integer x); -extern integer norm_rand(void); +extern void init_randoms(int seed); +extern int unif_rand(int x); +extern int norm_rand(void); -extern integer fix_int(integer val, integer min, integer max); +extern int fix_int(int val, int min, int max); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/buildpage.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/buildpage.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/buildpage.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/buildpage.c 2009-12-24 18:51:05.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: buildpage.c 3187 2009-11-22 22:29:05Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/buildpage.c $"; + "$Id: buildpage.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/buildpage.c $"; #include @@ -94,7 +94,7 @@ int page_contents; /* what is on the current page so far? */ scaled page_max_depth; /* maximum box depth on page being built */ halfword best_page_break; /* break here to get the best page known so far */ -integer least_page_cost; /* the score for this currently best page */ +int least_page_cost; /* the score for this currently best page */ scaled best_size; /* its |page_goal| */ /* @@ -192,10 +192,10 @@ scaled page_so_far[8]; /* height and glue of the current page */ halfword last_glue; /* used to implement \.{\\lastskip */ -integer last_penalty; /* used to implement \.{\\lastpenalty} */ +int last_penalty; /* used to implement \.{\\lastpenalty} */ scaled last_kern; /* used to implement \.{\\lastkern} */ -integer last_node_type; /* used to implement \.{\\lastnodetype} */ -integer insert_penalties; /* sum of the penalties for held-over insertions */ +int last_node_type; /* used to implement \.{\\lastnodetype} */ +int insert_penalties; /* sum of the penalties for held-over insertions */ #define print_plus(A,B) do { \ if (page_so_far[(A)]!=0) { \ @@ -277,7 +277,7 @@ flushes the unwanted contents, reporting them to the user. */ -static void box_error(integer n) +static void box_error(int n) { error(); begin_diagnostic(); @@ -293,7 +293,7 @@ does not contain an \.{\\hbox}. */ -static void ensure_vbox(integer n) +static void ensure_vbox(int n) { halfword p; /* the box register contents */ p = box(n); @@ -318,8 +318,8 @@ { /* append contributions to the current page */ halfword p; /* the node being appended */ halfword q, r; /* nodes being examined */ - integer b, c; /* badness and cost of current page */ - integer pi; /* penalty to be added to the badness */ + int b, c; /* badness and cost of current page */ + int pi; /* penalty to be added to the badness */ int n; /* insertion box number */ scaled delta, h, w; /* sizes used for insertion calculations */ pi = 0; @@ -744,7 +744,7 @@ halfword prev_p; /* predecessor of |p| */ int n; /* insertion box number */ boolean wait; /* should the present insertion be held over? */ - integer save_vbadness; /* saved value of |vbadness| */ + int save_vbadness; /* saved value of |vbadness| */ scaled save_vfuzz; /* saved value of |vfuzz| */ halfword save_split_top_skip; /* saved value of |split_top_skip| */ halfword i; /* for looping through the marks */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/buildpage.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/buildpage.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/buildpage.h 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/buildpage.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: buildpage.h 2830 2009-07-14 07:09:38Z taco $ */ +/* $Id: buildpage.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef BUILDPAGE_H # define BUILDPAGE_H @@ -30,7 +30,7 @@ extern int page_contents; /* what is on the current page so far? */ extern scaled page_max_depth; /* maximum box depth on page being built */ extern halfword best_page_break; /* break here to get the best page known so far */ -extern integer least_page_cost; /* the score for this currently best page */ +extern int least_page_cost; /* the score for this currently best page */ extern scaled best_size; /* its |page_goal| */ /* @@ -53,10 +53,10 @@ extern scaled page_so_far[8]; /* height and glue of the current page */ extern halfword last_glue; /* used to implement \.{\\lastskip */ -extern integer last_penalty; /* used to implement \.{\\lastpenalty} */ +extern int last_penalty; /* used to implement \.{\\lastpenalty} */ extern scaled last_kern; /* used to implement \.{\\lastkern} */ -extern integer last_node_type; /* used to implement \.{\\lastnodetype} */ -extern integer insert_penalties; /* sum of the penalties for held-over insertions */ +extern int last_node_type; /* used to implement \.{\\lastnodetype} */ +extern int insert_penalties; /* sum of the penalties for held-over insertions */ extern void print_totals(void); extern void freeze_page_specs(int s); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/commands.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/commands.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/commands.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/commands.c 2009-12-24 18:51:04.000000000 +0000 @@ -21,7 +21,7 @@ static const char _svn_version[] = "$Id: commands.c 3203 2009-12-01 10:18:20Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/commands.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/commands.c $"; void initialize_commands(void) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/conditional.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/conditional.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/conditional.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/conditional.c 2009-12-24 18:51:04.000000000 +0000 @@ -21,8 +21,8 @@ static const char _svn_version[] = - "$Id: conditional.c 2899 2009-07-21 23:03:53Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/conditional.c $"; + "$Id: conditional.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/conditional.c $"; #define box(A) eqtb[box_base+(A)].hh.rh @@ -50,14 +50,14 @@ halfword cond_ptr; /* top of the condition stack */ int if_limit; /* upper bound on |fi_or_else| codes */ int cur_if; /* type of conditional being worked on */ -integer if_line; /* line where that conditional began */ +int if_line; /* line where that conditional began */ /* When we skip conditional text, we keep track of the line number where skipping began, for use in error messages. */ -integer skip_line; /* skipping began here */ +int skip_line; /* skipping began here */ /* Here is a procedure that ignores text until coming to an \.{\\or}, @@ -69,7 +69,7 @@ void pass_text(void) { - integer l; /* level of $\.{\\if}\ldots\.{\\fi}$ nesting */ + int l; /* level of $\.{\\if}\ldots\.{\\fi}$ nesting */ int save_scanner_status; /* |scanner_status| upon entry */ save_scanner_status = scanner_status; scanner_status = skipping; @@ -160,7 +160,7 @@ static boolean test_for_cs(void) { boolean b; /*is the condition true? */ - integer m, s; /*to be tested against the second operand */ + int m, s; /*to be tested against the second operand */ halfword n, p, q; /*for traversing token lists in \.{\\ifx} tests */ n = get_avail(); p = n; /*head of the list of characters */ @@ -248,7 +248,7 @@ { boolean b; /*is the condition true? */ int r; /*relation to be evaluated */ - integer m, n; /*to be tested against the second operand */ + int m, n; /*to be tested against the second operand */ halfword p, q; /*for traversing token lists in \.{\\ifx} tests */ int save_scanner_status; /*|scanner_status| upon entry */ halfword save_cond_ptr; /*|cond_ptr| corresponding to this conditional */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/conditional.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/conditional.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/conditional.h 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/conditional.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: conditional.h 2886 2009-07-17 13:47:29Z taco $ */ +/* $Id: conditional.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef CONDITIONAL_H # define CONDITIONAL_H @@ -69,8 +69,8 @@ extern halfword cond_ptr; /* top of the condition stack */ extern int if_limit; /* upper bound on |fi_or_else| codes */ extern int cur_if; /* type of conditional being worked on */ -extern integer if_line; /* line where that conditional began */ -extern integer skip_line; /* skipping began here */ +extern int if_line; /* line where that conditional began */ +extern int skip_line; /* skipping began here */ extern void pass_text(void); extern void push_condition_stack(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/directions.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/directions.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/directions.c 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/directions.c 2009-12-24 18:51:05.000000000 +0000 @@ -22,7 +22,7 @@ static const char __svn_version[] = "$Id: directions.c 3204 2009-12-01 10:40:28Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/directions.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/directions.c $"; void scan_direction(void) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/dumpdata.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/dumpdata.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/dumpdata.c 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/dumpdata.c 2009-12-24 18:51:05.000000000 +0000 @@ -20,8 +20,8 @@ #include static const char _svn_version[] = - "$Id: dumpdata.c 3221 2009-12-04 10:49:35Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/dumpdata.c $"; + "$Id: dumpdata.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/dumpdata.c $"; #define font_id_text(A) cs_text(font_id_base+(A)) #define prev_depth cur_list.aux_field.cint @@ -57,9 +57,9 @@ void store_fmt_file(void) { - integer j, k, l; /* all-purpose indices */ + int j, k, l; /* all-purpose indices */ halfword p; /* all-purpose pointer */ - integer x; /* something to dump */ + int x; /* something to dump */ char *format_engine; char *fmtname = NULL; /* If dumping is not allowed, abort */ @@ -127,9 +127,9 @@ /* Dump the string pool */ k = dump_string_pool(); print_ln(); - print_int(k); + print_int(k); tprint(" strings using "); - print_int(pool_size); + print_int(pool_size); tprint(" bytes"); /* Dump the dynamic memory */ @@ -265,7 +265,8 @@ tprint_nl("\\font"); print_esc(font_id_text(k)); print_char('='); - tprint_file_name((unsigned char *)font_name(k), (unsigned char *)font_area(k), NULL); + tprint_file_name((unsigned char *) font_name(k), + (unsigned char *) font_area(k), NULL); if (font_size(k) != font_dsize(k)) { tprint(" at "); print_scaled(font_size(k)); @@ -349,9 +350,9 @@ boolean load_fmt_file(char *fmtname) { - integer j, k; /* all-purpose indices */ + int j, k; /* all-purpose indices */ halfword p; /* all-purpose pointer */ - integer x; /* something undumped */ + int x; /* something undumped */ char *format_engine; /* Undump constants for consistency check */ if (ini_version) { diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/dumpdata.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/dumpdata.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/dumpdata.h 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/dumpdata.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: dumpdata.h 3125 2009-11-11 09:41:44Z taco $ */ +/* $Id: dumpdata.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef DUMPDATA_H # define DUMPDATA_H @@ -88,7 +88,7 @@ # define dump_int(x) \ do \ { \ - integer x_val = (x); \ + int x_val = (x); \ generic_dump (x_val); \ } \ while (0) @@ -100,7 +100,7 @@ # define undump_int(x) \ do \ { \ - integer x_val; \ + int x_val; \ generic_undump (x_val); \ x = x_val; \ } \ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/equivalents.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/equivalents.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/equivalents.c 2009-12-18 09:38:08.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/equivalents.c 2009-12-24 18:51:04.000000000 +0000 @@ -20,8 +20,8 @@ #include static const char _svn_version[] = - "$Id: equivalents.c 2944 2009-08-02 22:14:29Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/equivalents.c $"; + "$Id: equivalents.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/equivalents.c $"; #define par_shape_ptr equiv(par_shape_loc) @@ -84,7 +84,7 @@ void initialize_equivalents(void) { - integer k; + int k; for (k = int_base; k <= eqtb_size; k++) xeq_level[k] = level_one; } @@ -158,11 +158,11 @@ */ save_record *save_stack; -integer save_ptr; /* first unused entry on |save_stack| */ -integer max_save_stack; /* maximum usage of save stack */ +int save_ptr; /* first unused entry on |save_stack| */ +int max_save_stack; /* maximum usage of save stack */ quarterword cur_level = level_one; /* current nesting level for groups */ group_code cur_group = bottom_level; /* current group type */ -integer cur_boundary; /* where the current level begins */ +int cur_boundary; /* where the current level begins */ /* At this time it might be a good idea for the reader to review the introduction @@ -374,12 +374,12 @@ void show_save_groups(void) { int p; /* index into |nest| */ - integer m; /* mode */ + int m; /* mode */ save_pointer v; /* saved value of |save_ptr| */ quarterword l; /* saved value of |cur_level| */ group_code c; /* saved value of |cur_group| */ int a; /* to keep track of alignments */ - integer i; + int i; quarterword j; char *s; /* print_save_stack(); */ @@ -540,7 +540,7 @@ /* Show the box packaging info */ { /* offsets may vary */ - integer ii = -1; + int ii = -1; while (saved_type(ii) != saved_boxspec) ii--; if (saved_value(ii) != 0) { @@ -657,7 +657,7 @@ |p|, a `|restore_zero|' will never be used in this case. */ -void eq_word_define(halfword p, integer w) +void eq_word_define(halfword p, int w) { if (eqtb[p].cint == w) { assign_trace(p, "reassigning"); @@ -689,7 +689,7 @@ assign_trace(p, "into"); } -void geq_word_define(halfword p, integer w) +void geq_word_define(halfword p, int w) { /* global |eq_word_define| */ assign_trace(p, "globally changing"); eqtb[p].cint = w; @@ -809,7 +809,7 @@ whenever it becomes necessary to ``freeze'' it at a particular value. */ -integer mag_set; /* if nonzero, this magnification should be used henceforth */ +int mag_set; /* if nonzero, this magnification should be used henceforth */ /* The |prepare_mag| subroutine is called whenever \TeX\ wants to use |mag| @@ -893,7 +893,7 @@ low-level languages that do not support recursion. */ -integer cur_cmd; /* current command set by |get_next| */ +int cur_cmd; /* current command set by |get_next| */ halfword cur_chr; /* operand of current command */ halfword cur_cs; /* control sequence found here, zero if none found */ halfword cur_tok; /* packed representative of |cur_cmd| and |cur_chr| */ @@ -904,8 +904,8 @@ void show_cur_cmd_chr(void) { - integer n; /* level of \.{\\if...\\fi} nesting */ - integer l; /* line where \.{\\if} started */ + int n; /* level of \.{\\if...\\fi} nesting */ + int l; /* line where \.{\\if} started */ halfword p; begin_diagnostic(); tprint_nl("{"); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/equivalents.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/equivalents.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/equivalents.h 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/equivalents.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: equivalents.h 3203 2009-12-01 10:18:20Z taco $ */ +/* $Id: equivalents.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef EQUIVALENTS_H # define EQUIVALENTS_H @@ -432,11 +432,11 @@ extern save_record *save_stack; -extern integer save_ptr; /* first unused entry on |save_stack| */ -extern integer max_save_stack; /* maximum usage of save stack */ +extern int save_ptr; /* first unused entry on |save_stack| */ +extern int max_save_stack; /* maximum usage of save stack */ extern quarterword cur_level; /* current nesting level for groups */ extern group_code cur_group; /* current group type */ -extern integer cur_boundary; /* where the current level begins */ +extern int cur_boundary; /* where the current level begins */ # define save_type(A) save_stack[(A)].type_ /* classifies a |save_stack| entry */ @@ -487,7 +487,7 @@ # define loc_par(A) equiv(local_base+(A)) # define glue_par(A) equiv(glue_base+(A)) -extern integer mag_set; /* if nonzero, this magnification should be used henceforth */ +extern int mag_set; /* if nonzero, this magnification should be used henceforth */ extern void prepare_mag(void); /* @@ -533,7 +533,7 @@ # define max_group_code local_box_group /* which is wrong, but is what the web says */ -extern integer cur_cmd; /* current command set by |get_next| */ +extern int cur_cmd; /* current command set by |get_next| */ extern halfword cur_chr; /* operand of current command */ extern halfword cur_cs; /* control sequence found here, zero if none found */ extern halfword cur_tok; /* packed representative of |cur_cmd| and |cur_chr| */ @@ -544,9 +544,9 @@ extern void eq_destroy(memory_word w); /* gets ready to forget |w| */ extern void eq_save(halfword p, quarterword l); /* saves |eqtb[p]| */ extern void eq_define(halfword p, quarterword t, halfword e); /* new data for |eqtb| */ -extern void eq_word_define(halfword p, integer w); +extern void eq_word_define(halfword p, int w); extern void geq_define(halfword p, quarterword t, halfword e); /* global |eq_define| */ -extern void geq_word_define(halfword p, integer w); /* global |eq_word_define| */ +extern void geq_word_define(halfword p, int w); /* global |eq_word_define| */ extern void save_for_after(halfword t); extern void unsave(void); /* pops the top level off the save stack */ extern void restore_trace(halfword p, char *s); /* |eqtb[p]| has just been restored or retained */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/errors.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/errors.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/errors.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/errors.c 2009-12-24 18:51:04.000000000 +0000 @@ -22,8 +22,8 @@ static const char __svn_version[] = - "$Id: errors.c 2859 2009-07-15 12:37:51Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/errors.c $"; + "$Id: errors.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/errors.c $"; #define new_line_char int_par(new_line_char_code) @@ -115,7 +115,7 @@ boolean set_box_allowed; /* is it safe to do a \.{\\setbox} assignment? */ int history; /* has the source input been clean so far? */ int error_count; /* the number of scrolled errors since the last paragraph ended */ -integer interrupt; /* should \TeX\ pause for instructions? */ +int interrupt; /* should \TeX\ pause for instructions? */ boolean OK_to_interrupt; /* should interrupts be observed? */ @@ -175,8 +175,8 @@ void error(void) { /* completes the job of error reporting */ ASCII_code c; /* what the user types */ - integer callback_id; - integer s1, s2, s3, s4; /* used to save global variables when deleting tokens */ + int callback_id; + int s1, s2, s3, s4; /* used to save global variables when deleting tokens */ boolean t; int i; if (history < error_message_issued) @@ -386,7 +386,7 @@ save a teeny bit of program space by declaring the following procedure: */ -void int_error(integer n) +void int_error(int n) { tprint(" ("); print_int(n); @@ -438,7 +438,7 @@ void lua_norm_error(char *s) { /* lua found a problem */ - integer saved_new_line_char; + int saved_new_line_char; saved_new_line_char = new_line_char; new_line_char = 10; print_err("LuaTeX error "); @@ -460,7 +460,7 @@ /* Here is the most dreaded error message */ -void overflow(char *s, integer n) +void overflow(char *s, int n) { /* stop due to finiteness */ normalize_selector(); print_err("TeX capacity exceeded, sorry ["); @@ -589,9 +589,9 @@ prints a warning message unless the user has suppressed it. */ -void char_warning(internal_font_number f, integer c) +void char_warning(internal_font_number f, int c) { - integer old_setting; /* saved value of |tracing_online| */ + int old_setting; /* saved value of |tracing_online| */ int k; /* index to current digit; we assume that $0\L n<16^{22}$ */ if (int_par(tracing_lost_chars_code) > 0) { old_setting = int_par(tracing_online_code); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/errors.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/errors.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/errors.h 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/errors.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: errors.h 2806 2009-07-10 18:19:32Z taco $ */ +/* $Id: errors.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef ERRORS_H # define ERRORS_H @@ -48,7 +48,7 @@ extern boolean set_box_allowed; extern int history; extern int error_count; -extern integer interrupt; +extern int interrupt; extern boolean OK_to_interrupt; typedef enum { @@ -81,13 +81,13 @@ extern void do_final_end(void); extern void jump_out(void); extern void error(void); -extern void int_error(integer n); +extern void int_error(int n); extern void normalize_selector(void); extern void succumb(void); extern void fatal_error(char *s); extern void lua_norm_error(char *s); extern void lua_fatal_error(char *s); -extern void overflow(char *s, integer n); +extern void overflow(char *s, int n); extern void confusion(char *s); extern void check_interrupt(void); extern void pause_for_instructions(void); @@ -97,6 +97,6 @@ extern void back_error(void); extern void ins_error(void); -extern void char_warning(internal_font_number f, integer c); +extern void char_warning(internal_font_number f, int c); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/expand.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/expand.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/expand.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/expand.c 2009-12-24 18:51:05.000000000 +0000 @@ -21,8 +21,8 @@ static const char _svn_version[] = - "$Id: expand.c 2886 2009-07-17 13:47:29Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/expand.c $"; + "$Id: expand.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/expand.c $"; /* Only a dozen or so command codes |>max_command| can possibly be returned by @@ -44,7 +44,7 @@ @^system dependencies@> */ -static integer expand_depth_count = 0; +static int expand_depth_count = 0; /* The |expand| subroutine is used when |cur_cmd>max_command|. It removes a @@ -67,8 +67,8 @@ halfword t; /* token that is being ``expanded after'' */ halfword p; /* for list manipulation */ halfword cur_ptr; /* for a local token list pointer */ - integer cv_backup; /* to save the global quantity |cur_val| */ - integer cvl_backup, radix_backup, co_backup; /* to save |cur_val_level|, etc. */ + int cv_backup; /* to save the global quantity |cur_val| */ + int cvl_backup, radix_backup, co_backup; /* to save |cur_val_level|, etc. */ halfword backup_backup; /* to save |link(backup_head)| */ int save_scanner_status; /* temporary storage of |scanner_status| */ incr(expand_depth_count); @@ -318,8 +318,8 @@ void manufacture_csname(void) { halfword p, q, r; - integer j; /* index into |buffer| */ - integer s; /* a character */ + int j; /* index into |buffer| */ + int s; /* a character */ r = get_avail(); p = r; /* head of the list of characters */ is_in_csname = true; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/extensions.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/extensions.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/extensions.c 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/extensions.c 2009-12-24 18:51:04.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: extensions.c 3229 2009-12-04 21:09:46Z hhenkel $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/extensions.c $"; + "$Id: extensions.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/extensions.c $"; #include @@ -131,7 +131,7 @@ void do_extension(PDF pdf) { - integer i, k; /* all-purpose integers */ + int i, k; /* all-purpose integers */ halfword p; /* all-purpose pointer */ switch (cur_chr) { case open_node: @@ -269,7 +269,7 @@ scan_pdf_ext_toks(); set_pdf_font_attr(k, tokens_to_string(def_ref)); if (str_length(pdf_font_attr(k)) == 0) { - flush_str((str_ptr-1)); /* from tokens_to_string */ + flush_str((str_ptr - 1)); /* from tokens_to_string */ set_pdf_font_attr(k, 0); } break; @@ -577,21 +577,21 @@ \.{\\pdfrefobj} */ -integer pdf_last_xform; +int pdf_last_xform; /* \.{\\pdfximage} and \.{\\pdfrefximage} are similiar to \.{\\pdfxform} and \.{\\pdfrefxform}. As we have to scan || quite often, it is better have a |rule_node| that holds the most recently scanned ||. */ -integer pdf_last_ximage; -integer pdf_last_ximage_pages; -integer pdf_last_ximage_colordepth; -integer pdf_last_annot; +int pdf_last_ximage; +int pdf_last_ximage_pages; +int pdf_last_ximage_colordepth; +int pdf_last_annot; /* pdflastlink needs an extra global variable */ -integer pdf_last_link; +int pdf_last_link; scaledpos pdf_last_pos = { 0, 0 }; /* @@ -612,7 +612,7 @@ return q; } -integer pdf_retval; /* global multi-purpose return value */ +int pdf_retval; /* global multi-purpose return value */ halfword make_local_par_node(void) @@ -858,7 +858,7 @@ halfword p; /* saved value of |save_ptr| or |cond_ptr| */ quarterword l; /* saved value of |cur_level| or |if_limit| */ quarterword c; /* saved value of |cur_group| or |cur_if| */ - integer i; /* saved value of |if_line| */ + int i; /* saved value of |if_line| */ p = save_ptr; l = cur_level; c = cur_group; @@ -916,7 +916,7 @@ #define get_tex_attribute_register(j) attribute(j) #define get_tex_box_register(j) box(j) -integer set_tex_dimen_register(integer j, scaled v) +int set_tex_dimen_register(int j, scaled v) { int a; /* return non-nil for error */ if (global_defs > 0) @@ -927,7 +927,7 @@ return 0; } -integer set_tex_skip_register(integer j, halfword v) +int set_tex_skip_register(int j, halfword v) { int a; /* return non-nil for error */ if (global_defs > 0) @@ -940,7 +940,7 @@ return 0; } -integer set_tex_count_register(integer j, scaled v) +int set_tex_count_register(int j, scaled v) { int a; /* return non-nil for error */ if (global_defs > 0) @@ -951,7 +951,7 @@ return 0; } -integer set_tex_box_register(integer j, scaled v) +int set_tex_box_register(int j, scaled v) { int a; /* return non-nil for error */ if (global_defs > 0) @@ -962,7 +962,7 @@ return 0; } -integer set_tex_attribute_register(integer j, scaled v) +int set_tex_attribute_register(int j, scaled v) { int a; /* return non-nil for error */ if (global_defs > 0) @@ -976,7 +976,7 @@ return 0; } -integer get_tex_toks_register(integer j) +int get_tex_toks_register(int j) { str_number s; s = get_nullstr(); @@ -986,7 +986,7 @@ return s; } -integer set_tex_toks_register(integer j, lstring s) +int set_tex_toks_register(int j, lstring s) { halfword ref; int a; @@ -1002,7 +1002,7 @@ return 0; } -scaled get_tex_box_width(integer j) +scaled get_tex_box_width(int j) { halfword q = box(j); if (q != null) @@ -1010,7 +1010,7 @@ return 0; } -integer set_tex_box_width(integer j, scaled v) +int set_tex_box_width(int j, scaled v) { halfword q = box(j); if (q == null) @@ -1019,7 +1019,7 @@ return 0; } -scaled get_tex_box_height(integer j) +scaled get_tex_box_height(int j) { halfword q = box(j); if (q != null) @@ -1027,7 +1027,7 @@ return 0; } -integer set_tex_box_height(integer j, scaled v) +int set_tex_box_height(int j, scaled v) { halfword q = box(j); if (q == null) @@ -1037,7 +1037,7 @@ } -scaled get_tex_box_depth(integer j) +scaled get_tex_box_depth(int j) { halfword q = box(j); if (q != null) @@ -1045,7 +1045,7 @@ return 0; } -integer set_tex_box_depth(integer j, scaled v) +int set_tex_box_depth(int j, scaled v) { halfword q = box(j); if (q == null) @@ -1086,7 +1086,7 @@ the {\sl Sync\TeX} related options, and the {\sl Sync\TeX} controller will read them. */ -integer synctexoption; +int synctexoption; /* @ A convenient primitive is provided: @@ -1103,7 +1103,7 @@ the correct value when quite everything is initialized. */ -integer synctexoffset; /* holds the true value of |synctex_code| */ +int synctexoffset; /* holds the true value of |synctex_code| */ /* Synchronization is achieved with the help of an auxiliary file named @@ -1200,7 +1200,7 @@ */ pool_pointer edit_name_start; /* where the filename to switch to starts */ -integer edit_name_length, edit_line; /* what line to start editing at */ +int edit_name_length, edit_line; /* what line to start editing at */ int ipcon; /* level of IPC action, 0 for none [default] */ boolean stop_at_space; /* whether |more_name| returns false for space */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/extensions.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/extensions.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/extensions.h 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/extensions.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: extensions.h 3221 2009-12-04 10:49:35Z taco $ */ +/* $Id: extensions.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef EXTENSIONS_H # define EXTENSIONS_H @@ -47,15 +47,15 @@ extern void new_write_whatsit(int w); extern void scan_pdf_ext_toks(void); extern halfword prev_rightmost(halfword s, halfword e); -extern integer pdf_last_xform; -extern integer pdf_last_ximage; -extern integer pdf_last_ximage_pages; -extern integer pdf_last_ximage_colordepth; -extern integer pdf_last_annot; -extern integer pdf_last_link; +extern int pdf_last_xform; +extern int pdf_last_ximage; +extern int pdf_last_ximage_pages; +extern int pdf_last_ximage_colordepth; +extern int pdf_last_annot; +extern int pdf_last_link; extern scaledpos pdf_last_pos; extern halfword concat_tokens(halfword q, halfword r); -extern integer pdf_retval; +extern int pdf_retval; extern halfword make_local_par_node(void); @@ -85,29 +85,29 @@ # define get_tex_attribute_register(j) attribute(j) # define get_tex_box_register(j) box(j) -extern integer set_tex_dimen_register(integer j, scaled v); -extern integer set_tex_skip_register(integer j, halfword v); -extern integer set_tex_count_register(integer j, scaled v); -extern integer set_tex_box_register(integer j, scaled v); -extern integer set_tex_attribute_register(integer j, scaled v); -extern integer get_tex_toks_register(integer l); -extern integer set_tex_toks_register(integer j, lstring s); -extern scaled get_tex_box_width(integer j); -extern integer set_tex_box_width(integer j, scaled v); -extern scaled get_tex_box_height(integer j); -extern integer set_tex_box_height(integer j, scaled v); -extern scaled get_tex_box_depth(integer j); -extern integer set_tex_box_depth(integer j, scaled v); +extern int set_tex_dimen_register(int j, scaled v); +extern int set_tex_skip_register(int j, halfword v); +extern int set_tex_count_register(int j, scaled v); +extern int set_tex_box_register(int j, scaled v); +extern int set_tex_attribute_register(int j, scaled v); +extern int get_tex_toks_register(int l); +extern int set_tex_toks_register(int j, lstring s); +extern scaled get_tex_box_width(int j); +extern int set_tex_box_width(int j, scaled v); +extern scaled get_tex_box_height(int j); +extern int set_tex_box_height(int j, scaled v); +extern scaled get_tex_box_depth(int j); +extern int set_tex_box_depth(int j, scaled v); /* Synctex variables */ -extern integer synctexoption; -extern integer synctexoffset; +extern int synctexoption; +extern int synctexoffset; /* Here are extra variables for Web2c. */ extern pool_pointer edit_name_start; -extern integer edit_name_length, edit_line; +extern int edit_name_length, edit_line; extern int ipcon; extern boolean stop_at_space; extern int shellenabledp; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/filename.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/filename.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/filename.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/filename.c 2009-12-24 18:51:05.000000000 +0000 @@ -23,7 +23,7 @@ static const char _svn_version[] = - "$Id: filename.c 3258 2009-12-16 10:40:36Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/filename.c $"; + "$Id: filename.c 3258 2009-12-16 10:40:36Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/filename.c $"; /* for use by |scan_file_name|, it comes from fontforge's Unicode library */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/inputstack.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/inputstack.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/inputstack.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/inputstack.c 2009-12-24 18:51:04.000000000 +0000 @@ -22,7 +22,7 @@ static const char _svn_version[] = - "$Id: inputstack.c 3221 2009-12-04 10:49:35Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/inputstack.c $"; + "$Id: inputstack.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/inputstack.c $"; #define end_line_char int_par(end_line_char_code) @@ -30,21 +30,21 @@ in_state_record *input_stack = NULL; -integer input_ptr = 0; /* first unused location of |input_stack| */ -integer max_in_stack = 0; /* largest value of |input_ptr| when pushing */ +int input_ptr = 0; /* first unused location of |input_stack| */ +int max_in_stack = 0; /* largest value of |input_ptr| when pushing */ in_state_record cur_input; /* the ``top'' input state */ -integer in_open = 0; /* the number of lines in the buffer, less one */ -integer open_parens = 0; /* the number of open text files */ +int in_open = 0; /* the number of lines in the buffer, less one */ +int open_parens = 0; /* the number of open text files */ alpha_file *input_file = NULL; -integer line = 0; /* current line number in the current source file */ -integer *line_stack = NULL; +int line = 0; /* current line number in the current source file */ +int *line_stack = NULL; str_number *source_filename_stack = NULL; char **full_source_filename_stack = NULL; -integer scanner_status = 0; /* can a subfile end now? */ +int scanner_status = 0; /* can a subfile end now? */ pointer warning_index = null; /* identifier relevant to non-|normal| scanner status */ pointer def_ref = null; /* reference count of token list being defined */ @@ -92,8 +92,8 @@ */ pointer *param_stack = NULL; /* token list pointers for parameters */ -integer param_ptr = 0; /* first unused entry in |param_stack| */ -integer max_param_stack = 0; /* largest value of |param_ptr|, will be |<=param_size+9| */ +int param_ptr = 0; /* first unused entry in |param_stack| */ +int max_param_stack = 0; /* largest value of |param_ptr|, will be |<=param_size+9| */ /* The input routines must also interact with the processing of @@ -107,7 +107,7 @@ |align_state=0|. */ -integer align_state = 0; /* group level with respect to current alignment */ +int align_state = 0; /* group level with respect to current alignment */ /* Thus, the ``current input state'' can be very complicated indeed; there @@ -119,7 +119,7 @@ displayed by this procedure. */ -integer base_ptr = 0; /* shallowest level shown by |show_context| */ +int base_ptr = 0; /* shallowest level shown by |show_context| */ /* The status at each level is indicated by printing two lines, where the first @@ -257,16 +257,16 @@ void show_context(void) { /* prints where the scanner is */ - integer old_setting; /* saved |selector| setting */ - integer nn; /* number of contexts shown so far, less one */ + int old_setting; /* saved |selector| setting */ + int nn; /* number of contexts shown so far, less one */ boolean bottom_line; /* have we reached the final context to be shown? */ - integer i; /* index into |buffer| */ - integer j; /* end of current line in |buffer| */ - integer l; /* length of descriptive information on line 1 */ - integer m; /* context information gathered for line 2 */ - integer n; /* length of line 1 */ - integer p; /* starting or ending place in |trick_buf| */ - integer q; /* temporary index */ + int i; /* index into |buffer| */ + int j; /* end of current line in |buffer| */ + int l; /* length of descriptive information on line 1 */ + int m; /* context information gathered for line 2 */ + int n; /* length of line 1 */ + int p; /* starting or ending place in |trick_buf| */ + int q; /* temporary index */ base_ptr = input_ptr; input_stack[base_ptr] = cur_input; @@ -649,7 +649,7 @@ halfword pseudo_files; /* stack of pseudo files */ -static halfword string_to_pseudo(str_number str, integer nl) +static halfword string_to_pseudo(str_number str, int nl) { halfword i, r, q = null; unsigned l, len; @@ -657,10 +657,10 @@ int sz; halfword h = new_node(pseudo_file_node, 0); unsigned char *s = str_string(str); - len = str_length(str); + len = str_length(str); l = 0; - while (l. */ -/* $Id: inputstack.h 3133 2009-11-12 09:32:09Z taco $ */ +/* $Id: inputstack.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef INPUTSTACK_H # define INPUTSTACK_H 1 @@ -34,9 +34,9 @@ halfword limit_field; halfword name_field; halfword ocp_lstack_field; /* used for omega translation processes */ - integer synctex_tag_field; /* stack the tag of the current file */ + int synctex_tag_field; /* stack the tag of the current file */ halfword ocp_no_field:16; /* used for omega translation processes */ - integer cattable_field:16; /* category table used by the current line (see textoken.c) */ + int cattable_field:16; /* category table used by the current line (see textoken.c) */ quarterword state_field:8; quarterword index_field:8; boolean partial_field:8; /* is the current line partial? (see textoken.c) */ @@ -44,8 +44,8 @@ } in_state_record; extern in_state_record *input_stack; -extern integer input_ptr; -extern integer max_in_stack; +extern int input_ptr; +extern int max_in_stack; extern in_state_record cur_input; /* the ``top'' input state */ # define iloc cur_input.loc_field /* location of first unread character in |buffer| */ @@ -156,11 +156,11 @@ # define terminal_input (iname==0) /* are we reading from the terminal? */ # define cur_file input_file[iindex] /* the current |alpha_file| variable */ -extern integer in_open; -extern integer open_parens; +extern int in_open; +extern int open_parens; extern alpha_file *input_file; -extern integer line; -extern integer *line_stack; +extern int line; +extern int *line_stack; extern str_number *source_filename_stack; extern char **full_source_filename_stack; @@ -204,7 +204,7 @@ absorbing = 5, /* |scanner_status| when reading a balanced text */ } scanner_states; -extern integer scanner_status; +extern int scanner_status; extern pointer warning_index; extern pointer def_ref; @@ -314,12 +314,12 @@ } token_types; extern pointer *param_stack; -extern integer param_ptr; -extern integer max_param_stack; +extern int param_ptr; +extern int max_param_stack; -extern integer align_state; +extern int align_state; -extern integer base_ptr; +extern int base_ptr; extern void show_context(void); extern void set_trick_count(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/linebreak.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/linebreak.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/linebreak.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/linebreak.c 2009-12-24 18:51:05.000000000 +0000 @@ -23,7 +23,7 @@ static const char _svn_version[] = - "$Id: linebreak.c 3144 2009-11-16 08:21:51Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/linebreak.c $"; + "$Id: linebreak.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/linebreak.c $"; /* We come now to what is probably the most interesting algorithm of \TeX: @@ -138,13 +138,13 @@ -void line_break(boolean d, integer line_break_context) +void line_break(boolean d, int line_break_context) { - integer paragraph_dir; /* main direction of paragraph */ + int paragraph_dir; /* main direction of paragraph */ halfword final_par_glue; halfword start_of_par; - integer callback_id; - integer line_break_dir; /* current direction within paragraph */ + int callback_id; + int line_break_dir; /* current direction within paragraph */ pack_begin_line = cur_list.ml_field; /* this is for over/underfull box messages */ vlink(temp_head) = vlink(cur_list.head_field); new_hyphenation(temp_head, cur_list.tail_field); @@ -310,7 +310,7 @@ static boolean second_pass; /* is this our second attempt to break this paragraph? */ static boolean final_pass; /*is this our final attempt to break this paragraph? */ -static integer threshold; /* maximum badness on feasible lines */ +static int threshold; /* maximum badness on feasible lines */ /* skipable nodes at the margins during character protrusion */ @@ -367,9 +367,9 @@ return hlist_stack[--hlist_stack_level]; } -static integer max_stretch_ratio = 0; /*maximal stretch ratio of expanded fonts */ -static integer max_shrink_ratio = 0; /*maximal shrink ratio of expanded fonts */ -static integer cur_font_step = 0; /*the current step of expanded fonts */ +static int max_stretch_ratio = 0; /*maximal stretch ratio of expanded fonts */ +static int max_shrink_ratio = 0; /*maximal shrink ratio of expanded fonts */ +static int cur_font_step = 0; /*the current step of expanded fonts */ static boolean check_expand_pars(internal_font_number f) @@ -683,14 +683,14 @@ -static integer internal_pen_inter; /* running \.{\\localinterlinepenalty} */ -static integer internal_pen_broken; /* running \.{\\localbrokenpenalty} */ +static int internal_pen_inter; /* running \.{\\localinterlinepenalty} */ +static int internal_pen_broken; /* running \.{\\localbrokenpenalty} */ static halfword internal_left_box; /* running \.{\\localleftbox} */ -static integer internal_left_box_width; /* running \.{\\localleftbox} width */ +static int internal_left_box_width; /* running \.{\\localleftbox} width */ static halfword init_internal_left_box; /* running \.{\\localleftbox} */ -static integer init_internal_left_box_width; /* running \.{\\localleftbox} width */ +static int init_internal_left_box_width; /* running \.{\\localleftbox} width */ static halfword internal_right_box; /* running \.{\\localrightbox} */ -static integer internal_right_box_width; /* running \.{\\localrightbox} width */ +static int internal_right_box_width; /* running \.{\\localrightbox} width */ static scaled disc_width[10] = { 0 }; /* the length of discretionary material preceding a break */ @@ -708,10 +708,10 @@ */ -static integer minimal_demerits[4]; /* best total demerits known for current - line class and position, given the fitness */ -static integer minimum_demerits; /* best total demerits known for current line class - and position */ +static int minimal_demerits[4]; /* best total demerits known for current + line class and position, given the fitness */ +static int minimum_demerits; /* best total demerits known for current line class + and position */ static halfword best_place[4]; /* how to achieve |minimal_demerits| */ static halfword best_pl_line[4]; /*corresponding line number */ @@ -743,11 +743,11 @@ static scaled second_indent; /*left margin to go with |second_width| */ static halfword best_bet; /*use this passive node and its predecessors */ -static integer fewest_demerits; /*the demerits associated with |best_bet| */ +static int fewest_demerits; /*the demerits associated with |best_bet| */ static halfword best_line; /*line number following the last line of the new paragraph */ -static integer actual_looseness; /*the difference between |line_number(best_bet)| - and the optimum |best_line| */ -static integer line_diff; /*the difference between the current line number and +static int actual_looseness; /*the difference between |line_number(best_bet)| + and the optimum |best_line| */ +static int line_diff; /*the difference between the current line number and the optimum |best_line| */ @@ -824,8 +824,8 @@ * only character nodes, kern nodes, and box or rule nodes. */ -static void add_to_widths(halfword s, integer line_break_dir, - integer pdf_adjust_spacing, scaled * widths) +static void add_to_widths(halfword s, int line_break_dir, + int pdf_adjust_spacing, scaled * widths) { while (s != null) { if (is_char_node(s)) { @@ -866,8 +866,8 @@ * with the |add_to_widths| function. */ -static void sub_from_widths(halfword s, integer line_break_dir, - integer pdf_adjust_spacing, scaled * widths) +static void sub_from_widths(halfword s, int line_break_dir, + int pdf_adjust_spacing, scaled * widths) { while (s != null) { /* @; */ @@ -1045,8 +1045,8 @@ static void -print_feasible_break(halfword cur_p, pointer r, halfword b, integer pi, - integer d, boolean artificial_demerits) +print_feasible_break(halfword cur_p, pointer r, halfword b, int pi, + int d, boolean artificial_demerits) { /* @; */ if (printed_node != cur_p) { @@ -1134,7 +1134,7 @@ } static void -ext_try_break(integer pi, +ext_try_break(int pi, quarterword break_type, int line_break_dir, int pdf_adjust_spacing, @@ -1162,7 +1162,7 @@ scaled line_width; /*the current line will be justified to this width */ fitness_value fit_class; /*possible fitness class of test line */ halfword b; /*badness of test line */ - integer d; /*demerits of test line */ + int d; /*demerits of test line */ boolean artificial_demerits; /*has |d| been forced to zero? */ scaled shortfall; /*used in badness calculations */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/linebreak.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/linebreak.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/linebreak.h 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/linebreak.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: linebreak.h 2942 2009-08-01 12:47:25Z taco $ */ +/* $Id: linebreak.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef LINEBREAK_H # define LINEBREAK_H @@ -27,7 +27,7 @@ extern halfword just_box; /* the |hlist_node| for the last line of the new paragraph */ -extern void line_break(boolean d, integer line_break_context); +extern void line_break(boolean d, int line_break_context); # define inf_bad 10000 /* infinitely bad value */ # define awful_bad 07777777777 /* more than a billion demerits */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/mainbody.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/mainbody.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/mainbody.c 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/mainbody.c 2009-12-24 18:51:04.000000000 +0000 @@ -20,8 +20,8 @@ #include static const char _svn_version[] = - "$Id: mainbody.c 3242 2009-12-07 10:48:56Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/mainbody.c $"; + "$Id: mainbody.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/mainbody.c $"; /* % pdfTeX is copyright (C) 1996-2006 Han The Thanh, . @@ -181,7 +181,7 @@ defined. */ -integer bad; /* is some ``constant'' wrong? */ +int bad; /* is some ``constant'' wrong? */ boolean luainit; /* are we using lua for initializations */ boolean tracefilenames; /* print file open-close info? */ @@ -196,35 +196,35 @@ boolean ini_version; /* are we \.{INITEX}? */ boolean dump_option; /* was the dump name option used? */ boolean dump_line; /* was a \.{\%\AM format} line seen? */ -integer bound_default; /* temporary for setup */ +int bound_default; /* temporary for setup */ char *bound_name; /* temporary for setup */ -integer error_line; /* width of context lines on terminal error messages */ -integer half_error_line; /* width of first lines of contexts in terminal +int error_line; /* width of context lines on terminal error messages */ +int half_error_line; /* width of first lines of contexts in terminal error messages; should be between 30 and |error_line-15| */ -integer max_print_line; /* width of longest text lines output; should be at least 60 */ -integer ocp_list_size; -integer ocp_buf_size; -integer ocp_stack_size; -integer max_strings; /* maximum number of strings; must not exceed |max_halfword| */ -integer strings_free; /* strings available after format loaded */ -integer font_k; /* loop variable for initialization */ -integer buf_size; /* maximum number of characters simultaneously present in +int max_print_line; /* width of longest text lines output; should be at least 60 */ +int ocp_list_size; +int ocp_buf_size; +int ocp_stack_size; +int max_strings; /* maximum number of strings; must not exceed |max_halfword| */ +int strings_free; /* strings available after format loaded */ +int font_k; /* loop variable for initialization */ +int buf_size; /* maximum number of characters simultaneously present in current lines of open files and in control sequences between \.{\\csname} and \.{\\endcsname}; must not exceed |max_halfword| */ -integer stack_size; /* maximum number of simultaneous input sources */ -integer max_in_open; /* maximum number of input files and error insertions that +int stack_size; /* maximum number of simultaneous input sources */ +int max_in_open; /* maximum number of input files and error insertions that can be going on simultaneously */ -integer param_size; /* maximum number of simultaneous macro parameters */ -integer nest_size; /* maximum number of semantic levels simultaneously active */ -integer save_size; /* space for saving values outside of current group; must be +int param_size; /* maximum number of simultaneous macro parameters */ +int nest_size; /* maximum number of semantic levels simultaneously active */ +int save_size; /* space for saving values outside of current group; must be at most |max_halfword| */ -integer expand_depth; /* limits recursive calls of the |expand| procedure */ +int expand_depth; /* limits recursive calls of the |expand| procedure */ int parsefirstlinep; /* parse the first line for options */ int filelineerrorstylep; /* format messages as file:line:error */ int haltonerrorp; /* stop at first error */ boolean quoted_filename; /* current filename is quoted */ -integer get_luatexversion(void) +int get_luatexversion(void) { return luatex_version; } @@ -234,7 +234,7 @@ return luatex_revision; } -integer get_luatex_date_info(void) +int get_luatex_date_info(void) { return luatex_date_info; /* todo, silly value */ } @@ -317,8 +317,8 @@ save_stack = xmallocarray(save_record, save_size); input_stack = xmallocarray(in_state_record, stack_size); input_file = xmallocarray(alpha_file, max_in_open); - input_file_callback_id = xmallocarray(integer, max_in_open); - line_stack = xmallocarray(integer, max_in_open); + input_file_callback_id = xmallocarray(int, max_in_open); + line_stack = xmallocarray(int, max_in_open); eof_seen = xmallocarray(boolean, max_in_open); grp_stack = xmallocarray(save_pointer, max_in_open); if_stack = xmallocarray(pointer, max_in_open); @@ -486,8 +486,8 @@ void close_files_and_terminate() { - integer k; /* all-purpose index */ - integer callback_id; + int k; /* all-purpose index */ + int callback_id; PDF pdf = static_pdf; callback_id = callback_defined(stop_run_callback); /* Finish the extensions */ @@ -667,7 +667,7 @@ #ifdef DEBUG void debug_help(void) { /* routine to display various things */ - integer k; + int k; int m = 0, n = 0, l = 0; while (1) { wake_up_terminal(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/mainbody.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/mainbody.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/mainbody.h 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/mainbody.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: mainbody.h 3255 2009-12-14 14:24:38Z taco $ */ +/* $Id: mainbody.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef MAINBODY_H # define MAINBODY_H @@ -86,11 +86,11 @@ typedef FILE *alpha_file; /* files that contain textual data */ typedef FILE *byte_file; /* files that contain binary data */ -typedef integer str_number; -typedef integer pool_pointer; +typedef int str_number; +typedef int pool_pointer; typedef unsigned char packed_ASCII_code; -typedef integer scaled; /* this type is used for scaled integers */ +typedef int scaled; /* this type is used for scaled integers */ typedef char small_number; /* this type is self-explanatory */ typedef float glue_ratio; /* one-word representation of a glue expansion factor */ @@ -103,9 +103,9 @@ typedef unsigned char group_code; /* |save_level| for a level boundary */ typedef int internal_font_number; /* |font| in a |char_node| */ -typedef integer font_index; /* index into |font_info| */ +typedef int font_index; /* index into |font_info| */ -typedef integer save_pointer; +typedef int save_pointer; /* Characters of text that have been converted to \TeX's internal form @@ -122,7 +122,7 @@ # define carriage_return '\r' /* ASCII code used at end of line */ /* Global variables */ -extern integer bad; /* is some ``constant'' wrong? */ +extern int bad; /* is some ``constant'' wrong? */ extern boolean luainit; /* are we using lua for initializations */ extern boolean tracefilenames; /* print file open-close info? */ @@ -130,24 +130,24 @@ extern boolean ini_version; /* are we \.{INITEX}? */ extern boolean dump_option; extern boolean dump_line; -extern integer bound_default; +extern int bound_default; extern char *bound_name; -extern integer error_line; -extern integer half_error_line; -extern integer max_print_line; -extern integer ocp_list_size; -extern integer ocp_buf_size; -extern integer ocp_stack_size; -extern integer max_strings; -extern integer strings_free; -extern integer font_k; -extern integer buf_size; -extern integer stack_size; -extern integer max_in_open; -extern integer param_size; -extern integer nest_size; -extern integer save_size; -extern integer expand_depth; +extern int error_line; +extern int half_error_line; +extern int max_print_line; +extern int ocp_list_size; +extern int ocp_buf_size; +extern int ocp_stack_size; +extern int max_strings; +extern int strings_free; +extern int font_k; +extern int buf_size; +extern int stack_size; +extern int max_in_open; +extern int param_size; +extern int nest_size; +extern int save_size; +extern int expand_depth; extern int parsefirstlinep; extern int filelineerrorstylep; extern int haltonerrorp; @@ -230,9 +230,9 @@ # define fix_date_and_time() dateandtime(int_par(time_code),int_par(day_code),int_par(month_code),int_par(year_code)) -extern integer get_luatexversion(void); +extern int get_luatexversion(void); extern str_number get_luatexrevision(void); -extern integer get_luatex_date_info(void); +extern int get_luatex_date_info(void); extern int ready_already; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/maincontrol.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/maincontrol.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/maincontrol.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/maincontrol.c 2009-12-24 18:51:04.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: maincontrol.c 3244 2009-12-10 12:51:42Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/maincontrol.c $"; + "$Id: maincontrol.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/maincontrol.c $"; #include @@ -192,9 +192,9 @@ void main_control(void) { /* governs \TeX's activities */ - integer t; /* general-purpose temporary variable */ + int t; /* general-purpose temporary variable */ halfword p; /* for whatsit nodes and testing whether an auto kern should be inserted */ - integer chr_stack; /* to temporarily save an |cur_chr| to be appended */ + int chr_stack; /* to temporarily save an |cur_chr| to be appended */ mathcodeval mval; /* to build up an argument to |set_math_char| */ t = 0; /* for -Wall */ chr_stack = -1; @@ -1120,7 +1120,7 @@ { halfword p, q; /* for short-term use */ scaled d; /* holds |split_max_depth| in |insert_group| */ - integer f; /* holds |floating_penalty| in |insert_group| */ + int f; /* holds |floating_penalty| in |insert_group| */ p = null; switch (cur_group) { case simple_group: @@ -1281,7 +1281,7 @@ |box_context| represents the context as explained above. */ -void box_end(integer box_context) +void box_end(int box_context) { if (box_context < box_flag) { /* Append box |cur_box| to the current list, shifted by |box_context| */ @@ -1355,7 +1355,7 @@ } /* the next input should specify a box or perhaps a rule */ -void scan_box(integer box_context) +void scan_box(int box_context) { /* Get the next non-blank non-relax... */ do { @@ -1461,7 +1461,7 @@ wrong in some way that relates to in-paragraph displays. */ -void end_graf(integer line_break_context) +void end_graf(int line_break_context) { if (mode == hmode) { if ((head == tail) || (vlink(head) == tail)) { @@ -1670,7 +1670,7 @@ } -void append_local_box(integer kind) +void append_local_box(int kind) { incr(save_ptr); set_saved_record(-1, saved_boxtype, 0, kind); @@ -1691,7 +1691,7 @@ void append_discretionary(void) { - integer c; + int c; tail_append(new_disc()); subtype(tail) = cur_chr; if (cur_chr == explicit_disc) { @@ -1725,7 +1725,7 @@ void build_local_box(void) { halfword p; - integer kind; + int kind; unsave(); assert(saved_type(-1) == saved_boxtype); kind = saved_value(-1); @@ -1755,7 +1755,7 @@ void build_discretionary(void) { halfword p, q; /* for link manipulation */ - integer n; /* length of discretionary list */ + int n; /* length of discretionary list */ unsave(); /* Prune the current list, if necessary, until it contains only |char_node|, |kern_node|, |hlist_node|, |vlist_node| and @@ -2064,7 +2064,7 @@ internal_font_number f; /* identifies a font */ halfword j; /* index into a \.{\\parshape} specification */ halfword p, q; /* for temporary short-term use */ - integer n; /* ditto */ + int n; /* ditto */ boolean e; /* should a definition be expanded? or was \.{\\let} not done? */ mathcodeval mval; /* for handling of \.{\\mathchardef}s */ a = 0; @@ -2690,9 +2690,9 @@ void fixup_directions(void) { - integer temp_no_whatsits; - integer temp_no_dirs; - integer temporary_dir; + int temp_no_whatsits; + int temp_no_dirs; + int temporary_dir; temp_no_whatsits = no_local_whatsits; temp_no_dirs = no_local_dirs; temporary_dir = text_direction; @@ -2747,7 +2747,7 @@ } } -void assign_internal_value(int a, halfword p, integer cur_val) +void assign_internal_value(int a, halfword p, int cur_val) { halfword n; if ((p >= int_base) && (p < attribute_base)) { @@ -2875,7 +2875,7 @@ void do_register_command(int a) { halfword l, q, r, s; /* for list manipulation */ - integer p; /* type of register involved */ + int p; /* type of register involved */ q = cur_cmd; /* Compute the register location |l| and its type |p|; but |return| if invalid */ /* Here we use the fact that the consecutive codes |int_val..mu_val| and @@ -3092,7 +3092,7 @@ void alter_box_dimen(void) { int c; /* |width_offset| or |height_offset| or |depth_offset| */ - integer b; /* box number */ + int b; /* box number */ c = cur_chr; scan_register_num(); b = cur_val; @@ -3193,7 +3193,7 @@ s = make_string(); if (c == 0) { /* Print string |s| on the terminal */ - if (term_offset + (int)str_length(s) > max_print_line - 2) + if (term_offset + (int) str_length(s) > max_print_line - 2) print_ln(); else if ((term_offset > 0) || (file_offset > 0)) print_char(' '); @@ -3292,8 +3292,8 @@ halfword p; /* tail of a token list to show */ int t; /* type of conditional being shown */ int m; /* upper bound on |fi_or_else| codes */ - integer l; /* line where that conditional began */ - integer n; /* level of \.{\\if...\\fi} nesting */ + int l; /* line where that conditional began */ + int n; /* level of \.{\\if...\\fi} nesting */ switch (cur_chr) { case show_lists: begin_diagnostic(); @@ -3408,7 +3408,7 @@ void initialize(void) { /* this procedure gets things started properly */ - integer k; /* index into |mem|, |eqtb|, etc. */ + int k; /* index into |mem|, |eqtb|, etc. */ /* Initialize whatever \TeX\ might access */ /* Set initial values of key variables */ initialize_errors(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/maincontrol.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/maincontrol.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/maincontrol.h 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/maincontrol.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: maincontrol.h 3003 2009-08-16 19:55:55Z hhenkel $ */ +/* $Id: maincontrol.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef MAINCONTROL_H # define MAINCONTROL_H @@ -127,19 +127,19 @@ extern void handle_right_brace(void); extern void extra_right_brace(void); extern void normal_paragraph(void); -extern void box_end(integer box_context); -extern void scan_box(integer box_context); +extern void box_end(int box_context); +extern void scan_box(int box_context); extern void new_graf(boolean indented); extern void indent_in_hmode(void); extern void head_for_vmode(void); -extern void end_graf(integer); +extern void end_graf(int); extern void begin_insert_or_adjust(void); extern void handle_mark(void); extern void append_penalty(void); extern void delete_last(void); extern void unpackage(void); extern void append_italic_correction(void); -extern void append_local_box(integer kind); +extern void append_local_box(int kind); extern void append_discretionary(void); extern void build_local_box(void); extern void build_discretionary(void); @@ -172,7 +172,7 @@ } extern void get_r_token(void); -extern void assign_internal_value(int a, halfword p, integer cur_val); +extern void assign_internal_value(int a, halfword p, int cur_val); extern void trap_zero_glue(void); extern void do_register_command(int a); extern void alter_aux(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/mathcodes.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/mathcodes.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/mathcodes.c 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/mathcodes.c 2009-12-24 18:51:05.000000000 +0000 @@ -22,10 +22,10 @@ -extern void rawset_sa_item(sa_tree head, integer n, integer v); +extern void rawset_sa_item(sa_tree head, int n, int v); static const char __svn_version[] = - "$Id: mathcodes.c 2869 2009-07-16 11:31:18Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/mathcodes.c $"; + "$Id: mathcodes.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/mathcodes.c $"; /* math codes */ @@ -34,8 +34,8 @@ #define MATHCODEHEAP 8 static mathcodeval *mathcode_heap = NULL; -static integer mathcode_heapsize = MATHCODEHEAP; -static integer mathcode_heapptr = 0; +static int mathcode_heapsize = MATHCODEHEAP; +static int mathcode_heapptr = 0; /* the 0xFFFFFFFF is a flag value */ #define MATHCODESTACK 8 @@ -48,8 +48,8 @@ #define DELCODEHEAP 8 static delcodeval *delcode_heap = NULL; -static integer delcode_heapsize = DELCODEHEAP; -static integer delcode_heapptr = 0; +static int delcode_heapsize = DELCODEHEAP; +static int delcode_heapptr = 0; #define DELCODESTACK 4 #define DELCODEDEFAULT 0xFFFFFFFF @@ -105,7 +105,7 @@ } -void show_mathcode(integer n) +void show_mathcode(int n) { mathcodeval c = get_math_code(n); if (c.origin_value == aleph_mathcode) { @@ -129,7 +129,7 @@ return; while (mathcode_head->stack_ptr > 0 && abs(mathcode_head->stack[mathcode_head->stack_ptr].level) - >= (integer) gl) { + >= (int) gl) { st = mathcode_head->stack[mathcode_head->stack_ptr]; if (st.level > 0) { rawset_sa_item(mathcode_head, st.code, st.value); @@ -148,10 +148,10 @@ } } -void set_math_code(integer n, - integer commandorigin, - integer mathclass, - integer mathfamily, integer mathcharacter, quarterword level) +void set_math_code(int n, + int commandorigin, + int mathclass, + int mathfamily, int mathcharacter, quarterword level) { mathcodeval d; d.origin_value = commandorigin; @@ -177,7 +177,7 @@ } } -mathcodeval get_math_code(integer n) +mathcodeval get_math_code(int n) { unsigned int ret; ret = get_sa_item(mathcode_head, n); @@ -195,7 +195,7 @@ } -integer get_math_code_num(integer n) +int get_math_code_num(int n) { mathcodeval mval; mval = get_math_code(n); @@ -221,7 +221,7 @@ void dumpmathcode(void) { - integer k; + int k; mathcodeval d; dump_sa_tree(mathcode_head); dump_int(mathcode_heapsize); @@ -237,7 +237,7 @@ void undumpmathcode(void) { - integer k, x; + int k, x; mathcodeval d; mathcode_head = undump_sa_tree(); undump_int(mathcode_heapsize); @@ -264,7 +264,7 @@ } -void show_delcode(integer n) +void show_delcode(int n) { delcodeval c; c = get_del_code(n); @@ -319,7 +319,7 @@ return; while (delcode_head->stack_ptr > 0 && abs(delcode_head->stack[delcode_head->stack_ptr].level) - >= (integer) gl) { + >= (int) gl) { st = delcode_head->stack[delcode_head->stack_ptr]; if (st.level > 0) { rawset_sa_item(delcode_head, st.code, st.value); @@ -339,11 +339,11 @@ } -void set_del_code(integer n, - integer commandorigin, - integer smathfamily, - integer smathcharacter, - integer lmathfamily, integer lmathcharacter, quarterword gl) +void set_del_code(int n, + int commandorigin, + int smathfamily, + int smathcharacter, + int lmathfamily, int lmathcharacter, quarterword gl) { delcodeval d; d.class_value = 0; @@ -371,7 +371,7 @@ delcode_heapptr++; } -delcodeval get_del_code(integer n) +delcodeval get_del_code(int n) { unsigned ret; ret = get_sa_item(delcode_head, n); @@ -390,7 +390,7 @@ } /* this really only works for old-style delcodes! */ -integer get_del_code_num(integer n) +int get_del_code_num(int n) { unsigned ret; ret = get_sa_item(delcode_head, n); @@ -417,7 +417,7 @@ void dumpdelcode(void) { - integer k; + int k; delcodeval d; dump_sa_tree(delcode_head); dump_int(delcode_heapsize); @@ -435,7 +435,7 @@ void undumpdelcode(void) { - integer k; + int k; delcodeval d; delcode_head = undump_sa_tree(); undump_int(delcode_heapsize); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/mathcodes.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/mathcodes.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/mathcodes.h 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/mathcodes.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: mathcodes.h 2899 2009-07-21 23:03:53Z oneiros $ */ +/* $Id: mathcodes.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef MATHCODES_H # define MATHCODES_H @@ -31,42 +31,42 @@ # define xetexnum_mathcode 22 typedef struct mathcodeval { - integer class_value; - integer origin_value; - integer family_value; - integer character_value; + int class_value; + int origin_value; + int family_value; + int character_value; } mathcodeval; -void set_math_code(integer n, - integer commandorigin, - integer mathclass, - integer mathfamily, integer mathcharacter, quarterword gl); - -mathcodeval get_math_code(integer n); -integer get_math_code_num(integer n); -integer get_del_code_num(integer n); +void set_math_code(int n, + int commandorigin, + int mathclass, + int mathfamily, int mathcharacter, quarterword gl); + +mathcodeval get_math_code(int n); +int get_math_code_num(int n); +int get_del_code_num(int n); mathcodeval scan_mathchar(int extcode); mathcodeval scan_delimiter_as_mathchar(int extcode); -mathcodeval mathchar_from_integer(integer value, int extcode); +mathcodeval mathchar_from_integer(int value, int extcode); void show_mathcode_value(mathcodeval d); typedef struct delcodeval { - integer class_value; - integer origin_value; - integer small_family_value; - integer small_character_value; - integer large_family_value; - integer large_character_value; + int class_value; + int origin_value; + int small_family_value; + int small_character_value; + int large_family_value; + int large_character_value; } delcodeval; -void set_del_code(integer n, - integer commandorigin, - integer smathfamily, - integer smathcharacter, - integer lmathfamily, integer lmathcharacter, quarterword gl); +void set_del_code(int n, + int commandorigin, + int smathfamily, + int smathcharacter, + int lmathfamily, int lmathcharacter, quarterword gl); -delcodeval get_del_code(integer n); +delcodeval get_del_code(int n); void unsave_math_codes(quarterword grouplevel); void initialize_math_codes(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/memoryword.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/memoryword.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/memoryword.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/memoryword.c 2009-12-24 18:51:04.000000000 +0000 @@ -21,7 +21,7 @@ static const char _svn_version[] = "$Id: memoryword.c 2675 2009-06-28 18:12:59Z oneiros $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/memoryword.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/memoryword.c $"; /* When debugging, we may want to print a |memory_word| without knowing diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/memoryword.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/memoryword.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/memoryword.h 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/memoryword.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: memoryword.h 2675 2009-06-28 18:12:59Z oneiros $ */ +/* $Id: memoryword.h 3261 2009-12-18 11:38:21Z taco $ */ /* This header file is extra special because it is read in from within the pascal source */ @@ -83,9 +83,9 @@ typedef struct { # ifdef WORDS_BIGENDIAN - integer CINT0, CINT1; + int CINT0, CINT1; # else - integer CINT1, CINT0; + int CINT1, CINT0; # endif } two_ints; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/mlist.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/mlist.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/mlist.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/mlist.c 2009-12-24 18:51:05.000000000 +0000 @@ -23,7 +23,7 @@ #include "lua/luatex-api.h" static const char _svn_version[] = - "$Id: mlist.c 3214 2009-12-02 13:53:09Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/mlist.c $"; + "$Id: mlist.c 3276 2009-12-21 10:51:38Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/mlist.c $"; #define delimiter_factor int_par(delimiter_factor_code) #define delimiter_shortfall dimen_par(delimiter_shortfall_code) @@ -178,7 +178,7 @@ } -static scaled accent_base_height(integer f) +static scaled accent_base_height(int f) { scaled a; a = x_height(f); @@ -673,15 +673,7 @@ } -/* This function is no longer useful */ - -boolean check_necessary_fonts(void) -{ - return false; /* temp */ -} - -void fixup_math_parameters(integer fam_id, integer size_id, integer f, - integer lvl) +void fixup_math_parameters(int fam_id, int size_id, int f, int lvl) { if (is_new_mathfont(f)) { /* fix all known parameters */ @@ -919,10 +911,12 @@ FractionDenominatorDisplayStyleShiftDown), lvl); - DEFINE_MATH_PARAMETERS(math_param_fraction_del_size, size_id, + DEFINE_MATH_PARAMETERS(math_param_fraction_del_size, size_id, font_MATH_par(f, FractionDelimiterSize), lvl); - DEFINE_DMATH_PARAMETERS(math_param_fraction_del_size, size_id, - font_MATH_par(f, FractionDelimiterDisplayStyleSize), lvl); + DEFINE_DMATH_PARAMETERS(math_param_fraction_del_size, size_id, + font_MATH_par(f, + FractionDelimiterDisplayStyleSize), + lvl); DEFINE_MATH_PARAMETERS(math_param_space_after_script, size_id, font_MATH_par(f, SpaceAfterScript), lvl); @@ -1177,7 +1171,7 @@ /* this needs to be called just at the start of |mlist_to_hlist| */ void finalize_math_parameters(void) { - integer saved_trace = int_par(tracing_assigns_code); + int saved_trace = int_par(tracing_assigns_code); int_par(tracing_assigns_code) = 0; if (get_math_param(math_param_space_after_script, display_style) == undefined_math_parameter) { @@ -1215,7 +1209,7 @@ */ -char *math_size_string(integer s) +char *math_size_string(int s) { if (s == text_size) return "textfont"; @@ -1309,7 +1303,7 @@ may deliver a slightly different result than |hpack| would produce. */ -static pointer char_box(internal_font_number f, integer c, pointer bb) +static pointer char_box(internal_font_number f, int c, pointer bb) { pointer b, p; /* the new box and its character node */ b = new_null_box(); @@ -1328,7 +1322,7 @@ a given character: */ -scaled height_plus_depth(internal_font_number f, integer c) +scaled height_plus_depth(internal_font_number f, int c) { return (char_height(f, c) + char_depth(f, c)); } @@ -1340,7 +1334,7 @@ of the characters already in box |b|: */ -scaled stack_into_box(pointer b, internal_font_number f, integer c) +scaled stack_into_box(pointer b, internal_font_number f, int c) { pointer p; /* new node placed into |b| */ p = char_box(f, c, node_attr(b)); @@ -1351,7 +1345,7 @@ } -scaled stack_into_hbox(pointer b, internal_font_number f, integer c) +scaled stack_into_hbox(pointer b, internal_font_number f, int c) { pointer p, q; /* new node placed into |b| */ p = char_box(f, c, node_attr(b)); @@ -1398,9 +1392,33 @@ +/* + \TeX's most important routine for dealing with formulas is called + |mlist_to_hlist|. After a formula has been scanned and represented + as an mlist, this routine converts it to an hlist that can be placed + into a box or incorporated into the text of a paragraph. There is one + implicit parameter, passed in a global variable: |cur_style| is a + style code. The explicit parameter |cur_mlist| points to the first + node or noad in the given mlist (and it might be |null|); the + parameter |penalties| is |true| if penalty nodes for potential line + breaks are to be inserted into the resulting hlist. After + |mlist_to_hlist| has acted, |vlink(temp_head)| points to the + translated hlist. + +Since mlists can be inside mlists, the procedure is recursive. And since this +is not part of \TeX's inner loop, the program has been written in a manner +that stresses compactness over efficiency. +@^recursion@> +*/ + +static int cur_style = 0; /* style code at current place in the list */ +int cur_size; /* size code corresponding to |cur_style| */ +scaled cur_mu; /* the math unit width corresponding to |cur_size| */ + + /* */ -pointer get_delim_box(extinfo * ext, internal_font_number f, scaled v, +static pointer get_delim_box(extinfo * ext, internal_font_number f, scaled v, pointer att, int boxtype) { pointer b; @@ -1409,8 +1427,8 @@ scaled b_max; /* natural (maximum) height of the stack */ scaled s_max; /* amount of possible shrink in the stack */ scaled a, wd, ht, dp, last_ht; - integer cc; /* a temporary character code for extensibles */ - integer i; /* a temporary counter number of extensible pieces */ + int cc; /* a temporary character code for extensibles */ + int i; /* a temporary counter number of extensible pieces */ int with_extenders; int num_extenders, num_normal, num_total; scaled c, d, u; @@ -1668,7 +1686,9 @@ height(b) = ht; depth(b) = 0; /* the next correction is needed for radicals */ - if (list_ptr(b) != null && type(list_ptr(b)) == hlist_node && list_ptr(list_ptr(b)) != null && type(list_ptr(list_ptr(b))) == glyph_node) { /* and it should be */ + if (list_ptr(b) != null && type(list_ptr(b)) == hlist_node && + list_ptr(list_ptr(b)) != null && + type(list_ptr(list_ptr(b))) == glyph_node) { /* and it should be */ last_ht = char_height(font(list_ptr(list_ptr(b))), character(list_ptr(list_ptr(b)))); @@ -1728,13 +1748,13 @@ return b; } -pointer get_delim_vbox(extinfo * ext, internal_font_number f, scaled v, +static pointer get_delim_vbox(extinfo * ext, internal_font_number f, scaled v, pointer att) { return get_delim_box(ext, f, v, att, vlist_node); } -pointer get_delim_hbox(extinfo * ext, internal_font_number f, scaled v, +static pointer get_delim_hbox(extinfo * ext, internal_font_number f, scaled v, pointer att) { return get_delim_box(ext, f, v, att, hlist_node); @@ -1759,7 +1779,9 @@ will be the height of its topmost component. */ -static void endless_loop_error(internal_font_number g, integer y) + + +static void endless_loop_error(internal_font_number g, int y) { char s[256]; char *hlp[] = { @@ -1773,15 +1795,15 @@ tex_error(s, hlp); } -static pointer var_delimiter(pointer d, integer s, scaled v, scaled *ic) +static pointer do_var_delimiter(pointer d, int s, scaled v, scaled * ic, boolean flat) { /* label found,continue; */ pointer b; /* the box that will be constructed */ internal_font_number f, g; /* best-so-far and tentative font codes */ - integer c, i, x, y; /* best-so-far and tentative character codes */ + int c, i, x, y; /* best-so-far and tentative character codes */ scaled u; /* height-plus-depth of a tentative character */ scaled w; /* largest height-plus-depth so far */ - integer z; /* runs through font family members */ + int z; /* runs through font family members */ boolean large_attempt; /* are we trying the ``large'' variant? */ pointer att; /* to save the current attribute list */ extinfo *ext; @@ -1811,7 +1833,10 @@ c = y; goto FOUND; } - u = height_plus_depth(g, y); + if (flat) + u = char_width(g, y); + else + u = height_plus_depth(g, y); if (u > w) { f = g; c = y; @@ -1849,117 +1874,49 @@ */ ext = NULL; if ((char_tag(f, c) == ext_tag) && - ((ext = get_charinfo_vert_variants(char_info(f, c))) != NULL)) { - b = get_delim_vbox(ext, f, v, att); - width(b) += char_italic(f, c); + ((!flat && (ext = get_charinfo_vert_variants(char_info(f, c))) != NULL) || + (flat && (ext = get_charinfo_hor_variants(char_info(f, c))) != NULL))) { + b = (flat ? get_delim_hbox(ext, f, v, att) : get_delim_vbox(ext, f, v, att)); } else { b = char_box(f, c, att); } - if (ic!=NULL) + /* This next test is because for OT MATH fonts, the italic correction of an + extensible character is only used for the placement of a subscript + (in negated form), and it is not supposed to be added to the + width of the character box at all. + + This has an effect later on in |make_op| as well, where it has to do + an extra correction for |make_script|'s addition of yet another italic + correction. + */ + if (!is_new_mathfont(f)) { + width(b) += char_italic(f, c); + } + if (ic != NULL) *ic = char_italic(f, c); } else { b = new_null_box(); reset_attributes(b, att); - width(b) = null_delimiter_space; /* use this width if no delimiter was found */ - if (ic!=NULL) + width(b) = ( flat ? 0 : null_delimiter_space); /* use this width if no delimiter was found */ + if (ic != NULL) *ic = 0; } - shift_amount(b) = half(height(b) - depth(b)) - math_axis(s); + if (!flat) + shift_amount(b) = half(height(b) - depth(b)) - math_axis(s); delete_attribute_ref(att); return b; } -pointer flat_var_delimiter(pointer d, integer s, scaled v) + +static pointer var_delimiter(pointer d, int s, scaled v, scaled * ic) { - /* label found,continue; */ - pointer b; /* the box that will be constructed */ - internal_font_number f, g; /* best-so-far and tentative font codes */ - integer c, i, x, y; /* best-so-far and tentative character codes */ - scaled u; /* height-plus-depth of a tentative character */ - scaled w; /* largest height-plus-depth so far */ - integer z; /* runs through font family members */ - boolean large_attempt; /* are we trying the ``large'' variant? */ - pointer att; /* to save the current attribute list */ - extinfo *ext; - f = null_font; - c = 0; - w = 0; - att = null; - large_attempt = false; - if (d == null) - goto FOUND; - z = small_fam(d); - x = small_char(d); - i = 0; - while (true) { - /* The search process is complicated slightly by the facts that some of the - characters might not be present in some of the fonts, and they might not - be probed in increasing order of height. */ - if ((z != 0) || (x != 0)) { - g = fam_fnt(z, s); - if (g != null_font) { - y = x; - CONTINUE: - i++; - if (char_exists(g, y)) { - if (char_tag(g, y) == ext_tag) { - f = g; - c = y; - goto FOUND; - } - u = char_width(g, y); - if (u > w) { - f = g; - c = y; - w = u; - if (u >= v) - goto FOUND; - } - if (i > 10000) { - /* endless loop */ - endless_loop_error(g, y); - goto FOUND; - } - if (char_tag(g, y) == list_tag) { - y = char_remainder(g, y); - goto CONTINUE; - } - } - } - } - if (large_attempt) - goto FOUND; /* there were none large enough */ - large_attempt = true; - z = large_fam(d); - x = large_char(d); - } - FOUND: - if (d != null) { - att = node_attr(d); - node_attr(d) = null; - flush_node(d); - } - if (f != null_font) { - /* When the following code is executed, |char_tag(q)| will be equal to - |ext_tag| if and only if a built-up symbol is supposed to be returned. - */ - ext = NULL; - if ((char_tag(f, c) == ext_tag) && - ((ext = get_charinfo_hor_variants(char_info(f, c))) != NULL)) { - b = get_delim_hbox(ext, f, v, att); - width(b) += char_italic(f, c); - } else { - b = char_box(f, c, att); - } - } else { - b = new_null_box(); - reset_attributes(b, att); - width(b) = 0; /* use this width if no delimiter was found */ - } - delete_attribute_ref(att); - return b; + return do_var_delimiter(d, s, v, ic, false); } +static pointer flat_delimiter(pointer d, int s, scaled v) +{ + return do_var_delimiter(d, s, v, NULL, true); +} /* The next subroutine is much simpler; it is used for numerators and @@ -1977,7 +1934,7 @@ kern is inserted. */ -pointer rebox(pointer b, scaled w) +static pointer rebox(pointer b, scaled w) { pointer p, q, r, att; /* temporary registers for list manipulation */ internal_font_number f; /* font in a one-character box */ @@ -2028,10 +1985,10 @@ #define mu_mult(A) mult_and_add(n,(A),xn_over_d((A),f,unity),max_dimen) -pointer math_glue(pointer g, scaled m) +static pointer math_glue(pointer g, scaled m) { pointer p; /* the new glue specification */ - integer n; /* integer part of |m| */ + int n; /* integer part of |m| */ scaled f; /* fraction part of |m| */ n = x_over_n(m, unity); f = tex_remainder; @@ -2059,9 +2016,9 @@ the value of the math unit. */ -void math_kern(pointer p, scaled m) +static void math_kern(pointer p, scaled m) { - integer n; /* integer part of |m| */ + int n; /* integer part of |m| */ scaled f; /* fraction part of |m| */ if (subtype(p) == mu_glue) { n = x_over_n(m, unity); @@ -2075,30 +2032,7 @@ } } -/* - \TeX's most important routine for dealing with formulas is called -|mlist_to_hlist|. After a formula has been scanned and represented as an -mlist, this routine converts it to an hlist that can be placed into a box -or incorporated into the text of a paragraph. There are three implicit -parameters, passed in global variables: |cur_mlist| points to the first -node or noad in the given mlist (and it might be |null|); |cur_style| is a -style code; and |mlist_penalties| is |true| if penalty nodes for potential -line breaks are to be inserted into the resulting hlist. After -|mlist_to_hlist| has acted, |vlink(temp_head)| points to the translated hlist. - -Since mlists can be inside mlists, the procedure is recursive. And since this -is not part of \TeX's inner loop, the program has been written in a manner -that stresses compactness over efficiency. -@^recursion@> -*/ - -pointer cur_mlist; /* beginning of mlist to be translated */ -integer cur_style; /* style code at current place in the list */ -integer cur_size; /* size code corresponding to |cur_style| */ -scaled cur_mu; /* the math unit width corresponding to |cur_size| */ -boolean mlist_penalties; /* should |mlist_to_hlist| insert penalties? */ - -void run_mlist_to_hlist(halfword p, integer mstyle, boolean penalties) +void run_mlist_to_hlist(halfword p, int mstyle, boolean penalties) { int callback_id; int a, sfix; @@ -2128,16 +2062,12 @@ lua_settop(L, sfix); vlink(temp_head) = a; } else if (callback_id == 0) { - cur_mlist = p; - cur_style = mstyle; - mlist_penalties = penalties; - mlist_to_hlist(); + mlist_to_hlist_args(p, mstyle, penalties); } else { vlink(temp_head) = null; } } - /* @ The recursion in |mlist_to_hlist| is due primarily to a subroutine called |clean_box| that puts a given noad field into a box using a given @@ -2150,33 +2080,32 @@ sense that its |shift_amount| is zero. */ -pointer clean_box(pointer p, integer s) +static pointer clean_box(pointer p, int s) { pointer q; /* beginning of a list to be boxed */ - integer save_style; /* |cur_style| to be restored */ + int save_style; /* |cur_style| to be restored */ pointer x; /* box to be returned */ pointer r; /* temporary pointer */ + pointer mlist = null; /* beginning of mlist to be translated */ switch (type(p)) { case math_char_node: - cur_mlist = new_noad(); + mlist = new_noad(); r = math_clone(p); - nucleus(cur_mlist) = r; + nucleus(mlist) = r; break; case sub_box_node: q = math_list(p); goto FOUND; break; case sub_mlist_node: - cur_mlist = math_list(p); + mlist = math_list(p); break; default: q = new_null_box(); goto FOUND; } save_style = cur_style; - cur_style = s; - mlist_penalties = false; - mlist_to_hlist(); + mlist_to_hlist_args(mlist, s, false); q = vlink(temp_head); /* recursive call */ cur_style = save_style; /* restore the style */ setup_cur_size_and_mu(); @@ -2220,9 +2149,9 @@ /* The outputs of |fetch| are placed in global variables. */ internal_font_number cur_f; /* the |font| field of a |math_char| */ -integer cur_c; /* the |character| field of a |math_char| */ +int cur_c; /* the |character| field of a |math_char| */ -void fetch(pointer a) +static void fetch(pointer a) { /* unpack the |math_char| field |a| */ cur_c = math_character(a); cur_f = fam_fnt(math_fam(a), cur_size); @@ -2266,7 +2195,7 @@ penalties between nodes. */ -void assign_new_hlist(pointer q, pointer r) +static void assign_new_hlist(pointer q, pointer r) { switch (type(q)) { case fraction_noad: @@ -2300,7 +2229,7 @@ simple ones. */ -void make_over(pointer q) +static void make_over(pointer q) { pointer p; p = overbar(clean_box(nucleus(q), cramped_style(cur_style)), @@ -2311,7 +2240,7 @@ type(nucleus(q)) = sub_box_node; } -void make_under(pointer q) +static void make_under(pointer q) { pointer p, x, y, r; /* temporary registers for box construction */ scaled delta; /* overall height plus depth */ @@ -2330,7 +2259,7 @@ type(nucleus(q)) = sub_box_node; } -void make_vcenter(pointer q) +static void make_vcenter(pointer q) { pointer v; /* the box that should be centered vertically */ scaled delta; /* its height plus depth */ @@ -2353,7 +2282,7 @@ placed so that the actual clearance is |psi| plus half the excess. */ -void make_radical(pointer q) +static void make_radical(pointer q) { pointer x, y, p; /* temporary registers for box construction */ scaled delta, clr, theta, h; /* dimensions involved in the calculation */ @@ -2440,12 +2369,12 @@ /* this has the |nucleus| box |x| as a limit above an extensible delimiter |y| */ -void make_over_delimiter(pointer q) +static void make_over_delimiter(pointer q) { pointer x, y, v; /* temporary registers for box construction */ scaled shift_up, shift_down, clr, delta; x = clean_box(nucleus(q), sub_style(cur_style)); - y = flat_var_delimiter(left_delimiter(q), cur_size, width(x)); + y = flat_delimiter(left_delimiter(q), cur_size, width(x)); left_delimiter(q) = null; fixup_widths(x, y); shift_up = over_delimiter_bgap(cur_style); @@ -2463,12 +2392,12 @@ /* this has the extensible delimiter |x| as a limit above |nucleus| box |y| */ -void make_delimiter_over(pointer q) +static void make_delimiter_over(pointer q) { pointer x, y, v; /* temporary registers for box construction */ scaled shift_up, shift_down, clr, delta; y = clean_box(nucleus(q), cur_style); - x = flat_var_delimiter(left_delimiter(q), + x = flat_delimiter(left_delimiter(q), cur_size + (cur_size == script_script_size ? 0 : 1), width(y)); left_delimiter(q) = null; @@ -2489,12 +2418,12 @@ /* this has the extensible delimiter |y| as a limit below a |nucleus| box |x| */ -void make_delimiter_under(pointer q) +static void make_delimiter_under(pointer q) { pointer x, y, v; /* temporary registers for box construction */ scaled shift_up, shift_down, clr, delta; x = clean_box(nucleus(q), cur_style); - y = flat_var_delimiter(left_delimiter(q), + y = flat_delimiter(left_delimiter(q), cur_size + (cur_size == script_script_size ? 0 : 1), width(x)); left_delimiter(q) = null; @@ -2515,12 +2444,12 @@ /* this has the extensible delimiter |x| as a limit below |nucleus| box |y| */ -void make_under_delimiter(pointer q) +static void make_under_delimiter(pointer q) { pointer x, y, v; /* temporary registers for box construction */ scaled shift_up, shift_down, clr, delta; y = clean_box(nucleus(q), sup_style(cur_style)); - x = flat_var_delimiter(left_delimiter(q), cur_size, width(y)); + x = flat_delimiter(left_delimiter(q), cur_size, width(y)); left_delimiter(q) = null; fixup_widths(x, y); shift_up = 0; /* over_delimiter_bgap(cur_style); */ @@ -2546,7 +2475,7 @@ #define TOP_CODE 1 #define BOT_CODE 2 -void do_make_math_accent(pointer q, internal_font_number f, integer c, +static void do_make_math_accent(pointer q, internal_font_number f, int c, int top_or_bot) { pointer p, r, x, y; /* temporary registers for box construction */ @@ -2599,7 +2528,7 @@ } else if (char_tag(f, c) != list_tag) { break; } else { - integer yy = char_remainder(f, c); + int yy = char_remainder(f, c); if (!char_exists(f, yy)) break; if (char_width(f, yy) > w) @@ -2684,7 +2613,7 @@ type(nucleus(q)) = sub_box_node; } -void make_math_accent(pointer q) +static void make_math_accent(pointer q) { if (accent_chr(q) != null) { fetch(accent_chr(q)); @@ -2709,7 +2638,7 @@ |new_hlist(q)| directly rather than making a sub-box. */ -void make_fraction(pointer q) +static void make_fraction(pointer q) { pointer p, v, x, y, z; /* temporary registers for box construction */ scaled delta, delta1, delta2, shift_up, shift_down, clr; @@ -2809,11 +2738,11 @@ |new_hlist(q)| will already contain the desired final box. */ -scaled make_op(pointer q) +static scaled make_op(pointer q) { scaled delta; /* offset between subscript and superscript */ pointer p, v, x, y, z; /* temporary registers for box construction */ - integer c; /* register for character examination */ + int c; /* register for character examination */ scaled shift_up, shift_down; /* dimensions for box calculation */ scaled ok_size; if ((subtype(q) == op_noad_type_normal) && (cur_style < text_style)) @@ -2828,8 +2757,19 @@ small_fam(y) = math_fam(nucleus(q)); small_char(y) = math_character(nucleus(q)); x = var_delimiter(y, text_size, ok_size, &delta); - if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) - width(x) = width(x) - delta; /* remove italic correction */ + if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) { + width(x) -= delta; /* remove italic correction */ + } + /* For an OT MATH font, we may have to get rid of yet another italic + correction because make_scripts() will add one. + This test is somewhat more complicated because |x| can be a null + delimiter */ + if ((subscr(q) != null || supscr(q) != null) + && (subtype(q) != op_noad_type_limits) + && ((list_ptr(x) != null) && (type(list_ptr(x)) == glyph_node) + && is_new_mathfont(font(list_ptr(x))))) { + width(x) -= delta; /* remove another italic correction */ + } } else { ok_size = height_plus_depth(cur_f, cur_c) + 1; while ((char_tag(cur_f, cur_c) == list_tag) && @@ -2956,9 +2896,9 @@ No boundary characters enter into these ligatures. */ -void make_ord(pointer q) +static void make_ord(pointer q) { - integer a; /* the left-side character for lig/kern testing */ + int a; /* the left-side character for lig/kern testing */ pointer p, r, s; /* temporary registers for list manipulation */ scaled k; /* a kern */ liginfo lig; /* a ligature */ @@ -3066,7 +3006,7 @@ actual images say */ -scaled math_kern_at(internal_font_number f, integer c, int side, int v) +static scaled math_kern_at(internal_font_number f, int c, int side, int v) { int h, k, numkerns; scaled *kerns_heights; @@ -3110,9 +3050,9 @@ } -scaled -find_math_kern(internal_font_number l_f, integer l_c, - internal_font_number r_f, integer r_c, int cmd, scaled shift) +static scaled +find_math_kern(internal_font_number l_f, int l_c, + internal_font_number r_f, int r_c, int cmd, scaled shift) { scaled corr_height_top = 0, corr_height_bot = 0; scaled krn_l = 0, krn_r = 0, krn = 0; @@ -3164,7 +3104,8 @@ } /* just a small helper */ -pointer attach_hkern_to_new_hlist(pointer q, scaled delta2) +static pointer +attach_hkern_to_new_hlist(pointer q, scaled delta2) { pointer y; pointer z = new_kern(delta2); @@ -3234,7 +3175,7 @@ } #endif -void make_scripts(pointer q, pointer p, scaled it) +static void make_scripts(pointer q, pointer p, scaled it) { pointer x, y, z; /* temporary registers for box construction */ scaled shift_up, shift_down, clr; /* dimensions in the calculation */ @@ -3415,8 +3356,7 @@ so they will have consistent sizes. */ -small_number make_left_right(pointer q, integer style, scaled max_d, - scaled max_hv) +static small_number make_left_right(pointer q, int style, scaled max_d, scaled max_hv) { scaled delta, delta1, delta2; /* dimensions used in the calculation */ pointer tmp; @@ -3545,7 +3485,7 @@ #define both_types(A,B) ((A)*16+(B)) -pointer math_spacing_glue(int l_type, int r_type, int mstyle) +static pointer math_spacing_glue(int l_type, int r_type, int mstyle) { int x = -1; pointer z = null; @@ -3641,31 +3581,65 @@ } +static pointer check_nucleus_complexity (halfword q, scaled *delta) +{ + int save_style; /* holds |cur_style| during recursion */ + pointer p = null; + switch (type(nucleus(q))) { + case math_char_node: + case math_text_char_node: + fetch(nucleus(q)); + if (char_exists(cur_f, cur_c)) { + *delta = char_italic(cur_f, cur_c); + p = new_glyph(cur_f, cur_c); + reset_attributes(p, node_attr(nucleus(q))); + if ((type(nucleus(q)) == math_text_char_node) + && (space(cur_f) != 0)) + *delta = 0; /* no italic correction in mid-word of text font */ + if ((subscr(q) == null) && (supscr(q) == null) && (*delta != 0)) { + pointer x = new_kern(*delta); + reset_attributes(x, node_attr(nucleus(q))); + vlink(p) = x; + *delta = 0; + } + } + break; + case sub_box_node: + p = math_list(nucleus(q)); + break; + case sub_mlist_node: + save_style = cur_style; + mlist_to_hlist_args(math_list(nucleus(q)), cur_style, false); /* recursive call */ + cur_style = save_style; + setup_cur_size_and_mu(); + p = hpack(vlink(temp_head), 0, additional, -1); + reset_attributes(p, node_attr(nucleus(q))); + break; + default: + confusion("mlist2"); /* this can't happen mlist2 */ + } + return p; +} /* Here is the overall plan of |mlist_to_hlist|, and the list of its local variables. */ -void mlist_to_hlist(void) +static void mlist_to_hlist(pointer mlist, boolean penalties) { - pointer mlist; /* beginning of the given list */ - boolean penalties; /* should penalty nodes be inserted? */ - integer style; /* the given style */ - integer save_style; /* holds |cur_style| during recursion */ pointer q; /* runs through the mlist */ pointer r; /* the most recent noad preceding |q| */ - integer r_type; /* the |type| of noad |r|, or |op_noad| if |r=null| */ - integer r_subtype; /* the |subtype| of noad |r| if |r_type| is |fence_noad| */ - integer t; /* the effective |type| of noad |q| during the second pass */ - integer t_subtype; /* the effective |subtype| of noad |q| during the second pass */ + int style; + int r_type; /* the |type| of noad |r|, or |op_noad| if |r=null| */ + int r_subtype; /* the |subtype| of noad |r| if |r_type| is |fence_noad| */ + int t; /* the effective |type| of noad |q| during the second pass */ + int t_subtype; /* the effective |subtype| of noad |q| during the second pass */ pointer p, x, y, z; /* temporary registers for list construction */ - integer pen; /* a penalty to be inserted */ - integer s; /* the size of a noad to be deleted */ + int pen; /* a penalty to be inserted */ + int s; /* the size of a noad to be deleted */ scaled max_hl, max_d; /* maximum height and depth of the list translated so far */ scaled delta; /* italic correction offset for subscript and superscript */ - mlist = cur_mlist; - penalties = mlist_penalties; - style = cur_style; /* tuck global parameters away as local variables */ + style = cur_style; /* tuck global parameter away as local variable */ q = mlist; r = null; r_type = simple_noad; @@ -3867,48 +3841,13 @@ @^subscripts@> @^superscripts@> */ - switch (type(nucleus(q))) { - case math_char_node: - case math_text_char_node: - fetch(nucleus(q)); - if (char_exists(cur_f, cur_c)) { - delta = char_italic(cur_f, cur_c); - p = new_glyph(cur_f, cur_c); - reset_attributes(p, node_attr(nucleus(q))); - if ((type(nucleus(q)) == math_text_char_node) - && (space(cur_f) != 0)) - delta = 0; /* no italic correction in mid-word of text font */ - if ((subscr(q) == null) && (supscr(q) == null) && (delta != 0)) { - x = new_kern(delta); - reset_attributes(x, node_attr(nucleus(q))); - vlink(p) = x; - delta = 0; - } - } else { - p = null; - } - break; - case sub_box_node: - p = math_list(nucleus(q)); - break; - case sub_mlist_node: - cur_mlist = math_list(nucleus(q)); - save_style = cur_style; - mlist_penalties = false; - mlist_to_hlist(); /* recursive call */ - cur_style = save_style; - setup_cur_size_and_mu(); - p = hpack(vlink(temp_head), 0, additional, -1); - reset_attributes(p, node_attr(nucleus(q))); - break; - default: - confusion("mlist2"); /* this can't happen mlist2 */ - } + p = check_nucleus_complexity(q, &delta); + if ((subscr(q) == null) && (supscr(q) == null)) { assign_new_hlist(q, p); - goto CHECK_DIMENSIONS; + } else { + make_scripts(q, p, delta); /* top, bottom */ } - make_scripts(q, p, delta); /* top, bottom */ CHECK_DIMENSIONS: z = hpack(new_hlist(q), 0, additional, -1); if (height(z) > max_hl) @@ -4070,3 +4009,11 @@ free_node(r, get_node_size(type(r), subtype(r))); } } + +void mlist_to_hlist_args(pointer n, int w, boolean m) +{ + cur_style = w; + mlist_to_hlist(n, m); +} + + diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/mlist.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/mlist.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/mlist.h 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/mlist.h 2009-12-24 18:51:05.000000000 +0000 @@ -18,24 +18,18 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: mlist.h 2899 2009-07-21 23:03:53Z oneiros $ */ +/* $Id: mlist.h 3265 2009-12-18 16:21:40Z taco $ */ #ifndef MLIST_H # define MLIST_H 1 -extern pointer cur_mlist; -extern integer cur_style; -extern boolean mlist_penalties; -extern integer cur_size; +extern int cur_size; -void run_mlist_to_hlist(halfword, integer, boolean); -void fixup_math_parameters(integer fam_id, integer size_id, integer f, - integer lvl); +extern void run_mlist_to_hlist(halfword, int, boolean); +extern void fixup_math_parameters(int fam_id, int size_id, int f, int lvl); +extern scaled get_math_quad(int a); -scaled get_math_quad(int a); -boolean check_necessary_fonts(void); - -void mlist_to_hlist(void); +extern void mlist_to_hlist_args(halfword, int, boolean); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/nesting.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/nesting.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/nesting.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/nesting.c 2009-12-24 18:51:05.000000000 +0000 @@ -27,7 +27,7 @@ #define count(A) eqtb[count_base+(A)].cint static const char _svn_version[] = - "$Id: nesting.c 2859 2009-07-15 12:37:51Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/nesting.c $"; + "$Id: nesting.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/nesting.c $"; /* \TeX\ is typically in the midst of building many lists at once. For example, @@ -64,7 +64,7 @@ mode and |cur_cmd| is the current command code. */ -void print_mode(integer m) +void print_mode(int m) { /* prints the mode represented by |m| */ if (m > 0) { switch (m / (max_command_cmd + 1)) { @@ -101,7 +101,7 @@ } } -void print_in_mode(integer m) +void print_in_mode(int m) { /* prints the mode represented by |m| */ if (m > 0) { switch (m / (max_command_cmd + 1)) { @@ -138,9 +138,9 @@ } } -integer get_mode_id(void) +int get_mode_id(void) { /* returns the mode represented by |m| */ - integer m = cur_list.mode_field; + int m = cur_list.mode_field; if (m > 0) { switch (m / (max_command_cmd + 1)) { case 0: @@ -250,7 +250,7 @@ int nest_ptr; /* first unused location of |nest| */ int max_nest_stack; /* maximum of |nest_ptr| when pushing */ list_state_record cur_list; /* the ``top'' semantic state */ -integer shown_mode; /* most recent mode shown by \.{\\tracingcommands} */ +int shown_mode; /* most recent mode shown by \.{\\tracingcommands} */ halfword save_tail; /* save |tail| so we can examine whether we have an auto kern before a glue */ @@ -356,10 +356,10 @@ void show_activities(void) { int p; /* index into |nest| */ - integer m; /* mode */ + int m; /* mode */ memory_word a; /* auxiliary */ halfword q, r; /* for showing the current page */ - integer t; /* ditto */ + int t; /* ditto */ nest[nest_ptr] = cur_list; /* put the top level into the array */ tprint_nl(""); print_ln(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/nesting.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/nesting.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/nesting.h 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/nesting.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: nesting.h 2693 2009-06-29 15:40:43Z taco $ */ +/* $Id: nesting.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef NESTING_H # define NESTING_H @@ -28,30 +28,30 @@ # define mmode (hmode+max_command_cmd+1) /* math mode */ -extern void print_mode(integer m); -extern void print_in_mode(integer m); -extern integer get_mode_id(void); +extern void print_mode(int m); +extern void print_in_mode(int m); +extern int get_mode_id(void); # define ignore_depth -65536000 /* magic dimension value to mean `ignore me' */ typedef struct list_state_record_ { - integer mode_field; + int mode_field; halfword head_field; halfword tail_field; halfword eTeX_aux_field; - integer pg_field; - integer ml_field; + int pg_field; + int ml_field; memory_word aux_field; halfword dirs_field; - integer math_field; - integer math_style_field; + int math_field; + int math_style_field; } list_state_record; extern list_state_record *nest; extern int nest_ptr; extern int max_nest_stack; extern list_state_record cur_list; -extern integer shown_mode; +extern int shown_mode; extern halfword save_tail; extern void push_nest(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/packaging.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/packaging.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/packaging.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/packaging.c 2009-12-24 18:51:05.000000000 +0000 @@ -20,8 +20,8 @@ #include static const char _svn_version[] = - "$Id: packaging.c 3203 2009-12-01 10:18:20Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/packaging.c $"; + "$Id: packaging.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/packaging.c $"; #define scan_normal_dimen() scan_dimen(false,false,false) @@ -109,11 +109,11 @@ */ -void scan_full_spec(group_code c, integer spec_direction) +void scan_full_spec(group_code c, int spec_direction) { /* scans a box specification and left brace */ - integer s; /* temporarily saved value */ - integer i; - integer v; + int s; /* temporarily saved value */ + int i; + int v; int spec_code; halfword attr_list; s = 0; @@ -200,7 +200,7 @@ scaled total_stretch[5]; scaled total_shrink[5]; /* glue found by |hpack| or |vpack| */ -integer last_badness; /* badness of the most recently packaged box */ +int last_badness; /* badness of the most recently packaged box */ /* If the global variable |adjust_tail| is non-null, the |hpack| routine @@ -218,7 +218,7 @@ halfword pre_adjust_tail; -integer font_expand_ratio; /* current expansion ratio */ +int font_expand_ratio; /* current expansion ratio */ halfword last_leftmost_char; halfword last_rightmost_char; @@ -236,9 +236,9 @@ { internal_font_number k; scaled dw; - integer ef; + int ef; internal_font_number f; - integer c; + int c; f = font(p); c = character(p); k = pdf_font_stretch(f); @@ -255,9 +255,9 @@ { internal_font_number k; scaled dw; - integer ef; + int ef; internal_font_number f; - integer c; + int c; f = font(p); c = character(p); k = pdf_font_shrink(f); @@ -304,11 +304,11 @@ get_ef_code(font(l), character(l)), 1000); } -void do_subst_font(halfword p, integer ex_ratio) +void do_subst_font(halfword p, int ex_ratio) { internal_font_number f, k; halfword r; - integer ef; + int ef; if (type(p) == disc_node) { r = vlink(pre_break(p)); while (r != null) { @@ -369,7 +369,7 @@ scaled char_pw(halfword p, int side) { internal_font_number f; - integer c; + int c; if (side == left_side) last_leftmost_char = null; else @@ -420,8 +420,8 @@ internal_font_number f; /* the font in a |char_node| */ halfword dir_ptr; /* for managing the direction stack */ /* BEWARE: this shadows a global |dir_ptr| */ - integer hpack_dir; /* the current direction */ - integer disc_level; + int hpack_dir; /* the current direction */ + int disc_level; halfword pack_interrupt[8]; scaled font_stretch; scaled font_shrink; @@ -826,7 +826,7 @@ return r; } -halfword filtered_hpack(halfword p, halfword qt, scaled w, int m, integer grp, +halfword filtered_hpack(halfword p, halfword qt, scaled w, int m, int grp, int pac) { halfword q; @@ -840,12 +840,12 @@ /* here is a function to calculate the natural whd of a (horizontal) node list */ scaled_whd natural_sizes(halfword p, halfword pp, glue_ratio g_mult, - integer g_sign, integer g_order, int pack_direction) + int g_sign, int g_order, int pack_direction) { scaled s; /* shift amount */ halfword g; /* points to a glue specification */ internal_font_number f; /* the font in a |char_node| */ - integer hpack_dir; + int hpack_dir; scaled_whd xx; /* for recursion */ scaled_whd whd, siz = { 0, 0, 0 }; if (pack_direction == -1) { @@ -953,7 +953,7 @@ or the alignment finishing routine. */ -integer pack_begin_line; /* source file line where the current paragraph +int pack_begin_line; /* source file line where the current paragraph or alignment began; a negative value denotes alignment */ /* @@ -1196,7 +1196,7 @@ return r; } -halfword filtered_vpackage(halfword p, scaled h, int m, scaled l, integer grp, +halfword filtered_vpackage(halfword p, scaled h, int m, scaled l, int grp, int pack_direction) { halfword q; @@ -1221,7 +1221,7 @@ scaled h; /* height of box */ halfword p; /* first node in a box */ scaled d; /* max depth */ - integer grp; + int grp; grp = cur_group; d = box_max_depth; unsave(); @@ -1413,9 +1413,9 @@ halfword prev_p; /* if |p| is a glue node, |type(prev_p)| determines whether |p| is a legal breakpoint */ halfword q, r; /* glue specifications */ - integer pi; /* penalty value */ - integer b; /* badness at a trial breakpoint */ - integer least_cost; /* the smallest badness plus penalties found so far */ + int pi; /* penalty value */ + int b; /* badness at a trial breakpoint */ + int least_cost; /* the smallest badness plus penalties found so far */ halfword best_place; /* the most recent break that leads to |least_cost| */ scaled prev_dp; /* depth of previous box in the list */ int t; /* |type| of the node following a kern */ @@ -1583,7 +1583,7 @@ halfword vsplit(halfword n, scaled h) { /* extracts a page of height |h| from box |n| */ halfword v; /* the box to be split */ - integer vdir; /* the direction of the box to be split */ + int vdir; /* the direction of the box to be split */ halfword p; /* runs through the vlist */ halfword q; /* points to where the break occurs */ halfword i; /* for traversing marks lists */ @@ -1662,12 +1662,12 @@ box desired, and |cur_cmd=make_box|. */ -void begin_box(integer box_context) +void begin_box(int box_context) { halfword q; /* run through the current list */ halfword k; /* 0 or |vmode| or |hmode| */ - integer n; /* a box number */ - integer spec_direction = -1; + int n; /* a box number */ + int spec_direction = -1; switch (cur_chr) { case box_code: scan_register_num(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/packaging.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/packaging.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/packaging.h 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/packaging.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: packaging.h 3187 2009-11-22 22:29:05Z oneiros $ */ +/* $Id: packaging.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PACKAGING_H # define PACKAGING_H @@ -35,14 +35,14 @@ # define substituted 3 /* |subtype| of kern nodes that should be substituted */ extern void scan_spec(group_code c); -extern void scan_full_spec(group_code c, integer spec_direction); +extern void scan_full_spec(group_code c, int spec_direction); extern scaled total_stretch[5]; extern scaled total_shrink[5]; /* glue found by |hpack| or |vpack| */ -extern integer last_badness; /* badness of the most recently packaged box */ +extern int last_badness; /* badness of the most recently packaged box */ extern halfword adjust_tail; /* tail of adjustment list */ extern halfword pre_adjust_tail; -extern integer font_expand_ratio; /* current expansion ratio */ +extern int font_expand_ratio; /* current expansion ratio */ extern halfword last_leftmost_char; extern halfword last_rightmost_char; extern halfword next_char_p; /* pointer to the next char of an implicit kern */ @@ -53,7 +53,7 @@ extern scaled char_shrink(halfword p); extern scaled kern_stretch(halfword p); extern scaled kern_shrink(halfword p); -extern void do_subst_font(halfword p, integer ex_ratio); +extern void do_subst_font(halfword p, int ex_ratio); extern scaled char_pw(halfword p, int side); extern halfword new_margin_kern(scaled w, halfword p, int side); @@ -65,18 +65,18 @@ extern halfword hpack(halfword p, scaled w, int m, int d); extern halfword filtered_hpack(halfword p, halfword qt, scaled w, int m, - integer grp, int d); + int grp, int d); extern scaled_whd natural_sizes(halfword p, halfword pp, glue_ratio g_mult, - integer g_sign, integer g_order, int d); + int g_sign, int g_order, int d); -extern integer pack_begin_line; +extern int pack_begin_line; # define vpack(A,B,C,D) vpackage(A,B,C,max_dimen,D) /* special case of unconstrained depth */ extern halfword vpackage(halfword p, scaled h, int m, scaled l, int d); extern halfword filtered_vpackage(halfword p, scaled h, int m, scaled l, - integer grp, int d); + int grp, int d); extern void finish_vcenter(void); extern void package(int c); extern void append_to_vlist(halfword b); @@ -145,6 +145,6 @@ # define ship_out_flag (max_global_box_flag+1) /* context code for `\.{\\shipout}' */ # define leader_flag ship_out_flag+1 /* context code for `\.{\\leaders}' */ -extern void begin_box(integer box_context); +extern void begin_box(int box_context); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/postlinebreak.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/postlinebreak.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/postlinebreak.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/postlinebreak.c 2009-12-24 18:51:04.000000000 +0000 @@ -23,7 +23,7 @@ static const char _svn_version[] = - "$Id: postlinebreak.c 3212 2009-12-02 11:07:20Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/postlinebreak.c $"; + "$Id: postlinebreak.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/postlinebreak.c $"; /* So far we have gotten a little way into the |line_break| routine, having covered its important |try_break| subroutine. Now let's consider the @@ -100,7 +100,7 @@ boolean post_disc_break; /*and did it have a nonempty post-break part? */ scaled cur_width; /*width of line number |cur_line| */ scaled cur_indent; /*left margin of line number |cur_line| */ - integer pen; /*use when calculating penalties between lines */ + int pen; /*use when calculating penalties between lines */ halfword cur_p; /* cur_p, but localized */ halfword cur_line; /*the current line number being justified */ @@ -153,7 +153,7 @@ halfword nxt = vlink(temp_head); delete_attribute_ref(node_attr(tmp)); node_attr(tmp) = node_attr(temp_head); - add_node_attr_ref (node_attr(tmp)); + add_node_attr_ref(node_attr(tmp)); couple_nodes(temp_head, tmp); try_couple_nodes(tmp, nxt); /* \break\par */ } @@ -285,7 +285,7 @@ halfword s = new_dir(dir_dir(p) - 64); delete_attribute_ref(node_attr(s)); node_attr(s) = node_attr(r); - add_node_attr_ref (node_attr(s)); + add_node_attr_ref(node_attr(s)); couple_nodes(r, s); try_couple_nodes(s, e); r = s; @@ -327,7 +327,7 @@ k = new_margin_kern(-w, last_rightmost_char, right_side); delete_attribute_ref(node_attr(k)); node_attr(k) = node_attr(p); - add_node_attr_ref (node_attr(k)); + add_node_attr_ref(node_attr(k)); vlink(k) = vlink(ptmp); vlink(ptmp) = k; if (ptmp == q) @@ -342,7 +342,7 @@ vlink(r) = vlink(q); delete_attribute_ref(node_attr(r)); node_attr(r) = node_attr(q); - add_node_attr_ref (node_attr(r)); + add_node_attr_ref(node_attr(r)); vlink(q) = r; q = r; } @@ -384,7 +384,7 @@ k = new_margin_kern(-w, last_leftmost_char, left_side); delete_attribute_ref(node_attr(k)); node_attr(k) = node_attr(q); - add_node_attr_ref (node_attr(k)); + add_node_attr_ref(node_attr(k)); vlink(k) = q; q = k; } @@ -393,7 +393,7 @@ r = new_param_glue(left_skip_code); delete_attribute_ref(node_attr(r)); node_attr(r) = node_attr(q); - add_node_attr_ref (node_attr(r)); + add_node_attr_ref(node_attr(r)); vlink(r) = q; q = r; } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/primitive.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/primitive.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/primitive.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/primitive.c 2009-12-24 18:51:04.000000000 +0000 @@ -24,7 +24,7 @@ #include "primitive.h" static const char _svn_version[] = - "$Id: primitive.c 3218 2009-12-04 08:21:56Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/primitive.c $"; + "$Id: primitive.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/primitive.c $"; /* Control sequences are stored and retrieved by means of a fairly standard hash @@ -54,11 +54,11 @@ two_halves *hash; /* the hash table */ halfword hash_used; /* allocation pointer for |hash| */ -integer hash_extra; /* |hash_extra=hash| above |eqtb_size| */ +int hash_extra; /* |hash_extra=hash| above |eqtb_size| */ halfword hash_top; /* maximum of the hash array */ halfword hash_high; /* pointer to next high hash location */ boolean no_new_control_sequence; /* are new identifiers legal? */ -integer cs_count; /* total number of known identifiers */ +int cs_count; /* total number of known identifiers */ #define hash_is_full (hash_used==hash_base) /* test if all positions are occupied */ @@ -140,7 +140,7 @@ pointer prim_lookup(str_number s) { - integer h; /* hash code */ + int h; /* hash code */ pointer p; /* index in |hash| array */ unsigned char *j; unsigned l; @@ -188,7 +188,7 @@ boolean is_primitive(str_number csname) { - integer n, m; + int n, m; char *ss; m = prim_lookup(csname); ss = makecstring(csname); @@ -202,22 +202,22 @@ /* a few simple accessors */ -quarterword get_prim_eq_type(integer p) +quarterword get_prim_eq_type(int p) { return prim_eq_type(p); } -quarterword get_prim_origin(integer p) +quarterword get_prim_origin(int p) { return prim_origin(p); } -halfword get_prim_equiv(integer p) +halfword get_prim_equiv(int p) { return prim_equiv(p); } -str_number get_prim_text(integer p) +str_number get_prim_text(int p) { return prim_text(p); } @@ -334,7 +334,7 @@ void primitive(char *thes, quarterword c, halfword o, halfword off, int cmd_origin) { - integer prim_val; /* needed to fill |prim_eqtb| */ + int prim_val; /* needed to fill |prim_eqtb| */ str_number ss; assert(o >= off); ss = maketexstring(thes); @@ -379,15 +379,15 @@ p = hash_used; } } - saved_cur_length = cur_length; - saved_cur_string = cur_string; + saved_cur_length = cur_length; + saved_cur_string = cur_string; saved_cur_string_size = cur_string_size; reset_cur_string(); for (k = j; k <= j + l - 1; k++) append_char(*k); cs_text(p) = make_string(); - cur_length = saved_cur_length; - cur_string = saved_cur_string; + cur_length = saved_cur_length; + cur_string = saved_cur_string; cur_string_size = saved_cur_string_size; incr(cs_count); return p; @@ -405,9 +405,9 @@ */ -pointer id_lookup(integer j, integer l) +pointer id_lookup(int j, int l) { /* search the hash table */ - integer h; /* hash code */ + int h; /* hash code */ pointer p; /* index in |hash| array */ h = compute_hash((char *) (buffer + j), l, hash_prime); @@ -424,7 +424,7 @@ p = h + hash_base; /* we start searching here; note that |0<=h 0) - if (str_length(cs_text(p)) == (unsigned)l) + if (str_length(cs_text(p)) == (unsigned) l) if (str_eq_buf(cs_text(p), j)) goto FOUND; if (cs_next(p) == 0) { @@ -449,7 +449,7 @@ pointer string_lookup(char *s, size_t l) { /* search the hash table */ - integer h; /* hash code */ + int h; /* hash code */ pointer p; /* index in |hash| array */ h = compute_hash(s, l, hash_prime); p = h + hash_base; /* we start searching here; note that |0<=h. */ -/* $Id: primitive.h 2899 2009-07-21 23:03:53Z oneiros $ */ +/* $Id: primitive.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef LUATEX_PRIMITIVE_H # define LUATEX_PRIMITIVE_H 1 @@ -41,11 +41,11 @@ extern two_halves *hash; /* the hash table */ extern halfword hash_used; /* allocation pointer for |hash| */ -extern integer hash_extra; /* |hash_extra=hash| above |eqtb_size| */ +extern int hash_extra; /* |hash_extra=hash| above |eqtb_size| */ extern halfword hash_top; /* maximum of the hash array */ extern halfword hash_high; /* pointer to next high hash location */ extern boolean no_new_control_sequence; /* are new identifiers legal? */ -extern integer cs_count; /* total number of known identifiers */ +extern int cs_count; /* total number of known identifiers */ # define cs_next(a) hash[(a)].lhfield /* link for coalesced lists */ # define cs_text(a) hash[(a)].rh @@ -64,10 +64,10 @@ extern boolean is_primitive(str_number csname); -extern quarterword get_prim_eq_type(integer p); -extern halfword get_prim_equiv(integer p); -extern str_number get_prim_text(integer p); -extern quarterword get_prim_origin(integer p); +extern quarterword get_prim_eq_type(int p); +extern halfword get_prim_equiv(int p); +extern str_number get_prim_text(int p); +extern quarterword get_prim_origin(int p); extern void dump_primitives(void); extern void undump_primitives(void); @@ -87,6 +87,6 @@ extern void print_cmd_chr(quarterword cmd, halfword chr_code); extern pointer string_lookup(char *s, size_t l); -extern pointer id_lookup(integer j, integer l); +extern pointer id_lookup(int j, int l); #endif /* LUATEX_PRIMITIVE_H */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/printing.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/printing.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/printing.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/printing.c 2009-12-24 18:51:04.000000000 +0000 @@ -21,8 +21,8 @@ #include static const char _svn_version[] = - "$Id: printing.c 3224 2009-12-04 11:18:30Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/printing.c $"; + "$Id: printing.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/printing.c $"; #define font_id_text(A) cs_text(font_id_base+(A)) @@ -75,12 +75,12 @@ alpha_file log_file; /* transcript of \TeX\ session */ int selector = term_only; /* where to print a message */ int dig[23]; /* digits in a number being output */ -integer tally = 0; /* the number of characters recently printed */ +int tally = 0; /* the number of characters recently printed */ int term_offset = 0; /* the number of characters on the current terminal line */ int file_offset = 0; /* the number of characters on the current file line */ packed_ASCII_code trick_buf[(ssup_error_line + 1)]; /* circular buffer for pseudoprinting */ -integer trick_count; /* threshold for pseudoprinting, explained later */ -integer first_count; /* another variable for pseudoprinting */ +int trick_count; /* threshold for pseudoprinting, explained later */ +int first_count; /* another variable for pseudoprinting */ boolean inhibit_par_tokens = false; /* for minor adjustments to |show_token_list| */ /* To end a line of text output, we call |print_ln| */ @@ -223,9 +223,9 @@ to do the same substraction while typesetting. */ -void print(integer s) +void print(int s) { /* prints string |s| */ - unsigned char *j, *l; /* current character code position */ + unsigned char *j, *l; /* current character code position */ if (s >= str_ptr) { /* this can't happen */ @@ -285,7 +285,7 @@ return; } j = str_string(s); - l = j+str_length(s); + l = j + str_length(s); while (j < l) { /* 0x110000 in utf=8: 0xF4 0x90 0x80 0x80 */ /* I don't bother checking the last two bytes explicitly */ @@ -323,7 +323,7 @@ void tprint(char *s) { - unsigned char *ss = (unsigned char *)s; + unsigned char *ss = (unsigned char *) s; if (selector == new_string) { append_string(ss, strlen(s)); return; @@ -340,7 +340,7 @@ /* |slow_print| is the same as |print| nowadays, but the name is kept for now. */ -void slow_print(integer s) +void slow_print(int s) { /* prints string |s| */ print(s); } @@ -356,7 +356,7 @@ void print_banner(char *v, int e) { boolean res; - integer callback_id; + int callback_id; callback_id = callback_defined(start_run_callback); if (callback_id == 0) { fprintf(term_out, "This is LuaTeX, Version %s-%d", v, e); @@ -426,7 +426,7 @@ void print_esc(str_number s) { /* prints escape character, then |s| */ - integer c; /* the escape character code */ + int c; /* the escape character code */ /* Set variable |c| to the current escape character */ c = int_par(escape_char_code); if (c >= 0 && c < STRING_OFFSET) @@ -436,7 +436,7 @@ void tprint_esc(char *s) { /* prints escape character, then |s| */ - integer c; /* the escape character code */ + int c; /* the escape character code */ /* Set variable |c| to the current escape character */ c = int_par(escape_char_code); if (c >= 0 && c < STRING_OFFSET) @@ -500,7 +500,7 @@ a parameter in the range |0<=n<=99|. */ -void print_two(integer n) +void print_two(int n) { /* prints two least significant digits */ n = abs(n) % 100; print_char('0' + (n / 10)); @@ -511,7 +511,7 @@ Hexadecimal printing of nonnegative integers is accomplished by |print_hex|. */ -void print_hex(integer n) +void print_hex(int n) { /* prints a positive integer in hexadecimal form */ int k; /* index to current digit; we assume that $0\L n<16^{22}$ */ k = 0; @@ -531,7 +531,7 @@ \.{mcmxc}, not \.{mxm}. */ -void print_roman_int(integer n) +void print_roman_int(int n) { char *j, *k; /* mysterious indices */ nonnegative_integer u, v; /* mysterious numbers */ @@ -582,7 +582,7 @@ they may be unprintable. */ -void print_cs(integer p) +void print_cs(int p) { /* prints a purported control sequence */ str_number t = cs_text(p); if (p < hash_base) { /* nullcs */ @@ -648,7 +648,7 @@ followed by the name of finite units: */ -void print_glue(scaled d, integer order, char *s) +void print_glue(scaled d, int order, char *s) { /* prints a glue component */ print_scaled(d); if ((order < normal) || (order > filll)) { @@ -666,7 +666,7 @@ /* The next subroutine prints a whole glue specification */ -void print_spec(integer p, char *s) +void print_spec(int p, char *s) { /* prints a glue specification */ if (p < 0) { print_char('*'); @@ -704,7 +704,7 @@ font will be printed. */ -integer font_in_short_display; /* an internal font number */ +int font_in_short_display; /* an internal font number */ /* Boxes, rules, inserts, whatsits, marks, and things in general that are @@ -745,7 +745,7 @@ } } -void short_display(integer p) +void short_display(int p) { /* prints highlights of list |p| */ while (p != null) { if (is_char_node(p)) { @@ -776,7 +776,7 @@ its reference count, and one to print a rule dimension. */ -void print_font_and_char(integer p) +void print_font_and_char(int p) { /* prints |char_node| data */ if (!is_valid_font(font(p))) print_char('*'); @@ -786,7 +786,7 @@ print(character(p)); } -void print_mark(integer p) +void print_mark(int p) { /* prints token list data in braces */ print_char('{'); if ((p < fix_mem_min) || (p > fix_mem_end)) @@ -819,8 +819,8 @@ |breadth_max| had better be positive, or you won't see anything. */ -integer depth_threshold; /* maximum nesting depth in box displays */ -integer breadth_max; /* maximum number of items shown at the same list level */ +int depth_threshold; /* maximum nesting depth in box displays */ +int breadth_max; /* maximum number of items shown at the same list level */ /* The recursive machinery is started by calling |show_box|. */ @@ -841,9 +841,9 @@ /* Helper for debugging purposes */ -void short_display_n(integer p, integer m) +void short_display_n(int p, int m) { /* prints highlights of list |p| */ - integer i = 0; + int i = 0; font_in_short_display = null_font; if (p == null) return; @@ -894,9 +894,9 @@ that's a convenient module in which to put it.) */ -void print_csnames(integer hstart, integer hfinish) +void print_csnames(int hstart, int hfinish) { - integer h; + int h; unsigned char *c, *l; fprintf(stderr, "fmtdebug:csnames from %d to %d:", (int) hstart, (int) hfinish); @@ -904,8 +904,8 @@ if (cs_text(h) > 0) { /* if have anything at this position */ c = str_string(cs_text(h)); l = c + str_length(cs_text(h)); - while (c. */ -/* $Id: printing.h 3217 2009-12-03 16:52:01Z taco $ */ +/* $Id: printing.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef PRINTING_H # define PRINTING_H @@ -38,12 +38,12 @@ extern alpha_file log_file; extern int selector; extern int dig[23]; -extern integer tally; +extern int tally; extern int term_offset; extern int file_offset; extern packed_ASCII_code trick_buf[(ssup_error_line + 1)]; -extern integer trick_count; -extern integer first_count; +extern int trick_count; +extern int first_count; extern boolean inhibit_par_tokens; /* @@ -59,24 +59,24 @@ extern void print_ln(void); extern void print_char(int s); -extern void print(integer s); +extern void print(int s); extern void print_nl(str_number s); extern void print_nlp(void); -extern void slow_print(integer s); +extern void slow_print(int s); extern void print_banner(char *, int); extern void log_banner(char *, int); extern void print_version_banner(void); extern void print_esc(str_number s); extern void print_the_digs(eight_bits k); extern void print_int(longinteger n); -extern void print_two(integer n); -extern void print_hex(integer n); -extern void print_roman_int(integer n); +extern void print_two(int n); +extern void print_hex(int n); +extern void print_roman_int(int n); extern void print_current_string(void); # define print_font_name(A) tprint(font_name(A)) -extern void print_cs(integer p); +extern void print_cs(int p); extern void sprint_cs(pointer p); extern void tprint(char *s); extern void tprint_nl(char *s); @@ -99,21 +99,21 @@ # define active_cs_value(A) pool_to_unichar((str_string((A))+3)) -extern void print_glue(scaled d, integer order, char *s); /* prints a glue component */ -extern void print_spec(integer p, char *s); /* prints a glue specification */ +extern void print_glue(scaled d, int order, char *s); /* prints a glue component */ +extern void print_spec(int p, char *s); /* prints a glue specification */ -extern integer font_in_short_display; /* an internal font number */ +extern int font_in_short_display; /* an internal font number */ extern void print_font_identifier(internal_font_number f); -extern void short_display(integer p); /* prints highlights of list |p| */ -extern void print_font_and_char(integer p); /* prints |char_node| data */ -extern void print_mark(integer p); /* prints token list data in braces */ +extern void short_display(int p); /* prints highlights of list |p| */ +extern void print_font_and_char(int p); /* prints |char_node| data */ +extern void print_mark(int p); /* prints token list data in braces */ extern void print_rule_dimen(scaled d); /* prints dimension in rule node */ -extern integer depth_threshold; /* maximum nesting depth in box displays */ -extern integer breadth_max; /* maximum number of items shown at the same list level */ +extern int depth_threshold; /* maximum nesting depth in box displays */ +extern int breadth_max; /* maximum number of items shown at the same list level */ extern void show_box(halfword p); -extern void short_display_n(integer p, integer m); /* prints highlights of list |p| */ +extern void short_display_n(int p, int m); /* prints highlights of list |p| */ -extern void print_csnames(integer hstart, integer hfinish); +extern void print_csnames(int hstart, int hfinish); extern void print_file_line(void); extern void begin_diagnostic(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/scanning.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/scanning.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/scanning.c 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/scanning.c 2009-12-24 18:51:04.000000000 +0000 @@ -21,8 +21,8 @@ #include static const char _svn_version[] = - "$Id: scanning.c 3258 2009-12-16 10:40:36Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/scanning.c $"; + "$Id: scanning.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/scanning.c $"; @@ -144,8 +144,8 @@ Otherwise |cur_val| will contain the integer or scaled value in question. */ -integer cur_val; /* value returned by numeric scanners */ -integer cur_val1; /* delcodes are sometimes 51 digits */ +int cur_val; /* value returned by numeric scanners */ +int cur_val1; /* delcodes are sometimes 51 digits */ int cur_val_level; /* the ``level'' of this value */ #define scanned_result(A,B) do { \ @@ -207,7 +207,7 @@ halfword m; /* |chr_code| part of the operand token */ halfword q; /* general purpose index */ int p; /* index into |nest| */ - integer save_cur_chr; + int save_cur_chr; boolean succeeded = true; m = chr; switch (cmd) { @@ -641,7 +641,7 @@ { /* fetch an internal parameter */ halfword m; /* |chr_code| part of the operand token */ - integer n, k; /* accumulators */ + int n, k; /* accumulators */ RESTART: m = cur_chr; if (!short_scan_something_internal(cur_cmd, cur_chr, level, negative)) { @@ -913,7 +913,7 @@ void scan_fifty_one_bit_int(void) { - integer iiii; + int iiii; scan_int(); if ((cur_val < 0) || (cur_val > 0777777777)) { print_err("Bad delimiter code"); @@ -960,7 +960,7 @@ void scan_string_argument(void) { - integer s; + int s; scan_left_brace(); get_x_token(); while ((cur_cmd != right_brace_cmd)) { @@ -1011,7 +1011,7 @@ void scan_int(void) { /* sets |cur_val| to an integer */ boolean negative; /* should the answer be negated? */ - integer m; /* |$2^{31}$ / radix|, the threshold of danger */ + int m; /* |$2^{31}$ / radix|, the threshold of danger */ int d; /* the digit just scanned */ boolean vacuous; /* have no digits appeared? */ boolean OK_so_far; /* has an error message been issued? */ @@ -1163,7 +1163,7 @@ static void coerce_glue(void) { - integer v; + int v; if (cur_val_level >= glue_val_level) { v = width(cur_val); delete_glue_ref(cur_val); @@ -1206,13 +1206,13 @@ /* sets |cur_val| to a dimension */ { boolean negative; /* should the answer be negated? */ - integer f; /* numerator of a fraction whose denominator is $2^{16}$ */ + int f; /* numerator of a fraction whose denominator is $2^{16}$ */ /* Local variables for dimension calculations */ int num, denom; /* conversion ratio for the scanned units */ int k, kk; /* number of digits in a decimal fraction */ halfword p, q; /* top of decimal digit stack */ scaled v; /* an internal dimension */ - integer save_cur_val; /* temporary storage of |cur_val| */ + int save_cur_val; /* temporary storage of |cur_val| */ f = 0; arith_error = false; @@ -1555,7 +1555,7 @@ void scan_scaled(void) { /* sets |cur_val| to a scaled value */ boolean negative; /* should the answer be negated? */ - integer f; /* numerator of a fraction whose denominator is $2^{16}$ */ + int f; /* numerator of a fraction whose denominator is $2^{16}$ */ int k, kk; /* number of digits in a decimal fraction */ halfword p, q; /* top of decimal digit stack */ f = 0; @@ -1769,7 +1769,7 @@ intends to change the parameter value. */ -static void font_param_error(integer f) +static void font_param_error(int f) { print_err("Font "); print_esc(font_id_text(f)); @@ -1784,7 +1784,7 @@ void set_font_dimen(void) { internal_font_number f; - integer n; /* the parameter number */ + int n; /* the parameter number */ scan_int(); n = cur_val; scan_font_ident(); @@ -1811,7 +1811,7 @@ void get_font_dimen(void) { internal_font_number f; - integer n; /* the parameter number */ + int n; /* the parameter number */ scan_int(); n = cur_val; scan_font_ident(); @@ -2246,9 +2246,9 @@ |max_answer|. */ -integer add_or_sub(integer x, integer y, integer max_answer, boolean negative) +int add_or_sub(int x, int y, int max_answer, boolean negative) { - integer a; /* the answer */ + int a; /* the answer */ if (negative) negate(y); if (x >= 0) { @@ -2274,10 +2274,10 @@ $q=\lfloor n/d+{1\over2}\rfloor$, when $n$ and $d$ are positive. */ -integer quotient(integer n, integer d) +int quotient(int n, int d) { boolean negative; /* should the answer be negated? */ - integer a; /* the answer */ + int a; /* the answer */ if (d == 0) { num_error(a); } else { @@ -2315,14 +2315,14 @@ analogous to \MF's |make_fraction| and |take_fraction| routines. */ -integer fract(integer x, integer n, integer d, integer max_answer) +int fract(int x, int n, int d, int max_answer) { boolean negative; /* should the answer be negated? */ - integer a; /* the answer */ - integer f; /* a proper fraction */ - integer h; /* smallest integer such that |2*h>=d| */ - integer r; /* intermediate remainder */ - integer t; /* temp variable */ + int a; /* the answer */ + int f; /* a proper fraction */ + int h; /* smallest integer such that |2*h>=d| */ + int r; /* intermediate remainder */ + int t; /* temp variable */ if (d == 0) goto TOO_BIG; a = 0; @@ -2423,10 +2423,10 @@ int r; /* state of expression so far */ int s; /* state of term so far */ int o; /* next operation or type of next factor */ - integer e; /* expression so far */ - integer t; /* term so far */ - integer f; /* current factor */ - integer n; /* numerator of combined multiplication and division */ + int e; /* expression so far */ + int t; /* term so far */ + int f; /* current factor */ + int n; /* numerator of combined multiplication and division */ halfword p; /* top of expression stack */ halfword q; /* for stack manipulations */ l = cur_val_level; diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/scanning.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/scanning.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/scanning.h 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/scanning.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: scanning.h 2768 2009-07-07 07:08:11Z taco $ */ +/* $Id: scanning.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef SCANNING_H # define SCANNING_H @@ -36,8 +36,8 @@ extern void scan_left_brace(void); extern void scan_optional_equals(void); -extern integer cur_val; /* value returned by numeric scanners */ -extern integer cur_val1; /* delcodes are sometimes 51 digits */ +extern int cur_val; /* value returned by numeric scanners */ +extern int cur_val1; /* delcodes are sometimes 51 digits */ extern int cur_val_level; /* the ``level'' of this value */ extern void scan_something_simple(halfword cmd, halfword subitem); @@ -101,10 +101,9 @@ extern void scan_normal_glue(void); extern void scan_mu_glue(void); -extern integer add_or_sub(integer x, integer y, integer max_answer, - boolean negative); -extern integer quotient(integer n, integer d); -extern integer fract(integer x, integer n, integer d, integer max_answer); +extern int add_or_sub(int x, int y, int max_answer, boolean negative); +extern int quotient(int n, int d); +extern int fract(int x, int n, int d, int max_answer); extern void scan_expr(void); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/stringpool.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/stringpool.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/stringpool.c 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/stringpool.c 2009-12-24 18:51:04.000000000 +0000 @@ -21,7 +21,7 @@ #include static const char _svn_version[] = - "$Id: stringpool.c 3258 2009-12-16 10:40:36Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/stringpool.c $"; + "$Id: stringpool.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/stringpool.c $"; /* Control sequence names and diagnostic messages are variable-length strings @@ -61,7 +61,7 @@ unsigned char *cur_string; /* current string buffer */ unsigned cur_length; /* current index in that buffer */ unsigned cur_string_size; /* malloced size of |cur_string| */ -unsigned pool_size; /* occupied byte count */ +unsigned pool_size; /* occupied byte count */ /* Once a sequence of characters has been appended to |cur_string|, it @@ -70,22 +70,23 @@ value. */ -void reset_cur_string (void) +void reset_cur_string(void) { cur_length = 0; cur_string_size = 255; - cur_string = (unsigned char *)xmalloc(256); - memset(cur_string,0,256); + cur_string = (unsigned char *) xmalloc(256); + memset(cur_string, 0, 256); } /* current string enters the pool */ str_number make_string(void) { if (str_ptr == (max_strings + STRING_OFFSET)) - overflow("number of strings", max_strings - init_str_ptr + STRING_OFFSET); + overflow("number of strings", + max_strings - init_str_ptr + STRING_OFFSET); str_room(1); - cur_string[cur_length] = '\0'; /* now |lstring.s| is always a valid C string */ - str_string(str_ptr) = (unsigned char *)cur_string; + cur_string[cur_length] = '\0'; /* now |lstring.s| is always a valid C string */ + str_string(str_ptr) = (unsigned char *) cur_string; str_length(str_ptr) = cur_length; pool_size += cur_length; reset_cur_string(); @@ -184,10 +185,10 @@ } while (0) -static integer buffer_to_unichar(integer k) +static int buffer_to_unichar(int k) { - integer a; /* a utf char */ - integer b; /* a utf nibble */ + int a; /* a utf char */ + int b; /* a utf nibble */ b = buffer[k]; if (b < 0x80) { a = b; @@ -228,9 +229,9 @@ return a; } -integer pool_to_unichar(unsigned char *t) +int pool_to_unichar(unsigned char *t) { - return (integer) str2uni(t); + return (int) str2uni(t); } @@ -242,9 +243,9 @@ it tends to return |true| about 80 percent of the time. */ -boolean str_eq_buf(str_number s, integer k) +boolean str_eq_buf(str_number s, int k) { /* test equality of strings */ - integer a; /* a unicode character */ + int a; /* a unicode character */ if (s < STRING_OFFSET) { a = buffer_to_unichar(k); if (a != s) @@ -267,8 +268,8 @@ boolean str_eq_str(str_number s, str_number t) { /* test equality of strings */ - integer a = 0; /* a utf char */ - unsigned char *j, *k, *l; /* running indices */ + int a = 0; /* a utf char */ + unsigned char *j, *k, *l; /* running indices */ if (s < STRING_OFFSET) { if (t >= STRING_OFFSET) { k = str_string(t); @@ -346,7 +347,7 @@ str_number search_string(str_number search) { str_number s; /* running index */ - unsigned len; /* length of searched string */ + unsigned len; /* length of searched string */ len = str_length(search); if (len == 0) { return get_nullstr(); @@ -374,11 +375,11 @@ { if (s == NULL || l == 0) return get_nullstr(); - str_string(str_ptr) = xmalloc(l+1); - memcpy(str_string(str_ptr),s,(l+1)); - str_length(str_ptr) = (unsigned)l; + str_string(str_ptr) = xmalloc(l + 1); + memcpy(str_string(str_ptr), s, (l + 1)); + str_length(str_ptr) = (unsigned) l; str_ptr++; - return (str_ptr -1); + return (str_ptr - 1); } /* append a C string to a TeX string */ @@ -386,68 +387,70 @@ { if (s == NULL || *s == 0) return; - l = strlen((char *)s); + l = strlen((char *) s); str_room(l); - memcpy(cur_string+cur_length, s, l); + memcpy(cur_string + cur_length, s, l); cur_length += l; return; } -char *makecstring(integer s) +char *makecstring(int s) { size_t l; return makeclstring(s, &l); } -char *makeclstring(integer s, size_t * len) +char *makeclstring(int s, size_t * len) { - if (s0) - dump_things(*str_string(j),str_length(j)); + if (l > 0) + dump_things(*str_string(j), str_length(j)); } - return (k-STRING_OFFSET); + return (k - STRING_OFFSET); } -int undump_string_pool (void) { +int undump_string_pool(void) +{ int j; - integer x; + int x; undump_int(str_ptr); if (max_strings < str_ptr + strings_free) max_strings = str_ptr + strings_free; str_ptr += STRING_OFFSET; if (ini_version) libcfree(string_pool); - init_string_pool_array (max_strings); - for (j=STRING_OFFSET+1;j=0) { - str_length(j) = (unsigned)x; + if (x >= 0) { + str_length(j) = (unsigned) x; pool_size += x; - str_string(j) = xmallocarray(unsigned char, (unsigned)(x+1)); - undump_things(*str_string(j),(unsigned)x); - *(str_string(j)+str_length(j)) = '\0'; + str_string(j) = xmallocarray(unsigned char, (unsigned) (x + 1)); + undump_things(*str_string(j), (unsigned) x); + *(str_string(j) + str_length(j)) = '\0'; } else { str_length(j) = 0; } @@ -456,7 +459,7 @@ return str_ptr; } -void init_string_pool_array (int s) +void init_string_pool_array(int s) { string_pool = xmallocarray(lstring, s); _string_pool = string_pool - STRING_OFFSET; @@ -471,13 +474,12 @@ void flush_str(str_number s) { /* printf("Flushing a string: %s (s=%d,str_ptr=%d)\n", (char *)str_string(s), (int)s, (int)str_ptr); */ - if (s > STRING_OFFSET) { /* don't ever delete the null string */ + if (s > STRING_OFFSET) { /* don't ever delete the null string */ pool_size -= str_length(s); str_length(s) = 0; - xfree (str_string(s)); + xfree(str_string(s)); str_string(s) = NULL; } - while (str_string((str_ptr-1))==NULL) + while (str_string((str_ptr - 1)) == NULL) str_ptr--; } - diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/stringpool.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/stringpool.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/stringpool.h 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/stringpool.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: stringpool.h 3221 2009-12-04 10:49:35Z taco $ */ +/* $Id: stringpool.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef STRINGPOOL_H # define STRINGPOOL_H @@ -73,9 +73,9 @@ extern unsigned char *cur_string; extern unsigned cur_length; extern unsigned cur_string_size; -extern unsigned pool_size; +extern unsigned pool_size; -#define EXTRA_STRING 500 +# define EXTRA_STRING 500 /* put |ASCII_code| \# at the end of |str_pool| */ # define append_char(A) do { \ @@ -97,17 +97,17 @@ } \ } while (0) -# define flush_char() --cur_length /* forget the last character in the pool */ +# define flush_char() --cur_length /* forget the last character in the pool */ extern str_number make_string(void); -extern boolean str_eq_buf(str_number s, integer k); +extern boolean str_eq_buf(str_number s, int k); extern boolean str_eq_str(str_number s, str_number t); extern boolean str_eq_cstr(str_number, char *, size_t); extern boolean get_strings_started(void); -extern void reset_cur_string (void); +extern void reset_cur_string(void); extern str_number search_string(str_number search); -extern integer pool_to_unichar(unsigned char *t); +extern int pool_to_unichar(unsigned char *t); extern unsigned char *uni2str(unsigned); extern unsigned str2uni(unsigned char *); @@ -116,13 +116,13 @@ extern str_number maketexlstring(const char *, size_t); extern void append_string(unsigned char *s, unsigned l); -extern char *makecstring(integer); -extern char *makeclstring(integer, size_t *); +extern char *makecstring(int); +extern char *makeclstring(int, size_t *); -extern int dump_string_pool (void); -extern int undump_string_pool (void); +extern int dump_string_pool(void); +extern int undump_string_pool(void); -extern void init_string_pool_array (int s); +extern void init_string_pool_array(int s); extern void flush_str(str_number s); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texdeffont.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/texdeffont.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texdeffont.c 2009-12-18 09:38:10.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texdeffont.c 2009-12-24 18:51:05.000000000 +0000 @@ -24,7 +24,7 @@ static const char _svn_version[] = - "$Id: texdeffont.c 2887 2009-07-17 16:04:51Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/texdeffont.c $"; + "$Id: texdeffont.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/texdeffont.c $"; /* @@ -34,7 +34,7 @@ the font. */ -integer font_bytes; +int font_bytes; void set_cur_font(internal_font_number f) { @@ -86,9 +86,9 @@ internal_font_number f; /* runs through existing fonts */ str_number t; /* name for the frozen font identifier */ int old_setting; /* holds |selector| setting */ - integer offset = 0; + int offset = 0; scaled s = -1000; /* stated ``at'' size, or negative of scaled magnification */ - integer natural_dir = -1; /* the natural direction of the font */ + int natural_dir = -1; /* the natural direction of the font */ if (job_name == 0) open_log_file(); /* avoid confusing \.{texput} with the font name */ get_r_token(); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texdeffont.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/texdeffont.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texdeffont.h 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texdeffont.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: texdeffont.h 2899 2009-07-21 23:03:53Z oneiros $ */ +/* $Id: texdeffont.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXDEFFONT_H # define TEXDEFFONT_H -extern integer font_bytes; +extern int font_bytes; extern void set_cur_font(internal_font_number f); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texfileio.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/texfileio.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texfileio.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texfileio.c 2009-12-24 18:51:05.000000000 +0000 @@ -24,8 +24,8 @@ #include static const char _svn_version[] = - "$Id: texfileio.c 3221 2009-12-04 10:49:35Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/texfileio.c $"; + "$Id: texfileio.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/texfileio.c $"; #define end_line_char int_par(end_line_char_code) @@ -83,8 +83,8 @@ Signalling this fact is achieved by having two arrays of integers. */ -integer *input_file_callback_id; -integer read_file_callback_id[17]; +int *input_file_callback_id; +int read_file_callback_id[17]; /* Handle -output-directory. We assume that it is OK to look here first. Possibly it @@ -271,9 +271,9 @@ boolean lua_a_open_in(alpha_file * f, char *fn, quarterword n) { - integer k; + int k; char *fnam; /* string returned by find callback */ - integer callback_id; + int callback_id; boolean ret = true; /* return value */ boolean file_ok = true; /* the status so far */ if (n == 0) { @@ -315,7 +315,7 @@ { boolean test; str_number fnam; - integer callback_id; + int callback_id; boolean ret = false; callback_id = callback_defined(find_write_file_callback); if (callback_id > 0) { @@ -336,7 +336,7 @@ { boolean test; str_number fnam; - integer callback_id; + int callback_id; boolean ret = false; callback_id = callback_defined(find_output_file_callback); if (callback_id > 0) { @@ -356,7 +356,7 @@ void lua_a_close_in(alpha_file f, quarterword n) { /* close a text file */ boolean ret; - integer callback_id; + int callback_id; if (n == 0) callback_id = input_file_callback_id[iindex]; else @@ -396,9 +396,9 @@ */ packed_ASCII_code *buffer; /* lines of characters being read */ -integer first; /* the first unused position in |buffer| */ -integer last; /* end of the line just input to |buffer| */ -integer max_buf_stack; /* largest index used in |buffer| */ +int first; /* the first unused position in |buffer| */ +int last; /* end of the line just input to |buffer| */ +int max_buf_stack; /* largest index used in |buffer| */ /* The |lua_input_ln| function brings the next line of input from the specified @@ -445,8 +445,8 @@ boolean lua_input_ln(alpha_file f, quarterword n, boolean bypass_eoln) { boolean lua_result; - integer last_ptr; - integer callback_id; + int last_ptr; + int callback_id; (void) bypass_eoln; /* todo: variable can be removed */ if (n == 0) callback_id = input_file_callback_id[iindex]; @@ -593,7 +593,7 @@ void term_input(void) { /* gets a line from the terminal */ - integer k; /* index into |buffer| */ + int k; /* index into |buffer| */ update_terminal(); /* now the user sees the prompt for sure */ if (!input_ln(term_in, true)) fatal_error("End of file on the terminal!"); @@ -692,16 +692,16 @@ char *pack_file_name(str_number n, str_number a, str_number e) { ASCII_code c; /* character being packed */ - unsigned char *j; /* index into |str_pool| */ - integer k = 0; /* number of positions filled in |fn| */ + unsigned char *j; /* index into |str_pool| */ + int k = 0; /* number of positions filled in |fn| */ unsigned char *fn = xmallocarray(packed_ASCII_code, str_length(a) + str_length(n) + str_length(e) + 1); - for (j = str_string(a); j < str_string(a)+str_length(a); j++) + for (j = str_string(a); j < str_string(a) + str_length(a); j++) append_to_fn(*j); - for (j = str_string(n); j < str_string(n)+str_length(n); j++) + for (j = str_string(n); j < str_string(n) + str_length(n); j++) append_to_fn(*j); - for (j = str_string(e); j < str_string(e)+str_length(e); j++) + for (j = str_string(e); j < str_string(e) + str_length(e); j++) append_to_fn(*j); fn[k] = 0; return (char *) fn; @@ -793,7 +793,7 @@ except of course for a short time just after |job_name| has become nonzero. */ -unsigned char *texmf_log_name; /* full name of the log file */ +unsigned char *texmf_log_name; /* full name of the log file */ /* The |open_log_file| routine is used to open the transcript file and to help @@ -831,7 +831,7 @@ selector = term_only; fn = prompt_file_name("transcript file name", ".log"); } - texmf_log_name = (unsigned char *)xstrdup(fn); + texmf_log_name = (unsigned char *) xstrdup(fn); selector = log_only; log_opened = true; if (callback_defined(start_run_callback) == 0) { @@ -894,12 +894,12 @@ /* |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) + 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); + tprint_file_name(NULL, (unsigned char *) fullnameoffile, NULL); } incr(open_parens); update_terminal(); @@ -1028,7 +1028,7 @@ /* the caller sets tfm_buffer=NULL and tfm_size=0 */ -int readbinfile(FILE * f, unsigned char **tfm_buffer, integer * tfm_size) +int readbinfile(FILE * f, unsigned char **tfm_buffer, int *tfm_size) { void *buf; int size; @@ -1039,7 +1039,7 @@ if (fseek(f, 0, SEEK_SET) == 0) { if (fread((void *) buf, size, 1, f) == 1) { *tfm_buffer = (unsigned char *) buf; - *tfm_size = (integer) size; + *tfm_size = (int) size; return 1; } } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texfileio.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/texfileio.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texfileio.h 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texfileio.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,13 +17,13 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: texfileio.h 3221 2009-12-04 10:49:35Z taco $ */ +/* $Id: texfileio.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXFILEIO_H # define TEXFILEIO_H -extern integer *input_file_callback_id; -extern integer read_file_callback_id[17]; +extern int *input_file_callback_id; +extern int read_file_callback_id[17]; extern char *luatex_find_file(char *s, int callback_index); extern char *luatex_find_read_file(char *s, int n, int callback_index); @@ -39,9 +39,9 @@ extern void lua_a_close_out(alpha_file f); extern packed_ASCII_code *buffer; -extern integer first; -extern integer last; -extern integer max_buf_stack; +extern int first; +extern int last; +extern int max_buf_stack; extern boolean lua_input_ln(alpha_file f, quarterword n, boolean bypass_eoln); @@ -113,7 +113,7 @@ extern str_number job_name; /* principal file name */ extern boolean log_opened; /* has the transcript file been opened? */ -extern unsigned char *texmf_log_name; /* full name of the log file */ +extern unsigned char *texmf_log_name; /* full name of the log file */ extern void open_log_file(void); extern void start_input(void); @@ -124,7 +124,7 @@ extern boolean zopen_w_output(FILE **, char *, const_string fopen_mode); extern void zwclose(FILE *); -extern int readbinfile(FILE * f, unsigned char **b, integer * s); +extern int readbinfile(FILE * f, unsigned char **b, int *s); # define read_tfm_file readbinfile # define read_vf_file readbinfile diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texmath.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/texmath.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texmath.c 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texmath.c 2009-12-24 18:51:05.000000000 +0000 @@ -21,8 +21,8 @@ #include static const char _svn_version[] = - "$Id: texmath.c 3217 2009-12-03 16:52:01Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/texmath.c $"; + "$Id: texmath.c 3264 2009-12-18 16:10:53Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/texmath.c $"; #define mode cur_list.mode_field #define head cur_list.head_field @@ -40,7 +40,7 @@ #define var_code 7 -extern void rawset_sa_item(sa_tree hed, integer n, integer v); +extern void rawset_sa_item(sa_tree hed, int n, int v); /* TODO: not sure if this is the right order */ #define back_error(A,B) do { \ @@ -177,15 +177,15 @@ static sa_tree math_fam_head = NULL; -integer fam_fnt(integer fam_id, integer size_id) +int fam_fnt(int fam_id, int size_id) { - integer n = fam_id + (256 * size_id); - return (integer) get_sa_item(math_fam_head, n); + int n = fam_id + (256 * size_id); + return (int) get_sa_item(math_fam_head, n); } -void def_fam_fnt(integer fam_id, integer size_id, integer f, integer lvl) +void def_fam_fnt(int fam_id, int size_id, int f, int lvl) { - integer n = fam_id + (256 * size_id); + int n = fam_id + (256 * size_id); set_sa_item(math_fam_head, n, f, lvl); fixup_math_parameters(fam_id, size_id, f, lvl); if (int_par(tracing_assigns_code) > 0) { @@ -201,14 +201,14 @@ } } -void unsave_math_fam_data(integer gl) +void unsave_math_fam_data(int gl) { sa_stack_item st; if (math_fam_head->stack == NULL) return; while (math_fam_head->stack_ptr > 0 && abs(math_fam_head->stack[math_fam_head->stack_ptr].level) - >= (integer) gl) { + >= (int) gl) { st = math_fam_head->stack[math_fam_head->stack_ptr]; if (st.level > 0) { rawset_sa_item(math_fam_head, st.code, st.value); @@ -242,7 +242,7 @@ void def_math_param(int param_id, int style_id, scaled value, int lvl) { - integer n = param_id + (256 * style_id); + int n = param_id + (256 * style_id); set_sa_item(math_param_head, n, value, lvl); if (int_par(tracing_assigns_code) > 0) { begin_diagnostic(); @@ -259,19 +259,19 @@ scaled get_math_param(int param_id, int style_id) { - integer n = param_id + (256 * style_id); + int n = param_id + (256 * style_id); return (scaled) get_sa_item(math_param_head, n); } -void unsave_math_param_data(integer gl) +void unsave_math_param_data(int gl) { sa_stack_item st; if (math_param_head->stack == NULL) return; while (math_param_head->stack_ptr > 0 && abs(math_param_head->stack[math_param_head->stack_ptr].level) - >= (integer) gl) { + >= (int) gl) { st = math_param_head->stack[math_param_head->stack_ptr]; if (st.level > 0) { rawset_sa_item(math_param_head, st.code, st.value); @@ -297,7 +297,7 @@ /* saving and unsaving of both */ -void unsave_math_data(integer gl) +void unsave_math_data(int gl) { unsave_math_fam_data(gl); unsave_math_param_data(gl); @@ -575,7 +575,7 @@ void print_delimiter(pointer p) { - integer a; + int a; if (small_fam(p) < 0) { print_int(-1); /* this should never happen */ } else if (small_fam(p) < 16 && large_fam(p) < 16 && @@ -610,7 +610,7 @@ void print_subsidiary_data(pointer p, ASCII_code c) { /* display a noad field */ - if ((int)cur_length >= depth_threshold) { + if ((int) cur_length >= depth_threshold) { if (p != null) tprint(" []"); } else { @@ -894,7 +894,7 @@ scaled l; /* new |display_width| */ scaled s; /* new |display_indent| */ pointer p; - integer n; /* scope of paragraph shape specification */ + int n; /* scope of paragraph shape specification */ if (head == tail || /* `\.{\\noindent\$\$}' or `\.{\$\${ }\$\$}' */ (vlink(head) == tail && /* the 2nd of \.{\$\${ }\$\$} \.{\$\${ }\$\$} */ type(tail) == whatsit_node && @@ -967,8 +967,8 @@ NULL }; delcodeval d; - integer cur_val1; /* and the global |cur_val| */ - integer mcls, msfam = 0, mschr = 0, mlfam = 0, mlchr = 0; + int cur_val1; /* and the global |cur_val| */ + int mcls, msfam = 0, mschr = 0, mlfam = 0, mlchr = 0; mcls = 0; if (extcode == tex_mathcode) { /* \delcode, this is the easiest */ scan_int(); @@ -1054,7 +1054,7 @@ void scan_extdef_del_code(int level, int extcode) { delcodeval d; - integer p; + int p; scan_char_num(); p = cur_val; scan_optional_equals(); @@ -1070,7 +1070,7 @@ NULL }; mathcodeval d; - integer mcls = 0, mfam = 0, mchr = 0; + int mcls = 0, mfam = 0, mchr = 0; if (extcode == tex_mathcode) { /* \mathcode */ /* "TFCC */ scan_int(); @@ -1137,7 +1137,7 @@ void scan_extdef_math_code(int level, int extcode) { mathcodeval d; - integer p; + int p; scan_char_num(); p = cur_val; scan_optional_equals(); @@ -1165,7 +1165,7 @@ * where the |\Umathchardef| is executed */ -mathcodeval mathchar_from_integer(integer value, int extcode) +mathcodeval mathchar_from_integer(int value, int extcode) { mathcodeval mval; mval.origin_value = extcode; @@ -1388,7 +1388,7 @@ */ -void scan_delimiter(pointer p, integer r) +void scan_delimiter(pointer p, int r) { delcodeval dval; if (r == tex_mathcode) { /* \radical */ @@ -1857,7 +1857,7 @@ unsave_math(); } if (t != right_noad_side) { - push_math(math_left_group, cur_style); + push_math(math_left_group, m_style); vlink(head) = q; tail = p; delim_ptr = p; @@ -2133,12 +2133,10 @@ void after_math(void) { - boolean danger; /* not enough symbol fonts are present */ - integer m; /* |mmode| or |-mmode| */ + int m; /* |mmode| or |-mmode| */ pointer p; /* the formula */ pointer a = null; /* box containing equation number */ boolean l = false; /* `\.{\\leqno}' instead of `\.{\\eqno}' */ - danger = check_necessary_fonts(); m = mode; p = fin_mlist(null); /* this pops the nest */ if (cur_cmd == math_shift_cs_cmd && @@ -2158,7 +2156,6 @@ assert(saved_type(0) == saved_eqno); if (saved_value(0) == 1) l = true; - danger = check_necessary_fonts(); m = mode; p = fin_mlist(null); } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texmath.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/texmath.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texmath.h 2009-12-18 09:38:12.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texmath.h 2009-12-24 18:51:05.000000000 +0000 @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: texmath.h 3214 2009-12-02 13:53:09Z taco $ */ +/* $Id: texmath.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXMATH_H # define TEXMATH_H 1 @@ -78,12 +78,11 @@ extern void scan_extdef_del_code(int level, int extcode); extern void scan_extdef_math_code(int level, int extcode); -extern integer fam_fnt(integer fam_id, integer size_id); -extern void def_fam_fnt(integer fam_id, integer size_id, integer f, - integer lvl); +extern int fam_fnt(int fam_id, int size_id); +extern void def_fam_fnt(int fam_id, int size_id, int f, int lvl); extern void dump_math_data(void); extern void undump_math_data(void); -void unsave_math_data(integer lvl); +void unsave_math_data(int lvl); /* @ We also need to compute the change in style between mlists and their diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texnodes.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/texnodes.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texnodes.c 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texnodes.c 2009-12-24 18:51:05.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: texnodes.c 3243 2009-12-10 12:51:06Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/texnodes.c $"; + "$Id: texnodes.c 3279 2009-12-21 19:46:33Z hhenkel $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/texnodes.c $"; #include #include "lua/luatex-api.h" @@ -52,14 +52,14 @@ halfword free_chain[MAX_CHAIN_SIZE] = { null }; -static integer my_prealloc = 0; +static int my_prealloc = 0; int fix_node_lists = 1; int free_error_seen = 0; int copy_error_seen = 0; -halfword slow_get_node(integer s); /* defined below */ +halfword slow_get_node(int s); /* defined below */ int copy_error(halfword p); /* define below */ #define fake_node 100 @@ -151,7 +151,7 @@ { "attr", "dir", "level", "dvi_ptr", "dvi_h", NULL }; char *node_fields_whatsit_pdf_literal[] = { "attr", "mode", "data", NULL }; -char *node_fields_whatsit_pdf_refobj[] = { "objnum", NULL }; +char *node_fields_whatsit_pdf_refobj[] = { "attr", "objnum", NULL }; char *node_fields_whatsit_pdf_refxform[] = { "attr", "width", "depth", "height", "objnum", NULL }; char *node_fields_whatsit_pdf_refximage[] = @@ -873,8 +873,8 @@ return; #ifdef DEBUG - fprintf(DEBUG_OUT, "Free-ing %s node %d\n", get_node_name(type(p), subtype(p)), - (int) p); + fprintf(DEBUG_OUT, "Free-ing %s node %d\n", + get_node_name(type(p), subtype(p)), (int) p); #endif if (free_error(p)) return; @@ -1389,7 +1389,7 @@ } } -halfword get_node(integer s) +halfword get_node(int s) { register halfword r; @@ -1421,7 +1421,7 @@ fprintf(stdout, "null;\n"); } -void free_node(halfword p, integer s) +void free_node(halfword p, int s) { if (p <= my_prealloc) { @@ -1447,7 +1447,7 @@ var_used -= s; /* maintain statistics */ } -void free_node_chain(halfword q, integer s) +void free_node_chain(halfword q, int s) { register halfword p = q; while (vlink(p) != null) { @@ -1466,7 +1466,7 @@ } -void init_node_mem(integer t) +void init_node_mem(int t) { my_prealloc = var_mem_stat_max; assert(whatsit_node_data[user_defined_node].id == user_defined_node); @@ -1611,7 +1611,7 @@ void undump_node_mem(void) { - integer x; + int x; undump_int(x); undump_int(rover); var_mem_max = (x < 100000 ? 100000 : x); @@ -1655,7 +1655,7 @@ # define test_rovers(a) #endif -halfword slow_get_node(integer s) +halfword slow_get_node(int s) { register int t; @@ -1818,7 +1818,7 @@ halfword j; char msg[256]; char *s; - integer free_chain_counts[MAX_CHAIN_SIZE] = { 0 }; + int free_chain_counts[MAX_CHAIN_SIZE] = { 0 }; snprintf(msg, 255, " %d words of node memory still in use:", (int) (var_used + my_prealloc)); tprint_nl(msg); @@ -2076,7 +2076,7 @@ attr_list_ref(q) = 1; node_attr(n) = q; } - p = vlink(p); + p = vlink(node_attr(n)); while (j-- > 0) p = vlink(p); t = attribute_value(p); @@ -2143,7 +2143,7 @@ } -void show_pdftex_whatsit_rule_spec(integer p) +void show_pdftex_whatsit_rule_spec(int p) { tprint("("); print_rule_dimen(height(p)); @@ -2174,7 +2174,7 @@ } -void show_whatsit_node(integer p) +void show_whatsit_node(int p) { switch (subtype(p)) { case open_node: @@ -2508,9 +2508,9 @@ flush_char(); \ } while (0) -void show_node_list(integer p) +void show_node_list(int p) { /* prints a node list symbolically */ - integer n; /* the number of items already printed at this level */ + int n; /* the number of items already printed at this level */ real g; /* a glue ratio, as a floating point number */ if ((int) cur_length > depth_threshold) { if (p > null) @@ -2879,7 +2879,7 @@ fast_delete_glue_ref(p); } -integer var_used; +int var_used; halfword temp_ptr; /* a pointer variable for occasional emergency use */ /* @@ -2891,7 +2891,7 @@ ended. */ -integer max_used_attr; /* maximum assigned attribute id */ +int max_used_attr; /* maximum assigned attribute id */ halfword attr_list_cache; /* @@ -3060,7 +3060,7 @@ @d y_displace(#)==vlink(#+4) { vertical displacement } */ -halfword new_glyph(integer f, integer c) +halfword new_glyph(int f, int c) { halfword p = null; /* the new node */ if ((f == 0) || (char_exists(f, c))) { @@ -3093,7 +3093,7 @@ |subtype_normal| by |new_ligkern|. */ -quarterword norm_min(integer h) +quarterword norm_min(int h) { if (h <= 0) return 1; @@ -3103,7 +3103,7 @@ return h; } -halfword new_char(integer f, integer c) +halfword new_char(int f, int c) { halfword p; /* the new node */ p = new_glyph_node(); @@ -3421,7 +3421,7 @@ be able to guess what comes next. */ -halfword new_penalty(integer m) +halfword new_penalty(int m) { halfword p; /* the new node */ p = new_node(penalty_node, 0); /* the |subtype| is not used */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/texnodes.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/texnodes.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/texnodes.h 2009-12-18 09:38:11.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/texnodes.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: texnodes.h 3217 2009-12-03 16:52:01Z taco $ */ +/* $Id: texnodes.h 3261 2009-12-18 11:38:21Z taco $ */ #include @@ -669,7 +669,7 @@ extern halfword new_span_node(halfword n, int c, scaled w); extern void print_short_node_contents(halfword n); -extern void show_node_list(integer i); +extern void show_node_list(int i); extern pointer actual_box_width(pointer r, scaled base_width); /* TH: these two defines still need checking. The node ordering in luatex is not @@ -739,19 +739,19 @@ extern halfword tail_of_list(halfword p); extern void delete_glue_ref(halfword p); -extern integer var_used; +extern int var_used; extern halfword temp_ptr; # define cache_disabled max_halfword -extern integer max_used_attr; +extern int max_used_attr; extern halfword attr_list_cache; extern halfword new_null_box(void); extern halfword new_rule(void); -extern halfword new_glyph(integer f, integer c); -extern quarterword norm_min(integer h); -extern halfword new_char(integer f, integer c); +extern halfword new_glyph(int f, int c); +extern quarterword norm_min(int h); +extern halfword new_char(int f, int c); extern scaled glyph_width(halfword p); extern scaled glyph_height(halfword p); extern scaled glyph_depth(halfword p); @@ -762,6 +762,6 @@ extern halfword new_glue(halfword q); extern halfword new_skip_param(int n); extern halfword new_kern(scaled w); -extern halfword new_penalty(integer m); +extern halfword new_penalty(int m); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/textcodes.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/textcodes.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/textcodes.c 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/textcodes.c 2009-12-24 18:51:04.000000000 +0000 @@ -24,7 +24,7 @@ static const char __svn_version[] = - "$Id: textcodes.c 2869 2009-07-16 11:31:18Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/textcodes.c $"; + "$Id: textcodes.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/textcodes.c $"; #define LCCODESTACK 8 #define LCCODEDEFAULT 0 @@ -45,12 +45,12 @@ #define CATCODEDEFAULT 12 -void set_lc_code(integer n, halfword v, quarterword gl) +void set_lc_code(int n, halfword v, quarterword gl) { set_sa_item(lccode_head, n, v, gl); } -halfword get_lc_code(integer n) +halfword get_lc_code(int n) { return (halfword) get_sa_item(lccode_head, n); } @@ -75,12 +75,12 @@ lccode_head = undump_sa_tree(); } -void set_uc_code(integer n, halfword v, quarterword gl) +void set_uc_code(int n, halfword v, quarterword gl) { set_sa_item(uccode_head, n, v, gl); } -halfword get_uc_code(integer n) +halfword get_uc_code(int n) { return (halfword) get_sa_item(uccode_head, n); } @@ -105,12 +105,12 @@ uccode_head = undump_sa_tree(); } -void set_sf_code(integer n, halfword v, quarterword gl) +void set_sf_code(int n, halfword v, quarterword gl) { set_sa_item(sfcode_head, n, v, gl); } -halfword get_sf_code(integer n) +halfword get_sf_code(int n) { return (halfword) get_sa_item(sfcode_head, n); } @@ -137,14 +137,14 @@ static sa_tree *catcode_heads = NULL; -static integer catcode_max = 0; +static int catcode_max = 0; static unsigned char *catcode_valid = NULL; #define CATCODE_MAX 65535 #define update_catcode_max(h) if (h > catcode_max) catcode_max = h -void set_cat_code(integer h, integer n, halfword v, quarterword gl) +void set_cat_code(int h, int n, halfword v, quarterword gl) { sa_tree s = catcode_heads[h]; update_catcode_max(h); @@ -155,7 +155,7 @@ set_sa_item(s, n, v, gl); } -halfword get_cat_code(integer h, integer n) +halfword get_cat_code(int h, int n) { sa_tree s = catcode_heads[h]; update_catcode_max(h); @@ -166,7 +166,7 @@ return (halfword) get_sa_item(s, n); } -void unsave_cat_codes(integer h, quarterword gl) +void unsave_cat_codes(int h, quarterword gl) { int k; update_catcode_max(h); @@ -176,7 +176,7 @@ } } -void clearcatcodestack(integer h) +void clearcatcodestack(int h) { clear_sa_stack(catcode_heads[h]); } @@ -215,7 +215,7 @@ static void undumpcatcodes(void) { - integer total, k, x; + int total, k, x; xfree(catcode_heads); xfree(catcode_valid); catcode_heads = Mxmalloc_array(sa_tree, (CATCODE_MAX + 1)); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/textcodes.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/textcodes.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/textcodes.h 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/textcodes.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,21 +17,21 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: textcodes.h 2899 2009-07-21 23:03:53Z oneiros $ */ +/* $Id: textcodes.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXTCODES_H # define TEXTCODES_H -void set_lc_code(integer n, halfword v, quarterword gl); -halfword get_lc_code(integer n); -void set_uc_code(integer n, halfword v, quarterword gl); -halfword get_uc_code(integer n); -void set_sf_code(integer n, halfword v, quarterword gl); -halfword get_sf_code(integer n); -void set_cat_code(integer h, integer n, halfword v, quarterword gl); -halfword get_cat_code(integer h, integer n); -void unsave_cat_codes(integer h, quarterword gl); +void set_lc_code(int n, halfword v, quarterword gl); +halfword get_lc_code(int n); +void set_uc_code(int n, halfword v, quarterword gl); +halfword get_uc_code(int n); +void set_sf_code(int n, halfword v, quarterword gl); +halfword get_sf_code(int n); +void set_cat_code(int h, int n, halfword v, quarterword gl); +halfword get_cat_code(int h, int n); +void unsave_cat_codes(int h, quarterword gl); int valid_catcode_table(int h); void initex_cat_codes(int h); void unsave_text_codes(quarterword grouplevel); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/textoken.c luatex-0.50.0/source/texk/web2c/luatexdir/tex/textoken.c --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/textoken.c 2009-12-18 09:38:08.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/textoken.c 2009-12-24 18:51:04.000000000 +0000 @@ -18,8 +18,8 @@ with LuaTeX; if not, see . */ static const char _svn_version[] = - "$Id: textoken.c 3248 2009-12-11 13:39:41Z taco $" - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/tex/textoken.c $"; + "$Id: textoken.c 3261 2009-12-18 11:38:21Z taco $" + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/tex/textoken.c $"; #include @@ -74,7 +74,7 @@ report these statistics when |tracing_stats| is sufficiently large. */ -integer var_used, dyn_used; /* how much memory is in use */ +int var_used, dyn_used; /* how much memory is in use */ halfword avail; /* head of the list of available one-word nodes */ halfword fix_mem_end; /* the last one-word node used in |mem| */ @@ -126,7 +126,7 @@ halfword get_avail(void) { /* single-word node allocation */ halfword p; /* the new node being got */ - integer t; + int t; p = avail; /* get top location in the |avail| stack */ if (p != null) { avail = token_link(avail); /* and pop it off */ @@ -309,15 +309,15 @@ a real control sequence named \.{BAD} would come out `\.{\\BAD\ }'. */ -void show_token_list(integer p, integer q, integer l) +void show_token_list(int p, int q, int l) { - integer m, c; /* pieces of a token */ + int m, c; /* pieces of a token */ ASCII_code match_chr; /* character used in a `|match|' */ ASCII_code n; /* the highest parameter number, as an ASCII digit */ match_chr = '#'; n = '0'; tally = 0; - if (l<0) + if (l < 0) l = 0x3FFFFFFF; while ((p != null) && (tally < l)) { if (p == q) { @@ -517,8 +517,8 @@ } flush_list(token_link(backup_head)); } - cur_cs = save_cur_cs; - return true; + cur_cs = save_cur_cs; + return true; } /* We can not return |undefined_control_sequence| under some conditions @@ -656,7 +656,7 @@ */ boolean force_eof; /* should the next \.{\\input} be aborted early? */ -integer luacstrings; /* how many lua strings are waiting to be input? */ +int luacstrings; /* how many lua strings are waiting to be input? */ /* If the user has set the |pausing| parameter to some positive value, @@ -669,7 +669,7 @@ void firm_up_the_line(void) { - integer k; /* an index into |buffer| */ + int k; /* an index into |buffer| */ ilimit = last; if (pausing > 0) { if (interaction > nonstop_mode) { @@ -1090,7 +1090,7 @@ buffer and the process is repeated, slowly but surely. */ -static boolean check_expanded_code(integer * kk); /* below */ +static boolean check_expanded_code(int *kk); /* below */ static int scan_control_sequence(void) { @@ -1100,7 +1100,7 @@ } else { register int cat; /* |cat_code(cur_chr)|, usually */ while (1) { - integer k = iloc; + int k = iloc; do_buffer_to_unichar(cur_chr, k); do_get_cat_code(cat); if (cat != letter_cmd || k > ilimit) { @@ -1144,7 +1144,7 @@ the buffer left two or three places. */ -static boolean check_expanded_code(integer * kk) +static boolean check_expanded_code(int *kk) { int l; int k = *kk; @@ -1545,11 +1545,11 @@ halfword p; /* tail of the token list */ halfword q; /* new node being added to the token list via |store_new_token| */ halfword t; /* token being appended */ - unsigned char *k; /* index into string */ + unsigned char *k; /* index into string */ p = temp_token_head; set_token_link(p, null); - k = (unsigned char *)b.s; - while (k < (unsigned char *)b.s+b.l) { + k = (unsigned char *) b.s; + while (k < (unsigned char *) b.s + b.l) { t = pool_to_unichar(k); k += utf8_size(t); if (t == ' ') { @@ -1585,7 +1585,7 @@ set_token_link(p, null); k = s.s; l = k + s.l; - while (ks = (unsigned char *)tokenlist_to_cstring(pp, inhibit_par, (int *) &(ret->l)); + ret->s = + (unsigned char *) tokenlist_to_cstring(pp, inhibit_par, + (int *) &(ret->l)); return ret; } diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/tex/textoken.h luatex-0.50.0/source/texk/web2c/luatexdir/tex/textoken.h --- luatex-0.47.0/source/texk/web2c/luatexdir/tex/textoken.h 2009-12-18 09:38:09.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/tex/textoken.h 2009-12-24 18:51:04.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: textoken.h 3229 2009-12-04 21:09:46Z hhenkel $ */ +/* $Id: textoken.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef TEXTOKEN_H # define TEXTOKEN_H @@ -42,7 +42,7 @@ # define end_match_token 0x1C00000 /* $2^{21}\cdot|end_match|$ */ # define protected_token 0x1C00001 /* $2^{21}\cdot|end_match|+1$ */ -#include "tex/stringpool.h" +# include "tex/stringpool.h" typedef struct smemory_word_ { halfword hhrh; @@ -64,7 +64,7 @@ extern void initialize_tokens(void); -extern integer dyn_used; +extern int dyn_used; # define token_info(a) fixmem[(a)].hhlh # define token_link(a) fixmem[(a)].hhrh @@ -99,7 +99,7 @@ extern void print_meaning(void); extern void flush_list(halfword p); -extern void show_token_list(integer p, integer q, integer l); +extern void show_token_list(int p, int q, int l); extern void token_show(halfword p); # define token_ref_count(a) token_info((a)) /* reference count preceding a token list */ @@ -141,7 +141,7 @@ extern halfword par_loc; extern halfword par_token; extern boolean force_eof; -extern integer luacstrings; +extern int luacstrings; extern void firm_up_the_line(void); extern void get_token(void); @@ -149,12 +149,12 @@ extern halfword str_toks(lstring b); extern void ins_the_toks(void); -extern integer scan_lua_state(void); +extern int scan_lua_state(void); extern void conv_toks(void); extern boolean in_lua_escape; extern boolean is_convert(halfword c); -extern str_number the_convert_string(halfword c, integer i); +extern str_number the_convert_string(halfword c, int i); # define closed 2 /* not open, or at end of file */ # define just_open 1 /* newly opened, first line not yet read */ @@ -164,7 +164,7 @@ extern void initialize_read(void); -extern void read_toks(integer n, halfword r, halfword j); +extern void read_toks(int n, halfword r, halfword j); extern str_number tokens_to_string(halfword p); /* return a string from tokens list */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/utils/avlstuff.c luatex-0.50.0/source/texk/web2c/luatexdir/utils/avlstuff.c --- luatex-0.47.0/source/texk/web2c/luatexdir/utils/avlstuff.c 2009-12-18 09:38:13.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/utils/avlstuff.c 2009-12-24 18:51:05.000000000 +0000 @@ -23,7 +23,7 @@ static const char __svn_version[] = "$Id: avlstuff.c 2817 2009-07-12 00:45:27Z oneiros $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/utils/avlstuff.c $"; + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/utils/avlstuff.c $"; /**********************************************************************/ /* memory management functions for AVL */ diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/utils/managed-sa.c luatex-0.50.0/source/texk/web2c/luatexdir/utils/managed-sa.c --- luatex-0.47.0/source/texk/web2c/luatexdir/utils/managed-sa.c 2009-12-18 09:38:13.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/utils/managed-sa.c 2009-12-24 18:51:05.000000000 +0000 @@ -21,9 +21,9 @@ #include static const char __svn_version[] = - "$Id: managed-sa.c 2899 2009-07-21 23:03:53Z oneiros $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/utils/managed-sa.c $"; + "$Id: managed-sa.c 3261 2009-12-18 11:38:21Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/utils/managed-sa.c $"; -static void store_sa_stack(sa_tree a, integer n, integer v, integer gl) +static void store_sa_stack(sa_tree a, int n, int v, int gl) { sa_stack_item st; st.code = n; @@ -39,7 +39,7 @@ a->stack[a->stack_ptr] = st; } -static void skip_in_stack(sa_tree a, integer n) +static void skip_in_stack(sa_tree a, int n) { int p = a->stack_ptr; if (a->stack == NULL) @@ -52,7 +52,7 @@ } } -sa_tree_item get_sa_item(const sa_tree head, const integer n) +sa_tree_item get_sa_item(const sa_tree head, const int n) { register int h; register int m; @@ -68,7 +68,7 @@ return head->dflt; } -void set_sa_item(sa_tree head, integer n, sa_tree_item v, integer gl) +void set_sa_item(sa_tree head, int n, sa_tree_item v, int gl) { int h, m, l; int i; @@ -98,7 +98,7 @@ head->tree[h][m][l] = v; } -void rawset_sa_item(sa_tree head, integer n, integer v) +void rawset_sa_item(sa_tree head, int n, int v) { head->tree[HIGHPART_PART(n)][MIDPART_PART(n)][LOWPART_PART(n)] = v; } @@ -173,7 +173,7 @@ |a->tree[0][0][x]| being close together in actual memory locations */ -sa_tree new_sa_tree(integer size, sa_tree_item dflt) +sa_tree new_sa_tree(int size, sa_tree_item dflt) { sa_tree_head *a; a = (sa_tree_head *) xmalloc(sizeof(sa_tree_head)); @@ -187,7 +187,7 @@ return (sa_tree) a; } -void restore_sa_stack(sa_tree head, integer gl) +void restore_sa_stack(sa_tree head, int gl) { sa_stack_item st; if (head->stack == NULL) @@ -242,7 +242,7 @@ sa_tree undump_sa_tree(void) { - integer x; + int x; int h, m, l; boolean f; sa_tree a = (sa_tree) Mxmalloc_array(sa_tree_head, 1); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/utils/managed-sa.h luatex-0.50.0/source/texk/web2c/luatexdir/utils/managed-sa.h --- luatex-0.47.0/source/texk/web2c/luatexdir/utils/managed-sa.h 2009-12-18 09:38:13.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/utils/managed-sa.h 2009-12-24 18:51:05.000000000 +0000 @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: managed-sa.h 2860 2009-07-15 15:51:22Z taco $ */ +/* $Id: managed-sa.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef MANAGED_SA_H # define MANAGED_SA_H 1 @@ -60,10 +60,10 @@ typedef sa_tree_head *sa_tree; -extern sa_tree_item get_sa_item(const sa_tree head, const integer n); -extern void set_sa_item(sa_tree head, integer n, sa_tree_item v, integer gl); +extern sa_tree_item get_sa_item(const sa_tree head, const int n); +extern void set_sa_item(sa_tree head, int n, sa_tree_item v, int gl); -extern sa_tree new_sa_tree(integer size, sa_tree_item dflt); +extern sa_tree new_sa_tree(int size, sa_tree_item dflt); extern sa_tree copy_sa_tree(sa_tree head); extern void destroy_sa_tree(sa_tree head); @@ -71,7 +71,7 @@ extern void dump_sa_tree(sa_tree a); extern sa_tree undump_sa_tree(void); -extern void restore_sa_stack(sa_tree a, integer gl); +extern void restore_sa_stack(sa_tree a, int gl); extern void clear_sa_stack(sa_tree a); #endif diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/utils/synctex.c luatex-0.50.0/source/texk/web2c/luatexdir/utils/synctex.c --- luatex-0.47.0/source/texk/web2c/luatexdir/utils/synctex.c 2009-12-18 09:38:13.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/utils/synctex.c 2009-12-24 18:51:05.000000000 +0000 @@ -239,18 +239,18 @@ synctex_fprintf_t fprintf; /* either fprintf or gzprintf */ char *busy_name; /* the real "foo.synctex(busy)" or "foo.synctex.gz(busy)" name */ char *root_name; /* in general jobname.tex */ - integer count; /* The number of interesting records in "foo.synctex" */ + int count; /* The number of interesting records in "foo.synctex" */ /* next concern the last sync record encountered */ halfword node; /* the last synchronized node, must be set * before the recorder */ synctex_recorder_t recorder;/* the recorder of the node above, the * routine that knows how to record the * node to the .synctex file */ - integer tag, line; /* current tag and line */ - integer curh, curv; /* current point */ - integer magnification; /* The magnification as given by \mag */ - integer unit; /* The unit, defaults to 1, use 8192 to produce shorter but less accurate info */ - integer total_length; /* The total length of the bytes written since the last check point */ + int tag, line; /* current tag and line */ + int curh, curv; /* current point */ + int magnification; /* The magnification as given by \mag */ + int unit; /* The unit, defaults to 1, use 8192 to produce shorter but less accurate info */ + int total_length; /* The total length of the bytes written since the last check point */ struct _flags { unsigned int option_read:1; /* Command line option read (in case of problem or at the end) */ unsigned int off:1; /* Definitely turn off synctex, corresponds to cli option -synctex=0 */ @@ -321,7 +321,7 @@ } static inline int synctex_record_preamble(void); -static inline int synctex_record_input(integer tag, char *name); +static inline int synctex_record_input(int tag, char *name); static char *synctex_suffix = ".synctex"; static char *synctex_suffix_gz = ".gz"; @@ -587,12 +587,12 @@ static inline int synctex_record_content(void); static inline int synctex_record_settings(void); -static inline int synctex_record_sheet(integer sheet); +static inline int synctex_record_sheet(int sheet); /* Recording the "{..." line. In *tex.web, use synctex_sheet(pdf_output) at * the very beginning of the ship_out procedure. */ -void synctex_sheet(integer mag) +void synctex_sheet(int mag) { SYNCTEX_RETURN_IF_DISABLED; #if SYNCTEX_DEBUG @@ -630,7 +630,7 @@ return; } -static inline int synctex_record_teehs(integer sheet); +static inline int synctex_record_teehs(int sheet); /* Recording the "}..." line. In *tex.web, use synctex_teehs at * the very end of the ship_out procedure. @@ -1067,7 +1067,7 @@ } /* Recording a "Input:..." line */ -static inline int synctex_record_input(integer tag, char *name) +static inline int synctex_record_input(int tag, char *name) { size_t len = 0; #if SYNCTEX_DEBUG > 999 @@ -1116,7 +1116,7 @@ } /* Recording a "{..." line */ -static inline int synctex_record_sheet(integer sheet) +static inline int synctex_record_sheet(int sheet) { #if SYNCTEX_DEBUG > 999 printf("\nSynchronize DEBUG: synctex_record_sheet\n"); @@ -1134,7 +1134,7 @@ } /* Recording a "}..." line */ -static inline int synctex_record_teehs(integer sheet) +static inline int synctex_record_teehs(int sheet) { #if SYNCTEX_DEBUG > 999 printf("\nSynchronize DEBUG: synctex_record_teehs\n"); diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/utils/synctex.h luatex-0.50.0/source/texk/web2c/luatexdir/utils/synctex.h --- luatex-0.47.0/source/texk/web2c/luatexdir/utils/synctex.h 2009-12-18 09:38:13.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/utils/synctex.h 2009-12-24 18:51:05.000000000 +0000 @@ -55,7 +55,7 @@ /* Recording the "{..." line. In *tex.web, use synctex_sheet(pdf_output) at * the very beginning of the ship_out procedure. */ -extern void synctex_sheet(integer mag); +extern void synctex_sheet(int mag); /* Recording the "}..." line. In *tex.web, use synctex_teehs at * the very end of the ship_out procedure. diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/utils/utils.c luatex-0.50.0/source/texk/web2c/luatexdir/utils/utils.c --- luatex-0.47.0/source/texk/web2c/luatexdir/utils/utils.c 2009-12-18 09:38:13.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/utils/utils.c 2009-12-24 18:51:05.000000000 +0000 @@ -49,8 +49,8 @@ #endif static const char __svn_version[] = - "$Id: utils.c 3217 2009-12-03 16:52:01Z taco $ " - "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.47.0/source/texk/web2c/luatexdir/utils/utils.c $"; + "$Id: utils.c 3261 2009-12-18 11:38:21Z taco $ " + "$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.50.0/source/texk/web2c/luatexdir/utils/utils.c $"; #define check_nprintf(size_get, size_want) \ if ((unsigned)(size_get) >= (unsigned)(size_want)) \ @@ -61,8 +61,8 @@ extern string ptexbanner; /* from web2c/lib/texmfmp.c */ extern string versionstring; /* from web2c/lib/version.c */ extern KPSEDLL string kpathsea_version_string; /* from kpathsea/version.c */ -integer epochseconds; -integer microseconds; +int epochseconds; +int microseconds; extern PDF static_pdf; @@ -362,7 +362,7 @@ |scaled_out| is the number of scaled points corresponding to that. */ -scaled divide_scaled(scaled s, scaled m, integer dd) +scaled divide_scaled(scaled s, scaled m, int dd) { register scaled q; register scaled r; @@ -408,6 +408,23 @@ return (scaled) di; } +int +do_zround (double r) +{ + int i; + + if (r > 2147483647.0) + i = 2147483647; + else if (r < -2147483647.0) + i = -2147483647; + else if (r >= 0.0) + i = (int)(r + 0.5); + else + i = (int)(r - 0.5); + + return i; +} + #ifdef MSVC @@ -427,3 +444,4 @@ } #endif + diff -Nru luatex-0.47.0/source/texk/web2c/luatexdir/utils/utils.h luatex-0.50.0/source/texk/web2c/luatexdir/utils/utils.h --- luatex-0.47.0/source/texk/web2c/luatexdir/utils/utils.h 2009-12-18 09:38:13.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/luatexdir/utils/utils.h 2009-12-24 18:51:05.000000000 +0000 @@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see . */ -/* $Id: utils.h 3217 2009-12-03 16:52:01Z taco $ */ +/* $Id: utils.h 3261 2009-12-18 11:38:21Z taco $ */ #ifndef UTILS_H # define UTILS_H -extern integer epochseconds; -extern integer microseconds; +extern int epochseconds; +extern int microseconds; extern char *pdftex_banner; void make_subset_tag(fd_entry *); diff -Nru luatex-0.47.0/source/texk/web2c/mplibdir/memio.w luatex-0.50.0/source/texk/web2c/mplibdir/memio.w --- luatex-0.47.0/source/texk/web2c/mplibdir/memio.w 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/mplibdir/memio.w 2009-12-24 18:51:14.000000000 +0000 @@ -53,6 +53,26 @@ #include #include "mplib.h" #include "mpmp.h" +static void swap_items (char *p, int nitems, int size); +/* If we have these macros, use them, as they provide a better guide to + the endianess when cross-compiling. */ +#if defined (BYTE_ORDER) && defined (BIG_ENDIAN) && defined (LITTLE_ENDIAN) +#ifdef WORDS_BIGENDIAN +#undef WORDS_BIGENDIAN +#endif +#if BYTE_ORDER == BIG_ENDIAN +#define WORDS_BIGENDIAN +#endif +#endif +/* More of the same, but now NeXT-specific. */ +#ifdef NeXT +#ifdef WORDS_BIGENDIAN +#undef WORDS_BIGENDIAN +#endif +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN +#endif +#endif @ @c void mp_store_mem_file (MP mp) { integer k; /* all-purpose index */ @@ -100,13 +120,88 @@ return false; } +@ If we want mem files to be shareable between different endianness architectures, +we have to swap some of the items so that everything turns out right. +Code borrowed from |texmfmp.c|. + +Make the NITEMS items pointed at by P, each of size SIZE, be the + opposite-endianness of whatever they are now. */ + +@d SWAP(x, y) temp = (x); (x) = (y); (y) = temp + +@c +static void +swap_items (char *p, int nitems, int size) +{ + char temp; +#if !defined (WORDS_BIGENDIAN) + /* Since `size' does not change, we can write a while loop for each + case, and avoid testing `size' for each time. */ + switch (size) + { + /* 16-byte items happen on the DEC Alpha machine when we are not + doing sharable memory dumps. */ + case 16: + while (nitems--) + { + SWAP (p[0], p[15]); + SWAP (p[1], p[14]); + SWAP (p[2], p[13]); + SWAP (p[3], p[12]); + SWAP (p[4], p[11]); + SWAP (p[5], p[10]); + SWAP (p[6], p[9]); + SWAP (p[7], p[8]); + p += size; + } + break; + + case 8: + while (nitems--) + { + SWAP (p[0], p[7]); + SWAP (p[1], p[6]); + SWAP (p[2], p[5]); + SWAP (p[3], p[4]); + p += size; + } + break; + + case 4: + while (nitems--) + { + SWAP (p[0], p[3]); + SWAP (p[1], p[2]); + p += size; + } + break; + + case 2: + while (nitems--) + { + SWAP (p[0], p[1]); + p += size; + } + break; + + case 1: + /* Nothing to do. */ + break; + + default: + fprintf (stderr, "Can't swap a %d-byte item for (un)dumping", (int)size); + exit(1); + } +#endif +} + @ Mem files consist of |memory_word| items, and we use the following macros to dump words of different types: -@d dump_wd(A) { WW=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); } -@d dump_int(A) { int cint=(A); (mp->write_binary_file)(mp,mp->mem_file,&cint,sizeof(cint)); } -@d dump_hh(A) { WW.hh=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); } -@d dump_qqqq(A) { WW.qqqq=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); } +@d dump_wd(A) { WW=(A); swap_items((char *)&WW,1,sizeof(WW)); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); } +@d dump_int(A) { int cint=(A); swap_items((char *)&cint,1,sizeof(cint)); (mp->write_binary_file)(mp,mp->mem_file,&cint,sizeof(cint)); } +@d dump_hh(A) { WW.hh=(A); swap_items((char *)&WW,1,sizeof(WW)); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); } +@d dump_qqqq(A) { WW.qqqq=(A); swap_items((char *)&WW,1,sizeof(WW)); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); } @d dump_string(A) { dump_int((int)(strlen(A)+1)); (mp->write_binary_file)(mp,mp->mem_file,A,strlen(A)+1); } @@ -117,8 +212,9 @@ @d mgeti(A) do { size_t wanted = sizeof(A); void *A_ptr = &A; - (mp->read_binary_file)(mp, mp->mem_file,&A_ptr,&wanted); + (mp->read_binary_file)(mp, mp->mem_file,&A_ptr,&wanted); if (wanted!=sizeof(A)) goto OFF_BASE; + swap_items(A_ptr,1,wanted); } while (0) @d mgetw(A) do { @@ -126,6 +222,7 @@ void *A_ptr = &A; (mp->read_binary_file)(mp, mp->mem_file,&A_ptr,&wanted); if (wanted!=sizeof(A)) goto OFF_BASE; + swap_items(A_ptr,1,wanted); } while (0) @d undump_wd(A) { mgetw(WW); A=WW; } diff -Nru luatex-0.47.0/source/texk/web2c/mplibdir/mpost.w luatex-0.50.0/source/texk/web2c/mplibdir/mpost.w --- luatex-0.47.0/source/texk/web2c/mplibdir/mpost.w 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/mplibdir/mpost.w 2009-12-24 18:52:27.000000000 +0000 @@ -1,4 +1,4 @@ -% $Id: mpost.w 1113 2009-08-12 08:16:29Z taco $ +% $Id: mpost.w 1135 2009-12-24 18:40:38Z taco $ % % Copyright 2008-2009 Taco Hoekwater. % @@ -56,6 +56,7 @@ extern KPSEDLL char *kpathsea_version_string; @= /*@@null@@*/ @> static char *mpost_tex_program = NULL; static int debug = 0; /* debugging for makempx */ +static int nokpse = 0; #ifdef WIN32 #define GETCWD _getcwd #else @@ -67,6 +68,8 @@ static char *job_name = NULL; static char *job_area = NULL; static int dvitomp_only = 0; +static int ini_version_test = false; +@; @ Allocating a bit of memory, with error detection: @@ -434,6 +437,7 @@ mpost_xfree(mpxopt->banner); mpost_xfree(mpxopt); mpost_xfree(mpversion); + puts(""); /* nicer in case of error */ return ret; } @@ -670,149 +674,182 @@ if (!nokpse) options->open_file = mpost_open_file; +@ +@= +#define ARGUMENT_IS(a) STREQ (mpost_options[optionid].name, a) + +/* SunOS cc can't initialize automatic structs, so make this static. */ +static struct option mpost_options[] + = { { "mem", 1, 0, 0 }, + { "help", 0, 0, 0 }, + { "debug", 0, &debug, 1 }, + { "no-kpathsea", 0, &nokpse, 1 }, + { "dvitomp", 0, &dvitomp_only, 1 }, + { "ini", 0, &ini_version_test, 1 }, + { "interaction", 1, 0, 0 }, + { "halt-on-error", 0, 0, 0 }, + { "kpathsea-debug", 1, 0, 0 }, + { "progname", 1, 0, 0 }, + { "version", 0, 0, 0 }, + { "recorder", 0, &recorder_enabled, 1 }, + { "file-line-error-style", 0, 0, 0 }, + { "no-file-line-error-style", 0, 0, 0 }, + { "file-line-error", 0, 0, 0 }, + { "no-file-line-error", 0, 0, 0 }, + { "jobname", 1, 0, 0 }, + { "output-directory", 1, 0, 0 }, + { "s", 1, 0, 0 }, + { "parse-first-line", 0, 0, 0 }, + { "no-parse-first-line", 0, 0, 0 }, + { "8bit", 0, 0, 0 }, + { "T", 0, 0, 0 }, + { "troff", 0, 0, 0 }, + { "tex", 1, 0, 0 }, + { 0, 0, 0, 0 } }; -@ Parsing the commandline options. -@d option_is(A) ((strncmp(argv[a],"--" A, strlen(A)+2)==0) || - (strncmp(argv[a],"-" A, strlen(A)+1)==0)) -@d option_arg(B) (mpost_optarg != NULL && strncmp(mpost_optarg,B, strlen(B))==0) +@ Parsing the commandline options. @= { - char *mpost_optarg; - boolean ini_version_test = false; - while (++ajob_name); + options->job_name = mpost_xstrdup(optarg); + } + + } else if (ARGUMENT_IS ("progname")) { + user_progname = optarg; + + } else if (ARGUMENT_IS ("mem")) { + if (optarg!=NULL) { mpost_xfree(options->mem_name); - options->mem_name = mpost_xstrdup(mpost_optarg); + options->mem_name = mpost_xstrdup(optarg); if (user_progname == NULL) - user_progname = mpost_optarg; - } - } else if (option_is("jobname")) { - if (mpost_optarg!=NULL) { - mpost_xfree(options->job_name); - options->job_name = mpost_xstrdup(mpost_optarg); + user_progname = optarg; } - } else if (option_is ("progname")) { - user_progname = mpost_optarg; - } else if (option_is("troff") || option_is("T")) { - options->troff_mode = (int)true; - } else if (option_is("recorder")) { - recorder_enabled = true; - } else if (option_is ("tex")) { - mpost_tex_program = mpost_optarg; - } else if (option_is("interaction")) { - if (option_arg("batchmode")) { + + } else if (ARGUMENT_IS ("interaction")) { + if (STREQ (optarg, "batchmode")) { options->interaction = mp_batch_mode; - } else if (option_arg("nonstopmode")) { + } else if (STREQ (optarg, "nonstopmode")) { options->interaction = mp_nonstop_mode; - } else if (option_arg("scrollmode")) { + } else if (STREQ (optarg, "scrollmode")) { options->interaction = mp_scroll_mode; - } else if (option_arg("errorstopmode")) { + } else if (STREQ (optarg, "errorstopmode")) { options->interaction = mp_error_stop_mode; } else { - fprintf(stdout,"warning: %s: unknown option argument %s\n", argv[0], argv[a]); + fprintf(stdout,"Ignoring unknown argument `%s' to --interaction", optarg); } - } else if (option_is("no-kpathsea")) { - nokpse=true; - } else if (option_is("file-line-error")) { + } else if (ARGUMENT_IS("troff") || + ARGUMENT_IS("T")) { + options->troff_mode = (int)true; + } else if (ARGUMENT_IS ("tex")) { + mpost_tex_program = optarg; + } else if (ARGUMENT_IS("file-line-error") || + ARGUMENT_IS("file-line-error-style")) { options->file_line_error_style=true; - } else if (option_is("no-file-line-error")) { + } else if (ARGUMENT_IS("no-file-line-error") || + ARGUMENT_IS("no-file-line-error-style")) { options->file_line_error_style=false; - } else if (option_is("dvitomp")) { - dvitomp_only = 1; - } else if (option_is("help")) { + } else if (ARGUMENT_IS("help")) { if (dvitomp_only) { @; } else { @; } - } else if (option_is("version")) { + } else if (ARGUMENT_IS("version")) { @; - } else if (option_is("8bit") || - option_is("parse-first-line")) { + } else if (ARGUMENT_IS("s")) { + if (strchr(optarg,'=')==NULL) { + fprintf(stdout,"fatal error: %s: missing -s argument\n", argv[0]); + exit (EXIT_FAILURE); + } else { + internal_set_option(optarg); + } + } else if (ARGUMENT_IS("halt-on-error")) { + options->halt_on_error = true; + } else if (ARGUMENT_IS("8bit") || + ARGUMENT_IS("parse-first-line")) { /* do nothing, these are always on */ - } else if (option_is("halt-on-error")) { - options->halt_on_error = true; - } else if (option_is("translate-file") || - option_is("output-directory") || - option_is("no-parse-first-line")) { - fprintf(stdout,"warning: %s: unimplemented option %s\n", argv[0], argv[a]); - } else if (option_is("")) { - fprintf(stdout,"fatal error: %s: unknown option %s\n", argv[0], argv[a]); - exit(EXIT_FAILURE); - } else { - break; - } - } + } else if (ARGUMENT_IS("translate-file") || + ARGUMENT_IS("output-directory") || + ARGUMENT_IS("no-parse-first-line")) { + fprintf(stdout,"warning: %s: unimplemented option %s\n", argv[0], argv[optind]); + } + } options->ini_version = (int)ini_version_test; } +@ +@= +#define option_is(a) STREQ (dvitomp_options[optionid].name, a) + +/* SunOS cc can't initialize automatic structs, so make this static. */ +static struct option dvitomp_options[] + = { { "help", 0, 0, 0 }, + { "no-kpathsea", 0, &nokpse, 1 }, + { "kpathsea-debug", 1, 0, 0 }, + { "progname", 1, 0, 0 }, + { "version", 0, 0, 0 }, + { 0, 0, 0, 0 } }; + + + @ @= { - char *mpost_optarg; - boolean ini_version_test = false; - while (++a; } else if (option_is("version")) { @; - } else if (option_is("")) { - fprintf(stdout,"fatal error: %s: unknown option %s\n", argv[0], argv[a]); - exit(EXIT_FAILURE); - } else { - break; } } - options->ini_version = (int)ini_version_test; } @ @= { +char *s = mp_metapost_version(); +if (dvitomp_only) + fprintf(stdout, "\n" "This is dvitomp %s\n", s); +else + fprintf(stdout, "\n" "This is MetaPost %s\n", s); +mpost_xfree(s); fprintf(stdout, "\n" "Usage: mpost [OPTION] [&MEMNAME] [MPNAME[.mp]] [COMMANDS]\n" @@ -834,13 +871,14 @@ " [-no]-file-line-error disable/enable file:line:error style messages\n" ); fprintf(stdout, +" -debug print debugging info and leave temporary files in place\n" " -kpathsea-debug=NUMBER set path searching debugging flags according to\n" " the bits of NUMBER\n" " -mem=MEMNAME or &MEMNAME use MEMNAME instead of program name or a %%& line\n" " -recorder enable filename recorder\n" " -troff set prologues:=1 and assume TEXPROGRAM is really troff\n" -" -sINTERNAL=\"STRING\" set internal INTERNAL to the string value STRING\n" -" -sINTERNAL=NUMBER set internal INTERNAL to the integer value NUMBER\n" +" -s INTERNAL=\"STRING\" set internal INTERNAL to the string value STRING\n" +" -s INTERNAL=NUMBER set internal INTERNAL to the integer value NUMBER\n" " -help display this help and exit\n" " -version output version information and exit\n" "\n" @@ -852,6 +890,12 @@ @ @= { +char *s = mp_metapost_version(); +if (dvitomp_only) + fprintf(stdout, "\n" "This is dvitomp %s\n", s); +else + fprintf(stdout, "\n" "This is MetaPost %s\n", s); +mpost_xfree(s); fprintf(stdout, "\n" "Usage: dvitomp DVINAME[.dvi] [MPXNAME[.mpx]]\n" @@ -903,10 +947,10 @@ mpost_xfree(options->command_line); options->command_line = mpost_xmalloc(command_line_size); strcpy(options->command_line,""); - if (acommand_line[k++] = *c; @@ -1151,8 +1195,6 @@ int history; /* the exit status */ MP mp; /* a metapost instance */ struct MP_options * options; /* instance options */ - int a=0; /* argc counter */ - boolean nokpse = false; /* switch to {\it not} enable kpse */ char *user_progname = NULL; /* If the user overrides |argv[0]| with {\tt -progname}. */ options = mp_options(); options->ini_version = (int)false; @@ -1165,12 +1207,12 @@ } if (dvitomp_only) { char *mpx = NULL, *dvi = NULL; - if (a==argc) { + if (optind>=argc) { /* error ? */ } else { - dvi = argv[a++]; - if (a @^system dependencies@> -@d default_banner "This is MetaPost, Version 1.207" /* printed when \MP\ starts */ +@d default_banner "This is MetaPost, Version 1.209" /* printed when \MP\ starts */ @d true 1 @d false 0 @(mpmp.h@>= -#define metapost_version "1.207" -#define metapost_magic (('M'*256) + 'P')*65536 + 1207 +#define metapost_version "1.209" +#define metapost_magic (('M'*256) + 'P')*65536 + 1209 #define metapost_old_magic (('M'*256) + 'P')*65536 + 1080 @ The external library header for \MP\ is |mplib.h|. It contains a @@ -16498,7 +16498,11 @@ char *s = mp->job_name+strlen(mp->job_name); while (s>mp->job_name) { if (*s == '.') { - *s = '\0'; + if(strcasecmp(s, ".mp") == 0 || strcasecmp(s, ".mem") == 0 || + strcasecmp(s, ".mf") == 0) { + *s = '\0'; + break; + } } s--; } @@ -21673,7 +21677,6 @@ } } else { n = mp_str(mp, value(p)); - delete_str_ref(value(p)); h = mp_ps_do_font_charstring (mp,f,n); free(n); } diff -Nru luatex-0.47.0/source/texk/web2c/mplibdir/mpxout.w luatex-0.50.0/source/texk/web2c/mplibdir/mpxout.w --- luatex-0.47.0/source/texk/web2c/mplibdir/mpxout.w 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/mplibdir/mpxout.w 2009-12-24 18:51:13.000000000 +0000 @@ -1,4 +1,4 @@ -% $Id: mpxout.w 1061 2009-05-27 13:01:37Z taco $ +% $Id: mpxout.w 1124 2009-12-20 23:32:42Z taco $ % % Copyright 2008-2009 Taco Hoekwater. % @@ -260,6 +260,8 @@ va_start(ap, msg); fprintf(stderr, "fatal: "); (void)vfprintf(stderr, msg, ap); + va_end(ap); + va_start(ap, msg); mpx_printf(mpx, "fatal", msg, ap); va_end(ap); mpx->history=mpx_fatal_error; diff -Nru luatex-0.47.0/source/texk/web2c/mplibdir/psout.w luatex-0.50.0/source/texk/web2c/mplibdir/psout.w --- luatex-0.47.0/source/texk/web2c/mplibdir/psout.w 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/mplibdir/psout.w 2009-12-24 18:51:13.000000000 +0000 @@ -1,4 +1,4 @@ -% $Id: psout.w 1098 2009-06-25 08:23:21Z taco $ +% $Id: psout.w 1129 2009-12-22 16:41:37Z taco $ % % Copyright 2008-2009 Taco Hoekwater. % @@ -3695,20 +3695,31 @@ break; case CS_HMOVETO: /* |- dx HMOVETO |- */ cs_debug(CS_HMOVETO); - finish_subpath(); - start_subpath(f,cc_get(-1),0); + /* treating in-line moves as 'line segments' work better than attempting + to split the path up in two separate sections, at least for now. */ + if (f->pp == NULL) { /* this is the first */ + start_subpath(f,cc_get(-1),0); + } else { + add_line_segment(f,cc_get(-1),0); + } cc_clear (); break; case CS_RMOVETO: /* |- dx dy RMOVETO |- */ cs_debug(CS_RMOVETO); - finish_subpath(); - start_subpath(f,cc_get(-2),cc_get(-1)); + if (f->pp == NULL) { /* this is the first */ + start_subpath(f,cc_get(-2),cc_get(-1)); + } else { + add_line_segment(f,cc_get(-2),cc_get(-1)); + } cc_clear (); break; case CS_VMOVETO: /* |- dy VMOVETO |- */ cs_debug(CS_VMOVETO); - finish_subpath(); - start_subpath(f,0,cc_get(-1)); + if (f->pp == NULL) { /* this is the first */ + start_subpath(f,0,cc_get(-1)); + } else { + add_line_segment(f,0,cc_get(-1)); + } cc_clear (); break; /* hinting commands */ @@ -3812,9 +3823,7 @@ break; case CS_SETCURRENTPOINT: /* |- x y SETCURRENTPOINT |- */ cs_debug(CS_SETCURRENTPOINT); - f->cur_x = cc_get(-2); - f->cur_y = cc_get(-1); - f->pp = NULL; + /* totally ignoring setcurrentpoint actually works better for most fonts ? */ cc_clear (); break; default: @@ -4671,7 +4680,7 @@ font_number ldf ; ldf = mp_print_font_comments (mp, h, prologues); mp_ps_print_ln(mp); - if ( (prologues==1) && (mp->last_ps_fnumlast_fnum) ) + if ( (prologues==1) && mp->ps->tfm_tree == NULL && (mp->last_ps_fnumlast_fnum) ) mp_read_psname_table(mp); mp_ps_print(mp, "%%BeginProlog"); mp_ps_print_ln(mp); if ( (prologues>0)||(procset>0) ) { @@ -5722,6 +5731,7 @@ mp_ps_pair_out(mp, txy,tyy); mp_ps_print(mp, "0 0] t"); } else if ((txx!=unity)||(tyy!=unity) ) { + mp_ps_print(mp, " "); mp_ps_pair_out(mp,txx,tyy); mp_ps_print(mp, " s"); }; diff -Nru luatex-0.47.0/source/texk/web2c/mplibdir/svgout.w luatex-0.50.0/source/texk/web2c/mplibdir/svgout.w --- luatex-0.47.0/source/texk/web2c/mplibdir/svgout.w 2009-12-18 09:38:14.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/mplibdir/svgout.w 2009-12-24 18:51:14.000000000 +0000 @@ -1201,7 +1201,7 @@ } if (mp->history >= mp_fatal_error_stop ) return 1; mp_open_output_file(mp); - if ( (qprologues>=1) && (mp->last_ps_fnumlast_fnum) ) + if ( (qprologues>=1) && mp->ps->tfm_tree == NULL && (mp->last_ps_fnumlast_fnum) ) mp_read_psname_table(mp); /* The next seems counterintuitive, but calls from |mp_svg_ship_out| * set standalone to true, and because embedded use is likely, it is diff -Nru luatex-0.47.0/source/texk/web2c/tmf-pool.h luatex-0.50.0/source/texk/web2c/tmf-pool.h --- luatex-0.47.0/source/texk/web2c/tmf-pool.h 2009-12-18 09:38:17.000000000 +0000 +++ luatex-0.50.0/source/texk/web2c/tmf-pool.h 2009-12-24 18:51:33.000000000 +0000 @@ -2,16 +2,15 @@ You may freely use, modify and/or distribute this file. */ #ifndef TMF_POOL_H -#define TMF_POOL_H -#ifndef META_FONT -typedef int integer; -typedef integer strnumber; +# define TMF_POOL_H +# ifndef META_FONT +typedef int strnumber; typedef unsigned char packedASCIIcode; -typedef integer poolpointer; -extern packedASCIIcode *strpool; -extern poolpointer poolptr; -#else -#define EXTERN extern -#include "mfd.h" -#endif +typedef int poolpointer; +extern packedASCIIcode *strpool; +extern poolpointer poolptr; +# else +# define EXTERN extern +# include "mfd.h" +# endif #endif