pdftex[964] branches/stable/source: sync from tl 75248
commits+karl at tug.org
commits+karl at tug.org
Sun May 18 00:44:20 CEST 2025
Revision: 964
https://tug.org/svn/pdftex?view=revision&revision=964
Author: karl
Date: 2025-05-18 00:44:20 +0200 (Sun, 18 May 2025)
Log Message:
-----------
sync from tl 75248
Modified Paths:
--------------
branches/stable/source/Makefile
branches/stable/source/src/build-aux/texinfo.tex
branches/stable/source/src/configure
branches/stable/source/src/libs/README
branches/stable/source/src/libs/configure
branches/stable/source/src/libs/libpng/ChangeLog
branches/stable/source/src/libs/libpng/README
branches/stable/source/src/libs/libpng/TLpatches/ChangeLog
branches/stable/source/src/libs/libpng/TLpatches/TL-Changes
branches/stable/source/src/libs/libpng/configure
branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE
branches/stable/source/src/libs/libpng/libpng-src/CHANGES
branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt
branches/stable/source/src/libs/libpng/libpng-src/README
branches/stable/source/src/libs/libpng/libpng-src/arm/arm_init.c
branches/stable/source/src/libs/libpng/libpng-src/ci/README.md
branches/stable/source/src/libs/libpng/libpng-src/ci/ci_lint.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_cmake.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_configure.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_version.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/lib/ci.lib.sh
branches/stable/source/src/libs/libpng/libpng-src/configure.ac
branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngpixel.c
branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngimage.c
branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c
branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c
branches/stable/source/src/libs/libpng/libpng-src/example.c
branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt
branches/stable/source/src/libs/libpng/libpng-src/libpng.3
branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3
branches/stable/source/src/libs/libpng/libpng-src/mips/mips_init.c
branches/stable/source/src/libs/libpng/libpng-src/png.5
branches/stable/source/src/libs/libpng/libpng-src/png.c
branches/stable/source/src/libs/libpng/libpng-src/png.h
branches/stable/source/src/libs/libpng/libpng-src/pngconf.h
branches/stable/source/src/libs/libpng/libpng-src/pngdebug.h
branches/stable/source/src/libs/libpng/libpng-src/pngerror.c
branches/stable/source/src/libs/libpng/libpng-src/pngget.c
branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h
branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h
branches/stable/source/src/libs/libpng/libpng-src/pngmem.c
branches/stable/source/src/libs/libpng/libpng-src/pngpread.c
branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h
branches/stable/source/src/libs/libpng/libpng-src/pngread.c
branches/stable/source/src/libs/libpng/libpng-src/pngrio.c
branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c
branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c
branches/stable/source/src/libs/libpng/libpng-src/pngset.c
branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h
branches/stable/source/src/libs/libpng/libpng-src/pngtest.c
branches/stable/source/src/libs/libpng/libpng-src/pngwio.c
branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c
branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c
branches/stable/source/src/libs/libpng/libpng-src/powerpc/filter_vsx_intrinsics.c
branches/stable/source/src/libs/libpng/libpng-src/powerpc/powerpc_init.c
branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in
branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in
branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa
branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt
branches/stable/source/src/libs/libpng/version.ac
branches/stable/source/src/tardate.ac
branches/stable/source/src/texk/README
branches/stable/source/src/texk/configure
branches/stable/source/src/texk/kpathsea/ChangeLog
branches/stable/source/src/texk/kpathsea/NEWS
branches/stable/source/src/texk/kpathsea/c-auto.in
branches/stable/source/src/texk/kpathsea/c-ctype.h
branches/stable/source/src/texk/kpathsea/c-memstr.h
branches/stable/source/src/texk/kpathsea/configure
branches/stable/source/src/texk/kpathsea/expand.c
branches/stable/source/src/texk/kpathsea/version.ac
branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm
branches/stable/source/src/texk/web2c/ChangeLog
branches/stable/source/src/texk/web2c/Makefile.in
branches/stable/source/src/texk/web2c/NEWS
branches/stable/source/src/texk/web2c/configure
branches/stable/source/src/texk/web2c/ctangleboot.cin
branches/stable/source/src/texk/web2c/cwebboot.cin
branches/stable/source/src/texk/web2c/cwebdir/ChangeLog
branches/stable/source/src/texk/web2c/cwebdir/Makefile
branches/stable/source/src/texk/web2c/cwebdir/comm-bs.ch
branches/stable/source/src/texk/web2c/cwebdir/comm-mac.ch
branches/stable/source/src/texk/web2c/cwebdir/comm-mini.ch
branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.ch
branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.h
branches/stable/source/src/texk/web2c/cwebdir/comm-w32.ch
branches/stable/source/src/texk/web2c/cwebdir/common.bux
branches/stable/source/src/texk/web2c/cwebdir/common.c
branches/stable/source/src/texk/web2c/cwebdir/common.h
branches/stable/source/src/texk/web2c/cwebdir/common.w
branches/stable/source/src/texk/web2c/cwebdir/ctang-w2c.ch
branches/stable/source/src/texk/web2c/cwebdir/ctang-w32.ch
branches/stable/source/src/texk/web2c/cwebdir/ctangle.c
branches/stable/source/src/texk/web2c/cwebdir/ctangle.w
branches/stable/source/src/texk/web2c/cwebdir/ctwill-hint.ch
branches/stable/source/src/texk/web2c/cwebdir/ctwill-mini.ch
branches/stable/source/src/texk/web2c/cwebdir/ctwill-w2c.ch
branches/stable/source/src/texk/web2c/cwebdir/ctwill.bux
branches/stable/source/src/texk/web2c/cwebdir/cweav-w2c.ch
branches/stable/source/src/texk/web2c/cwebdir/cweav-w32.ch
branches/stable/source/src/texk/web2c/cwebdir/cweave.w
branches/stable/source/src/texk/web2c/cwebdir/po/cweb.pot
branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb.po
branches/stable/source/src/texk/web2c/cwebdir/po/de/web2c-help.po
branches/stable/source/src/texk/web2c/cwebdir/po/it/cweb.po
branches/stable/source/src/texk/web2c/cwebdir/po/web2c-help.pot
branches/stable/source/src/texk/web2c/cwebdir/tests/ham-sorted.tex
branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ch
branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ref
branches/stable/source/src/texk/web2c/cwebdir/tests/ham.sref
branches/stable/source/src/texk/web2c/cwebdir/tests/ham.tex
branches/stable/source/src/texk/web2c/doc/luatex/luatex-math.tex
branches/stable/source/src/texk/web2c/doc/luatex/luatex.pdf
branches/stable/source/src/texk/web2c/etexdir/ChangeLog
branches/stable/source/src/texk/web2c/help.h
branches/stable/source/src/texk/web2c/lib/ChangeLog
branches/stable/source/src/texk/web2c/lib/openclose.c
branches/stable/source/src/texk/web2c/lib/texmfmp.c
branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
branches/stable/source/src/texk/web2c/pdftexdir/NEWS
branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web
branches/stable/source/src/texk/web2c/pdftexdir/pdftex_version.h
branches/stable/source/src/texk/web2c/synctexdir/ChangeLog
branches/stable/source/src/texk/web2c/synctexdir/synctex.c
branches/stable/source/src/texk/web2c/tangle.ch
branches/stable/source/src/texk/web2c/tangleboot.pin
branches/stable/source/src/texk/web2c/tests/fix-changefile-lines.py
branches/stable/source/src/texk/web2c/tex.ch
branches/stable/source/src/texk/web2c/web2c/ChangeLog
branches/stable/source/src/texk/web2c/web2c/configure
branches/stable/source/src/utils/README
branches/stable/source/src/utils/configure
branches/stable/source/src/version.ac
branches/stable/source/sync-pdftex.sh
Added Paths:
-----------
branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/
branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_autoconf.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_c.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_cmake.sh
branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_shell.sh
branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/fixed.dfa
branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/float-fixed.dfa
branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nocompile-limits.dfa
branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nolimits.dfa
branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/read-full.dfa
branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/write-full.dfa
branches/stable/source/src/libs/libpng/libpng-src/scripts/cmake/PNGCheckLibconf.cmake
branches/stable/source/src/texk/web2c/tests/invalidmu.tex
Removed Paths:
-------------
branches/stable/source/src/libs/libpng/libpng-src/ci/ci_shellify.sh
Modified: branches/stable/source/Makefile
===================================================================
--- branches/stable/source/Makefile 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/Makefile 2025-05-17 22:44:20 UTC (rev 964)
@@ -32,6 +32,7 @@
synctest:
svn status # if not clean, commit first or changes will be lost
+ # also svn update the TL source dir, and note revision.
./sync-pdftex.sh # does not actually change anything.
syncreal:
Modified: branches/stable/source/src/build-aux/texinfo.tex
===================================================================
--- branches/stable/source/src/build-aux/texinfo.tex 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/build-aux/texinfo.tex 2025-05-17 22:44:20 UTC (rev 964)
@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2025-01-31.21}
+\def\texinfoversion{2025-03-22.08}
%
% Copyright 1985, 1986, 1988, 1990-2025 Free Software Foundation, Inc.
%
@@ -287,7 +287,6 @@
% Avoid "undefined control sequence" errors.
\def\currentchapterdefs{}
\def\currentsectiondefs{}
-\def\currentsection{}
\def\prevchapterdefs{}
\def\prevsectiondefs{}
\def\currentcolordefs{}
@@ -980,18 +979,51 @@
\newif\ifpdf
\newif\ifpdfmakepagedest
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set). So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
+\else
+ \ifx\pdfoutput\relax
+ \else
+ \ifcase\pdfoutput
+ \else
+ \pdftrue
+ \fi
+ \fi
+\fi
+
+\newif\ifxetex
+\ifx\XeTeXrevision\thisisundefined\else
+ \xetextrue
+\fi
+
\newif\ifluatex
\ifx\luatexversion\thisisundefined\else
\luatextrue
+ \ifnum\luatexversion>84
+ \pdftrue
+ \fi
\fi
+\newif\ifpdforxetex
+\ifpdf
+ \pdforxetextrue
+\fi
+\ifxetex
+ \pdforxetextrue
+\fi
+
+
+
+% Whether to use non-ASCII bytes in internal link targets. Presently this
+% is almost always on.
+\newif\iftxiuseunicodedestname
+\txiuseunicodedestnametrue
+
%
% For LuaTeX
%
-\newif\iftxiuseunicodedestname
-\txiuseunicodedestnamefalse % For pdfTeX etc.
-
\ifluatex
% Use Unicode destination names
\txiuseunicodedestnametrue
@@ -1045,7 +1077,7 @@
%
\endgroup
\def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
- \ifnum\luatexversion>84
+ \ifpdf
% For LuaTeX >= 0.85
\def\pdfdest{\pdfextension dest}
\let\pdfoutput\outputmode
@@ -1068,34 +1100,7 @@
\fi
\fi
-% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
-% can be set). So we test for \relax and 0 as well as being undefined.
-\ifx\pdfoutput\thisisundefined
-\else
- \ifx\pdfoutput\relax
- \else
- \ifcase\pdfoutput
- \else
- \pdftrue
- \fi
- \fi
-\fi
-\newif\ifxetex
-\ifx\XeTeXrevision\thisisundefined\else
- \xetextrue
-\fi
-
-\newif\ifpdforxetex
-\pdforxetexfalse
-\ifpdf
- \pdforxetextrue
-\fi
-\ifxetex
- \pdforxetextrue
-\fi
-
-
% Output page labels information.
% See PDF reference v.1.7 p.594, section 8.3.1.
% Page label ranges must be increasing.
@@ -1388,9 +1393,6 @@
\safewhatsit{\pdfdest name{\pdfdestname} xyz}%
}
%
- % used to mark target names; must be expandable.
- \def\pdfmkpgn#1{#1}
- %
% Adding outlines to PDF; macros for calculating structure of outlines
% come from Petr Olsak
\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
@@ -1416,7 +1418,7 @@
\def\pdfdestname{#4}%
\fi
%
- \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
+ \pdfoutline goto name{\pdfdestname}#2{\pdfoutlinetext}%
}
%
\def\pdfmakeoutlines{%
@@ -1427,15 +1429,18 @@
\def\thischapnum{##2}%
\def\thissecnum{0}%
\def\thissubsecnum{0}%
+ \def\indexlastsec{chap\thischapnum}%
}%
\def\numsecentry##1##2##3##4{%
\advancenumber{chap\thischapnum}%
\def\thissecnum{##2}%
\def\thissubsecnum{0}%
+ \def\indexlastsec{sec\thissecnum}%
}%
\def\numsubsecentry##1##2##3##4{%
\advancenumber{sec\thissecnum}%
\def\thissubsecnum{##2}%
+ \def\indexlastsec{subsec\thissecnum}%
}%
\def\numsubsubsecentry##1##2##3##4{%
\advancenumber{subsec\thissubsecnum}%
@@ -1443,7 +1448,13 @@
\def\thischapnum{0}%
\def\thissecnum{0}%
\def\thissubsecnum{0}%
+ \let\indexlastsec\empty
%
+ % Index initials are subsidiary to whatever sectioning command just
+ % occurred, usually @appendix or @chapter but occasionally a lower level.
+ \def\idxinitialentry##1##2##3##4{%
+ \expandafter\advancenumber\expandafter{\indexlastsec}%
+ }%
% use \def rather than \let here because we redefine \chapentry et
% al. a second time, below.
\def\appentry{\numchapentry}%
@@ -1455,9 +1466,6 @@
\def\unnsubsecentry{\numsubsecentry}%
\def\unnsubsubsecentry{\numsubsubsecentry}%
%
- % Treat index initials like @section. Note that this is the wrong
- % level if the index is not at the level of @appendix or @chapter.
- \def\idxinitialentry{\numsecentry}%
\readdatafile{toc}%
%
% Read toc second time, this time actually producing the outlines.
@@ -1482,18 +1490,6 @@
\def\idxinitialentry##1##2##3##4{%
\dopdfoutline{##1}{}{idx.##1.##2}{##4}}%
%
- % PDF outlines are displayed using system fonts, instead of
- % document fonts. Therefore we cannot use special characters,
- % since the encoding is unknown. For example, the eogonek from
- % Latin 2 (0xea) gets translated to a | character. Info from
- % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
- %
- % TODO this right, we have to translate 8-bit characters to
- % their "best" equivalent, based on the @documentencoding. Too
- % much work for too little return. Just use the ASCII equivalents
- % we use for the index sort strings.
- %
- \indexnofonts
\ifnodeseen\else \dopdfoutlinecontents \fi % for @contents at beginning
\setupdatafile
% We can have normal brace characters in the PDF outlines, unlike
@@ -1501,9 +1497,9 @@
\def\{{\lbracecharliteral}%
\def\}{\rbracecharliteral}%
\catcode`\\=\active \otherbackslash
- \input \tocreadfilename
+ \input \tocreadfilename\relax
+ \ifnodeseen \dopdfoutlinecontents \fi % for @contents at end
\endgroup
- \ifnodeseen \dopdfoutlinecontents \fi % for @contents at end
}
\def\dopdfoutlinecontents{%
\expandafter\dopdfoutline\expandafter{\putwordTOC}{}{txi.CONTENTS}{}%
@@ -1541,7 +1537,7 @@
%
\def\pdflink#1{\pdflinkpage{#1}{#1}}%
\def\pdflinkpage#1#2{%
- \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \startlink attr{/Border [0 0 0]} goto name{#1}
\setcolor{\linkcolor}#2\endlink}
\else
% non-pdf mode
@@ -1644,18 +1640,20 @@
% horizontal space being required in the PDF viewer.
\def\partentry##1##2##3##4{}% ignore parts in the outlines
\def\numchapentry##1##2##3##4{%
- \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
+ \dopdfoutline{##2 ##1}{1}{##3}{##4}%
+ \def\indexseclevel{2}}%
\def\numsecentry##1##2##3##4{%
- \dopdfoutline{##1}{2}{##3}{##4}}%
+ \dopdfoutline{##1}{2}{##3}{##4}%
+ \def\indexseclevel{3}}%
\def\numsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{3}{##3}{##4}}%
+ \dopdfoutline{##1}{3}{##3}{##4}%
+ \def\indexseclevel{4}}%
\def\numsubsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{4}{##3}{##4}}%
+ \dopdfoutline{##1}{4}{##3}{##4}%
+ \def\indexseclevel{5}}%
%
- % Note this is at the wrong level unless the index is in an @appendix
- % or @chapter.
\def\idxinitialentry##1##2##3##4{%
- \dopdfoutline{##1}{2}{idx.##1.##2}{##4}}%
+ \dopdfoutline{##1}{\indexseclevel}{idx.##1.##2}{##4}}%
%
\let\appentry\numchapentry%
\let\appsecentry\numsecentry%
@@ -1680,7 +1678,9 @@
\def\{{\lbracecharliteral}%
\def\}{\rbracecharliteral}%
\catcode`\\=\active \otherbackslash
+ \xetexpreauxfile
\input \tocreadfilename\relax
+ \xetexpostauxfile
\ifnodeseen \dopdfoutlinecontents \fi % for @contents at end
\endgroup
}
@@ -5177,8 +5177,8 @@
%
\uccode`\1=`\{ \uppercase{\def\{{1}}%
\uccode`\1=`\} \uppercase{\def\}{1}}%
- \let\lbracechar\{%
- \let\rbracechar\}%
+ \def\lbracechar##1{\{}%
+ \def\rbracechar##1{\}}%
%
%
% We need to get rid of all macros, leaving only the arguments (if present).
@@ -5523,6 +5523,8 @@
\tolerance = 9500
\plainfrenchspacing
\everypar = {}% don't want the \kern\-parindent from indentation suppression.
+ \let\entry\indexentry
+ \ifxetex\xetexpreauxfile\fi
%
% See comment in \requireopenindexfile.
\def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
@@ -5548,6 +5550,7 @@
\fi
\fi
\closein 1
+ \ifxetex\xetexpostauxfile\fi
\endgroup}
% Checked in @bye
@@ -5583,7 +5586,9 @@
}%
\else
\begindoublecolumns
+ \ifxetex\xetexpreauxfile\fi
\input \jobname.\indexname s
+ \ifxetex\xetexpostauxfile\fi
\enddoublecolumns
\fi
}{%
@@ -5594,11 +5599,39 @@
% should work because we (hopefully) don't otherwise use @ in index files.
%\catcode`\@=12\relax
\catcode`\@=0\relax
+ \ifxetex\xetexpreauxfile\fi
\input \jobname.\indexname s
+ \ifxetex\xetexpostauxfile\fi
\enddoublecolumns
}%
}
+\def\indexentry#1#2{%
+ \let\entrypagetarget\empty
+ \ifpdforxetex
+ % only link the index text to the page if no comma appears in the
+ % list of pages, i.e. there is only one page
+ \checkpagelistcomma{#2}\pagelistcomma
+ \expandafter\ifcase\pagelistcomma
+ \def\entrypagetarget{#2}%
+ \fi
+ \fi%
+ \entryinternal{#1}{#2}%
+}
+
+\def\checkpagelistcomma#1#2{%
+ \checkpagelistcommaxx#2#1,\finish
+}
+\def\checkpagelistcommaxx#1#2,#3\finish{%
+ \def\tmp{#3}%
+ \ifx\tmp\empty
+ \def#1{0\relax}
+ \else
+ \def#1{1\relax}
+ \fi
+}
+
+
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
@@ -5673,18 +5706,14 @@
\def\doindexinitialentry#1{%
\ifpdforxetex
\global\advance\idxinitialno by 1
- \def\indexlbrace{\{}
- \def\indexrbrace{\}}
- \def\indexbackslash{\realbackslash}
- \def\indexatchar{\@}
+ \def\indexlbrace{\{}%
+ \def\indexrbrace{\}}%
+ \def\indexbackslash{\realbackslash}%
+ \def\indexatchar{\@}%
\writetocentry{idxinitial}{\asis #1}{IDX\the\idxinitialno}%
% The @asis removes a pair of braces around e.g. {@indexatchar} that
% are output by texindex.
%
- \vbox to 0pt{}%
- % This vbox fixes the \pdfdest location for double column formatting.
- % Without it, the \pdfdest is output above topskip glue at the top
- % of a column as this glue is not added until the first box.
\pdfmkdest{idx.\asis #1.IDX\the\idxinitialno}%
\fi
}
@@ -5704,16 +5733,18 @@
\newdimen\entrycontskip
\entrycontskip=1em
-% for PDF output, whether to make the text of the entry a link to the page
-% number. set for @contents and @shortcontents where there is only one
-% page number.
+% for PDF output, whether to make the text of the entry a link to the section.
+% set for @contents and @shortcontents.
\newif\iflinkentrytext
-% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
-% then page number (#2) flushed to the right margin. It is used for index
-% and table of contents entries. The paragraph is indented by \leftskip.
-% If \tocnodetarget is set, link text to the referenced node.
-\def\entry{%
+% \entryinternal typesets a paragraph consisting of the text (#1), dot
+% leaders, and then page number (#2) flushed to the right margin. It is
+% used for index and table of contents entries. The paragraph is indented
+% by \leftskip.
+% For PDF output, if \linkentrytexttrue and \tocnodetarget is set, link text
+% to the referenced node. Else if \entrypagetarget is set, link text to the
+% page.
+\def\entryinternal{%
\begingroup
%
% Start a new paragraph if necessary, so our assignments below can't
@@ -5761,7 +5792,11 @@
\endlink
\fi
\else
- \unhbox\boxA
+ \ifx\entrypagetarget\empty
+ \unhbox\boxA
+ \else
+ \pdflinkpage{\entrypagetarget}{\unhbox\boxA}%
+ \fi
\fi
\else
\unhbox\boxA
@@ -6433,6 +6468,10 @@
\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
\suppressfirstparagraphindent}
+% @xrefname - give text with printed name for linking to node and allow
+% referencing node, but do not print any heading.
+\parseargdef\xrefname{\donoderef{Yomitfromtoc}{#1}}%
+
% These macros generate a chapter, section, etc. heading only
% (including whitespace, linebreaking, etc. around it),
% given all the information in convenient, parsed form.
@@ -6554,11 +6593,6 @@
\chapfonts \rm
\let\footnote=\errfootnoteheading % give better error message
%
- % Have to define \currentsection before calling \donoderef, because the
- % xref code eventually uses it. On the other hand, it has to be called
- % after \pchapsepmacro, or the headline will change too soon.
- \gdef\currentsection{#1}%
- %
% Only insert the separating space if we have a chapter/appendix
% number, and don't print the unnumbered ``number''.
\ifx\temptype\Ynothingkeyword
@@ -6585,7 +6619,7 @@
% been typeset. If the destination for the pdf outline is after the
% text, then jumping from the outline may wind up with the text not
% being visible, for instance under high magnification.
- \donoderef{#2}%
+ \donoderef{#2}{#1}%
%
% Typeset the actual heading.
\nobreak % Avoid page breaks at the interline glue.
@@ -6701,10 +6735,8 @@
\ifx\temptype\Ynothingkeyword
\setbox0 = \hbox{}%
\def\toctype{unn}%
- \gdef\currentsection{#1}%
\else\ifx\temptype\Yomitfromtockeyword
- % for @headings -- no section number, don't include in toc,
- % and don't redefine \currentsection.
+ % for @headings -- no section number, don't include in toc.
\setbox0 = \hbox{}%
\def\toctype{omit}%
\let\sectionlevel=\empty
@@ -6711,11 +6743,9 @@
\else\ifx\temptype\Yappendixkeyword
\setbox0 = \hbox{#4\enspace}%
\def\toctype{app}%
- \gdef\currentsection{#1}%
\else
\setbox0 = \hbox{#4\enspace}%
\def\toctype{num}%
- \gdef\currentsection{#1}%
\fi\fi\fi
%
% Write the toc entry (before \donoderef). See comments in \chapmacro.
@@ -6723,7 +6753,7 @@
%
% Write the node reference (= pdf destination for pdftex).
% Again, see comments in \chapmacro.
- \donoderef{#3}%
+ \donoderef{#3}{#1}%
%
% Interline glue will be inserted when the vbox is completed.
% That glue will be a valid breakpoint for the page, since it'll be
@@ -6955,6 +6985,7 @@
%
\def\contents{%
\startcontents{\putwordTOC}{\contentsmkdest}%
+ \ifxetex\xetexpreauxfile\fi
\openin 1 \tocreadfilename\space
\ifeof 1 \else
\findsecnowidths
@@ -6966,6 +6997,7 @@
\pdfmakeoutlines
\fi
\closein 1
+ \ifxetex\xetexpostauxfile\fi
\endgroup
\contentsendroman
}
@@ -6999,11 +7031,13 @@
\let\numsubsubsecentry = \numsecentry
\let\appsubsubsecentry = \numsecentry
\let\unnsubsubsecentry = \numsecentry
+ \ifxetex\xetexpreauxfile\fi
\openin 1 \tocreadfilename\space
\ifeof 1 \else
\readtocfile
\fi
\closein 1
+ \ifxetex\xetexpostauxfile\fi
\vfill \eject
\contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
@@ -7167,6 +7201,7 @@
\extrasecnoskip=0pt
\let\tocnodetarget\empty
+\let\entrypagetarget\empty
% \tocentry{TITLE}{SEC NO}{NODE}{PAGE}
%
@@ -7174,7 +7209,7 @@
\def\tocnodetarget{#3}%
\def\secno{#2}%
\ifx\empty\secno
- \entry{#1}{#4}%
+ \entryinternal{#1}{#4}%
\else
\ifdim 0pt=\secnowidth
\setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}%
@@ -7185,7 +7220,7 @@
#2\hskip\labelspace\hskip\extrasecnoskip\hfill}%
\fi
\entrycontskip=\wd0
- \entry{\box0 #1}{#4}%
+ \entryinternal{\box0 #1}{#4}%
\fi
}
\newdimen\labelspace
@@ -8170,18 +8205,11 @@
}
\fi
-\let\E=\expandafter
-
% Used at the time of macro expansion.
% Argument is macro body with arguments substituted
\def\scanmacro#1{%
\newlinechar`\^^M
- % expand the expansion of \eatleadingcr twice to maybe remove a leading
- % newline (and \else and \fi tokens), then call \eatspaces on the result.
- \def\xeatspaces##1{%
- \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
- }}%
- \def\xempty##1{}%
+ \def\xeatspaces##1{\eatleadingcrthen\eatspaces{##1}}%
%
% Process the macro body under the current catcode regime.
\scantokens{#1 at comment}%
@@ -8234,10 +8262,12 @@
\unbrace{\gdef\trim@@@ #1 } #2@{#1}
}
-{\catcode`\^^M=\other%
-\gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
-% Warning: this won't work for a delimited argument
-% or for an empty argument
+% Trim a single leading ^^M off a string, then call #1
+{\catcode`\^^M=\active \catcode`\Q=3%
+\gdef\eatleadingcrthen #1#2{\eatlcra #1Q#2Q^^MQ}%
+\gdef\eatlcra #1#2Q^^M{\eatlcrb #1#2Q}%
+\gdef\eatlcrb #1Q#2Q#3Q{#1{#2}}%
+}
% Trim a single trailing ^^M off a string.
{\catcode`\^^M=\other \catcode`\Q=3%
@@ -8373,6 +8403,10 @@
% <parameter list> is #, then the preceding argument is delimited by
% an opening brace, and that opening brace is not consumed.
+% Make @ a letter, so that we can make private-to-Texinfo macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
% Parse the optional {params} list to @macro or @rmacro.
% Set \paramno to the number of arguments,
% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
@@ -8385,7 +8419,7 @@
% That gets used by \mbodybackslash (above).
%
% If there are 10 or more arguments, a different technique is used: see
-% \parsemmanyargdef.
+% \parsemmanyargdef@@.
%
\def\parsemargdef#1;{%
\paramno=0\def\paramlist{}%
@@ -8392,7 +8426,6 @@
\let\hash\relax
% \hash is redefined to `#' later to get it into definitions
\let\xeatspaces\relax
- \let\xempty\relax
\parsemargdefxxx#1,;,%
\ifnum\paramno<10\relax\else
\paramno0\relax
@@ -8404,11 +8437,9 @@
\else \let\next=\parsemargdefxxx
\advance\paramno by 1
\expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
+ {\xeatspaces{\hash\the\paramno}}%
\edef\paramlist{\paramlist\hash\the\paramno,}%
\fi\next}
-% the \xempty{} is to give \eatleadingcr an argument in the case of an
-% empty macro argument.
% \parsemacbody, \parsermacbody
%
@@ -8419,15 +8450,13 @@
% body to be transformed.
% Set \macrobody to the body of the macro, and call \macrodef.
%
+\catcode `\@\texiatcatcode
{\catcode`\ =\other\long\gdef\parsemacbody#1 at end macro{%
\xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
{\catcode`\ =\other\long\gdef\parsermacbody#1 at end rmacro{%
\xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
+\catcode `\@=11\relax
-% Make @ a letter, so that we can make private-to-Texinfo macro names.
-\edef\texiatcatcode{\the\catcode`\@}
-\catcode `@=11\relax
-
%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
% If there are 10 or more arguments, a different technique is used, where the
@@ -8687,15 +8716,13 @@
\noexpand\expandafter
\expandafter\noexpand\csname\the\macname @@\endcsname}%
\expandafter\xdef\csname\the\macname @@\endcsname##1{%
- \noexpand\passargtomacro
- \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
+ \noexpand\passargtomacro
+ \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
\expandafter\xdef\csname\the\macname @@@\endcsname##1{%
- \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname @@@@\endcsname\paramlist{%
- \endgroup\noexpand\scanmacro{\macrobody}}%
+ \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
+ \expandaftergroup{\expandafter\xdef\csname\the\macname @@@@\endcsname}%
+ \paramlist{%
+ \endgroup\noexpand\scanmacro{\macrobody}}%
\else % 10 or more:
\expandafter\xdef\csname\the\macname\endcsname{%
\noexpand\getargvals@{\the\macname}{\argl}%
@@ -8707,6 +8734,16 @@
\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
+% utility definition to avoid excessive use of \expandafter. call
+% as \expandaftergroup{CONTENT}\WORD to expand \WORD exactly once and remove
+% braces around CONTENT.
+\def\expandaftergroup#1#2{%
+ \expandafter\expandaftergroupx\expandafter{#2}{#1}%
+}
+\def\expandaftergroupx#1#2{%
+ #2#1%
+}
+
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
@@ -8876,9 +8913,8 @@
\expandafter\noexpand
\csname\the\macname @@@\endcsname##1\noexpand\endlinemacro
}
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter\csname\the\macname @@@\endcsname\paramlist{%
+ \expandaftergroup{\expandafter\xdef\csname\the\macname @@@\endcsname}%
+ \paramlist{%
\newlinechar=13 % split \macrobody into lines
\noexpand\scantokens{\macrobody}%
}
@@ -8953,11 +8989,11 @@
\let\lastnode=\empty
% Write a cross-reference definition for the current node. #1 is the
-% type (Ynumbered, Yappendix, Ynothing).
+% type (Ynumbered, Yappendix, Ynothing). #2 is the section title.
%
-\def\donoderef#1{%
+\def\donoderef#1#2{%
\ifx\lastnode\empty\else
- \setref{\lastnode}{#1}%
+ \setref{\lastnode}{#1}{#2}%
\global\let\lastnode=\empty
\setnodeseenonce
\fi
@@ -8978,14 +9014,21 @@
%
\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
-\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+\def\anchor#1{%
+ \savesf \setref{#1}{Yanchor}{#1}\restoresf \ignorespaces
+}
-% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
-% anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name taken from \currentsection,
-% or the anchor name.
-% 2) NAME-snt - section number and type, passed as the SNT arg, or
-% empty for anchors.
+% @namedanchor{NAME, XREFNAME} -- define xref target at arbitrary point
+% with label text for cross-references to it.
+\def\namedanchor#1{\donamedanchor#1\finish}%
+\def\donamedanchor#1,#2\finish{%
+ \savesf \setref{#1}{Yanchor}{\ignorespaces #2\unskip}\restoresf \ignorespaces
+}
+
+% \setref{NAME}{SNT}{TITLE} defines a cross-reference point NAME (a node
+% or an anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name
+% 2) NAME-snt - section number and type, passed as the SNT arg.
% 3) NAME-pg - the page number.
%
% This is called from \donoderef, \anchor, and \dofloat. In the case of
@@ -8992,7 +9035,7 @@
% floats, there is an additional part, which is not written here:
% 4) NAME-lof - the text as it should appear in a @listoffloats.
%
-\def\setref#1#2{%
+\def\setref#1#2#3{%
\pdfmkdest{#1}%
\iflinks
{%
@@ -9004,7 +9047,7 @@
\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
##1}{##2}}% these are parameters of \writexrdef
}%
- \toks0 = \expandafter{\currentsection}%
+ \toks0 = {#3}%
\immediate \writexrdef{title}{\the\toks0 }%
\immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
\safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
@@ -9058,15 +9101,7 @@
\setbox\infofilenamebox = \hbox{\infofilename\unskip}%
%
\startxreflink{#1}{#4}%
- {%
- % Have to otherify everything special to allow the \csname to
- % include an _ in the xref name, etc.
- \indexnofonts
- \turnoffactive
- \def\value##1{##1}%
- \expandafter\global\expandafter\let\expandafter\Xthisreftitle
- \csname XR#1-title\endcsname
- }%
+ \getrefx{#1-title}\Xthisreftitle
%
% Float references are printed completely differently: "Figure 1.2"
% instead of "[somenode], p.3". \iffloat distinguishes them by
@@ -9099,7 +9134,6 @@
% Cross-manual reference with a printed manual name.
%
\crossmanualxref{\cite{\printedmanual\unskip}}%
- %
\else\ifdim \wd\infofilenamebox > 0pt
% Cross-manual reference with only an info filename (arg 4), no
% printed manual name (arg 5). This is essentially the same as
@@ -9106,14 +9140,17 @@
% the case above; we output the filename, since we have nothing else.
%
\crossmanualxref{\code{\infofilename\unskip}}%
- %
\else
% Reference within this manual.
%
- % Only output a following space if the -snt ref is nonempty, as the ref
- % will be empty for @unnumbered and @anchor.
- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}%
- \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ % Only output a following space if the -snt ref is nonempty, as is
+ % the case for @unnumbered and @anchor.
+ \getrefx{#1-snt}\tmp
+ \ifx\tmp\empty\else
+ \ifx\tmp\Yanchor\else
+ \tmp\space
+ \fi
+ \fi
%
% output the `[mynode]' via the macro below so it can be overridden.
\xrefprintnodename\printedrefname
@@ -9169,7 +9206,7 @@
\else
% Otherwise just copy the Info node name.
\def\printedrefname{\ignorespaces #1}%
- \fi%
+ \fi
\fi
\fi
\fi
@@ -9201,7 +9238,7 @@
\ifnum\filenamelength>0
goto file{\the\filename.pdf} name{\pdfdestname}%
\else
- goto name{\pdfmkpgn{\pdfdestname}}%
+ goto name{\pdfdestname}%
\fi
\else % XeTeX
\ifnum\filenamelength>0
@@ -9281,6 +9318,7 @@
%
\def\Ynothing{}
\def\Yomitfromtoc{}
+\def\Yanchor{\isanchor} \let\isanchor\relax
\def\Ynumbered{%
\ifnum\secno=0
\putwordChapter at tie \the\chapno
@@ -9307,14 +9345,7 @@
% \refx{NAME} - reference a cross-reference string named NAME.
\def\refx#1{%
- \requireauxfile
- {%
- \indexnofonts
- \turnoffactive
- \def\value##1{##1}%
- \expandafter\global\expandafter\let\expandafter\thisrefX
- \csname XR#1\endcsname
- }%
+ \getrefx{#1}\thisrefX
\ifx\thisrefX\relax
% If not defined, say something at least.
\angleleft un\-de\-fined\angleright
@@ -9335,6 +9366,17 @@
\fi
}
+% Set #2 to xref string #1
+\def\getrefx#1#2{%
+ \requireauxfile
+ {%
+ \indexnofonts
+ \turnoffactive
+ \def\value##1{##1}%
+ \expandafter\global\expandafter\let\expandafter#2\csname XR#1\endcsname
+ }%
+}
+
% This is the macro invoked by entries in the aux file. Define a control
% sequence for a cross-reference target (we prepend XR to the control sequence
% name to avoid collisions). The value is the page number. If this is a float
@@ -9399,6 +9441,7 @@
% Read the last existing aux file, if any. No error if none exists.
%
\def\tryauxfile{%
+ \ifxetex\xetexpreauxfile\fi
\openin 1 \jobname.aux
\ifeof 1 \else
\readdatafile{aux}%
@@ -9405,6 +9448,7 @@
\global\havexrefstrue
\fi
\closein 1
+ \ifxetex\xetexpostauxfile\fi
}
\def\setupdatafile{%
@@ -9790,14 +9834,15 @@
\global\advance\floatno by 1
%
{%
- % This magic value for \currentsection is output by \setref as the
- % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % This magic value for the third argument of \setref is output as
+ % the XREFLABEL-title value. \xrefX uses it to distinguish float
% labels (which have a completely different output format) from
% node and anchor labels. And \xrdef uses it to construct the
% lists of floats.
%
- \edef\currentsection{\floatmagic=\safefloattype}%
- \setref{\floatlabel}{Yfloat}%
+ \edef\tmp{\noexpand\setref{\floatlabel}{Yfloat}%
+ {\floatmagic=\safefloattype}}%
+ \tmp
}%
\fi
%
@@ -9919,7 +9964,7 @@
% #1 is the control sequence we are passed; we expand into a conditional
% which is true if #1 represents a float ref. That is, the magic
-% \currentsection value which we \setref above.
+% value which we passed to \setref above.
%
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
%
@@ -9976,6 +10021,7 @@
\toksA = \expandafter{\csname XR#1-lof\endcsname}%
%
% use the same \entry macro we use to generate the TOC and index.
+ \let\entry\entryinternal
\edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
\writeentry
}}
@@ -10071,17 +10117,24 @@
\fi
\fi
+\let\xetexpreauxfile\relax
+\let\xetexpostauxfile\relax
+
% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
% for non-UTF-8 (byte-wise) encodings.
%
\def\setbytewiseio{%
\ifxetex
- \XeTeXdefaultencoding "bytes" % For subsequent files to be read
- \XeTeXinputencoding "bytes" % For document root file
- % Unfortunately, there seems to be no corresponding XeTeX command for
- % output encoding. This is a problem for auxiliary index and TOC files.
- % The only solution would be perhaps to write out @U{...} sequences in
- % place of non-ASCII characters.
+ % For document root file
+ \XeTeXinputencoding "bytes"
+ %
+ % Setting for subsequent files to be read with @include.
+ \XeTeXdefaultencoding "bytes"
+ %
+ % Use UTF-8 for reading auxiliary index and TOC files, which are
+ % always output in UTF-8 with XeTeX.
+ \def\xetexpreauxfile{\XeTeXdefaultencoding "UTF-8"}%
+ \def\xetexpostauxfile{\XeTeXdefaultencoding "bytes"}%
\fi
\ifluatex
@@ -10713,12 +10766,12 @@
% Suppress ligature creation from adjacent characters.
\ifluatex
- \def\nolig{{}}
-\else
% Braces do not suppress ligature creation in LuaTeX, e.g. in of{}fice
% to suppress the "ff" ligature. Using a kern appears to be the only
% workaround.
\def\nolig{\kern0pt{}}
+\else
+ \def\nolig{{}}
\fi
% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
Modified: branches/stable/source/src/configure
===================================================================
--- branches/stable/source/src/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for TeX Live 2024-03-10.
+# Generated by GNU Autoconf 2.72 for TeX Live 2025-03-07.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -614,8 +614,8 @@
# Identity of this package.
PACKAGE_NAME='TeX Live'
PACKAGE_TARNAME='tex-live'
-PACKAGE_VERSION='2024-03-10'
-PACKAGE_STRING='TeX Live 2024-03-10'
+PACKAGE_VERSION='2025-03-07'
+PACKAGE_STRING='TeX Live 2025-03-07'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1549,7 +1549,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures TeX Live 2024-03-10 to adapt to many kinds of systems.
+'configure' configures TeX Live 2025-03-07 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1624,7 +1624,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of TeX Live 2024-03-10:";;
+ short | recursive ) echo "Configuration of TeX Live 2025-03-07:";;
esac
cat <<\_ACEOF
@@ -1945,7 +1945,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-TeX Live configure 2024-03-10
+TeX Live configure 2025-03-07
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2653,7 +2653,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by TeX Live $as_me 2024-03-10, which was
+It was created by TeX Live $as_me 2025-03-07, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -12549,7 +12549,7 @@
# Define the identity of the package.
PACKAGE='tex-live'
- VERSION='2024-03-10'
+ VERSION='2025-03-07'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -26733,7 +26733,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by TeX Live $as_me 2024-03-10, which was
+This file was extended by TeX Live $as_me 2025-03-07, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -26792,7 +26792,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-TeX Live config.status 2024-03-10
+TeX Live config.status 2025-03-07
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
@@ -28759,11 +28759,11 @@
test "x$srcdir" = x. || msg_compiling="$msg_compiling
from sources in $kpse_src"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result:
-** Configuration summary for $PACKAGE_STRING (2025$with_banner_add):
+** Configuration summary for $PACKAGE_STRING (2026/dev$with_banner_add):
$msg_compiling" >&5
printf "%s\n" "
-** Configuration summary for $PACKAGE_STRING (2025$with_banner_add):
+** Configuration summary for $PACKAGE_STRING (2026/dev$with_banner_add):
$msg_compiling" >&6; }
case $kpse_src$kpse_bld in
Modified: branches/stable/source/src/libs/README
===================================================================
--- branches/stable/source/src/libs/README 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/README 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-$Id: README 73588 2025-01-25 02:34:51Z kakuto $
+$Id: README 75188 2025-05-12 20:59:34Z kakuto $
Public domain. Originally created by Karl Berry, 2005.
Libraries we compile for TeX Live.
@@ -28,7 +28,7 @@
https://sourceforge.net/projects/silgraphite/files/graphite2/
(requires C++11)
-harfbuzz 10.2.0 - checked 12jan25
+harfbuzz 11.2.1 - checked 13may25
https://github.com/harfbuzz/harfbuzz/releases/latest
icu 76.1 - checked 27oct24 (requires C++17, e.g., g++13)
@@ -37,10 +37,9 @@
libpaper 1.1.29 - checked 07jan24
https://ftp.debian.org/debian/pool/main/libp/libpaper/
-libpng 1.6.46 - checked 25jan25
+libpng 1.6.48 - checked 01may25
https://sourceforge.net/projects/libpng/files/ - used by many
-lua 5.2.4
lua 5.3.6 - checked 04oct20
https://www.lua.org/ftp/
Lua updates must be done carefully, by the LuaTeX maintainer,
@@ -53,7 +52,7 @@
mpfi 1.5.4 - checked 1feb24
https://perso.ens-lyon.fr/nathalie.revol/software.html#download
-mpfr 4.2.1 - checked 1feb24
+mpfr 4.2.2 - checked 21mar25
https://ftp.gnu.org/gnu/mpfr/
pixman 0.42.2 - no longer checked
Modified: branches/stable/source/src/libs/configure
===================================================================
--- branches/stable/source/src/libs/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for TeX Live libs 2025.
+# Generated by GNU Autoconf 2.72 for TeX Live libs 2026/dev.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -603,8 +603,8 @@
# Identity of this package.
PACKAGE_NAME='TeX Live libs'
PACKAGE_TARNAME='tex-live-libs'
-PACKAGE_VERSION='2025'
-PACKAGE_STRING='TeX Live libs 2025'
+PACKAGE_VERSION='2026/dev'
+PACKAGE_STRING='TeX Live libs 2026/dev'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1471,7 +1471,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures TeX Live libs 2025 to adapt to many kinds of systems.
+'configure' configures TeX Live libs 2026/dev to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1542,7 +1542,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of TeX Live libs 2025:";;
+ short | recursive ) echo "Configuration of TeX Live libs 2026/dev:";;
esac
cat <<\_ACEOF
@@ -1839,7 +1839,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-TeX Live libs configure 2025
+TeX Live libs configure 2026/dev
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1999,7 +1999,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by TeX Live libs $as_me 2025, which was
+It was created by TeX Live libs $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -7617,7 +7617,7 @@
# Define the identity of the package.
PACKAGE='tex-live-libs'
- VERSION='2025'
+ VERSION='2026/dev'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -8650,7 +8650,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by TeX Live libs $as_me 2025, which was
+This file was extended by TeX Live libs $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8709,7 +8709,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-TeX Live libs config.status 2025
+TeX Live libs config.status 2026/dev
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: branches/stable/source/src/libs/libpng/ChangeLog
===================================================================
--- branches/stable/source/src/libs/libpng/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,13 @@
+2025-05-01 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Import libpng-1.6.48.
+ * version.ac: Adjust.
+
+2025-03-09 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Import libpng-1.6.47.
+ * version.ac: Adjust.
+
2025-01-25 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Import libpng-1.6.46.
Modified: branches/stable/source/src/libs/libpng/README
===================================================================
--- branches/stable/source/src/libs/libpng/README 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/README 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
- Building libpng-1.6.45 as part of the TL tree
+ Building libpng-1.6.48 as part of the TL tree
=============================================
This directory libs/libpng/ uses a proxy Makefile.am to build the libpng library
@@ -14,4 +14,4 @@
=============================
2009-07-23 Peter Breitenlohner <peb at mppmu.mpg.de>
-2025-01-25 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+2025-05-01 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Modified: branches/stable/source/src/libs/libpng/TLpatches/ChangeLog
===================================================================
--- branches/stable/source/src/libs/libpng/TLpatches/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/TLpatches/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,11 @@
+2025-05-01 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Import libpng-1.6.48.
+
+2025-03-09 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ Import libpng-1.6.47.
+
2025-01-25 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
Import libpng-1.6.46.
Modified: branches/stable/source/src/libs/libpng/TLpatches/TL-Changes
===================================================================
--- branches/stable/source/src/libs/libpng/TLpatches/TL-Changes 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/TLpatches/TL-Changes 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,5 +1,5 @@
-Changes applied to the libpng-1.6.46/ tree as obtained from:
- https://sourceforge.net/projects/libpng/files/libpng16/1.6.46/
+Changes applied to the libpng-1.6.48/ tree as obtained from:
+ https://sourceforge.net/projects/libpng/files/libpng16/1.6.48/
Copied:
scripts/pnglibconf.h.prebuilt -> pnglibconf.h
@@ -11,7 +11,6 @@
.editorconfig
.editorconfig-checker.json
.gitignore
- .travis.yml
.yamllint.yml
Makefile.in
aclocal.m4
Modified: branches/stable/source/src/libs/libpng/configure
===================================================================
--- branches/stable/source/src/libs/libpng/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for libpng (TeX Live) 1.6.46.
+# Generated by GNU Autoconf 2.72 for libpng (TeX Live) 1.6.48.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -604,8 +604,8 @@
# Identity of this package.
PACKAGE_NAME='libpng (TeX Live)'
PACKAGE_TARNAME='libpng--tex-live-'
-PACKAGE_VERSION='1.6.46'
-PACKAGE_STRING='libpng (TeX Live) 1.6.46'
+PACKAGE_VERSION='1.6.48'
+PACKAGE_STRING='libpng (TeX Live) 1.6.48'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1342,7 +1342,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures libpng (TeX Live) 1.6.46 to adapt to many kinds of systems.
+'configure' configures libpng (TeX Live) 1.6.48 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1414,7 +1414,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libpng (TeX Live) 1.6.46:";;
+ short | recursive ) echo "Configuration of libpng (TeX Live) 1.6.48:";;
esac
cat <<\_ACEOF
@@ -1534,7 +1534,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libpng (TeX Live) configure 1.6.46
+libpng (TeX Live) configure 1.6.48
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1861,7 +1861,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libpng (TeX Live) $as_me 1.6.46, which was
+It was created by libpng (TeX Live) $as_me 1.6.48, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4822,7 +4822,7 @@
# Define the identity of the package.
PACKAGE='libpng--tex-live-'
- VERSION='1.6.46'
+ VERSION='1.6.48'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -7996,7 +7996,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libpng (TeX Live) $as_me 1.6.46, which was
+This file was extended by libpng (TeX Live) $as_me 1.6.48, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8064,7 +8064,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-libpng (TeX Live) config.status 1.6.46
+libpng (TeX Live) config.status 1.6.48
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,5 +1,5 @@
-libpng 1.6.46 - January 23, 2025
-================================
+libpng 1.6.48 - April 30, 2025
+==============================
This is a public release of libpng, intended for use in production code.
@@ -9,13 +9,13 @@
Source files with LF line endings (for Unix/Linux):
- * libpng-1.6.46.tar.xz (LZMA-compressed, recommended)
- * libpng-1.6.46.tar.gz (deflate-compressed)
+ * libpng-1.6.48.tar.xz (LZMA-compressed, recommended)
+ * libpng-1.6.48.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows):
- * lpng1646.7z (LZMA-compressed, recommended)
- * lpng1646.zip (deflate-compressed)
+ * lpng1648.7z (LZMA-compressed, recommended)
+ * lpng1648.zip (deflate-compressed)
Other information:
@@ -25,17 +25,17 @@
* TRADEMARK.md
-Changes from version 1.6.45 to version 1.6.46
+Changes from version 1.6.47 to version 1.6.48
---------------------------------------------
- * Added support for the mDCV and cLLI chunks.
- (Contributed by John Bowler)
- * Fixed a build issue affecting C89 compilers.
- This was a regression introduced in libpng-1.6.45.
- (Contributed by John Bowler)
- * Added makefile.c89, specifically for testing C89 compilers.
- * Cleaned up contrib/pngminus: corrected an old typo, removed an old
- workaround, and updated the CMake file.
+ * Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
+ (Reported by Mohit Bakshi; fixed by John Bowler)
+ * Added #error directives to discourage the inclusion of private
+ libpng implementation header files in PNG-supporting applications.
+ * Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
+ alternative to `DFA_XTRA`.
+ * Removed the Travis CI configuration files, with heartfelt thanks for
+ their generous support of our project over the past five years!
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Modified: branches/stable/source/src/libs/libpng/libpng-src/CHANGES
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/CHANGES 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/CHANGES 2025-05-17 22:44:20 UTC (rev 964)
@@ -6239,6 +6239,28 @@
Cleaned up contrib/pngminus: corrected an old typo, removed an old
workaround, and updated the CMake file.
+Version 1.6.47 [February 18, 2025]
+ Modified the behaviour of colorspace chunks in order to adhere
+ to the new precedence rules formulated in the latest draft of
+ the PNG Specification.
+ (Contributed by John Bowler)
+ Fixed a latent bug in `png_write_iCCP`.
+ This would have been a read-beyond-end-of-malloc vulnerability,
+ introduced early in the libpng-1.6.0 development, yet (fortunately!)
+ it was inaccessible before the above-mentioned modification of the
+ colorspace precedence rules, due to pre-existing colorspace checks.
+ (Reported by Bob Friesenhahn; fixed by John Bowler)
+
+Version 1.6.48 [April 30, 2025]
+ Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
+ (Reported by Mohit Bakshi; fixed by John Bowler)
+ Added #error directives to discourage the inclusion of private
+ libpng implementation header files in PNG-supporting applications.
+ Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
+ alternative to `DFA_XTRA`.
+ Removed the Travis CI configuration files, with heartfelt thanks for
+ their generous support of our project over the past five years!
+
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
Modified: branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt 2025-05-17 22:44:20 UTC (rev 964)
@@ -14,11 +14,11 @@
#
# SPDX-License-Identifier: libpng-2.0
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.14...4.0)
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
-set(PNGLIB_REVISION 46)
+set(PNGLIB_REVISION 48)
set(PNGLIB_SUBREVISION 0)
#set(PNGLIB_SUBREVISION "git")
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION})
@@ -34,7 +34,8 @@
# Allow the users to specify an application-specific API prefix for libpng
# vendoring purposes. A standard libpng build should have no such prefix.
-set(PNG_PREFIX ""
+set(PNG_PREFIX
+ ""
CACHE STRING "Prefix to prepend to the API function names")
# Allow the users to override the postfix appended to debug library file names.
@@ -41,12 +42,31 @@
# Previously, we used to set CMAKE_DEBUG_POSTFIX globally. That variable should
# not be cached, however, because doing so would affect all projects processed
# after libpng, in unexpected and undesirable ways.
-set(PNG_DEBUG_POSTFIX "d"
+set(PNG_DEBUG_POSTFIX
+ "d"
CACHE STRING "Postfix to append to library file names under the Debug configuration")
# Allow the users to import their own extra configuration settings.
-set(DFA_XTRA ""
- CACHE FILEPATH "File containing extra configuration settings")
+# Those settings can be either passed via DFA_XTRA if they are in DFA form
+# (such as "pngusr.dfa"), or via PNG_LIBCONF_HEADER if they are in prebuilt
+# header file form (such as "scripts/pnglibconf.h.prebuilt"), but not both.
+# For platforms such as Android or iOS, or in certain cross-platform build
+# scenarios, having a valid PNG_LIBCONF_HEADER is mandatory.
+set(DFA_XTRA
+ ""
+ CACHE FILEPATH "DFA file containing customized build configuration settings for libpng")
+set(PNG_LIBCONF_HEADER
+ ""
+ CACHE FILEPATH "C header file containing customized build configuration settings for libpng")
+set(PNG_LIBCONF_HEADER_PREBUILT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
+if(ANDROID OR IOS)
+ set(PNG_LIBCONF_HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
+endif()
+if((NOT DFA_XTRA STREQUAL "") AND (NOT PNG_LIBCONF_HEADER STREQUAL ""))
+ message(SEND_ERROR "The options DFA_XTRA=\"${DFA_XTRA}\" "
+ "and PNG_LIBCONF_HEADER=\"${PNG_LIBCONF_HEADER}\" "
+ "are mutually exclusive")
+endif()
# Allow the users to switch on/off various library build types.
option(PNG_SHARED "Build libpng as a shared library" ON)
@@ -53,7 +73,12 @@
option(PNG_STATIC "Build libpng as a static library" ON)
if(APPLE)
option(PNG_FRAMEWORK "Build libpng as a framework bundle" ON)
+else()
+ option(PNG_FRAMEWORK "Build libpng as a framework bundle (not available on this platform)" OFF)
endif()
+if(NOT APPLE AND PNG_FRAMEWORK)
+ message(SEND_ERROR "The option PNG_FRAMEWORK should not be set on this platform")
+endif()
# Allow the users to switch on/off the auxiliary build and test artifacts.
# These artifacts are NOT part of libpng proper, and are subject to change
@@ -74,8 +99,8 @@
if(NOT PNG_EXECUTABLES)
message(DEPRECATION "The option PNG_EXECUTABLES has been deprecated in favour of PNG_TOOLS")
if(PNG_TOOLS)
- message(AUTHOR_WARNING
- "Setting PNG_TOOLS to ${PNG_EXECUTABLES}, to stay compatible with PNG_EXECUTABLES")
+ message(AUTHOR_WARNING "Setting PNG_TOOLS to ${PNG_EXECUTABLES}, "
+ "to stay compatible with PNG_EXECUTABLES")
set(PNG_TOOLS "${PNG_EXECUTABLES}")
endif()
endif()
@@ -104,16 +129,15 @@
option(PNG_BUILD_ZLIB "[Deprecated; please use ZLIB_ROOT]" OFF)
if(PNG_BUILD_ZLIB)
if("x${ZLIB_ROOT}" STREQUAL "x")
- message(SEND_ERROR
- "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
- "please use ZLIB_ROOT instead")
+ message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
+ "please use ZLIB_ROOT instead")
else()
- message(SEND_ERROR
- "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
- "using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
+ message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
+ "using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
endif()
endif()
+# Find the prerequisite libraries.
find_package(ZLIB REQUIRED)
if(UNIX
@@ -135,15 +159,17 @@
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm|aarch)")
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm64|aarch64)")
set(PNG_ARM_NEON_POSSIBLE_VALUES on off)
- set(PNG_ARM_NEON "on"
+ set(PNG_ARM_NEON
+ "on"
CACHE STRING "Enable ARM NEON optimizations: on|off; on is default")
else()
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
- set(PNG_ARM_NEON "off"
+ set(PNG_ARM_NEON
+ "off"
CACHE STRING "Enable ARM NEON optimizations: check|on|off; off is default")
endif()
set_property(CACHE PNG_ARM_NEON
- PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
+ PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
@@ -165,10 +191,11 @@
# Set definitions and sources for PowerPC.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(powerpc|ppc64)")
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
- set(PNG_POWERPC_VSX "on"
+ set(PNG_POWERPC_VSX
+ "on"
CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default")
set_property(CACHE PNG_POWERPC_VSX
- PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
+ PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
@@ -187,10 +214,11 @@
# Set definitions and sources for Intel.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(i[3-6]86|x86|amd64)")
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
- set(PNG_INTEL_SSE "on"
+ set(PNG_INTEL_SSE
+ "on"
CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default")
set_property(CACHE PNG_INTEL_SSE
- PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
+ PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
@@ -209,10 +237,11 @@
# Set definitions and sources for MIPS.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)")
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
- set(PNG_MIPS_MSA "on"
+ set(PNG_MIPS_MSA
+ "on"
CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
set_property(CACHE PNG_MIPS_MSA
- PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
+ PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index_msa)
if(index_msa EQUAL -1)
message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
@@ -219,10 +248,11 @@
endif()
set(PNG_MIPS_MMI_POSSIBLE_VALUES on off)
- set(PNG_MIPS_MMI "on"
+ set(PNG_MIPS_MMI
+ "on"
CACHE STRING "Enable MIPS_MMI optimizations: on|off; on is default")
set_property(CACHE PNG_MIPS_MMI
- PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
+ PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
list(FIND PNG_MIPS_MMI_POSSIBLE_VALUES ${PNG_MIPS_MMI} index_mmi)
if(index_mmi EQUAL -1)
message(FATAL_ERROR "PNG_MIPS_MMI must be one of [${PNG_MIPS_MMI_POSSIBLE_VALUES}]")
@@ -257,25 +287,25 @@
if(PNG_TARGET_ARCHITECTURE MATCHES "^(loongarch)")
include(CheckCCompilerFlag)
set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off)
- set(PNG_LOONGARCH_LSX "on"
+ set(PNG_LOONGARCH_LSX
+ "on"
CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default")
set_property(CACHE PNG_LOONGARCH_LSX
- PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
+ PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]")
elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off")
- CHECK_C_COMPILER_FLAG("-mlsx" COMPILER_SUPPORTS_LSX)
+ check_c_compiler_flag("-mlsx" COMPILER_SUPPORTS_LSX)
if(COMPILER_SUPPORTS_LSX)
set(libpng_loongarch_sources
loongarch/loongarch_lsx_init.c
loongarch/filter_lsx_intrinsics.c)
set_source_files_properties(${libpng_loongarch_sources}
- PROPERTIES
- COMPILE_FLAGS "-mlsx")
+ PROPERTIES COMPILE_FLAGS "-mlsx")
add_definitions(-DPNG_LOONGARCH_LSX_OPT=1)
else()
- message(FATAL_ERROR "Compiler does not support -mlsx option")
+ message(FATAL_ERROR "This compiler does not support the -mlsx option")
endif()
else()
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
@@ -324,7 +354,8 @@
# Solaris, because of an incompatibility with the Solaris link editor.
list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
endif()
- list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
+ list(APPEND CMAKE_REQUIRED_FLAGS
+ "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
check_c_source_compiles("
void sym1(void) {}
void sym2(void) {}
@@ -348,26 +379,48 @@
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
endif()
-# Find an AWK language processor.
-# Start with specific AWK implementations like gawk and nawk, which are
-# known to work with our scripts, then fall back to the system awk.
-find_program(AWK NAMES gawk nawk awk)
-if(AWK)
- message(STATUS "Found AWK program: ${AWK}")
-else()
- message(STATUS "Could not find an AWK-compatible program")
+if(PNG_LIBCONF_HEADER STREQUAL "")
+ # No custom configuration header file has been specified, so we build it
+ # from our DFA files and (optionally) out of the user-supplied DFA file.
+ # Find an AWK language processor.
+ # Start with specific AWK implementations like gawk and nawk, which are
+ # known to work with our scripts, then fall back to the system awk.
+ find_program(AWK NAMES gawk nawk awk)
+ if(AWK)
+ message(STATUS "Found AWK program: ${AWK}")
+ else()
+ message(STATUS "Could not find an AWK-compatible program")
+ endif()
endif()
-if(NOT AWK OR (ANDROID OR IOS))
- # No awk available to generate sources; use pre-built pnglibconf.h
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
- ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
+# Include the internal module PNGCheckLibconf.cmake
+include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGCheckLibconf.cmake)
+
+if(NOT PNG_LIBCONF_HEADER STREQUAL "")
+ # Configure libpng with the user-defined pnglibconf.h file.
+ png_check_libconf(HEADER "${PNG_LIBCONF_HEADER}")
+ configure_file("${PNG_LIBCONF_HEADER}"
+ ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
+ @ONLY)
add_custom_target(png_genfiles)
+elseif(NOT AWK)
+ # No AWK program available to generate pnglibconf.h.
+ # Configure libpng with pnglibconf.h.prebuilt.
+ png_check_libconf(HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
+ configure_file("${PNG_LIBCONF_HEADER_PREBUILT}"
+ ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
+ @ONLY)
+ add_custom_target(png_genfiles)
else()
+ png_check_libconf(DFA_XTRA "${DFA_XTRA}")
+
# Include the internal module PNGGenConfig.cmake
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGGenConfig.cmake)
- # Copy the awk scripts, converting their line endings to Unix (LF)
+ # Work around a limitation of various Windows AWK programs that are
+ # unable to process CRLF-terminated AWK scripts.
+ # Copy these AWK scripts to a temporary location, converting their
+ # line endings from Windows (CRLF) to Unix (LF) at the destination.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk
${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk
@ONLY
@@ -413,7 +466,8 @@
# Generate pnglibconf.h
generate_source(OUTPUT "pnglibconf.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
+ pnglibconf_out
${PNGLIBCONF_H_EXTRA_DEPENDS})
add_custom_target(pnglibconf_h
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
@@ -420,7 +474,8 @@
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
+ pnglibconf_h)
add_custom_target(png_scripts_intprefix_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
@@ -428,7 +483,8 @@
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out)
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
+ pnglibconf_out)
add_custom_target(png_scripts_prefix_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out")
@@ -440,7 +496,8 @@
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
+ pnglibconf_h)
add_custom_target(png_scripts_sym_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out")
@@ -456,7 +513,8 @@
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
+ pnglibconf_h)
add_custom_target(png_scripts_vers_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
@@ -489,20 +547,33 @@
# A single target handles generation of all generated files.
add_custom_target(png_genfiles
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym" png_gensym
- "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers" png_genvers
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c" pnglibconf_c
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h
- "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
- "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h" pngprefix_h
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out" png_scripts_intprefix_out
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c" png_scripts_pnglibconf_c
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out" png_scripts_prefix_out
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out" png_scripts_sym_out
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk" png_scripts_symbols_chk
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out" png_scripts_symbols_out
- "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out" png_scripts_vers_out)
-endif(NOT AWK OR (ANDROID OR IOS))
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
+ png_gensym
+ "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
+ png_genvers
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
+ pnglibconf_c
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
+ pnglibconf_h
+ "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
+ pnglibconf_out
+ "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
+ pngprefix_h
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
+ png_scripts_intprefix_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
+ png_scripts_pnglibconf_c
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
+ png_scripts_prefix_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
+ png_scripts_sym_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
+ png_scripts_symbols_chk
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
+ png_scripts_symbols_out
+ "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
+ png_scripts_vers_out)
+endif()
# List the source code files.
set(libpng_public_hdrs
@@ -516,7 +587,7 @@
pnginfo.h
pngstruct.h
)
-if(AWK AND NOT (ANDROID OR IOS))
+if(AWK)
list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
endif()
set(libpng_sources
@@ -601,34 +672,38 @@
add_library(png_shared SHARED ${libpng_sources})
add_dependencies(png_shared png_genfiles)
list(APPEND PNG_LIBRARY_TARGETS png_shared)
- set_target_properties(png_shared PROPERTIES
- OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
- DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
- VERSION "${PNGLIB_SHARED_VERSION}"
- SOVERSION "${PNGLIB_ABI_VERSION}")
+ set_target_properties(png_shared
+ PROPERTIES OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
+ DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
+ VERSION "${PNGLIB_SHARED_VERSION}"
+ SOVERSION "${PNGLIB_ABI_VERSION}")
if(UNIX AND AWK)
if(HAVE_LD_VERSION_SCRIPT)
- set_target_properties(png_shared PROPERTIES
- LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
+ set_target_properties(png_shared
+ PROPERTIES LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
elseif(HAVE_SOLARIS_LD_VERSION_SCRIPT)
- set_target_properties(png_shared PROPERTIES
- LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
+ set_target_properties(png_shared
+ PROPERTIES LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
endif()
endif()
if(APPLE)
# Avoid CMake's implicit compile definition "png_shared_EXPORTS".
- set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL "")
+ set_target_properties(png_shared
+ PROPERTIES DEFINE_SYMBOL "")
elseif(WIN32)
# Use the explicit compile definition "PNG_BUILD_DLL" for Windows DLLs.
- set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
+ set_target_properties(png_shared
+ PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
endif()
target_include_directories(png_shared
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(png_shared
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
- target_include_directories(png_shared SYSTEM
+ target_include_directories(png_shared
+ SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
- target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY})
+ target_link_libraries(png_shared
+ PUBLIC ZLIB::ZLIB ${M_LIBRARY})
endif()
if(PNG_STATIC)
@@ -635,21 +710,22 @@
add_library(png_static STATIC ${libpng_sources})
add_dependencies(png_static png_genfiles)
list(APPEND PNG_LIBRARY_TARGETS png_static)
- set_target_properties(png_static PROPERTIES
- OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
- DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
+ set_target_properties(png_static
+ PROPERTIES OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
+ DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
target_include_directories(png_static
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(png_static
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
- target_include_directories(png_static SYSTEM
+ target_include_directories(png_static
+ SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
- target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY})
+ target_link_libraries(png_static
+ PUBLIC ZLIB::ZLIB ${M_LIBRARY})
endif()
if(PNG_FRAMEWORK AND NOT APPLE)
- message(AUTHOR_WARNING
- "Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
+ message(AUTHOR_WARNING "Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
set(PNG_FRAMEWORK OFF)
endif()
@@ -657,25 +733,28 @@
add_library(png_framework SHARED ${libpng_sources})
add_dependencies(png_framework png_genfiles)
list(APPEND PNG_LIBRARY_TARGETS png_framework)
- set_target_properties(png_framework PROPERTIES
- FRAMEWORK TRUE
- FRAMEWORK_VERSION "${PNGLIB_VERSION}"
- MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
- MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
- MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
- XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
- PUBLIC_HEADER "${libpng_public_hdrs}"
- OUTPUT_NAME "png"
- DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
+ set_target_properties(png_framework
+ PROPERTIES FRAMEWORK TRUE
+ FRAMEWORK_VERSION "${PNGLIB_VERSION}"
+ MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
+ MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
+ MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
+ XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
+ PUBLIC_HEADER "${libpng_public_hdrs}"
+ OUTPUT_NAME "png"
+ DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
- set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
+ set_target_properties(png_framework
+ PROPERTIES DEFINE_SYMBOL "")
target_include_directories(png_framework
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(png_framework
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
- target_include_directories(png_framework SYSTEM
+ target_include_directories(png_framework
+ SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
- target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY})
+ target_link_libraries(png_framework
+ PUBLIC ZLIB::ZLIB ${M_LIBRARY})
endif()
if(NOT PNG_LIBRARY_TARGETS)
@@ -702,7 +781,8 @@
set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png")
add_executable(pngtest ${pngtest_sources})
- target_link_libraries(pngtest PRIVATE png_shared)
+ target_link_libraries(pngtest
+ PRIVATE png_shared)
png_add_test(NAME pngtest
COMMAND pngtest
@@ -713,7 +793,8 @@
FILES "${TEST_PNG3_PNGS}")
add_executable(pngvalid ${pngvalid_sources})
- target_link_libraries(pngvalid PRIVATE png_shared)
+ target_link_libraries(pngvalid
+ PRIVATE png_shared)
png_add_test(NAME pngvalid-gamma-16-to-8
COMMAND pngvalid
@@ -759,7 +840,8 @@
OPTIONS --transform)
add_executable(pngstest ${pngstest_sources})
- target_link_libraries(pngstest PRIVATE png_shared)
+ target_link_libraries(pngstest
+ PRIVATE png_shared)
foreach(gamma_type 1.8 linear none sRGB)
foreach(alpha_type none alpha)
@@ -814,7 +896,8 @@
endforeach()
add_executable(pngunknown ${pngunknown_sources})
- target_link_libraries(pngunknown PRIVATE png_shared)
+ target_link_libraries(pngunknown
+ PRIVATE png_shared)
png_add_test(NAME pngunknown-discard
COMMAND pngunknown
@@ -830,7 +913,8 @@
FILES "${PNGTEST_PNG}")
png_add_test(NAME pngunknown-sAPI
COMMAND pngunknown
- OPTIONS --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
+ OPTIONS --strict
+ bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
FILES "${PNGTEST_PNG}")
png_add_test(NAME pngunknown-save
COMMAND pngunknown
@@ -846,7 +930,8 @@
FILES "${PNGTEST_PNG}")
add_executable(pngimage ${pngimage_sources})
- target_link_libraries(pngimage PRIVATE png_shared)
+ target_link_libraries(pngimage
+ PRIVATE png_shared)
png_add_test(NAME pngimage-quick
COMMAND pngimage
@@ -860,11 +945,13 @@
if(PNG_SHARED AND PNG_TOOLS)
add_executable(pngfix ${pngfix_sources})
- target_link_libraries(pngfix PRIVATE png_shared)
+ target_link_libraries(pngfix
+ PRIVATE png_shared)
set(PNG_BIN_TARGETS pngfix)
add_executable(png-fix-itxt ${png_fix_itxt_sources})
- target_link_libraries(png-fix-itxt PRIVATE ZLIB::ZLIB ${M_LIBRARY})
+ target_link_libraries(png-fix-itxt
+ PRIVATE ZLIB::ZLIB ${M_LIBRARY})
list(APPEND PNG_BIN_TARGETS png-fix-itxt)
endif()
@@ -878,12 +965,11 @@
# CMake version 3.13.
cmake_parse_arguments(_SYM "" "FILE;TARGET" "" ${ARGN})
if(NOT _SYM_FILE AND NOT _SYM_TARGET)
- message(FATAL_ERROR "create_symlink: Missing FILE or TARGET argument")
+ message(FATAL_ERROR "create_symlink: Missing arguments: FILE or TARGET")
endif()
if(_SYM_FILE AND _SYM_TARGET)
- message(FATAL_ERROR "create_symlink: "
- "The arguments FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET}) "
- "are mutually-exclusive")
+ message(FATAL_ERROR "create_symlink: Mutually-exlusive arguments:"
+ "FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET})")
endif()
if(_SYM_FILE)
@@ -945,11 +1031,11 @@
# Only do this on Windows for Cygwin - the files don't make much sense
# outside of a UNIX look-alike.
if(NOT WIN32 OR CYGWIN OR MINGW)
- set(prefix ${CMAKE_INSTALL_PREFIX})
+ set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
- set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
- set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
- set(LIBS "-lz -lm")
+ set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+ set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+ set(LIBS "-lz -lm")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
@ONLY)
Modified: branches/stable/source/src/libs/libpng/libpng-src/README
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/README 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/README 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-README for libpng version 1.6.46
+README for libpng version 1.6.48
================================
See the note about version numbers near the top of `png.h`.
Modified: branches/stable/source/src/libs/libpng/libpng-src/arm/arm_init.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/arm/arm_init.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/arm/arm_init.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -35,14 +35,14 @@
#ifndef PNG_ARM_NEON_FILE
# if defined(__aarch64__) || defined(_M_ARM64)
/* ARM Neon is expected to be unconditionally available on ARM64. */
-# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64"
+# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
/* ARM Neon is expected to be available on the target CPU architecture. */
-# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch"
+# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
# elif defined(__linux__)
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
# else
-# error "No support for run-time ARM Neon checking; use compile-time options"
+# error No support for run-time ARM Neon checking; use compile-time options
# endif
#endif
@@ -53,7 +53,7 @@
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
-# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
+# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
void
Modified: branches/stable/source/src/libs/libpng/libpng-src/ci/README.md
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/README.md 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/README.md 2025-05-17 22:44:20 UTC (rev 964)
@@ -4,7 +4,7 @@
Copyright Notice
----------------
-Copyright (c) 2019-2024 Cosmin Truta.
+Copyright (c) 2019-2025 Cosmin Truta.
Use, modification and distribution are subject to the MIT License.
Please see the accompanying file `LICENSE_MIT.txt` or visit
Modified: branches/stable/source/src/libs/libpng/libpng-src/ci/ci_lint.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/ci_lint.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/ci_lint.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
-# Copyright (c) 2019-2024 Cosmin Truta.
+# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
@@ -61,7 +61,7 @@
}
ci_info "## LINTING: CI scripts ##"
ci_spawn "$CI_SHELLCHECK" --version
- find ./ci -maxdepth 1 -name "*.sh" | {
+ find ./ci -name "ci_*.sh" -not -name "ci_env.*.sh" | {
local my_file
while IFS="" read -r my_file
do
Deleted: branches/stable/source/src/libs/libpng/libpng-src/ci/ci_shellify.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/ci_shellify.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/ci_shellify.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,92 +0,0 @@
-#!/usr/bin/env bash
-set -o errexit -o pipefail -o posix
-
-# Copyright (c) 2019-2024 Cosmin Truta.
-#
-# Use, modification and distribution are subject to the MIT License.
-# Please see the accompanying file LICENSE_MIT.txt
-#
-# SPDX-License-Identifier: MIT
-
-# shellcheck source=ci/lib/ci.lib.sh
-source "$(dirname "$0")/lib/ci.lib.sh"
-cd "$CI_TOPLEVEL_DIR"
-
-function ci_shellify_c {
- # Convert C preprocessor text, specifically originating
- # from png.h, to shell scripting text.
- # Select only the easy-to-parse definitions of PNG_LIBPNG_*.
- sed -n -e '/^\# *define * PNG_LIBPNG_[^ ]* * ["0-9A-Za-z_]/ p' |
- sed -e 's/^\# *define * PNG\([^ ]*\) * \([^ ]*\)/PNG\1=\2/' \
- -e 's/=PNG\([0-9A-Za-z_]*\)/=\${PNG\1}/' \
- -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
-}
-
-function ci_shellify_autoconf {
- # Convert autoconf (M4) text, specifically originating
- # from configure.ac, to shell scripting text.
- # Select only the easy-to-parse definitions of PNGLIB_*.
- sed -n -e '/^ *PNGLIB_[^ ]*=[$"0-9A-Za-z_]/ p' |
- sed -e 's/^ *PNG\([0-9A-Za-z_]*\)=\([^# ]*\).*$/PNG\1=\2/' \
- -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
-}
-
-function ci_shellify_cmake {
- # Convert CMake lists text, specifically originating
- # from CMakeLists.txt, to shell scripting text.
- # Select only the easy-to-parse definitions of PNGLIB_*.
- sed -n -e '/^ *set *(PNGLIB_[^ ]* * [$"0-9A-Za-z_].*)/ p' |
- sed -e 's/^ *set *(PNG\([^ ]*\) * \([^() ]*\)).*$/PNG\1=\2/' \
- -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
-}
-
-function ci_shellify {
- local arg filename
- for arg in "$@"
- do
- test -f "$arg" || ci_err "no such file: '$arg'"
- filename="$(basename -- "$arg")"
- case "$filename" in
- ( *.[ch] )
- [[ $filename == png.h ]] || {
- ci_err "unable to shellify: '$filename' (expecting: 'png.h')"
- }
- ci_shellify_c <"$arg" ;;
- ( config* | *.ac )
- [[ $filename == configure.ac ]] || {
- ci_err "unable to shellify: '$filename' (expecting: 'configure.ac')"
- }
- ci_shellify_autoconf <"$arg" ;;
- ( *CMake* | *cmake* | *.txt )
- [[ $filename == [Cc][Mm]ake[Ll]ists.txt ]] || {
- ci_err "unable to shellify: '$filename' (expecting: 'CMakeLists.txt')"
- }
- ci_shellify_cmake <"$arg" ;;
- ( * )
- ci_err "unable to shellify: '$arg'" ;;
- esac
- done
-}
-
-function usage {
- echo "usage: $CI_SCRIPT_NAME [<options>] <files>..."
- echo "options: -?|-h|--help"
- echo "files: png.h|configure.ac|CMakeLists.txt"
- exit "${@:-0}"
-}
-
-function main {
- local opt
- while getopts ":" opt
- do
- # This ain't a while-loop. It only pretends to be.
- [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
- ci_err "unknown option: '$1'"
- done
- shift $((OPTIND - 1))
- [[ $# -eq 0 ]] && usage 2
- # And... go!
- ci_shellify "$@"
-}
-
-main "$@"
Modified: branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_cmake.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_cmake.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_cmake.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
-# Copyright (c) 2019-2024 Cosmin Truta.
+# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
@@ -64,6 +64,7 @@
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
+ ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
@@ -148,10 +149,12 @@
-S . \
-DCMAKE_INSTALL_PREFIX="$CI_INSTALL_DIR" \
"${all_cmake_vars[@]}"
- # Spawn "cmake --build ...".
- ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
- --config "$CI_CMAKE_BUILD_TYPE" \
- "${all_cmake_build_flags[@]}"
+ ci_expr $((CI_NO_BUILD)) || {
+ # Spawn "cmake --build ...".
+ ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
+ --config "$CI_CMAKE_BUILD_TYPE" \
+ "${all_cmake_build_flags[@]}"
+ }
ci_expr $((CI_NO_TEST)) || {
# Spawn "ctest" if testing is not disabled.
ci_spawn pushd "$CI_BUILD_DIR"
Modified: branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_configure.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_configure.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_configure.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
-# Copyright (c) 2019-2024 Cosmin Truta.
+# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
@@ -58,6 +58,7 @@
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
+ ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
@@ -131,8 +132,10 @@
ci_spawn cd "$CI_BUILD_DIR"
# Spawn "configure".
ci_spawn "$CI_SRC_DIR/configure" --prefix="$CI_INSTALL_DIR" $CI_CONFIGURE_FLAGS
- # Spawn "make".
- ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS
+ ci_expr $((CI_NO_BUILD)) || {
+ # Spawn "make".
+ ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS
+ }
ci_expr $((CI_NO_TEST)) || {
# Spawn "make test" if testing is not disabled.
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS test
Modified: branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_makefiles.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
-# Copyright (c) 2019-2024 Cosmin Truta.
+# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
@@ -51,6 +51,7 @@
ci_info "environment option: \$CI_LIBS: '$CI_LIBS'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
+ ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
@@ -145,10 +146,12 @@
for my_makefile in $CI_MAKEFILES
do
ci_info "using makefile: $my_makefile"
- # Spawn "make".
- ci_spawn "$CI_MAKE" -f "$my_makefile" \
- "${all_make_flags[@]}" \
- "${all_make_vars[@]}"
+ ci_expr $((CI_NO_BUILD)) || {
+ # Spawn "make".
+ ci_spawn "$CI_MAKE" -f "$my_makefile" \
+ "${all_make_flags[@]}" \
+ "${all_make_vars[@]}"
+ }
ci_expr $((CI_NO_TEST)) || {
# Spawn "make test" if testing is not disabled.
ci_spawn "$CI_MAKE" -f "$my_makefile" \
Modified: branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_version.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_version.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/ci_verify_version.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
-# Copyright (c) 2019-2024 Cosmin Truta.
+# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
@@ -12,33 +12,43 @@
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
-function ci_init_shellify {
- [[ -f $CI_SCRIPT_DIR/ci_shellify.sh ]] || {
- ci_err_internal "missing script: '$CI_SCRIPT_DIR/ci_shellify.sh'"
- }
-}
+# Declare the global environments collected from various sources.
+declare CI_ENV_LIBPNG_VER # collected from png.h
+declare CI_ENV_AUTOCONF_VER # collected from configure.ac
+declare CI_ENV_CMAKE_VER # collected from CMakeLists.txt
+declare CI_ENV_LIBPNGCONFIG_VER # collected from scripts/libpng-config-head.in
function ci_run_shellify {
+ local my_script my_result
+ my_script="$CI_SCRIPT_DIR/libexec/ci_shellify_${1#--}.sh"
+ shift 1
+ [[ -f $my_script ]] || {
+ ci_err_internal "missing script: '$my_script'"
+ }
ci_info "shellifying:" "$@"
- local my_result
- "$BASH" "$CI_SCRIPT_DIR/ci_shellify.sh" "$@"
+ "$BASH" "$my_script" "$@"
echo "$my_result" | "$BASH" --posix || ci_err "bad shellify output"
echo "$my_result"
}
-function ci_verify_version {
+function ci_init_version_verification {
ci_info "## START OF VERIFICATION ##"
- local my_env_libpng_ver my_env_autoconf_ver my_env_cmake_ver my_expect
- ci_init_shellify
- my_env_libpng_ver="$(ci_run_shellify png.h)"
- echo "$my_env_libpng_ver"
- my_env_autoconf_ver="$(ci_run_shellify configure.ac)"
- echo "$my_env_autoconf_ver"
- my_env_cmake_ver="$(ci_run_shellify CMakeLists.txt)"
- echo "$my_env_cmake_ver"
- ci_info "## VERIFYING: png.h version definitions ##"
- eval "$my_env_libpng_ver"
- local my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
+ CI_ENV_LIBPNG_VER="$(ci_run_shellify --c png.h)"
+ echo "$CI_ENV_LIBPNG_VER"
+ CI_ENV_AUTOCONF_VER="$(ci_run_shellify --autoconf configure.ac)"
+ echo "$CI_ENV_AUTOCONF_VER"
+ CI_ENV_CMAKE_VER="$(ci_run_shellify --cmake CMakeLists.txt)"
+ echo "$CI_ENV_CMAKE_VER"
+ CI_ENV_LIBPNGCONFIG_VER="$(ci_run_shellify --shell scripts/libpng-config-head.in)"
+ echo "$CI_ENV_LIBPNGCONFIG_VER"
+}
+
+# shellcheck disable=SC2154
+function ci_do_version_verification {
+ local my_expect
+ ci_info "## VERIFYING: version definitions in 'png.h' ##"
+ eval "$CI_ENV_LIBPNG_VER"
+ my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect"* ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_STRING == $my_expect*"
@@ -77,7 +87,7 @@
else
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD != [01]"
fi
- ci_info "## VERIFYING: png.h build definitions ##"
+ ci_info "## VERIFYING: build definitions in 'png.h' ##"
my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect" ]]
then
@@ -110,11 +120,11 @@
else
ci_err "unexpected: \$PNG_LIBPNG_VER_STRING == '$PNG_LIBPNG_VER_STRING'"
fi
- ci_info "## VERIFYING: png.h type definitions ##"
+ ci_info "## VERIFYING: type definitions in 'png.h' ##"
my_expect="$(echo "png_libpng_version_${PNG_LIBPNG_VER_STRING}" | tr . _)"
ci_spawn grep -w -e "$my_expect" png.h
- ci_info "## VERIFYING: configure.ac version definitions ##"
- eval "$my_env_autoconf_ver"
+ ci_info "## VERIFYING: version definitions in 'configure.ac' ##"
+ eval "$CI_ENV_AUTOCONF_VER"
if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" ]]
then
ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
@@ -121,8 +131,8 @@
else
ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
fi
- ci_info "## VERIFYING: CMakeLists.txt version definitions ##"
- eval "$my_env_cmake_ver"
+ ci_info "## VERIFYING: version definitions in 'CMakeLists.txt' ##"
+ eval "$CI_ENV_CMAKE_VER"
if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" && "$PNGLIB_SUBREVISION" == 0 ]]
then
ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
@@ -133,10 +143,28 @@
else
ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
fi
+ ci_info "## VERIFYING: version definitions in 'scripts/libpng-config-head.in' ##"
+ eval "$CI_ENV_LIBPNGCONFIG_VER"
+ if [[ "$version" == "$PNG_LIBPNG_VER_STRING" ]]
+ then
+ ci_info "matched: \$version == \$PNG_LIBPNG_VER_STRING"
+ else
+ ci_err "mismatched: \$version != \$PNG_LIBPNG_VER_STRING"
+ fi
+}
+
+function ci_finish_version_verification {
ci_info "## END OF VERIFICATION ##"
- ci_info "success!"
+ # Relying on "set -o errexit" to not reach here in case of error.
+ ci_info "## SUCCESS ##"
}
+function ci_verify_version {
+ ci_init_version_verification
+ ci_do_version_verification
+ ci_finish_version_verification
+}
+
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>]"
echo "options: -?|-h|--help"
Modified: branches/stable/source/src/libs/libpng/libpng-src/ci/lib/ci.lib.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/lib/ci.lib.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/lib/ci.lib.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019-2024 Cosmin Truta.
+# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
@@ -91,6 +91,9 @@
[[ ${CI_FORCE:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_FORCE: '$CI_FORCE'"
}
+[[ ${CI_NO_BUILD:-0} == [01] ]] || {
+ ci_err "bad boolean option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
+}
[[ ${CI_NO_TEST:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_TEST: '$CI_NO_TEST'"
}
@@ -100,3 +103,9 @@
[[ ${CI_NO_CLEAN:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
}
+if ci_expr $((CI_NO_BUILD))
+then
+ ci_expr $((CI_NO_TEST && CI_NO_INSTALL)) || {
+ ci_err "\$CI_NO_BUILD requires \$CI_NO_TEST and \$CI_NO_INSTALL"
+ }
+fi
Added: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_autoconf.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_autoconf.sh (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_autoconf.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+set -o errexit -o pipefail -o posix
+
+# Copyright (c) 2019-2025 Cosmin Truta.
+#
+# Use, modification and distribution are subject to the MIT License.
+# Please see the accompanying file LICENSE_MIT.txt
+#
+# SPDX-License-Identifier: MIT
+
+# shellcheck source=ci/lib/ci.lib.sh
+source "$(dirname "$0")/../lib/ci.lib.sh"
+
+function ci_shellify_autoconf {
+ # Convert autoconf (M4) text, specifically originating
+ # from configure.ac, to shell scripting text.
+ # Select only the easy-to-parse definitions of PNGLIB_*.
+ sed -n -e '/^ *PNGLIB_[^ ]*=[$"0-9A-Za-z_]/ p' |
+ sed -e 's/^ *PNG\([0-9A-Za-z_]*\)=\([^# ]*\).*$/PNG\1=\2/' \
+ -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
+}
+
+function usage {
+ echo "usage: $CI_SCRIPT_NAME [<options>] configure.ac"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
+}
+
+function main {
+ local opt
+ while getopts ":" opt
+ do
+ # This ain't a while-loop. It only pretends to be.
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
+ ci_err "unknown option: '$1'"
+ done
+ shift $((OPTIND - 1))
+ [[ $# -eq 0 ]] && usage 2
+ [[ $# -eq 1 ]] || ci_err "too many operands"
+ # And... go!
+ test -e "$1" || ci_err "no such file: '$1'"
+ [[ $(basename -- "$1") == configure.ac ]] || {
+ ci_err "incorrect operand: '$1' (expecting: 'configure.ac')"
+ }
+ ci_shellify_autoconf <"$1"
+}
+
+main "$@"
Property changes on: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_autoconf.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_c.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_c.sh (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_c.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+set -o errexit -o pipefail -o posix
+
+# Copyright (c) 2019-2025 Cosmin Truta.
+#
+# Use, modification and distribution are subject to the MIT License.
+# Please see the accompanying file LICENSE_MIT.txt
+#
+# SPDX-License-Identifier: MIT
+
+# shellcheck source=ci/lib/ci.lib.sh
+source "$(dirname "$0")/../lib/ci.lib.sh"
+
+function ci_shellify_c {
+ # Convert C preprocessor text, specifically originating
+ # from png.h, to shell scripting text.
+ # Select only the easy-to-parse definitions of PNG_LIBPNG_*.
+ sed -n -e '/^\# *define * PNG_LIBPNG_[^ ]* * ["0-9A-Za-z_]/ p' |
+ sed -e 's/^\# *define * PNG\([^ ]*\) * \([^ ]*\)/PNG\1=\2/' \
+ -e 's/=PNG\([0-9A-Za-z_]*\)/=\${PNG\1}/' \
+ -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
+}
+
+function usage {
+ echo "usage: $CI_SCRIPT_NAME [<options>] png.h"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
+}
+
+function main {
+ local opt
+ while getopts ":" opt
+ do
+ # This ain't a while-loop. It only pretends to be.
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
+ ci_err "unknown option: '$1'"
+ done
+ shift $((OPTIND - 1))
+ [[ $# -eq 0 ]] && usage 2
+ [[ $# -eq 1 ]] || ci_err "too many operands"
+ # And... go!
+ test -e "$1" || ci_err "no such file: '$1'"
+ [[ $(basename -- "$1") == png.h ]] || {
+ ci_err "incorrect operand: '$1' (expecting: 'png.h')"
+ }
+ ci_shellify_c <"$1"
+}
+
+main "$@"
Property changes on: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_c.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_cmake.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_cmake.sh (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_cmake.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+set -o errexit -o pipefail -o posix
+
+# Copyright (c) 2019-2025 Cosmin Truta.
+#
+# Use, modification and distribution are subject to the MIT License.
+# Please see the accompanying file LICENSE_MIT.txt
+#
+# SPDX-License-Identifier: MIT
+
+# shellcheck source=ci/lib/ci.lib.sh
+source "$(dirname "$0")/../lib/ci.lib.sh"
+
+function ci_shellify_cmake {
+ # Convert CMake lists text, specifically originating
+ # from CMakeLists.txt, to shell scripting text.
+ # Select only the easy-to-parse definitions of PNGLIB_*.
+ sed -n -e '/^ *set *(PNGLIB_[^ ]* * [$"0-9A-Za-z_].*)/ p' |
+ sed -e 's/^ *set *(PNG\([^ ]*\) * \([^() ]*\)).*$/PNG\1=\2/' \
+ -e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
+}
+
+function usage {
+ echo "usage: $CI_SCRIPT_NAME [<options>] CMakeLists.txt"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
+}
+
+function main {
+ local opt
+ while getopts ":" opt
+ do
+ # This ain't a while-loop. It only pretends to be.
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
+ ci_err "unknown option: '$1'"
+ done
+ shift $((OPTIND - 1))
+ [[ $# -eq 0 ]] && usage 2
+ [[ $# -eq 1 ]] || ci_err "too many operands"
+ # And... go!
+ test -e "$1" || ci_err "no such file: '$1'"
+ filename="$(basename -- "$1")"
+ [[ $filename == [Cc][Mm]ake[Ll]ists.txt ]] || {
+ ci_err "incorrect operand: '$1' (expecting: 'CMakeLists.txt')"
+ }
+ ci_shellify_cmake <"$1"
+}
+
+main "$@"
Property changes on: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_cmake.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_shell.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_shell.sh (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_shell.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+set -o errexit -o pipefail -o posix
+
+# Copyright (c) 2019-2025 Cosmin Truta.
+#
+# Use, modification and distribution are subject to the MIT License.
+# Please see the accompanying file LICENSE_MIT.txt
+#
+# SPDX-License-Identifier: MIT
+
+# shellcheck source=ci/lib/ci.lib.sh
+source "$(dirname "$0")/../lib/ci.lib.sh"
+
+function ci_shellify_shell {
+ # Convert shell scripting text to shell scripting text.
+ # Select only the easy-to-parse version definitions.
+ sed -n -e '/^ *[A-Za-z_][0-9A-Za-z_]*=[0-9][^ #]* *$/ p' |
+ sed -e 's/^ *\([^ ]*=[^ ]*\) *$/export \1;/'
+}
+
+function usage {
+ echo "usage: $CI_SCRIPT_NAME [<options>] libpng-config-head.in"
+ echo "options: -?|-h|--help"
+ exit "${@:-0}"
+}
+
+function main {
+ local opt
+ while getopts ":" opt
+ do
+ # This ain't a while-loop. It only pretends to be.
+ [[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
+ ci_err "unknown option: '$1'"
+ done
+ shift $((OPTIND - 1))
+ [[ $# -eq 0 ]] && usage 2
+ [[ $# -eq 1 ]] || ci_err "too many operands"
+ # And... go!
+ test -e "$1" || ci_err "no such file: '$1'"
+ [[ $(basename -- "$1") == libpng-config-head.in ]] || {
+ ci_err "incorrect operand: '$1' (expecting: 'libpng-config-head.in')"
+ }
+ ci_shellify_shell <"$1"
+}
+
+main "$@"
Property changes on: branches/stable/source/src/libs/libpng/libpng-src/ci/libexec/ci_shellify_shell.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: branches/stable/source/src/libs/libpng/libpng-src/configure.ac
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/configure.ac 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/configure.ac 2025-05-17 22:44:20 UTC (rev 964)
@@ -25,7 +25,7 @@
dnl Version number stuff here:
-AC_INIT([libpng],[1.6.46],[png-mng-implement at lists.sourceforge.net])
+AC_INIT([libpng],[1.6.48],[png-mng-implement at lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts/autoconf])
# libpng does not follow GNU file name conventions (hence 'foreign')
@@ -46,10 +46,10 @@
dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake
-PNGLIB_VERSION=1.6.46
+PNGLIB_VERSION=1.6.48
PNGLIB_MAJOR=1
PNGLIB_MINOR=6
-PNGLIB_RELEASE=46
+PNGLIB_RELEASE=48
dnl End of version number stuff
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/fixed.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/fixed.dfa (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/fixed.dfa 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,15 @@
+# fixed.dfa
+# Build time configuration of libpng
+#
+# Author: John Bowler
+# Copyright: (c) John Bowler, 2025
+# Usage rights:
+# To the extent possible under law, the author has waived all copyright and
+# related or neighboring rights to this work. This work is published from:
+# United States.
+#
+# Test the standard libpng configuration without floating point (the internal
+# fixed point implementations are used instead).
+#
+option FLOATING_ARITHMETIC off
+option FLOATING_POINT off
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/float-fixed.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/float-fixed.dfa (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/float-fixed.dfa 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,14 @@
+# fixed-float.dfa
+# Build time configuration of libpng
+#
+# Author: John Bowler
+# Copyright: (c) John Bowler, 2025
+# Usage rights:
+# To the extent possible under law, the author has waived all copyright and
+# related or neighboring rights to this work. This work is published from:
+# United States.
+#
+# Test the standard libpng configuration with the fixed point internal
+# implementation in place of the default floating point
+#
+option FLOATING_ARITHMETIC off
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nocompile-limits.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nocompile-limits.dfa (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nocompile-limits.dfa 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,21 @@
+# nolimits.dfa
+# Build time configuration of libpng
+#
+# Author: John Bowler
+# Copyright: (c) John Bowler, 2025
+#
+# Usage rights:
+# To the extent possible under law, the author has waived all copyright and
+# related or neighboring rights to this work. This work is published from:
+# United States.
+#
+# Build libpng without any limits and without run-time settable limits. Turning
+# USER_LIMITS off reduces libpng code size by allowing compile-time elimination
+# of some checking code.
+#
+option USER_LIMITS off
+
+@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX
+@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX
+@# define PNG_USER_CHUNK_CACHE_MAX 0
+@# define PNG_USER_CHUNK_MALLOC_MAX 0
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nolimits.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nolimits.dfa (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/nolimits.dfa 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,19 @@
+# nolimits.dfa
+# Build time configuration of libpng
+#
+# Author: John Bowler
+# Copyright: (c) John Bowler, 2025
+#
+# Usage rights:
+# To the extent possible under law, the author has waived all copyright and
+# related or neighboring rights to this work. This work is published from:
+# United States.
+#
+# Build libpng without any limits. With these settigs run-time limits are still
+# possible.
+#
+@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX
+@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX
+@# define PNG_USER_CHUNK_CACHE_MAX 0
+@# define PNG_USER_CHUNK_MALLOC_MAX 0
+
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/read-full.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/read-full.dfa (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/read-full.dfa 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,13 @@
+# read-full.dfa
+# Build time configuration of libpng
+#
+# Author: John Bowler
+# Copyright: (c) John Bowler, 2025
+# Usage rights:
+# To the extent possible under law, the author has waived all copyright and
+# related or neighboring rights to this work. This work is published from:
+# United States.
+#
+# Build libpng with no write support and full read support.
+#
+option WRITE off
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/write-full.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/write-full.dfa (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/conftest/write-full.dfa 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,13 @@
+# write-full.dfa
+# Build time configuration of libpng
+#
+# Author: John Bowler
+# Copyright: (c) John Bowler, 2025
+# Usage rights:
+# To the extent possible under law, the author has waived all copyright and
+# related or neighboring rights to this work. This work is published from:
+# United States.
+#
+# Build libpng with no read support and full write support.
+#
+option READ off
Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngpixel.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngpixel.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngpixel.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -184,11 +184,11 @@
compression_method, filter_method;
png_bytep row_tmp;
- /* Now associate the recently opened (FILE*) with the default
- * libpng initialization functions. Sometimes libpng is
- * compiled without stdio support (it can be difficult to do
- * in some environments); in that case you will have to write
- * your own read callback to read data from the (FILE*).
+ /* Now associate the recently opened FILE object with the
+ * default libpng initialization functions. Sometimes libpng
+ * is compiled without stdio support (it can be difficult to
+ * do in some environments); in that case you will have to
+ * write your own read callback to read data from the stream.
*/
png_init_io(png_ptr, f);
Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngimage.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngimage.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngimage.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -542,6 +542,7 @@
struct display
{
jmp_buf error_return; /* Where to go to on error */
+ error_level error_code; /* Set before longjmp */
const char *filename; /* The name of the original file */
const char *operation; /* Operation being performed */
@@ -762,7 +763,10 @@
/* Errors cause this routine to exit to the fail code */
if (level > APP_FAIL || (level > ERRORS && !(dp->options & CONTINUE)))
+ {
+ dp->error_code = level;
longjmp(dp->error_return, level);
+ }
}
/* error handler callbacks for libpng */
@@ -1570,18 +1574,19 @@
do_test(struct display *dp, const char *file)
/* Exists solely to isolate the setjmp clobbers */
{
- int ret = setjmp(dp->error_return);
+ dp->error_code = VERBOSE; /* The "lowest" level */
- if (ret == 0)
+ if (setjmp(dp->error_return) == 0)
{
test_one_file(dp, file);
return 0;
}
- else if (ret < ERRORS) /* shouldn't longjmp on warnings */
- display_log(dp, INTERNAL_ERROR, "unexpected return code %d", ret);
+ else if (dp->error_code < ERRORS) /* shouldn't longjmp on warnings */
+ display_log(dp, INTERNAL_ERROR, "unexpected return code %d",
+ dp->error_code);
- return ret;
+ return dp->error_code;
}
int
@@ -1681,7 +1686,11 @@
int ret = do_test(&d, argv[i]);
if (ret > QUIET) /* abort on user or internal error */
+ {
+ display_clean(&d);
+ display_destroy(&d);
return 99;
+ }
}
/* Here on any return, including failures, except user/internal issues
Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -595,7 +595,8 @@
memset(image, 0, sizeof *image);
}
-/* Reset the image to be read again - only needs to rewind the FILE* at present.
+/* Reset the image to be read again - only needs to rewind the FILE object at
+ * present.
*/
static void
resetimage(Image *image)
Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -32,7 +32,7 @@
#endif
#if PNG_LIBPNG_VER < 10603 /* 1.6.3 */
-# error "pngfix will not work with libpng prior to 1.6.3"
+# error pngfix requires libpng version 1.6.3 or newer
#endif
#ifdef PNG_SETJMP_SUPPORTED
@@ -68,7 +68,7 @@
#endif
#ifndef PNG_MAXIMUM_INFLATE_WINDOW
-# error "pngfix not supported in this libpng version"
+# error pngfix requires libpng with PNG_MAXIMUM_INFLATE_WINDOW supported
#endif
#if ZLIB_VERNUM >= 0x1240
Modified: branches/stable/source/src/libs/libpng/libpng-src/example.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/example.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/example.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -2,7 +2,7 @@
/* example.c - an example of using libpng
*
- * Maintained 2018-2024 Cosmin Truta
+ * Maintained 2018-2025 Cosmin Truta
* Maintained 1998-2016 Glenn Randers-Pehrson
* Maintained 1996-1997 Andreas Dilger
* Written 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -179,11 +179,11 @@
* components.
*
* You do not have to read directly from a file. You can read from memory or,
- * on systems that support it, from a <stdio.h> FILE*. This is controlled by
- * the particular png_image_read_from_ function you call at the start.
- * Likewise, on write, you can write to a FILE* if your system supports it.
- * Check the macro PNG_STDIO_SUPPORTED to see if stdio support has been
- * included in your libpng build.
+ * on systems that support <stdio.h>, from a FILE object. This is controlled
+ * by the particular png_image_begin_read_from_ function you call at the start.
+ * Likewise, on write, you can write to a FILE object if your system supports
+ * <stdio.h>. The macro PNG_STDIO_SUPPORTED indicates if stdio is available
+ * and accessible from your libpng build.
*
* If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data, you may need to write it
* in the 8-bit format for display. You do this by setting the convert_to_8bit
Modified: branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt 2025-05-17 22:44:20 UTC (rev 964)
@@ -9,7 +9,7 @@
Based on:
- libpng version 1.6.36, December 2018, through 1.6.46 - January 2025
+ libpng version 1.6.36, December 2018, through 1.6.48 - April 2025
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta
@@ -4089,7 +4089,7 @@
is filled in from the PNG header in the file.
int png_image_begin_read_from_stdio (png_imagep image,
- FILE* file)
+ FILE *file)
The PNG header is read from the stdio FILE object.
@@ -4164,7 +4164,7 @@
int convert_to_8_bit, const void *buffer,
png_int_32 row_stride, const void *colormap)
- Write the image to the given (FILE*).
+ Write the image to the given FILE object.
With all write APIs if image is in one of the linear formats with
(png_uint_16) data then setting convert_to_8_bit will cause the output to be
Modified: branches/stable/source/src/libs/libpng/libpng-src/libpng.3
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/libpng.3 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/libpng.3 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "January 23, 2025"
+.TH LIBPNG 3 "April 30, 2025"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.46
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.48
.SH SYNOPSIS
\fB#include <png.h>\fP
@@ -223,7 +223,7 @@
\fBint png_image_begin_read_from_file (png_imagep \fP\fIimage\fP\fB, const char \fI*file_name\fP\fB);\fP
-\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE* \fIfile\fP\fB);\fP
+\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE *\fIfile\fP\fB);\fP
\fBint, png_image_begin_read_from_memory (png_imagep \fP\fIimage\fP\fB, png_const_voidp \fP\fImemory\fP\fB, size_t \fIsize\fP\fB);\fP
@@ -528,7 +528,7 @@
Based on:
- libpng version 1.6.36, December 2018, through 1.6.46 - January 2025
+ libpng version 1.6.36, December 2018, through 1.6.48 - April 2025
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta
@@ -4608,7 +4608,7 @@
is filled in from the PNG header in the file.
int png_image_begin_read_from_stdio (png_imagep image,
- FILE* file)
+ FILE *file)
The PNG header is read from the stdio FILE object.
@@ -4683,7 +4683,7 @@
int convert_to_8_bit, const void *buffer,
png_int_32 row_stride, const void *colormap)
- Write the image to the given (FILE*).
+ Write the image to the given FILE object.
With all write APIs if image is in one of the linear formats with
(png_uint_16) data then setting convert_to_8_bit will cause the output to be
Modified: branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,24 +1,17 @@
-.TH LIBPNGPF 3 "January 23, 2025"
+.TH LIBPNGPF 3 "April 30, 2025"
.SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.46
-(private functions)
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.48
.SH SYNOPSIS
-\fB#include \fI"pngpriv.h"
+\fB#include "pngpriv.h"\fP
-\fBAs of libpng version \fP\fI1.5.1\fP\fB, this section is no longer
-\fP\fImaintained\fP\fB, now that the private function prototypes are hidden in
-\fP\fIpngpriv.h\fP\fB and not accessible to applications. Look in
-\fP\fIpngpriv.h\fP\fB for the prototypes and a short description of each
-function.
-
.SH DESCRIPTION
-The functions previously listed here are used privately by libpng and are not
-available for use by applications. They are not "exported" to applications
-using shared libraries.
+As of libpng version 1.5.1, this manual is no longer maintained. The private
+function prototypes, declared in private header files, should not be accessed
+by applications.
.SH "SEE ALSO"
-.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
+.BR "libpng"(3)
.SH AUTHORS
Cosmin Truta, Glenn Randers-Pehrson
Modified: branches/stable/source/src/libs/libpng/libpng-src/mips/mips_init.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/mips/mips_init.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/mips/mips_init.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -48,7 +48,7 @@
#include PNG_MIPS_MSA_FILE
#else /* PNG_MIPS_MSA_FILE */
-# error "PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks"
+# error PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks
#endif /* PNG_MIPS_MSA_FILE */
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
@@ -66,12 +66,12 @@
#include PNG_MIPS_MMI_FILE
#else /* PNG_MIPS_MMI_FILE */
-# error "PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks"
+# error PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks
#endif /* PNG_MIPS_MMI_FILE */
#endif /* PNG_MIPS_MMI_CHECK_SUPPORTED*/
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
-# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
+# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
/* MIPS supports two optimizations: MMI and MSA. The appropriate
Modified: branches/stable/source/src/libs/libpng/libpng-src/png.5
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/png.5 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/png.5 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-.TH PNG 5 "January 23, 2025"
+.TH PNG 5 "April 30, 2025"
.SH NAME
png \- Portable Network Graphics (PNG) format
@@ -20,10 +20,10 @@
.SH "SEE ALSO"
.BR "libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP
-PNG Specification (Third Edition) Candidate Recommendation Draft, July 2024:
+PNG Specification (Third Edition) Candidate Recommendation, March 2025:
.IP
.br
-https://www.w3.org/TR/2024/CRD-png-3-20240718/
+https://www.w3.org/TR/2025/CR-png-3-20250313/
.LP
PNG Specification (Second Edition), November 2003:
.IP
Modified: branches/stable/source/src/libs/libpng/libpng-src/png.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/png.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/png.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -13,8 +13,35 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_46 Your_png_h_is_not_version_1_6_46;
+typedef png_libpng_version_1_6_48 Your_png_h_is_not_version_1_6_48;
+/* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
+ * corresponding macro definitions. This causes a compile time failure if
+ * something is wrong but generates no code.
+ *
+ * (1) The first check is that the PNG_CHUNK(cHNK, index) 'index' values must
+ * increment from 0 to the last value.
+ */
+#define PNG_CHUNK(cHNK, index) != (index) || ((index)+1)
+
+#if 0 PNG_KNOWN_CHUNKS < 0
+# error PNG_KNOWN_CHUNKS chunk definitions are not in order
+#endif
+
+#undef PNG_CHUNK
+
+/* (2) The chunk name macros, png_cHNK, must all be valid and defined. Since
+ * this is a preprocessor test undefined pp-tokens come out as zero and will
+ * fail this test.
+ */
+#define PNG_CHUNK(cHNK, index) !PNG_CHUNK_NAME_VALID(png_ ## cHNK) ||
+
+#if PNG_KNOWN_CHUNKS 0
+# error png_cHNK not defined for some known cHNK
+#endif
+
+#undef PNG_CHUNK
+
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
* stream we can set num_bytes = 8 so that libpng will not attempt to read
@@ -241,21 +268,23 @@
*/
memset(&create_struct, 0, (sizeof create_struct));
- /* Added at libpng-1.2.6 */
# ifdef PNG_USER_LIMITS_SUPPORTED
create_struct.user_width_max = PNG_USER_WIDTH_MAX;
create_struct.user_height_max = PNG_USER_HEIGHT_MAX;
# ifdef PNG_USER_CHUNK_CACHE_MAX
- /* Added at libpng-1.2.43 and 1.4.0 */
create_struct.user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX;
# endif
-# ifdef PNG_USER_CHUNK_MALLOC_MAX
- /* Added at libpng-1.2.43 and 1.4.1, required only for read but exists
- * in png_struct regardless.
- */
+# if PNG_USER_CHUNK_MALLOC_MAX > 0 /* default to compile-time limit */
create_struct.user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX;
+
+ /* No compile-time limit, so initialize to the system limit: */
+# elif defined PNG_MAX_MALLOC_64K /* legacy system limit */
+ create_struct.user_chunk_malloc_max = 65536U;
+
+# else /* modern system limit SIZE_MAX (C99) */
+ create_struct.user_chunk_malloc_max = PNG_SIZE_MAX;
# endif
# endif
@@ -597,13 +626,6 @@
/* Free any eXIf entry */
if (((mask & PNG_FREE_EXIF) & info_ptr->free_me) != 0)
{
-# ifdef PNG_READ_eXIf_SUPPORTED
- if (info_ptr->eXIf_buf)
- {
- png_free(png_ptr, info_ptr->eXIf_buf);
- info_ptr->eXIf_buf = NULL;
- }
-# endif
if (info_ptr->exif)
{
png_free(png_ptr, info_ptr->exif);
@@ -678,7 +700,7 @@
* function of your own because "FILE *" isn't necessarily available.
*/
void PNGAPI
-png_init_io(png_structrp png_ptr, png_FILE_p fp)
+png_init_io(png_structrp png_ptr, FILE *fp)
{
png_debug(1, "in png_init_io");
@@ -793,7 +815,7 @@
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
- "libpng version 1.6.46" PNG_STRING_NEWLINE \
+ "libpng version 1.6.48" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
@@ -1038,169 +1060,6 @@
}
}
-/* png_convert_size: a PNGAPI but no longer in png.h, so deleted
- * at libpng 1.5.5!
- */
-
-/* Added at libpng version 1.2.34 and 1.4.0 (moved from pngset.c) */
-#ifdef PNG_GAMMA_SUPPORTED /* always set if COLORSPACE */
-static int
-png_colorspace_check_gamma(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_fixed_point gAMA, int from)
- /* This is called to check a new gamma value against an existing one. The
- * routine returns false if the new gamma value should not be written.
- *
- * 'from' says where the new gamma value comes from:
- *
- * 0: the new gamma value is the libpng estimate for an ICC profile
- * 1: the new gamma value comes from a gAMA chunk
- * 2: the new gamma value comes from an sRGB chunk
- */
-{
- png_fixed_point gtest;
-
- if ((colorspace->flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
- (png_muldiv(>est, colorspace->gamma, PNG_FP_1, gAMA) == 0 ||
- png_gamma_significant(gtest) != 0))
- {
- /* Either this is an sRGB image, in which case the calculated gamma
- * approximation should match, or this is an image with a profile and the
- * value libpng calculates for the gamma of the profile does not match the
- * value recorded in the file. The former, sRGB, case is an error, the
- * latter is just a warning.
- */
- if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0 || from == 2)
- {
- png_chunk_report(png_ptr, "gamma value does not match sRGB",
- PNG_CHUNK_ERROR);
- /* Do not overwrite an sRGB value */
- return from == 2;
- }
-
- else /* sRGB tag not involved */
- {
- png_chunk_report(png_ptr, "gamma value does not match libpng estimate",
- PNG_CHUNK_WARNING);
- return from == 1;
- }
- }
-
- return 1;
-}
-
-void /* PRIVATE */
-png_colorspace_set_gamma(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_fixed_point gAMA)
-{
- /* Changed in libpng-1.5.4 to limit the values to ensure overflow can't
- * occur. Since the fixed point representation is asymmetrical it is
- * possible for 1/gamma to overflow the limit of 21474 and this means the
- * gamma value must be at least 5/100000 and hence at most 20000.0. For
- * safety the limits here are a little narrower. The values are 0.00016 to
- * 6250.0, which are truly ridiculous gamma values (and will produce
- * displays that are all black or all white.)
- *
- * In 1.6.0 this test replaces the ones in pngrutil.c, in the gAMA chunk
- * handling code, which only required the value to be >0.
- */
- png_const_charp errmsg;
-
- if (gAMA < 16 || gAMA > 625000000)
- errmsg = "gamma value out of range";
-
-# ifdef PNG_READ_gAMA_SUPPORTED
- /* Allow the application to set the gamma value more than once */
- else if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
- (colorspace->flags & PNG_COLORSPACE_FROM_gAMA) != 0)
- errmsg = "duplicate";
-# endif
-
- /* Do nothing if the colorspace is already invalid */
- else if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0)
- return;
-
- else
- {
- if (png_colorspace_check_gamma(png_ptr, colorspace, gAMA,
- 1/*from gAMA*/) != 0)
- {
- /* Store this gamma value. */
- colorspace->gamma = gAMA;
- colorspace->flags |=
- (PNG_COLORSPACE_HAVE_GAMMA | PNG_COLORSPACE_FROM_gAMA);
- }
-
- /* At present if the check_gamma test fails the gamma of the colorspace is
- * not updated however the colorspace is not invalidated. This
- * corresponds to the case where the existing gamma comes from an sRGB
- * chunk or profile. An error message has already been output.
- */
- return;
- }
-
- /* Error exit - errmsg has been set. */
- colorspace->flags |= PNG_COLORSPACE_INVALID;
- png_chunk_report(png_ptr, errmsg, PNG_CHUNK_WRITE_ERROR);
-}
-
-void /* PRIVATE */
-png_colorspace_sync_info(png_const_structrp png_ptr, png_inforp info_ptr)
-{
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0)
- {
- /* Everything is invalid */
- info_ptr->valid &= ~(PNG_INFO_gAMA|PNG_INFO_cHRM|PNG_INFO_sRGB|
- PNG_INFO_iCCP);
-
-# ifdef PNG_COLORSPACE_SUPPORTED
- /* Clean up the iCCP profile now if it won't be used. */
- png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, -1/*not used*/);
-# else
- PNG_UNUSED(png_ptr)
-# endif
- }
-
- else
- {
-# ifdef PNG_COLORSPACE_SUPPORTED
- /* Leave the INFO_iCCP flag set if the pngset.c code has already set
- * it; this allows a PNG to contain a profile which matches sRGB and
- * yet still have that profile retrievable by the application.
- */
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_MATCHES_sRGB) != 0)
- info_ptr->valid |= PNG_INFO_sRGB;
-
- else
- info_ptr->valid &= ~PNG_INFO_sRGB;
-
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
- info_ptr->valid |= PNG_INFO_cHRM;
-
- else
- info_ptr->valid &= ~PNG_INFO_cHRM;
-# endif
-
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0)
- info_ptr->valid |= PNG_INFO_gAMA;
-
- else
- info_ptr->valid &= ~PNG_INFO_gAMA;
- }
-}
-
-#ifdef PNG_READ_SUPPORTED
-void /* PRIVATE */
-png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
-{
- if (info_ptr == NULL) /* reduce code size; check here not in the caller */
- return;
-
- info_ptr->colorspace = png_ptr->colorspace;
- png_colorspace_sync_info(png_ptr, info_ptr);
-}
-#endif
-#endif /* GAMMA */
-
#ifdef PNG_COLORSPACE_SUPPORTED
static png_int_32
png_fp_add(png_int_32 addend0, png_int_32 addend1, int *error)
@@ -1269,9 +1128,10 @@
* non-zero on a parameter error. The X, Y and Z values are required to be
* positive and less than 1.0.
*/
-static int
+int /* PRIVATE */
png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
{
+ /* NOTE: returns 0 on success, 1 means error. */
png_int_32 d, dred, dgreen, dblue, dwhite, whiteX, whiteY;
/* 'd' in each of the blocks below is just X+Y+Z for each component,
@@ -1334,9 +1194,10 @@
return 0;
}
-static int
+int /* PRIVATE */
png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
{
+ /* NOTE: returns 0 on success, 1 means error. */
png_fixed_point red_inverse, green_inverse, blue_scale;
png_fixed_point left, right, denominator;
@@ -1628,239 +1489,9 @@
return 0; /*success*/
}
+#endif /* COLORSPACE */
-static int
-png_XYZ_normalize(png_XYZ *XYZ)
-{
- png_int_32 Y, Ytemp;
-
- /* Normalize by scaling so the sum of the end-point Y values is PNG_FP_1. */
- Ytemp = XYZ->red_Y;
- if (png_safe_add(&Ytemp, XYZ->green_Y, XYZ->blue_Y))
- return 1;
-
- Y = Ytemp;
-
- if (Y != PNG_FP_1)
- {
- if (png_muldiv(&XYZ->red_X, XYZ->red_X, PNG_FP_1, Y) == 0)
- return 1;
- if (png_muldiv(&XYZ->red_Y, XYZ->red_Y, PNG_FP_1, Y) == 0)
- return 1;
- if (png_muldiv(&XYZ->red_Z, XYZ->red_Z, PNG_FP_1, Y) == 0)
- return 1;
-
- if (png_muldiv(&XYZ->green_X, XYZ->green_X, PNG_FP_1, Y) == 0)
- return 1;
- if (png_muldiv(&XYZ->green_Y, XYZ->green_Y, PNG_FP_1, Y) == 0)
- return 1;
- if (png_muldiv(&XYZ->green_Z, XYZ->green_Z, PNG_FP_1, Y) == 0)
- return 1;
-
- if (png_muldiv(&XYZ->blue_X, XYZ->blue_X, PNG_FP_1, Y) == 0)
- return 1;
- if (png_muldiv(&XYZ->blue_Y, XYZ->blue_Y, PNG_FP_1, Y) == 0)
- return 1;
- if (png_muldiv(&XYZ->blue_Z, XYZ->blue_Z, PNG_FP_1, Y) == 0)
- return 1;
- }
-
- return 0;
-}
-
-static int
-png_colorspace_endpoints_match(const png_xy *xy1, const png_xy *xy2, int delta)
-{
- /* Allow an error of +/-0.01 (absolute value) on each chromaticity */
- if (PNG_OUT_OF_RANGE(xy1->whitex, xy2->whitex,delta) ||
- PNG_OUT_OF_RANGE(xy1->whitey, xy2->whitey,delta) ||
- PNG_OUT_OF_RANGE(xy1->redx, xy2->redx, delta) ||
- PNG_OUT_OF_RANGE(xy1->redy, xy2->redy, delta) ||
- PNG_OUT_OF_RANGE(xy1->greenx, xy2->greenx,delta) ||
- PNG_OUT_OF_RANGE(xy1->greeny, xy2->greeny,delta) ||
- PNG_OUT_OF_RANGE(xy1->bluex, xy2->bluex, delta) ||
- PNG_OUT_OF_RANGE(xy1->bluey, xy2->bluey, delta))
- return 0;
- return 1;
-}
-
-/* Added in libpng-1.6.0, a different check for the validity of a set of cHRM
- * chunk chromaticities. Earlier checks used to simply look for the overflow
- * condition (where the determinant of the matrix to solve for XYZ ends up zero
- * because the chromaticity values are not all distinct.) Despite this it is
- * theoretically possible to produce chromaticities that are apparently valid
- * but that rapidly degrade to invalid, potentially crashing, sets because of
- * arithmetic inaccuracies when calculations are performed on them. The new
- * check is to round-trip xy -> XYZ -> xy and then check that the result is
- * within a small percentage of the original.
- */
-static int
-png_colorspace_check_xy(png_XYZ *XYZ, const png_xy *xy)
-{
- int result;
- png_xy xy_test;
-
- /* As a side-effect this routine also returns the XYZ endpoints. */
- result = png_XYZ_from_xy(XYZ, xy);
- if (result != 0)
- return result;
-
- result = png_xy_from_XYZ(&xy_test, XYZ);
- if (result != 0)
- return result;
-
- if (png_colorspace_endpoints_match(xy, &xy_test,
- 5/*actually, the math is pretty accurate*/) != 0)
- return 0;
-
- /* Too much slip */
- return 1;
-}
-
-/* This is the check going the other way. The XYZ is modified to normalize it
- * (another side-effect) and the xy chromaticities are returned.
- */
-static int
-png_colorspace_check_XYZ(png_xy *xy, png_XYZ *XYZ)
-{
- int result;
- png_XYZ XYZtemp;
-
- result = png_XYZ_normalize(XYZ);
- if (result != 0)
- return result;
-
- result = png_xy_from_XYZ(xy, XYZ);
- if (result != 0)
- return result;
-
- XYZtemp = *XYZ;
- return png_colorspace_check_xy(&XYZtemp, xy);
-}
-
-/* Used to check for an endpoint match against sRGB */
-static const png_xy sRGB_xy = /* From ITU-R BT.709-3 */
-{
- /* color x y */
- /* red */ 64000, 33000,
- /* green */ 30000, 60000,
- /* blue */ 15000, 6000,
- /* white */ 31270, 32900
-};
-
-static int
-png_colorspace_set_xy_and_XYZ(png_const_structrp png_ptr,
- png_colorspacerp colorspace, const png_xy *xy, const png_XYZ *XYZ,
- int preferred)
-{
- if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0)
- return 0;
-
- /* The consistency check is performed on the chromaticities; this factors out
- * variations because of the normalization (or not) of the end point Y
- * values.
- */
- if (preferred < 2 &&
- (colorspace->flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
- {
- /* The end points must be reasonably close to any we already have. The
- * following allows an error of up to +/-.001
- */
- if (png_colorspace_endpoints_match(xy, &colorspace->end_points_xy,
- 100) == 0)
- {
- colorspace->flags |= PNG_COLORSPACE_INVALID;
- png_benign_error(png_ptr, "inconsistent chromaticities");
- return 0; /* failed */
- }
-
- /* Only overwrite with preferred values */
- if (preferred == 0)
- return 1; /* ok, but no change */
- }
-
- colorspace->end_points_xy = *xy;
- colorspace->end_points_XYZ = *XYZ;
- colorspace->flags |= PNG_COLORSPACE_HAVE_ENDPOINTS;
-
- /* The end points are normally quoted to two decimal digits, so allow +/-0.01
- * on this test.
- */
- if (png_colorspace_endpoints_match(xy, &sRGB_xy, 1000) != 0)
- colorspace->flags |= PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB;
-
- else
- colorspace->flags &= PNG_COLORSPACE_CANCEL(
- PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB);
-
- return 2; /* ok and changed */
-}
-
-int /* PRIVATE */
-png_colorspace_set_chromaticities(png_const_structrp png_ptr,
- png_colorspacerp colorspace, const png_xy *xy, int preferred)
-{
- /* We must check the end points to ensure they are reasonable - in the past
- * color management systems have crashed as a result of getting bogus
- * colorant values, while this isn't the fault of libpng it is the
- * responsibility of libpng because PNG carries the bomb and libpng is in a
- * position to protect against it.
- */
- png_XYZ XYZ;
-
- switch (png_colorspace_check_xy(&XYZ, xy))
- {
- case 0: /* success */
- return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, xy, &XYZ,
- preferred);
-
- case 1:
- /* We can't invert the chromaticities so we can't produce value XYZ
- * values. Likely as not a color management system will fail too.
- */
- colorspace->flags |= PNG_COLORSPACE_INVALID;
- png_benign_error(png_ptr, "invalid chromaticities");
- break;
-
- default:
- /* libpng is broken; this should be a warning but if it happens we
- * want error reports so for the moment it is an error.
- */
- colorspace->flags |= PNG_COLORSPACE_INVALID;
- png_error(png_ptr, "internal error checking chromaticities");
- }
-
- return 0; /* failed */
-}
-
-int /* PRIVATE */
-png_colorspace_set_endpoints(png_const_structrp png_ptr,
- png_colorspacerp colorspace, const png_XYZ *XYZ_in, int preferred)
-{
- png_XYZ XYZ = *XYZ_in;
- png_xy xy;
-
- switch (png_colorspace_check_XYZ(&xy, &XYZ))
- {
- case 0:
- return png_colorspace_set_xy_and_XYZ(png_ptr, colorspace, &xy, &XYZ,
- preferred);
-
- case 1:
- /* End points are invalid. */
- colorspace->flags |= PNG_COLORSPACE_INVALID;
- png_benign_error(png_ptr, "invalid end points");
- break;
-
- default:
- colorspace->flags |= PNG_COLORSPACE_INVALID;
- png_error(png_ptr, "internal error checking chromaticities");
- }
-
- return 0; /* failed */
-}
-
-#if defined(PNG_sRGB_SUPPORTED) || defined(PNG_iCCP_SUPPORTED)
+#ifdef PNG_READ_iCCP_SUPPORTED
/* Error message generation */
static char
png_icc_tag_char(png_uint_32 byte)
@@ -1900,15 +1531,12 @@
}
static int
-png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace,
- png_const_charp name, png_alloc_size_t value, png_const_charp reason)
+png_icc_profile_error(png_const_structrp png_ptr, png_const_charp name,
+ png_alloc_size_t value, png_const_charp reason)
{
size_t pos;
char message[196]; /* see below for calculation */
- if (colorspace != NULL)
- colorspace->flags |= PNG_COLORSPACE_INVALID;
-
pos = png_safecat(message, (sizeof message), 0, "profile '"); /* 9 chars */
pos = png_safecat(message, pos+79, pos, name); /* Truncate to 79 chars */
pos = png_safecat(message, (sizeof message), pos, "': "); /* +2 = 90 */
@@ -1935,109 +1563,11 @@
pos = png_safecat(message, (sizeof message), pos, reason);
PNG_UNUSED(pos)
- /* This is recoverable, but make it unconditionally an app_error on write to
- * avoid writing invalid ICC profiles into PNG files (i.e., we handle them
- * on read, with a warning, but on write unless the app turns off
- * application errors the PNG won't be written.)
- */
- png_chunk_report(png_ptr, message,
- (colorspace != NULL) ? PNG_CHUNK_ERROR : PNG_CHUNK_WRITE_ERROR);
+ png_chunk_benign_error(png_ptr, message);
return 0;
}
-#endif /* sRGB || iCCP */
-#ifdef PNG_sRGB_SUPPORTED
-int /* PRIVATE */
-png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace,
- int intent)
-{
- /* sRGB sets known gamma, end points and (from the chunk) intent. */
- /* IMPORTANT: these are not necessarily the values found in an ICC profile
- * because ICC profiles store values adapted to a D50 environment; it is
- * expected that the ICC profile mediaWhitePointTag will be D50; see the
- * checks and code elsewhere to understand this better.
- *
- * These XYZ values, which are accurate to 5dp, produce rgb to gray
- * coefficients of (6968,23435,2366), which are reduced (because they add up
- * to 32769 not 32768) to (6968,23434,2366). These are the values that
- * libpng has traditionally used (and are the best values given the 15bit
- * algorithm used by the rgb to gray code.)
- */
- static const png_XYZ sRGB_XYZ = /* D65 XYZ (*not* the D50 adapted values!) */
- {
- /* color X Y Z */
- /* red */ 41239, 21264, 1933,
- /* green */ 35758, 71517, 11919,
- /* blue */ 18048, 7219, 95053
- };
-
- /* Do nothing if the colorspace is already invalidated. */
- if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0)
- return 0;
-
- /* Check the intent, then check for existing settings. It is valid for the
- * PNG file to have cHRM or gAMA chunks along with sRGB, but the values must
- * be consistent with the correct values. If, however, this function is
- * called below because an iCCP chunk matches sRGB then it is quite
- * conceivable that an older app recorded incorrect gAMA and cHRM because of
- * an incorrect calculation based on the values in the profile - this does
- * *not* invalidate the profile (though it still produces an error, which can
- * be ignored.)
- */
- if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST)
- return png_icc_profile_error(png_ptr, colorspace, "sRGB",
- (png_alloc_size_t)intent, "invalid sRGB rendering intent");
-
- if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 &&
- colorspace->rendering_intent != intent)
- return png_icc_profile_error(png_ptr, colorspace, "sRGB",
- (png_alloc_size_t)intent, "inconsistent rendering intents");
-
- if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0)
- {
- png_benign_error(png_ptr, "duplicate sRGB information ignored");
- return 0;
- }
-
- /* If the standard sRGB cHRM chunk does not match the one from the PNG file
- * warn but overwrite the value with the correct one.
- */
- if ((colorspace->flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0 &&
- !png_colorspace_endpoints_match(&sRGB_xy, &colorspace->end_points_xy,
- 100))
- png_chunk_report(png_ptr, "cHRM chunk does not match sRGB",
- PNG_CHUNK_ERROR);
-
- /* This check is just done for the error reporting - the routine always
- * returns true when the 'from' argument corresponds to sRGB (2).
- */
- (void)png_colorspace_check_gamma(png_ptr, colorspace, PNG_GAMMA_sRGB_INVERSE,
- 2/*from sRGB*/);
-
- /* intent: bugs in GCC force 'int' to be used as the parameter type. */
- colorspace->rendering_intent = (png_uint_16)intent;
- colorspace->flags |= PNG_COLORSPACE_HAVE_INTENT;
-
- /* endpoints */
- colorspace->end_points_xy = sRGB_xy;
- colorspace->end_points_XYZ = sRGB_XYZ;
- colorspace->flags |=
- (PNG_COLORSPACE_HAVE_ENDPOINTS|PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB);
-
- /* gamma */
- colorspace->gamma = PNG_GAMMA_sRGB_INVERSE;
- colorspace->flags |= PNG_COLORSPACE_HAVE_GAMMA;
-
- /* Finally record that we have an sRGB profile */
- colorspace->flags |=
- (PNG_COLORSPACE_MATCHES_sRGB|PNG_COLORSPACE_FROM_sRGB);
-
- return 1; /* set */
-}
-#endif /* sRGB */
-
-#ifdef PNG_iCCP_SUPPORTED
/* Encoded value of D50 as an ICC XYZNumber. From the ICC 2010 spec the value
* is XYZ(0.9642,1.0,0.8249), which scales to:
*
@@ -2047,21 +1577,19 @@
{ 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d };
static int /* bool */
-icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
- png_const_charp name, png_uint_32 profile_length)
+icc_check_length(png_const_structrp png_ptr, png_const_charp name,
+ png_uint_32 profile_length)
{
if (profile_length < 132)
- return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
- "too short");
+ return png_icc_profile_error(png_ptr, name, profile_length, "too short");
return 1;
}
-#ifdef PNG_READ_iCCP_SUPPORTED
int /* PRIVATE */
-png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
- png_const_charp name, png_uint_32 profile_length)
+png_icc_check_length(png_const_structrp png_ptr, png_const_charp name,
+ png_uint_32 profile_length)
{
- if (!icc_check_length(png_ptr, colorspace, name, profile_length))
+ if (!icc_check_length(png_ptr, name, profile_length))
return 0;
/* This needs to be here because the 'normal' check is in
@@ -2070,30 +1598,17 @@
* the caller supplies the profile buffer so libpng doesn't allocate it. See
* the call to icc_check_length below (the write case).
*/
-# ifdef PNG_SET_USER_LIMITS_SUPPORTED
- else if (png_ptr->user_chunk_malloc_max > 0 &&
- png_ptr->user_chunk_malloc_max < profile_length)
- return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
- "exceeds application limits");
-# elif PNG_USER_CHUNK_MALLOC_MAX > 0
- else if (PNG_USER_CHUNK_MALLOC_MAX < profile_length)
- return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
- "exceeds libpng limits");
-# else /* !SET_USER_LIMITS */
- /* This will get compiled out on all 32-bit and better systems. */
- else if (PNG_SIZE_MAX < profile_length)
- return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
- "exceeds system limits");
-# endif /* !SET_USER_LIMITS */
+ if (profile_length > png_chunk_max(png_ptr))
+ return png_icc_profile_error(png_ptr, name, profile_length,
+ "profile too long");
return 1;
}
-#endif /* READ_iCCP */
int /* PRIVATE */
-png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
- png_const_charp name, png_uint_32 profile_length,
- png_const_bytep profile/* first 132 bytes only */, int color_type)
+png_icc_check_header(png_const_structrp png_ptr, png_const_charp name,
+ png_uint_32 profile_length,
+ png_const_bytep profile/* first 132 bytes only */, int color_type)
{
png_uint_32 temp;
@@ -2104,18 +1619,18 @@
*/
temp = png_get_uint_32(profile);
if (temp != profile_length)
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"length does not match profile");
temp = (png_uint_32) (*(profile+8));
if (temp > 3 && (profile_length & 3))
- return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
+ return png_icc_profile_error(png_ptr, name, profile_length,
"invalid length");
temp = png_get_uint_32(profile+128); /* tag count: 12 bytes/tag */
if (temp > 357913930 || /* (2^32-4-132)/12: maximum possible tag count */
profile_length < 132+12*temp) /* truncated tag table */
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"tag count too large");
/* The 'intent' must be valid or we can't store it, ICC limits the intent to
@@ -2123,7 +1638,7 @@
*/
temp = png_get_uint_32(profile+64);
if (temp >= 0xffff) /* The ICC limit */
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"invalid rendering intent");
/* This is just a warning because the profile may be valid in future
@@ -2130,7 +1645,7 @@
* versions.
*/
if (temp >= PNG_sRGB_INTENT_LAST)
- (void)png_icc_profile_error(png_ptr, NULL, name, temp,
+ (void)png_icc_profile_error(png_ptr, name, temp,
"intent outside defined range");
/* At this point the tag table can't be checked because it hasn't necessarily
@@ -2147,7 +1662,7 @@
*/
temp = png_get_uint_32(profile+36); /* signature 'ascp' */
if (temp != 0x61637370)
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"invalid signature");
/* Currently the PCS illuminant/adopted white point (the computational
@@ -2158,7 +1673,7 @@
* following is just a warning.
*/
if (memcmp(profile+68, D50_nCIEXYZ, 12) != 0)
- (void)png_icc_profile_error(png_ptr, NULL, name, 0/*no tag value*/,
+ (void)png_icc_profile_error(png_ptr, name, 0/*no tag value*/,
"PCS illuminant is not D50");
/* The PNG spec requires this:
@@ -2186,18 +1701,18 @@
{
case 0x52474220: /* 'RGB ' */
if ((color_type & PNG_COLOR_MASK_COLOR) == 0)
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"RGB color space not permitted on grayscale PNG");
break;
case 0x47524159: /* 'GRAY' */
if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"Gray color space not permitted on RGB PNG");
break;
default:
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"invalid ICC profile color space");
}
@@ -2222,7 +1737,7 @@
case 0x61627374: /* 'abst' */
/* May not be embedded in an image */
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"invalid embedded Abstract ICC profile");
case 0x6c696e6b: /* 'link' */
@@ -2232,7 +1747,7 @@
* therefore a DeviceLink profile should not be found embedded in a
* PNG.
*/
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"unexpected DeviceLink ICC profile class");
case 0x6e6d636c: /* 'nmcl' */
@@ -2240,7 +1755,7 @@
* contain an AToB0 tag that is open to misinterpretation. Almost
* certainly it will fail the tests below.
*/
- (void)png_icc_profile_error(png_ptr, NULL, name, temp,
+ (void)png_icc_profile_error(png_ptr, name, temp,
"unexpected NamedColor ICC profile class");
break;
@@ -2250,7 +1765,7 @@
* tag content to ensure they are backward compatible with one of the
* understood profiles.
*/
- (void)png_icc_profile_error(png_ptr, NULL, name, temp,
+ (void)png_icc_profile_error(png_ptr, name, temp,
"unrecognized ICC profile class");
break;
}
@@ -2266,7 +1781,7 @@
break;
default:
- return png_icc_profile_error(png_ptr, colorspace, name, temp,
+ return png_icc_profile_error(png_ptr, name, temp,
"unexpected ICC PCS encoding");
}
@@ -2274,9 +1789,9 @@
}
int /* PRIVATE */
-png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace,
- png_const_charp name, png_uint_32 profile_length,
- png_const_bytep profile /* header plus whole tag table */)
+png_icc_check_tag_table(png_const_structrp png_ptr, png_const_charp name,
+ png_uint_32 profile_length,
+ png_const_bytep profile /* header plus whole tag table */)
{
png_uint_32 tag_count = png_get_uint_32(profile+128);
png_uint_32 itag;
@@ -2302,7 +1817,7 @@
* profile.
*/
if (tag_start > profile_length || tag_length > profile_length - tag_start)
- return png_icc_profile_error(png_ptr, colorspace, name, tag_id,
+ return png_icc_profile_error(png_ptr, name, tag_id,
"ICC profile tag outside profile");
if ((tag_start & 3) != 0)
@@ -2311,7 +1826,7 @@
* only a warning here because libpng does not care about the
* alignment.
*/
- (void)png_icc_profile_error(png_ptr, NULL, name, tag_id,
+ (void)png_icc_profile_error(png_ptr, name, tag_id,
"ICC profile tag start not a multiple of 4");
}
}
@@ -2318,300 +1833,125 @@
return 1; /* success, maybe with warnings */
}
+#endif /* READ_iCCP */
-#ifdef PNG_sRGB_SUPPORTED
-#if PNG_sRGB_PROFILE_CHECKS >= 0
-/* Information about the known ICC sRGB profiles */
-static const struct
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+#if (defined PNG_READ_mDCV_SUPPORTED) || (defined PNG_READ_cHRM_SUPPORTED)
+static int
+have_chromaticities(png_const_structrp png_ptr)
{
- png_uint_32 adler, crc, length;
- png_uint_32 md5[4];
- png_byte have_md5;
- png_byte is_broken;
- png_uint_16 intent;
-
-# define PNG_MD5(a,b,c,d) { a, b, c, d }, (a!=0)||(b!=0)||(c!=0)||(d!=0)
-# define PNG_ICC_CHECKSUM(adler, crc, md5, intent, broke, date, length, fname)\
- { adler, crc, length, md5, broke, intent },
-
-} png_sRGB_checks[] =
-{
- /* This data comes from contrib/tools/checksum-icc run on downloads of
- * all four ICC sRGB profiles from www.color.org.
+ /* Handle new PNGv3 chunks and the precedence rules to determine whether
+ * png_struct::chromaticities must be processed. Only required for RGB to
+ * gray.
+ *
+ * mDCV: this is the mastering colour space and it is independent of the
+ * encoding so it needs to be used regardless of the encoded space.
+ *
+ * cICP: first in priority but not yet implemented - the chromaticities come
+ * from the 'primaries'.
+ *
+ * iCCP: not supported by libpng (so ignored)
+ *
+ * sRGB: the defaults match sRGB
+ *
+ * cHRM: calculate the coefficients
*/
- /* adler32, crc32, MD5[4], intent, date, length, file-name */
- PNG_ICC_CHECKSUM(0x0a3fd9f6, 0x3b8772b9,
- PNG_MD5(0x29f83dde, 0xaff255ae, 0x7842fae4, 0xca83390d), 0, 0,
- "2009/03/27 21:36:31", 3048, "sRGB_IEC61966-2-1_black_scaled.icc")
+# ifdef PNG_READ_mDCV_SUPPORTED
+ if (png_has_chunk(png_ptr, mDCV))
+ return 1;
+# define check_chromaticities 1
+# endif /*mDCV*/
- /* ICC sRGB v2 perceptual no black-compensation: */
- PNG_ICC_CHECKSUM(0x4909e5e1, 0x427ebb21,
- PNG_MD5(0xc95bd637, 0xe95d8a3b, 0x0df38f99, 0xc1320389), 1, 0,
- "2009/03/27 21:37:45", 3052, "sRGB_IEC61966-2-1_no_black_scaling.icc")
+# ifdef PNG_READ_sRGB_SUPPORTED
+ if (png_has_chunk(png_ptr, sRGB))
+ return 0;
+# endif /*sRGB*/
- PNG_ICC_CHECKSUM(0xfd2144a1, 0x306fd8ae,
- PNG_MD5(0xfc663378, 0x37e2886b, 0xfd72e983, 0x8228f1b8), 0, 0,
- "2009/08/10 17:28:01", 60988, "sRGB_v4_ICC_preference_displayclass.icc")
+# ifdef PNG_READ_cHRM_SUPPORTED
+ if (png_has_chunk(png_ptr, cHRM))
+ return 1;
+# define check_chromaticities 1
+# endif /*cHRM*/
- /* ICC sRGB v4 perceptual */
- PNG_ICC_CHECKSUM(0x209c35d2, 0xbbef7812,
- PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0, 0,
- "2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc")
+ return 0; /* sRGB defaults */
+}
+#endif /* READ_mDCV || READ_cHRM */
- /* The following profiles have no known MD5 checksum. If there is a match
- * on the (empty) MD5 the other fields are used to attempt a match and
- * a warning is produced. The first two of these profiles have a 'cprt' tag
- * which suggests that they were also made by Hewlett Packard.
- */
- PNG_ICC_CHECKSUM(0xa054d762, 0x5d5129ce,
- PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 0,
- "2004/07/21 18:57:42", 3024, "sRGB_IEC61966-2-1_noBPC.icc")
-
- /* This is a 'mntr' (display) profile with a mediaWhitePointTag that does not
- * match the D50 PCS illuminant in the header (it is in fact the D65 values,
- * so the white point is recorded as the un-adapted value.) The profiles
- * below only differ in one byte - the intent - and are basically the same as
- * the previous profile except for the mediaWhitePointTag error and a missing
- * chromaticAdaptationTag.
- */
- PNG_ICC_CHECKSUM(0xf784f3fb, 0x182ea552,
- PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 0, 1/*broken*/,
- "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 perceptual")
-
- PNG_ICC_CHECKSUM(0x0398f3fc, 0xf29e526d,
- PNG_MD5(0x00000000, 0x00000000, 0x00000000, 0x00000000), 1, 1/*broken*/,
- "1998/02/09 06:49:00", 3144, "HP-Microsoft sRGB v2 media-relative")
-};
-
-static int
-png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
- png_const_bytep profile, uLong adler)
+void /* PRIVATE */
+png_set_rgb_coefficients(png_structrp png_ptr)
{
- /* The quick check is to verify just the MD5 signature and trust the
- * rest of the data. Because the profile has already been verified for
- * correctness this is safe. png_colorspace_set_sRGB will check the 'intent'
- * field too, so if the profile has been edited with an intent not defined
- * by sRGB (but maybe defined by a later ICC specification) the read of
- * the profile will fail at that point.
+ /* Set the rgb_to_gray coefficients from the colorspace if available. Note
+ * that '_set' means that png_rgb_to_gray was called **and** it successfully
+ * set up the coefficients.
*/
+ if (png_ptr->rgb_to_gray_coefficients_set == 0)
+ {
+# if check_chromaticities
+ png_XYZ xyz;
- png_uint_32 length = 0;
- png_uint_32 intent = 0x10000; /* invalid */
-#if PNG_sRGB_PROFILE_CHECKS > 1
- uLong crc = 0; /* the value for 0 length data */
-#endif
- unsigned int i;
-
-#ifdef PNG_SET_OPTION_SUPPORTED
- /* First see if PNG_SKIP_sRGB_CHECK_PROFILE has been set to "on" */
- if (((png_ptr->options >> PNG_SKIP_sRGB_CHECK_PROFILE) & 3) ==
- PNG_OPTION_ON)
- return 0;
-#endif
-
- for (i=0; i < (sizeof png_sRGB_checks) / (sizeof png_sRGB_checks[0]); ++i)
- {
- if (png_get_uint_32(profile+84) == png_sRGB_checks[i].md5[0] &&
- png_get_uint_32(profile+88) == png_sRGB_checks[i].md5[1] &&
- png_get_uint_32(profile+92) == png_sRGB_checks[i].md5[2] &&
- png_get_uint_32(profile+96) == png_sRGB_checks[i].md5[3])
+ if (have_chromaticities(png_ptr) &&
+ png_XYZ_from_xy(&xyz, &png_ptr->chromaticities) == 0)
{
- /* This may be one of the old HP profiles without an MD5, in that
- * case we can only use the length and Adler32 (note that these
- * are not used by default if there is an MD5!)
+ /* png_set_rgb_to_gray has not set the coefficients, get them from the
+ * Y * values of the colorspace colorants.
*/
-# if PNG_sRGB_PROFILE_CHECKS == 0
- if (png_sRGB_checks[i].have_md5 != 0)
- return 1+png_sRGB_checks[i].is_broken;
-# endif
+ png_fixed_point r = xyz.red_Y;
+ png_fixed_point g = xyz.green_Y;
+ png_fixed_point b = xyz.blue_Y;
+ png_fixed_point total = r+g+b;
- /* Profile is unsigned or more checks have been configured in. */
- if (length == 0)
+ if (total > 0 &&
+ r >= 0 && png_muldiv(&r, r, 32768, total) && r >= 0 && r <= 32768 &&
+ g >= 0 && png_muldiv(&g, g, 32768, total) && g >= 0 && g <= 32768 &&
+ b >= 0 && png_muldiv(&b, b, 32768, total) && b >= 0 && b <= 32768 &&
+ r+g+b <= 32769)
{
- length = png_get_uint_32(profile);
- intent = png_get_uint_32(profile+64);
- }
+ /* We allow 0 coefficients here. r+g+b may be 32769 if two or
+ * all of the coefficients were rounded up. Handle this by
+ * reducing the *largest* coefficient by 1; this matches the
+ * approach used for the default coefficients in pngrtran.c
+ */
+ int add = 0;
- /* Length *and* intent must match */
- if (length == (png_uint_32) png_sRGB_checks[i].length &&
- intent == (png_uint_32) png_sRGB_checks[i].intent)
- {
- /* Now calculate the adler32 if not done already. */
- if (adler == 0)
+ if (r+g+b > 32768)
+ add = -1;
+ else if (r+g+b < 32768)
+ add = 1;
+
+ if (add != 0)
{
- adler = adler32(0, NULL, 0);
- adler = adler32(adler, profile, length);
+ if (g >= r && g >= b)
+ g += add;
+ else if (r >= g && r >= b)
+ r += add;
+ else
+ b += add;
}
- if (adler == png_sRGB_checks[i].adler)
+ /* Check for an internal error. */
+ if (r+g+b != 32768)
+ png_error(png_ptr,
+ "internal error handling cHRM coefficients");
+
+ else
{
- /* These basic checks suggest that the data has not been
- * modified, but if the check level is more than 1 perform
- * our own crc32 checksum on the data.
- */
-# if PNG_sRGB_PROFILE_CHECKS > 1
- if (crc == 0)
- {
- crc = crc32(0, NULL, 0);
- crc = crc32(crc, profile, length);
- }
-
- /* So this check must pass for the 'return' below to happen.
- */
- if (crc == png_sRGB_checks[i].crc)
-# endif
- {
- if (png_sRGB_checks[i].is_broken != 0)
- {
- /* These profiles are known to have bad data that may cause
- * problems if they are used, therefore attempt to
- * discourage their use, skip the 'have_md5' warning below,
- * which is made irrelevant by this error.
- */
- png_chunk_report(png_ptr, "known incorrect sRGB profile",
- PNG_CHUNK_ERROR);
- }
-
- /* Warn that this being done; this isn't even an error since
- * the profile is perfectly valid, but it would be nice if
- * people used the up-to-date ones.
- */
- else if (png_sRGB_checks[i].have_md5 == 0)
- {
- png_chunk_report(png_ptr,
- "out-of-date sRGB profile with no signature",
- PNG_CHUNK_WARNING);
- }
-
- return 1+png_sRGB_checks[i].is_broken;
- }
+ png_ptr->rgb_to_gray_red_coeff = (png_uint_16)r;
+ png_ptr->rgb_to_gray_green_coeff = (png_uint_16)g;
}
-
-# if PNG_sRGB_PROFILE_CHECKS > 0
- /* The signature matched, but the profile had been changed in some
- * way. This probably indicates a data error or uninformed hacking.
- * Fall through to "no match".
- */
- png_chunk_report(png_ptr,
- "Not recognizing known sRGB profile that has been edited",
- PNG_CHUNK_WARNING);
- break;
-# endif
}
}
- }
-
- return 0; /* no match */
-}
-
-void /* PRIVATE */
-png_icc_set_sRGB(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_const_bytep profile, uLong adler)
-{
- /* Is this profile one of the known ICC sRGB profiles? If it is, just set
- * the sRGB information.
- */
- if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler) != 0)
- (void)png_colorspace_set_sRGB(png_ptr, colorspace,
- (int)/*already checked*/png_get_uint_32(profile+64));
-}
-#endif /* PNG_sRGB_PROFILE_CHECKS >= 0 */
-#endif /* sRGB */
-
-int /* PRIVATE */
-png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
- png_const_charp name, png_uint_32 profile_length, png_const_bytep profile,
- int color_type)
-{
- if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0)
- return 0;
-
- if (icc_check_length(png_ptr, colorspace, name, profile_length) != 0 &&
- png_icc_check_header(png_ptr, colorspace, name, profile_length, profile,
- color_type) != 0 &&
- png_icc_check_tag_table(png_ptr, colorspace, name, profile_length,
- profile) != 0)
- {
-# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0
- /* If no sRGB support, don't try storing sRGB information */
- png_icc_set_sRGB(png_ptr, colorspace, profile, 0);
-# endif
- return 1;
- }
-
- /* Failure case */
- return 0;
-}
-#endif /* iCCP */
-
-#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-void /* PRIVATE */
-png_colorspace_set_rgb_coefficients(png_structrp png_ptr)
-{
- /* Set the rgb_to_gray coefficients from the colorspace. */
- if (png_ptr->rgb_to_gray_coefficients_set == 0 &&
- (png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
- {
- /* png_set_background has not been called, get the coefficients from the Y
- * values of the colorspace colorants.
- */
- png_fixed_point r = png_ptr->colorspace.end_points_XYZ.red_Y;
- png_fixed_point g = png_ptr->colorspace.end_points_XYZ.green_Y;
- png_fixed_point b = png_ptr->colorspace.end_points_XYZ.blue_Y;
- png_fixed_point total = r+g+b;
-
- if (total > 0 &&
- r >= 0 && png_muldiv(&r, r, 32768, total) && r >= 0 && r <= 32768 &&
- g >= 0 && png_muldiv(&g, g, 32768, total) && g >= 0 && g <= 32768 &&
- b >= 0 && png_muldiv(&b, b, 32768, total) && b >= 0 && b <= 32768 &&
- r+g+b <= 32769)
+ else
+# endif /* check_chromaticities */
{
- /* We allow 0 coefficients here. r+g+b may be 32769 if two or
- * all of the coefficients were rounded up. Handle this by
- * reducing the *largest* coefficient by 1; this matches the
- * approach used for the default coefficients in pngrtran.c
- */
- int add = 0;
-
- if (r+g+b > 32768)
- add = -1;
- else if (r+g+b < 32768)
- add = 1;
-
- if (add != 0)
- {
- if (g >= r && g >= b)
- g += add;
- else if (r >= g && r >= b)
- r += add;
- else
- b += add;
- }
-
- /* Check for an internal error. */
- if (r+g+b != 32768)
- png_error(png_ptr,
- "internal error handling cHRM coefficients");
-
- else
- {
- png_ptr->rgb_to_gray_red_coeff = (png_uint_16)r;
- png_ptr->rgb_to_gray_green_coeff = (png_uint_16)g;
- }
+ /* Use the historical REC 709 (etc) values: */
+ png_ptr->rgb_to_gray_red_coeff = 6968;
+ png_ptr->rgb_to_gray_green_coeff = 23434;
+ /* png_ptr->rgb_to_gray_blue_coeff = 2366; */
}
-
- /* This is a png_error at present even though it could be ignored -
- * it should never happen, but it is important that if it does, the
- * bug is fixed.
- */
- else
- png_error(png_ptr, "internal error handling cHRM->XYZ");
}
}
#endif /* READ_RGB_TO_GRAY */
-#endif /* COLORSPACE */
-
void /* PRIVATE */
png_check_IHDR(png_const_structrp png_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
@@ -3413,7 +2753,7 @@
#endif
-#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_COLORSPACE_SUPPORTED) ||\
+#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_COLORSPACE_SUPPORTED) ||\
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
/* muldiv functions */
/* This API takes signed arguments and rounds the result to the nearest
@@ -3421,7 +2761,7 @@
* the nearest .00001). Overflow and divide by zero are signalled in
* the result, a boolean - true on success, false on overflow.
*/
-int
+int /* PRIVATE */
png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
png_int_32 divisor)
{
@@ -3535,27 +2875,7 @@
return 0;
}
-#endif /* READ_GAMMA || INCH_CONVERSIONS */
-#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
-/* The following is for when the caller doesn't much care about the
- * result.
- */
-png_fixed_point
-png_muldiv_warn(png_const_structrp png_ptr, png_fixed_point a, png_int_32 times,
- png_int_32 divisor)
-{
- png_fixed_point result;
-
- if (png_muldiv(&result, a, times, divisor) != 0)
- return result;
-
- png_warning(png_ptr, "fixed point overflow ignored");
- return 0;
-}
-#endif
-
-#ifdef PNG_GAMMA_SUPPORTED /* more fixed point functions for gamma */
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
png_fixed_point
png_reciprocal(png_fixed_point a)
@@ -3574,7 +2894,9 @@
return 0; /* error/overflow */
}
+#endif /* READ_GAMMA || COLORSPACE || INCH_CONVERSIONS || READ_pHYS */
+#ifdef PNG_READ_GAMMA_SUPPORTED
/* This is the shared test on whether a gamma value is 'significant' - whether
* it is worth doing gamma correction.
*/
@@ -3581,19 +2903,29 @@
int /* PRIVATE */
png_gamma_significant(png_fixed_point gamma_val)
{
+ /* sRGB: 1/2.2 == 0.4545(45)
+ * AdobeRGB: 1/(2+51/256) ~= 0.45471 5dp
+ *
+ * So the correction from AdobeRGB to sRGB (output) is:
+ *
+ * 2.2/(2+51/256) == 1.00035524
+ *
+ * I.e. vanishly small (<4E-4) but still detectable in 16-bit linear (+/-
+ * 23). Note that the Adobe choice seems to be something intended to give an
+ * exact number with 8 binary fractional digits - it is the closest to 2.2
+ * that is possible a base 2 .8p representation.
+ */
return gamma_val < PNG_FP_1 - PNG_GAMMA_THRESHOLD_FIXED ||
gamma_val > PNG_FP_1 + PNG_GAMMA_THRESHOLD_FIXED;
}
-#endif
-#ifdef PNG_READ_GAMMA_SUPPORTED
-#ifdef PNG_16BIT_SUPPORTED
+#ifndef PNG_FLOATING_ARITHMETIC_SUPPORTED
/* A local convenience routine. */
static png_fixed_point
png_product2(png_fixed_point a, png_fixed_point b)
{
- /* The required result is 1/a * 1/b; the following preserves accuracy. */
-#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
+ /* The required result is a * b; the following preserves accuracy. */
+#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED /* Should now be unused */
double r = a * 1E-5;
r *= b;
r = floor(r+.5);
@@ -3609,9 +2941,8 @@
return 0; /* overflow */
}
-#endif /* 16BIT */
+#endif /* FLOATING_ARITHMETIC */
-/* The inverse of the above. */
png_fixed_point
png_reciprocal2(png_fixed_point a, png_fixed_point b)
{
@@ -4264,10 +3595,27 @@
* tables, we don't make a full table if we are reducing to 8-bit in
* the future. Note also how the gamma_16 tables are segmented so that
* we don't need to allocate > 64K chunks for a full 16-bit table.
+ *
+ * TODO: move this to pngrtran.c and make it static. Better yet create
+ * pngcolor.c and put all the PNG_COLORSPACE stuff in there.
*/
+#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
+ defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \
+ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
+# define GAMMA_TRANSFORMS 1 /* #ifdef CSE */
+#else
+# define GAMMA_TRANSFORMS 0
+#endif
+
void /* PRIVATE */
png_build_gamma_table(png_structrp png_ptr, int bit_depth)
{
+ png_fixed_point file_gamma, screen_gamma;
+ png_fixed_point correction;
+# if GAMMA_TRANSFORMS
+ png_fixed_point file_to_linear, linear_to_screen;
+# endif
+
png_debug(1, "in png_build_gamma_table");
/* Remove any existing table; this copes with multiple calls to
@@ -4282,27 +3630,44 @@
png_destroy_gamma_table(png_ptr);
}
+ /* The following fields are set, finally, in png_init_read_transformations.
+ * If file_gamma is 0 (unset) nothing can be done otherwise if screen_gamma
+ * is 0 (unset) there is no gamma correction but to/from linear is possible.
+ */
+ file_gamma = png_ptr->file_gamma;
+ screen_gamma = png_ptr->screen_gamma;
+# if GAMMA_TRANSFORMS
+ file_to_linear = png_reciprocal(file_gamma);
+# endif
+
+ if (screen_gamma > 0)
+ {
+# if GAMMA_TRANSFORMS
+ linear_to_screen = png_reciprocal(screen_gamma);
+# endif
+ correction = png_reciprocal2(screen_gamma, file_gamma);
+ }
+ else /* screen gamma unknown */
+ {
+# if GAMMA_TRANSFORMS
+ linear_to_screen = file_gamma;
+# endif
+ correction = PNG_FP_1;
+ }
+
if (bit_depth <= 8)
{
- png_build_8bit_table(png_ptr, &png_ptr->gamma_table,
- png_ptr->screen_gamma > 0 ?
- png_reciprocal2(png_ptr->colorspace.gamma,
- png_ptr->screen_gamma) : PNG_FP_1);
+ png_build_8bit_table(png_ptr, &png_ptr->gamma_table, correction);
-#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
- defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \
- defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
+#if GAMMA_TRANSFORMS
if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0)
{
- png_build_8bit_table(png_ptr, &png_ptr->gamma_to_1,
- png_reciprocal(png_ptr->colorspace.gamma));
+ png_build_8bit_table(png_ptr, &png_ptr->gamma_to_1, file_to_linear);
png_build_8bit_table(png_ptr, &png_ptr->gamma_from_1,
- png_ptr->screen_gamma > 0 ?
- png_reciprocal(png_ptr->screen_gamma) :
- png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */);
+ linear_to_screen);
}
-#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
+#endif /* GAMMA_TRANSFORMS */
}
#ifdef PNG_16BIT_SUPPORTED
else
@@ -4368,22 +3733,17 @@
* reduced to 8 bits.
*/
if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0)
- png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift,
- png_ptr->screen_gamma > 0 ? png_product2(png_ptr->colorspace.gamma,
- png_ptr->screen_gamma) : PNG_FP_1);
-
+ png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift,
+ png_reciprocal(correction));
else
- png_build_16bit_table(png_ptr, &png_ptr->gamma_16_table, shift,
- png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->colorspace.gamma,
- png_ptr->screen_gamma) : PNG_FP_1);
+ png_build_16bit_table(png_ptr, &png_ptr->gamma_16_table, shift,
+ correction);
-#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
- defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \
- defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
+# if GAMMA_TRANSFORMS
if ((png_ptr->transformations & (PNG_COMPOSE | PNG_RGB_TO_GRAY)) != 0)
{
png_build_16bit_table(png_ptr, &png_ptr->gamma_16_to_1, shift,
- png_reciprocal(png_ptr->colorspace.gamma));
+ file_to_linear);
/* Notice that the '16 from 1' table should be full precision, however
* the lookup on this table still uses gamma_shift, so it can't be.
@@ -4390,10 +3750,9 @@
* TODO: fix this.
*/
png_build_16bit_table(png_ptr, &png_ptr->gamma_16_from_1, shift,
- png_ptr->screen_gamma > 0 ? png_reciprocal(png_ptr->screen_gamma) :
- png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */);
+ linear_to_screen);
}
-#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
+#endif /* GAMMA_TRANSFORMS */
}
#endif /* 16BIT */
}
@@ -4608,7 +3967,7 @@
# ifdef PNG_STDIO_SUPPORTED
if (cp->owned_file != 0)
{
- FILE *fp = png_voidcast(FILE*, cp->png_ptr->io_ptr);
+ FILE *fp = png_voidcast(FILE *, cp->png_ptr->io_ptr);
cp->owned_file = 0;
/* Ignore errors here. */
Modified: branches/stable/source/src/libs/libpng/libpng-src/png.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/png.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/png.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.46
+ * libpng version 1.6.48
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -14,7 +14,7 @@
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson
- * libpng versions 1.6.36, December 2018, through 1.6.46, January 2025:
+ * libpng versions 1.6.36, December 2018, through 1.6.48, April 2025:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@@ -238,7 +238,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
- * 1.6.46 16 10646 16.so.16.46[.0]
+ * 1.6.48 16 10648 16.so.16.48[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@@ -274,7 +274,7 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.46"
+#define PNG_LIBPNG_VER_STRING "1.6.48"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
/* The versions of shared library builds should stay in sync, going forward */
@@ -285,7 +285,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
-#define PNG_LIBPNG_VER_RELEASE 46
+#define PNG_LIBPNG_VER_RELEASE 48
/* This should be zero for a public release, or non-zero for a
* development version.
@@ -316,7 +316,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
-#define PNG_LIBPNG_VER 10646 /* 1.6.46 */
+#define PNG_LIBPNG_VER 10648 /* 1.6.48 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -426,7 +426,7 @@
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char* png_libpng_version_1_6_46;
+typedef char* png_libpng_version_1_6_48;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -1570,7 +1570,7 @@
#ifdef PNG_STDIO_SUPPORTED
/* Initialize the input/output for the PNG file to the default functions. */
-PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));
+PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, FILE *fp));
#endif
/* Replace the (error and abort), and warning functions with user
@@ -3088,7 +3088,7 @@
*/
PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
- FILE* file));
+ FILE *file));
/* The PNG header is read from the stdio FILE object. */
#endif /* STDIO */
@@ -3163,7 +3163,7 @@
PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,
int convert_to_8_bit, const void *buffer, png_int_32 row_stride,
const void *colormap));
- /* Write the image to the given (FILE*). */
+ /* Write the image to the given FILE object. */
#endif /* SIMPLIFIED_WRITE_STDIO */
/* With all write APIs if image is in one of the linear formats with 16-bit
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngconf.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngconf.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngconf.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngconf.h - machine-configurable file for libpng
*
- * libpng version 1.6.46
+ * libpng version 1.6.48
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
@@ -219,25 +219,13 @@
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
-# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
+# error PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
# endif
-# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
- (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
- /* older Borland and MSC
- * compilers used '__export' and required this to be after
- * the type.
- */
-# ifndef PNG_EXPORT_TYPE
-# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
-# endif
-# define PNG_DLL_EXPORT __export
-# else /* newer compiler */
-# define PNG_DLL_EXPORT __declspec(dllexport)
-# ifndef PNG_DLL_IMPORT
-# define PNG_DLL_IMPORT __declspec(dllimport)
-# endif
-# endif /* compiler */
+# define PNG_DLL_EXPORT __declspec(dllexport)
+# ifndef PNG_DLL_IMPORT
+# define PNG_DLL_IMPORT __declspec(dllimport)
+# endif
#else /* !Windows */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
@@ -479,7 +467,7 @@
#if CHAR_BIT == 8 && UCHAR_MAX == 255
typedef unsigned char png_byte;
#else
-# error "libpng requires 8-bit bytes"
+# error libpng requires 8-bit bytes
#endif
#if INT_MIN == -32768 && INT_MAX == 32767
@@ -487,7 +475,7 @@
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
typedef short png_int_16;
#else
-# error "libpng requires a signed 16-bit type"
+# error libpng requires a signed 16-bit integer type
#endif
#if UINT_MAX == 65535
@@ -495,7 +483,7 @@
#elif USHRT_MAX == 65535
typedef unsigned short png_uint_16;
#else
-# error "libpng requires an unsigned 16-bit type"
+# error libpng requires an unsigned 16-bit integer type
#endif
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
@@ -503,7 +491,7 @@
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
typedef long int png_int_32;
#else
-# error "libpng requires a signed 32-bit (or more) type"
+# error libpng requires a signed 32-bit (or longer) integer type
#endif
#if UINT_MAX > 4294967294U
@@ -511,7 +499,7 @@
#elif ULONG_MAX > 4294967294U
typedef unsigned long int png_uint_32;
#else
-# error "libpng requires an unsigned 32-bit (or more) type"
+# error libpng requires an unsigned 32-bit (or longer) integer type
#endif
/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
@@ -592,10 +580,6 @@
typedef size_t * png_size_tp;
typedef const size_t * png_const_size_tp;
-#ifdef PNG_STDIO_SUPPORTED
-typedef FILE * png_FILE_p;
-#endif
-
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double * png_doublep;
typedef const double * png_const_doublep;
@@ -617,6 +601,15 @@
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char * * * png_charppp;
+#ifdef PNG_STDIO_SUPPORTED
+/* With PNG_STDIO_SUPPORTED it was possible to use I/O streams that were
+ * not necessarily stdio FILE streams, to allow building Windows applications
+ * before Win32 and Windows CE applications before WinCE 3.0, but that kind
+ * of support has long been discontinued.
+ */
+typedef FILE * png_FILE_p; /* [Deprecated] */
+#endif
+
#endif /* PNG_BUILDING_SYMBOL_TABLE */
#endif /* PNGCONF_H */
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngdebug.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngdebug.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngdebug.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
-/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
+/* pngdebug.h - internal debugging macros for libpng
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -10,6 +10,10 @@
* and license in png.h
*/
+#ifndef PNGPRIV_H
+# error This file must not be included by applications; please include <png.h>
+#endif
+
/* Define PNG_DEBUG at compile time for debugging information. Higher
* numbers for PNG_DEBUG mean more debugging information. This has
* only been added since version 0.95 so it is not implemented throughout
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngerror.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngerror.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngerror.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -935,23 +935,37 @@
int /* PRIVATE */
png_safe_execute(png_imagep image, int (*function)(png_voidp), png_voidp arg)
{
- png_voidp saved_error_buf = image->opaque->error_buf;
+ const png_voidp saved_error_buf = image->opaque->error_buf;
jmp_buf safe_jmpbuf;
- int result;
/* Safely execute function(arg), with png_error returning back here. */
if (setjmp(safe_jmpbuf) == 0)
{
+ int result;
+
image->opaque->error_buf = safe_jmpbuf;
result = function(arg);
image->opaque->error_buf = saved_error_buf;
- return result;
+
+ if (result)
+ return 1; /* success */
}
- /* On png_error, return via longjmp, pop the jmpbuf, and free the image. */
+ /* The function failed either because of a caught png_error and a regular
+ * return of false above or because of an uncaught png_error from the
+ * function itself. Ensure that the error_buf is always set back to the
+ * value saved above:
+ */
image->opaque->error_buf = saved_error_buf;
- png_image_free(image);
- return 0;
+
+ /* On the final false return, when about to return control to the caller, the
+ * image is freed (png_image_free does this check but it is duplicated here
+ * for clarity:
+ */
+ if (saved_error_buf == NULL)
+ png_image_free(image);
+
+ return 0; /* failure */
}
#endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */
#endif /* READ || WRITE */
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngget.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngget.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngget.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngget.c - retrieval of values from info struct
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -380,7 +380,13 @@
* Notice that this can overflow - a warning is output and 0 is
* returned.
*/
- return png_muldiv_warn(png_ptr, microns, 500, 127);
+ png_fixed_point result;
+
+ if (png_muldiv(&result, microns, 500, 127) != 0)
+ return result;
+
+ png_warning(png_ptr, "fixed point overflow ignored");
+ return 0;
}
png_fixed_point PNGAPI
@@ -390,7 +396,7 @@
return png_fixed_inches_from_microns(png_ptr,
png_get_x_offset_microns(png_ptr, info_ptr));
}
-#endif
+#endif /* FIXED_POINT */
#ifdef PNG_FIXED_POINT_SUPPORTED
png_fixed_point PNGAPI
@@ -518,44 +524,31 @@
# ifdef PNG_FLOATING_POINT_SUPPORTED
png_uint_32 PNGAPI
png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr,
- double *white_x, double *white_y, double *red_x, double *red_y,
- double *green_x, double *green_y, double *blue_x, double *blue_y)
+ double *whitex, double *whitey, double *redx, double *redy,
+ double *greenx, double *greeny, double *bluex, double *bluey)
{
png_debug1(1, "in %s retrieval function", "cHRM");
- /* Quiet API change: this code used to only return the end points if a cHRM
- * chunk was present, but the end points can also come from iCCP or sRGB
- * chunks, so in 1.6.0 the png_get_ APIs return the end points regardless and
- * the png_set_ APIs merely check that set end points are mutually
- * consistent.
- */
+ /* PNGv3: this just returns the values store from the cHRM, if any. */
if (png_ptr != NULL && info_ptr != NULL &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
+ (info_ptr->valid & PNG_INFO_cHRM) != 0)
{
- if (white_x != NULL)
- *white_x = png_float(png_ptr,
- info_ptr->colorspace.end_points_xy.whitex, "cHRM white X");
- if (white_y != NULL)
- *white_y = png_float(png_ptr,
- info_ptr->colorspace.end_points_xy.whitey, "cHRM white Y");
- if (red_x != NULL)
- *red_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redx,
- "cHRM red X");
- if (red_y != NULL)
- *red_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.redy,
- "cHRM red Y");
- if (green_x != NULL)
- *green_x = png_float(png_ptr,
- info_ptr->colorspace.end_points_xy.greenx, "cHRM green X");
- if (green_y != NULL)
- *green_y = png_float(png_ptr,
- info_ptr->colorspace.end_points_xy.greeny, "cHRM green Y");
- if (blue_x != NULL)
- *blue_x = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluex,
- "cHRM blue X");
- if (blue_y != NULL)
- *blue_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluey,
- "cHRM blue Y");
+ if (whitex != NULL)
+ *whitex = png_float(png_ptr, info_ptr->cHRM.whitex, "cHRM wx");
+ if (whitey != NULL)
+ *whitey = png_float(png_ptr, info_ptr->cHRM.whitey, "cHRM wy");
+ if (redx != NULL)
+ *redx = png_float(png_ptr, info_ptr->cHRM.redx, "cHRM rx");
+ if (redy != NULL)
+ *redy = png_float(png_ptr, info_ptr->cHRM.redy, "cHRM ry");
+ if (greenx != NULL)
+ *greenx = png_float(png_ptr, info_ptr->cHRM.greenx, "cHRM gx");
+ if (greeny != NULL)
+ *greeny = png_float(png_ptr, info_ptr->cHRM.greeny, "cHRM gy");
+ if (bluex != NULL)
+ *bluex = png_float(png_ptr, info_ptr->cHRM.bluex, "cHRM bx");
+ if (bluey != NULL)
+ *bluey = png_float(png_ptr, info_ptr->cHRM.bluey, "cHRM by");
return PNG_INFO_cHRM;
}
@@ -568,38 +561,31 @@
double *green_Y, double *green_Z, double *blue_X, double *blue_Y,
double *blue_Z)
{
+ png_XYZ XYZ;
png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)");
if (png_ptr != NULL && info_ptr != NULL &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
+ (info_ptr->valid & PNG_INFO_cHRM) != 0 &&
+ png_XYZ_from_xy(&XYZ, &info_ptr->cHRM) == 0)
{
if (red_X != NULL)
- *red_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_X,
- "cHRM red X");
+ *red_X = png_float(png_ptr, XYZ.red_X, "cHRM red X");
if (red_Y != NULL)
- *red_Y = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Y,
- "cHRM red Y");
+ *red_Y = png_float(png_ptr, XYZ.red_Y, "cHRM red Y");
if (red_Z != NULL)
- *red_Z = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_Z,
- "cHRM red Z");
+ *red_Z = png_float(png_ptr, XYZ.red_Z, "cHRM red Z");
if (green_X != NULL)
- *green_X = png_float(png_ptr,
- info_ptr->colorspace.end_points_XYZ.green_X, "cHRM green X");
+ *green_X = png_float(png_ptr, XYZ.green_X, "cHRM green X");
if (green_Y != NULL)
- *green_Y = png_float(png_ptr,
- info_ptr->colorspace.end_points_XYZ.green_Y, "cHRM green Y");
+ *green_Y = png_float(png_ptr, XYZ.green_Y, "cHRM green Y");
if (green_Z != NULL)
- *green_Z = png_float(png_ptr,
- info_ptr->colorspace.end_points_XYZ.green_Z, "cHRM green Z");
+ *green_Z = png_float(png_ptr, XYZ.green_Z, "cHRM green Z");
if (blue_X != NULL)
- *blue_X = png_float(png_ptr,
- info_ptr->colorspace.end_points_XYZ.blue_X, "cHRM blue X");
+ *blue_X = png_float(png_ptr, XYZ.blue_X, "cHRM blue X");
if (blue_Y != NULL)
- *blue_Y = png_float(png_ptr,
- info_ptr->colorspace.end_points_XYZ.blue_Y, "cHRM blue Y");
+ *blue_Y = png_float(png_ptr, XYZ.blue_Y, "cHRM blue Y");
if (blue_Z != NULL)
- *blue_Z = png_float(png_ptr,
- info_ptr->colorspace.end_points_XYZ.blue_Z, "cHRM blue Z");
+ *blue_Z = png_float(png_ptr, XYZ.blue_Z, "cHRM blue Z");
return PNG_INFO_cHRM;
}
@@ -616,29 +602,22 @@
png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
png_fixed_point *int_blue_Z)
{
+ png_XYZ XYZ;
png_debug1(1, "in %s retrieval function", "cHRM_XYZ");
if (png_ptr != NULL && info_ptr != NULL &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
+ (info_ptr->valid & PNG_INFO_cHRM) != 0U &&
+ png_XYZ_from_xy(&XYZ, &info_ptr->cHRM) == 0)
{
- if (int_red_X != NULL)
- *int_red_X = info_ptr->colorspace.end_points_XYZ.red_X;
- if (int_red_Y != NULL)
- *int_red_Y = info_ptr->colorspace.end_points_XYZ.red_Y;
- if (int_red_Z != NULL)
- *int_red_Z = info_ptr->colorspace.end_points_XYZ.red_Z;
- if (int_green_X != NULL)
- *int_green_X = info_ptr->colorspace.end_points_XYZ.green_X;
- if (int_green_Y != NULL)
- *int_green_Y = info_ptr->colorspace.end_points_XYZ.green_Y;
- if (int_green_Z != NULL)
- *int_green_Z = info_ptr->colorspace.end_points_XYZ.green_Z;
- if (int_blue_X != NULL)
- *int_blue_X = info_ptr->colorspace.end_points_XYZ.blue_X;
- if (int_blue_Y != NULL)
- *int_blue_Y = info_ptr->colorspace.end_points_XYZ.blue_Y;
- if (int_blue_Z != NULL)
- *int_blue_Z = info_ptr->colorspace.end_points_XYZ.blue_Z;
+ if (int_red_X != NULL) *int_red_X = XYZ.red_X;
+ if (int_red_Y != NULL) *int_red_Y = XYZ.red_Y;
+ if (int_red_Z != NULL) *int_red_Z = XYZ.red_Z;
+ if (int_green_X != NULL) *int_green_X = XYZ.green_X;
+ if (int_green_Y != NULL) *int_green_Y = XYZ.green_Y;
+ if (int_green_Z != NULL) *int_green_Z = XYZ.green_Z;
+ if (int_blue_X != NULL) *int_blue_X = XYZ.blue_X;
+ if (int_blue_Y != NULL) *int_blue_Y = XYZ.blue_Y;
+ if (int_blue_Z != NULL) *int_blue_Z = XYZ.blue_Z;
return PNG_INFO_cHRM;
}
@@ -647,31 +626,24 @@
png_uint_32 PNGAPI
png_get_cHRM_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
- png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x,
- png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y,
- png_fixed_point *blue_x, png_fixed_point *blue_y)
+ png_fixed_point *whitex, png_fixed_point *whitey, png_fixed_point *redx,
+ png_fixed_point *redy, png_fixed_point *greenx, png_fixed_point *greeny,
+ png_fixed_point *bluex, png_fixed_point *bluey)
{
png_debug1(1, "in %s retrieval function", "cHRM");
+ /* PNGv3: this just returns the values store from the cHRM, if any. */
if (png_ptr != NULL && info_ptr != NULL &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
+ (info_ptr->valid & PNG_INFO_cHRM) != 0)
{
- if (white_x != NULL)
- *white_x = info_ptr->colorspace.end_points_xy.whitex;
- if (white_y != NULL)
- *white_y = info_ptr->colorspace.end_points_xy.whitey;
- if (red_x != NULL)
- *red_x = info_ptr->colorspace.end_points_xy.redx;
- if (red_y != NULL)
- *red_y = info_ptr->colorspace.end_points_xy.redy;
- if (green_x != NULL)
- *green_x = info_ptr->colorspace.end_points_xy.greenx;
- if (green_y != NULL)
- *green_y = info_ptr->colorspace.end_points_xy.greeny;
- if (blue_x != NULL)
- *blue_x = info_ptr->colorspace.end_points_xy.bluex;
- if (blue_y != NULL)
- *blue_y = info_ptr->colorspace.end_points_xy.bluey;
+ if (whitex != NULL) *whitex = info_ptr->cHRM.whitex;
+ if (whitey != NULL) *whitey = info_ptr->cHRM.whitey;
+ if (redx != NULL) *redx = info_ptr->cHRM.redx;
+ if (redy != NULL) *redy = info_ptr->cHRM.redy;
+ if (greenx != NULL) *greenx = info_ptr->cHRM.greenx;
+ if (greeny != NULL) *greeny = info_ptr->cHRM.greeny;
+ if (bluex != NULL) *bluex = info_ptr->cHRM.bluex;
+ if (bluey != NULL) *bluey = info_ptr->cHRM.bluey;
return PNG_INFO_cHRM;
}
@@ -688,11 +660,11 @@
{
png_debug1(1, "in %s retrieval function", "gAMA");
+ /* PNGv3 compatibility: only report gAMA if it is really present. */
if (png_ptr != NULL && info_ptr != NULL &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
- file_gamma != NULL)
+ (info_ptr->valid & PNG_INFO_gAMA) != 0)
{
- *file_gamma = info_ptr->colorspace.gamma;
+ if (file_gamma != NULL) *file_gamma = info_ptr->gamma;
return PNG_INFO_gAMA;
}
@@ -707,12 +679,13 @@
{
png_debug1(1, "in %s retrieval function", "gAMA(float)");
+ /* PNGv3 compatibility: only report gAMA if it is really present. */
if (png_ptr != NULL && info_ptr != NULL &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) != 0 &&
- file_gamma != NULL)
+ (info_ptr->valid & PNG_INFO_gAMA) != 0)
{
- *file_gamma = png_float(png_ptr, info_ptr->colorspace.gamma,
- "png_get_gAMA");
+ if (file_gamma != NULL)
+ *file_gamma = png_float(png_ptr, info_ptr->gamma, "gAMA");
+
return PNG_INFO_gAMA;
}
@@ -729,9 +702,10 @@
png_debug1(1, "in %s retrieval function", "sRGB");
if (png_ptr != NULL && info_ptr != NULL &&
- (info_ptr->valid & PNG_INFO_sRGB) != 0 && file_srgb_intent != NULL)
+ (info_ptr->valid & PNG_INFO_sRGB) != 0)
{
- *file_srgb_intent = info_ptr->colorspace.rendering_intent;
+ if (file_srgb_intent != NULL)
+ *file_srgb_intent = info_ptr->rendering_intent;
return PNG_INFO_sRGB;
}
Modified: branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
-/* pnginfo.h - header file for PNG reference library
+/* pnginfo.h - internal structures for libpng
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -10,43 +10,20 @@
* and license in png.h
*/
- /* png_info is a structure that holds the information in a PNG file so
- * that the application can find out the characteristics of the image.
- * If you are reading the file, this structure will tell you what is
- * in the PNG file. If you are writing the file, fill in the information
- * you want to put into the PNG file, using png_set_*() functions, then
- * call png_write_info().
+#ifndef PNGPRIV_H
+# error This file must not be included by applications; please include <png.h>
+#endif
+
+/* INTERNAL, PRIVATE definition of a PNG.
*
- * The names chosen should be very close to the PNG specification, so
- * consult that document for information about the meaning of each field.
+ * png_info is a modifiable description of a PNG datastream. The fields inside
+ * this structure are accessed through png_get_<CHUNK>() functions and modified
+ * using png_set_<CHUNK>() functions.
*
- * With libpng < 0.95, it was only possible to directly set and read the
- * the values in the png_info_struct, which meant that the contents and
- * order of the values had to remain fixed. With libpng 0.95 and later,
- * however, there are now functions that abstract the contents of
- * png_info_struct from the application, so this makes it easier to use
- * libpng with dynamic libraries, and even makes it possible to use
- * libraries that don't have all of the libpng ancillary chunk-handing
- * functionality. In libpng-1.5.0 this was moved into a separate private
- * file that is not visible to applications.
- *
- * The following members may have allocated storage attached that should be
- * cleaned up before the structure is discarded: palette, trans, text,
- * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
- * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these
- * are automatically freed when the info structure is deallocated, if they were
- * allocated internally by libpng. This behavior can be changed by means
- * of the png_data_freer() function.
- *
- * More allocation details: all the chunk-reading functions that
- * change these members go through the corresponding png_set_*
- * functions. A function to clear these members is available: see
- * png_free_data(). The png_set_* functions do not depend on being
- * able to point info structure members to any of the storage they are
- * passed (they make their own copies), EXCEPT that the png_set_text
- * functions use the same storage passed to them in the text_ptr or
- * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
- * functions do not make their own copies.
+ * Some functions in libpng do directly access members of png_info. However,
+ * this should be avoided. png_struct objects contain members which hold
+ * caches, sometimes optimised, of the values from png_info objects, and
+ * png_info is not passed to the functions which read and write image data.
*/
#ifndef PNGINFO_H
#define PNGINFO_H
@@ -86,20 +63,6 @@
* and initialize the appropriate fields below.
*/
-#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
- /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are
- * defined. When COLORSPACE is switched on all the colorspace-defining
- * chunks should be enabled, when GAMMA is switched on all the gamma-defining
- * chunks should be enabled. If this is not done it becomes possible to read
- * inconsistent PNG files and assign a probably incorrect interpretation to
- * the information. (In other words, by carefully choosing which chunks to
- * recognize the system configuration can select an interpretation for PNG
- * files containing ambiguous data and this will result in inconsistent
- * behavior between different libpng builds!)
- */
- png_colorspace colorspace;
-#endif
-
#ifdef PNG_cICP_SUPPORTED
/* cICP chunk data */
png_byte cicp_colour_primaries;
@@ -211,11 +174,8 @@
#endif
#ifdef PNG_eXIf_SUPPORTED
- int num_exif; /* Added at libpng-1.6.31 */
+ png_uint_32 num_exif; /* Added at libpng-1.6.31 */
png_bytep exif;
-# ifdef PNG_READ_eXIf_SUPPORTED
- png_bytep eXIf_buf; /* Added at libpng-1.6.32 */
-# endif
#endif
#ifdef PNG_hIST_SUPPORTED
@@ -288,5 +248,16 @@
png_bytepp row_pointers; /* the image bits */
#endif
+#ifdef PNG_cHRM_SUPPORTED
+ png_xy cHRM;
+#endif
+
+#ifdef PNG_gAMA_SUPPORTED
+ png_fixed_point gamma;
+#endif
+
+#ifdef PNG_sRGB_SUPPORTED
+ int rendering_intent;
+#endif
};
#endif /* PNGINFO_H */
Modified: branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.46 */
+/* libpng version 1.6.48 */
/* Copyright (c) 2018-2025 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngmem.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngmem.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngmem.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngmem.c - stub functions for memory allocation
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -72,30 +72,29 @@
* to implement a user memory handler. This checks to be sure it isn't
* called with big numbers.
*/
-#ifndef PNG_USER_MEM_SUPPORTED
- PNG_UNUSED(png_ptr)
-#endif
+# ifdef PNG_MAX_MALLOC_64K
+ /* This is support for legacy systems which had segmented addressing
+ * limiting the maximum allocation size to 65536. It takes precedence
+ * over PNG_SIZE_MAX which is set to 65535 on true 16-bit systems.
+ *
+ * TODO: libpng-1.8: finally remove both cases.
+ */
+ if (size > 65536U) return NULL;
+# endif
- /* Some compilers complain that this is always true. However, it
- * can be false when integer overflow happens.
+ /* This is checked too because the system malloc call below takes a (size_t).
*/
- if (size > 0 && size <= PNG_SIZE_MAX
-# ifdef PNG_MAX_MALLOC_64K
- && size <= 65536U
-# endif
- )
- {
-#ifdef PNG_USER_MEM_SUPPORTED
+ if (size > PNG_SIZE_MAX) return NULL;
+
+# ifdef PNG_USER_MEM_SUPPORTED
if (png_ptr != NULL && png_ptr->malloc_fn != NULL)
return png_ptr->malloc_fn(png_constcast(png_structrp,png_ptr), size);
+# else
+ PNG_UNUSED(png_ptr)
+# endif
- else
-#endif
- return malloc((size_t)size); /* checked for truncation above */
- }
-
- else
- return NULL;
+ /* Use the system malloc */
+ return malloc((size_t)/*SAFE*/size); /* checked for truncation above */
}
#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngpread.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngpread.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngpread.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngpread.c - read a png file in push mode
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -193,17 +193,8 @@
*/
if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
{
- png_byte chunk_length[4];
- png_byte chunk_tag[4];
-
PNG_PUSH_SAVE_BUFFER_IF_LT(8)
- png_push_fill_buffer(png_ptr, chunk_length, 4);
- png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
- png_reset_crc(png_ptr);
- png_crc_read(png_ptr, chunk_tag, 4);
- png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
- png_check_chunk_name(png_ptr, png_ptr->chunk_name);
- png_check_chunk_length(png_ptr, png_ptr->push_length);
+ png_ptr->push_length = png_read_chunk_header(png_ptr);
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
}
@@ -244,13 +235,13 @@
png_error(png_ptr, "Invalid IHDR length");
PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
+ png_handle_chunk(png_ptr, info_ptr, png_ptr->push_length);
}
else if (chunk_name == png_IEND)
{
PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
+ png_handle_chunk(png_ptr, info_ptr, png_ptr->push_length);
png_ptr->process_mode = PNG_READ_DONE_MODE;
png_push_have_end(png_ptr, info_ptr);
@@ -267,12 +258,6 @@
}
#endif
- else if (chunk_name == png_PLTE)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
- }
-
else if (chunk_name == png_IDAT)
{
png_ptr->idat_size = png_ptr->push_length;
@@ -285,179 +270,10 @@
return;
}
-#ifdef PNG_READ_gAMA_SUPPORTED
- else if (png_ptr->chunk_name == png_gAMA)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_sBIT_SUPPORTED
- else if (png_ptr->chunk_name == png_sBIT)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_cHRM_SUPPORTED
- else if (png_ptr->chunk_name == png_cHRM)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_cICP_SUPPORTED
- else if (png_ptr->chunk_name == png_cICP)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_cICP(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_cLLI_SUPPORTED
- else if (png_ptr->chunk_name == png_cLLI)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_cLLI(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_mDCV_SUPPORTED
- else if (png_ptr->chunk_name == png_mDCV)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_mDCV(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_eXIf_SUPPORTED
- else if (png_ptr->chunk_name == png_eXIf)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_eXIf(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_sRGB_SUPPORTED
- else if (chunk_name == png_sRGB)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_iCCP_SUPPORTED
- else if (png_ptr->chunk_name == png_iCCP)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_sPLT_SUPPORTED
- else if (chunk_name == png_sPLT)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_tRNS_SUPPORTED
- else if (chunk_name == png_tRNS)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_bKGD_SUPPORTED
- else if (chunk_name == png_bKGD)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_hIST_SUPPORTED
- else if (chunk_name == png_hIST)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_pHYs_SUPPORTED
- else if (chunk_name == png_pHYs)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_oFFs_SUPPORTED
- else if (chunk_name == png_oFFs)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
- }
-#endif
-
-#ifdef PNG_READ_pCAL_SUPPORTED
- else if (chunk_name == png_pCAL)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_sCAL_SUPPORTED
- else if (chunk_name == png_sCAL)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_tIME_SUPPORTED
- else if (chunk_name == png_tIME)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_tEXt_SUPPORTED
- else if (chunk_name == png_tEXt)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_zTXt_SUPPORTED
- else if (chunk_name == png_zTXt)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
- }
-
-#endif
-#ifdef PNG_READ_iTXt_SUPPORTED
- else if (chunk_name == png_iTXt)
- {
- PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
- }
-#endif
-
else
{
PNG_PUSH_SAVE_BUFFER_IF_FULL
- png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length,
- PNG_HANDLE_CHUNK_AS_DEFAULT);
+ png_handle_chunk(png_ptr, info_ptr, png_ptr->push_length);
}
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngpriv.h - private declarations for use inside libpng
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -19,9 +19,21 @@
* they should be well aware of the issues that may arise from doing so.
*/
+
+/* pngpriv.h must be included first in each translation unit inside libpng.
+ * On the other hand, it must not be included at all, directly or indirectly,
+ * by any application code that uses the libpng API.
+ */
#ifndef PNGPRIV_H
-#define PNGPRIV_H
+# define PNGPRIV_H
+#else
+# error Duplicate inclusion of pngpriv.h; please check the libpng source files
+#endif
+#if defined(PNG_H) || defined(PNGCONF_H) || defined(PNGLCONF_H)
+# error This file must not be included by applications; please include <png.h>
+#endif
+
/* Feature Test Macros. The following are defined here to ensure that correctly
* implemented libraries reveal the APIs libpng needs to build and hide those
* that are not needed and potentially damaging to the compilation.
@@ -57,7 +69,6 @@
*/
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
# include <config.h>
-
/* Pick up the definition of 'restrict' from config.h if it was read: */
# define PNG_RESTRICT restrict
#endif
@@ -67,9 +78,7 @@
* are not internal definitions may be required. This is handled below just
* before png.h is included, but load the configuration now if it is available.
*/
-#ifndef PNGLCONF_H
-# include "pnglibconf.h"
-#endif
+#include "pnglibconf.h"
/* Local renames may change non-exported API functions from png.h */
#if defined(PNG_PREFIX) && !defined(PNGPREFIX_H)
@@ -671,7 +680,7 @@
#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200U
#define PNG_FLAG_CRC_CRITICAL_USE 0x0400U
#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800U
-#define PNG_FLAG_ASSUME_sRGB 0x1000U /* Added to libpng-1.5.4 */
+/* PNG_FLAG_ASSUME_sRGB unused 0x1000U * Added to libpng-1.5.4 */
#define PNG_FLAG_OPTIMIZE_ALPHA 0x2000U /* Added to libpng-1.5.4 */
#define PNG_FLAG_DETECT_UNINITIALIZED 0x4000U /* Added to libpng-1.5.4 */
/* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000U */
@@ -802,11 +811,31 @@
*
* PNG_32b correctly produces a value shifted by up to 24 bits, even on
* architectures where (int) is only 16 bits.
+ *
+ * 1.6.47: PNG_32b was made into a preprocessor evaluable macro by replacing the
+ * static_cast with a promoting binary operation using a guaranteed 32-bit
+ * (minimum) unsigned value.
*/
-#define PNG_32b(b,s) ((png_uint_32)(b) << (s))
+#define PNG_32b(b,s) (((0xFFFFFFFFU)&(b)) << (s))
#define PNG_U32(b1,b2,b3,b4) \
(PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0))
+/* Chunk name validation. When using these macros all the arguments should be
+ * constants, otherwise code bloat may well occur. The macros are provided
+ * primarily for use in #if checks.
+ *
+ * PNG_32to8 produces a byte value with the right shift; used to extract the
+ * byte value from a chunk name.
+ */
+#define PNG_32to8(cn,s) (((cn) >> (s)) & 0xffU)
+#define PNG_CN_VALID_UPPER(b) ((b) >= 65 && (b) <= 90) /* upper-case ASCII */
+#define PNG_CN_VALID_ASCII(b) PNG_CN_VALID_UPPER((b) & ~32U)
+#define PNG_CHUNK_NAME_VALID(cn) (\
+ PNG_CN_VALID_ASCII(PNG_32to8(cn,24)) && /* critical, !ancillary */\
+ PNG_CN_VALID_ASCII(PNG_32to8(cn,16)) && /* public, !privately defined */\
+ PNG_CN_VALID_UPPER(PNG_32to8(cn, 8)) && /* VALID, !reserved */\
+ PNG_CN_VALID_ASCII(PNG_32to8(cn, 0)) /* data-dependent, !copy ok */)
+
/* Constants for known chunk types.
*
* MAINTAINERS: If you need to add a chunk, define the name here.
@@ -834,11 +863,14 @@
#define png_IEND PNG_U32( 73, 69, 78, 68)
#define png_IHDR PNG_U32( 73, 72, 68, 82)
#define png_PLTE PNG_U32( 80, 76, 84, 69)
+#define png_acTL PNG_U32( 97, 99, 84, 76) /* PNGv3: APNG */
#define png_bKGD PNG_U32( 98, 75, 71, 68)
#define png_cHRM PNG_U32( 99, 72, 82, 77)
#define png_cICP PNG_U32( 99, 73, 67, 80) /* PNGv3 */
#define png_cLLI PNG_U32( 99, 76, 76, 73) /* PNGv3 */
#define png_eXIf PNG_U32(101, 88, 73, 102) /* registered July 2017 */
+#define png_fcTL PNG_U32(102, 99, 84, 76) /* PNGv3: APNG */
+#define png_fdAT PNG_U32(102, 100, 65, 84) /* PNGv3: APNG */
#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */
#define png_gAMA PNG_U32(103, 65, 77, 65)
#define png_gIFg PNG_U32(103, 73, 70, 103)
@@ -888,11 +920,74 @@
#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13))
#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5))
+/* Known chunks. All supported chunks must be listed here. The macro PNG_CHUNK
+ * contains the four character ASCII name by which the chunk is identified. The
+ * macro is implemented as required to build tables or switch statements which
+ * require entries for every known chunk. The macro also contains an index
+ * value which should be in order (this is checked in png.c).
+ *
+ * Notice that "known" does not require "SUPPORTED"; tables should be built in
+ * such a way that chunks unsupported in a build require no more than the table
+ * entry (which should be small.) In particular function pointers for
+ * unsupported chunks should be NULL.
+ *
+ * At present these index values are not exported (not part of the public API)
+ * so can be changed at will. For convenience the names are in lexical sort
+ * order but with the critical chunks at the start in the order of occurence in
+ * a PNG.
+ *
+ * PNG_INFO_ values do not exist for every one of these chunk handles; for
+ * example PNG_INFO_{IDAT,IEND,tEXt,iTXt,zTXt} and possibly other chunks in the
+ * future.
+ */
+#define PNG_KNOWN_CHUNKS\
+ PNG_CHUNK(IHDR, 0)\
+ PNG_CHUNK(PLTE, 1)\
+ PNG_CHUNK(IDAT, 2)\
+ PNG_CHUNK(IEND, 3)\
+ PNG_CHUNK(acTL, 4)\
+ PNG_CHUNK(bKGD, 5)\
+ PNG_CHUNK(cHRM, 6)\
+ PNG_CHUNK(cICP, 7)\
+ PNG_CHUNK(cLLI, 8)\
+ PNG_CHUNK(eXIf, 9)\
+ PNG_CHUNK(fcTL, 10)\
+ PNG_CHUNK(fdAT, 11)\
+ PNG_CHUNK(gAMA, 12)\
+ PNG_CHUNK(hIST, 13)\
+ PNG_CHUNK(iCCP, 14)\
+ PNG_CHUNK(iTXt, 15)\
+ PNG_CHUNK(mDCV, 16)\
+ PNG_CHUNK(oFFs, 17)\
+ PNG_CHUNK(pCAL, 18)\
+ PNG_CHUNK(pHYs, 19)\
+ PNG_CHUNK(sBIT, 20)\
+ PNG_CHUNK(sCAL, 21)\
+ PNG_CHUNK(sPLT, 22)\
+ PNG_CHUNK(sRGB, 23)\
+ PNG_CHUNK(tEXt, 24)\
+ PNG_CHUNK(tIME, 25)\
+ PNG_CHUNK(tRNS, 26)\
+ PNG_CHUNK(zTXt, 27)
+
/* Gamma values (new at libpng-1.5.4): */
#define PNG_GAMMA_MAC_OLD 151724 /* Assume '1.8' is really 2.2/1.45! */
#define PNG_GAMMA_MAC_INVERSE 65909
#define PNG_GAMMA_sRGB_INVERSE 45455
+/* gamma sanity check. libpng cannot implement gamma transforms outside a
+ * certain limit because of its use of 16-bit fixed point intermediate values.
+ * Gamma values that are too large or too small will zap the 16-bit values all
+ * to 0 or 65535 resulting in an obvious 'bad' image.
+ *
+ * In libpng 1.6.0 the limits were changed from 0.07..3 to 0.01..100 to
+ * accommodate the optimal 16-bit gamma of 36 and its reciprocal.
+ *
+ * These are png_fixed_point integral values:
+ */
+#define PNG_LIB_GAMMA_MIN 1000
+#define PNG_LIB_GAMMA_MAX 10000000
+
/* Almost everything below is C specific; the #defines above can be used in
* non-C code (so long as it is C-preprocessed) the rest of this stuff cannot.
*/
@@ -905,17 +1000,15 @@
* must match that used in the build, or we must be using pnglibconf.h.prebuilt:
*/
#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
-# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
- "-I (include path) error: see the notes in pngpriv.h"
- /* This means that when pnglibconf.h was built the copy of zlib.h that it
- * used is not the same as the one being used here. Because the build of
- * libpng makes decisions to use inflateInit2 and inflateReset2 based on the
- * zlib version number and because this affects handling of certain broken
- * PNG files the -I directives must match.
+# error The include path of <zlib.h> is incorrect
+ /* When pnglibconf.h was built, the copy of zlib.h that it used was not the
+ * same as the one being used here. Considering how libpng makes decisions
+ * to use the zlib API based on the zlib version number, the -I options must
+ * match.
*
- * The most likely explanation is that you passed a -I in CFLAGS. This will
- * not work; all the preprocessor directives and in particular all the -I
- * directives must be in CPPFLAGS.
+ * A possible cause of this mismatch is that you passed an -I option in
+ * CFLAGS, which is unlikely to work. All the preprocessor options, and all
+ * the -I options in particular, should be in CPPFLAGS.
*/
#endif
@@ -956,7 +1049,6 @@
*
* All of these functions must be declared with PNG_INTERNAL_FUNCTION.
*/
-
/* Zlib support */
#define PNG_UNEXPECTED_ZLIB_RETURN (-7)
PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret),
@@ -996,6 +1088,25 @@
PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr,
png_const_charp user_png_ver),PNG_EMPTY);
+#ifdef PNG_READ_SUPPORTED /* should only be used on read */
+/* Security: read limits on the largest allocations while reading a PNG. This
+ * avoids very large allocations caused by PNG files with damaged or altered
+ * chunk 'length' fields.
+ */
+#ifdef PNG_SET_USER_LIMITS_SUPPORTED /* run-time limit */
+# define png_chunk_max(png_ptr) ((png_ptr)->user_chunk_malloc_max)
+
+#elif PNG_USER_CHUNK_MALLOC_MAX > 0 /* compile-time limit */
+# define png_chunk_max(png_ptr) ((void)png_ptr, PNG_USER_CHUNK_MALLOC_MAX)
+
+#elif (defined PNG_MAX_MALLOC_64K) /* legacy system limit */
+# define png_chunk_max(png_ptr) ((void)png_ptr, 65536U)
+
+#else /* modern system limit SIZE_MAX (C99) */
+# define png_chunk_max(png_ptr) ((void)png_ptr, PNG_SIZE_MAX)
+#endif
+#endif /* READ */
+
/* Internal base allocator - no messages, NULL on failure to allocate. This
* does, however, call the application provided allocator and that could call
* png_error (although that would be a bug in the application implementation.)
@@ -1095,9 +1206,6 @@
PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr,
png_uint_32 skip),PNG_EMPTY);
-/* Read the CRC from the file and compare it to the libpng calculated CRC */
-PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY);
-
/* Calculate the CRC over a section of data. Note that we are only
* passing a maximum of 64K on systems that have this as a memory limit,
* since this is the maximum buffer size we can specify.
@@ -1175,10 +1283,10 @@
#ifdef PNG_WRITE_iCCP_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
- png_const_charp name, png_const_bytep profile), PNG_EMPTY);
- /* The profile must have been previously validated for correctness, the
- * length comes from the first four bytes. Only the base, deflate,
- * compression is supported.
+ png_const_charp name, png_const_bytep profile, png_uint_32 proflen),
+ PNG_EMPTY);
+ /* Writes a previously 'set' profile. The profile argument is **not**
+ * compressed.
*/
#endif
@@ -1487,128 +1595,24 @@
/* The following decodes the appropriate chunks, and does error correction,
* then calls the appropriate callback for the chunk if it is valid.
*/
+typedef enum
+{
+ /* Result of a call to png_handle_chunk made to handle the current chunk
+ * png_struct::chunk_name on read. Always informational, either the stream
+ * is read for the next chunk or the routine will call png_error.
+ *
+ * NOTE: order is important internally. handled_saved and above are regarded
+ * as handling the chunk.
+ */
+ handled_error = 0, /* bad crc or known and bad format or too long */
+ handled_discarded, /* not saved in the unknown chunk list */
+ handled_saved, /* saved in the unknown chunk list */
+ handled_ok /* known, supported and handled without error */
+} png_handle_result_code;
-/* Decode the IHDR chunk */
-PNG_INTERNAL_FUNCTION(void,png_handle_IHDR,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_handle_PLTE,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_handle_IEND,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-
-#ifdef PNG_READ_bKGD_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_bKGD,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_cHRM_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_cICP_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_cICP,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_cLLI_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_cLLI,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_eXIf_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_eXIf,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_gAMA_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_hIST_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_iCCP_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif /* READ_iCCP */
-
-#ifdef PNG_READ_iTXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_mDCV_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_mDCV,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_oFFs_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_oFFs,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_pCAL_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_pCAL,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_pHYs_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_pHYs,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_sBIT_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_sBIT,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_sCAL_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_sPLT_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif /* READ_sPLT */
-
-#ifdef PNG_READ_sRGB_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_tEXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_tEXt,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_tIME_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_tIME,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_tRNS_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_tRNS,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-#ifdef PNG_READ_zTXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-#endif
-
-PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
- png_uint_32 chunk_name),PNG_EMPTY);
-
-PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
- png_uint_32 chunk_length),PNG_EMPTY);
-
-PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_handle_result_code,png_handle_unknown,
+ (png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),
+ PNG_EMPTY);
/* This is the function that gets called for unknown chunks. The 'keep'
* argument is either non-zero for a known chunk that has been set to be
* handled as unknown or zero for an unknown chunk. By default the function
@@ -1615,6 +1619,12 @@
* just skips the chunk or errors out if it is critical.
*/
+PNG_INTERNAL_FUNCTION(png_handle_result_code,png_handle_chunk,
+ (png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+ /* This handles the current chunk png_ptr->chunk_name with unread
+ * data[length] and returns one of the above result codes.
+ */
+
#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\
defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling,
@@ -1654,8 +1664,6 @@
png_bytep buffer, size_t buffer_length),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr),
PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr,
png_inforp info_ptr),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr,
@@ -1668,109 +1676,28 @@
png_inforp info_ptr),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr),
PNG_EMPTY);
-# ifdef PNG_READ_tEXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_push_handle_tEXt,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_push_read_tEXt,(png_structrp png_ptr,
- png_inforp info_ptr),PNG_EMPTY);
-# endif
-# ifdef PNG_READ_zTXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_push_handle_zTXt,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_push_read_zTXt,(png_structrp png_ptr,
- png_inforp info_ptr),PNG_EMPTY);
-# endif
-# ifdef PNG_READ_iTXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_push_handle_iTXt,(png_structrp png_ptr,
- png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr,
- png_inforp info_ptr),PNG_EMPTY);
-# endif
-
#endif /* PROGRESSIVE_READ */
-/* Added at libpng version 1.6.0 */
-#ifdef PNG_GAMMA_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY);
- /* Set the colorspace gamma with a value provided by the application or by
- * the gAMA chunk on read. The value will override anything set by an ICC
- * profile.
- */
-
-PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr,
- png_inforp info_ptr), PNG_EMPTY);
- /* Synchronize the info 'valid' flags with the colorspace */
-
-PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr,
- png_inforp info_ptr), PNG_EMPTY);
- /* Copy the png_struct colorspace to the info_struct and call the above to
- * synchronize the flags. Checks for NULL info_ptr and does nothing.
- */
-#endif
-
-/* Added at libpng version 1.4.0 */
-#ifdef PNG_COLORSPACE_SUPPORTED
-/* These internal functions are for maintaining the colorspace structure within
- * a png_info or png_struct (or, indeed, both).
- */
-PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities,
- (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy,
- int preferred), PNG_EMPTY);
-
-PNG_INTERNAL_FUNCTION(int,png_colorspace_set_endpoints,
- (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ,
- int preferred), PNG_EMPTY);
-
-#ifdef PNG_sRGB_SUPPORTED
-PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr,
- png_colorspacerp colorspace, int intent), PNG_EMPTY);
- /* This does set the colorspace gAMA and cHRM values too, but doesn't set the
- * flags to write them, if it returns false there was a problem and an error
- * message has already been output (but the colorspace may still need to be
- * synced to record the invalid flag).
- */
-#endif /* sRGB */
-
#ifdef PNG_iCCP_SUPPORTED
-PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_const_charp name,
- png_uint_32 profile_length, png_const_bytep profile, int color_type),
- PNG_EMPTY);
- /* The 'name' is used for information only */
-
/* Routines for checking parts of an ICC profile. */
#ifdef PNG_READ_iCCP_SUPPORTED
PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_const_charp name,
- png_uint_32 profile_length), PNG_EMPTY);
+ png_const_charp name, png_uint_32 profile_length), PNG_EMPTY);
#endif /* READ_iCCP */
PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_const_charp name,
- png_uint_32 profile_length,
+ png_const_charp name, png_uint_32 profile_length,
png_const_bytep profile /* first 132 bytes only */, int color_type),
PNG_EMPTY);
PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr,
- png_colorspacerp colorspace, png_const_charp name,
- png_uint_32 profile_length,
+ png_const_charp name, png_uint_32 profile_length,
png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY);
-#ifdef PNG_sRGB_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_icc_set_sRGB,(
- png_const_structrp png_ptr, png_colorspacerp colorspace,
- png_const_bytep profile, uLong adler), PNG_EMPTY);
- /* 'adler' is the Adler32 checksum of the uncompressed profile data. It may
- * be zero to indicate that it is not available. It is used, if provided,
- * as a fast check on the profile when checking to see if it is sRGB.
- */
-#endif
#endif /* iCCP */
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-PNG_INTERNAL_FUNCTION(void,png_colorspace_set_rgb_coefficients,
- (png_structrp png_ptr), PNG_EMPTY);
- /* Set the rgb_to_gray coefficients from the colorspace Y values */
+PNG_INTERNAL_FUNCTION(void,png_set_rgb_coefficients, (png_structrp png_ptr),
+ PNG_EMPTY);
+ /* Set the rgb_to_gray coefficients from the cHRM Y values (if unset) */
#endif /* READ_RGB_TO_GRAY */
-#endif /* COLORSPACE */
/* Added at libpng version 1.4.0 */
PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr,
@@ -2032,8 +1959,10 @@
size_t size),PNG_EMPTY);
#endif /* pCAL || sCAL */
-#if defined(PNG_GAMMA_SUPPORTED) ||\
- defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
+#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
+ defined(PNG_COLORSPACE_SUPPORTED) ||\
+ defined(PNG_INCH_CONVERSIONS_SUPPORTED) ||\
+ defined(PNG_READ_pHYs_SUPPORTED)
/* Added at libpng version 1.5.0 */
/* This is a utility to provide a*times/div (rounded) and indicate
* if there is an overflow. The result is a boolean - false (0)
@@ -2042,16 +1971,7 @@
*/
PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a,
png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY);
-#endif
-#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
-/* Same deal, but issue a warning on overflow and return 0. */
-PNG_INTERNAL_FUNCTION(png_fixed_point,png_muldiv_warn,
- (png_const_structrp png_ptr, png_fixed_point a, png_int_32 multiplied_by,
- png_int_32 divided_by),PNG_EMPTY);
-#endif
-
-#ifdef PNG_GAMMA_SUPPORTED
/* Calculate a reciprocal - used for gamma values. This returns
* 0 if the argument is 0 in order to maintain an undefined value;
* there are no warnings.
@@ -2058,6 +1978,7 @@
*/
PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a),
PNG_EMPTY);
+#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
/* The same but gives a reciprocal of the product of two fixed point
@@ -2066,14 +1987,22 @@
*/
PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a,
png_fixed_point b),PNG_EMPTY);
-#endif
/* Return true if the gamma value is significantly different from 1.0 */
PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value),
PNG_EMPTY);
-#endif
-#ifdef PNG_READ_GAMMA_SUPPORTED
+/* PNGv3: 'resolve' the file gamma according to the new PNGv3 rules for colour
+ * space information.
+ *
+ * NOTE: this uses precisely those chunks that libpng supports. For example it
+ * doesn't use iCCP and it can only use cICP for known and manageable
+ * transforms. For this reason a gamma specified by png_set_gamma always takes
+ * precedence.
+ */
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_resolve_file_gamma,
+ (png_const_structrp png_ptr),PNG_EMPTY);
+
/* Internal fixed point gamma correction. These APIs are called as
* required to convert single values - they don't need to be fast,
* they are not used when processing image pixel values.
@@ -2091,8 +2020,24 @@
PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr,
int bit_depth),PNG_EMPTY);
+#endif /* READ_GAMMA */
+
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+/* Set the RGB coefficients if not already set by png_set_rgb_to_gray */
+PNG_INTERNAL_FUNCTION(void,png_set_rgb_coefficients,(png_structrp png_ptr),
+ PNG_EMPTY);
#endif
+#if defined(PNG_cHRM_SUPPORTED) || defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
+PNG_INTERNAL_FUNCTION(int,png_XYZ_from_xy,(png_XYZ *XYZ, const png_xy *xy),
+ PNG_EMPTY);
+#endif /* cHRM || READ_RGB_TO_GRAY */
+
+#ifdef PNG_COLORSPACE_SUPPORTED
+PNG_INTERNAL_FUNCTION(int,png_xy_from_XYZ,(png_xy *xy, const png_XYZ *XYZ),
+ PNG_EMPTY);
+#endif
+
/* SIMPLIFIED READ/WRITE SUPPORT */
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
@@ -2224,4 +2169,3 @@
#endif
#endif /* PNG_VERSION_INFO_ONLY */
-#endif /* PNGPRIV_H */
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngread.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngread.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngread.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -131,14 +131,11 @@
png_ptr->mode |= PNG_AFTER_IDAT;
}
- /* This should be a binary subdivision search or a hash for
- * matching the chunk name rather than a linear search.
- */
if (chunk_name == png_IHDR)
- png_handle_IHDR(png_ptr, info_ptr, length);
+ png_handle_chunk(png_ptr, info_ptr, length);
else if (chunk_name == png_IEND)
- png_handle_IEND(png_ptr, info_ptr, length);
+ png_handle_chunk(png_ptr, info_ptr, length);
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
@@ -155,8 +152,6 @@
}
}
#endif
- else if (chunk_name == png_PLTE)
- png_handle_PLTE(png_ptr, info_ptr, length);
else if (chunk_name == png_IDAT)
{
@@ -164,114 +159,8 @@
break;
}
-#ifdef PNG_READ_bKGD_SUPPORTED
- else if (chunk_name == png_bKGD)
- png_handle_bKGD(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_cHRM_SUPPORTED
- else if (chunk_name == png_cHRM)
- png_handle_cHRM(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_cICP_SUPPORTED
- else if (chunk_name == png_cICP)
- png_handle_cICP(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_cLLI_SUPPORTED
- else if (chunk_name == png_cLLI)
- png_handle_cLLI(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_eXIf_SUPPORTED
- else if (chunk_name == png_eXIf)
- png_handle_eXIf(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_gAMA_SUPPORTED
- else if (chunk_name == png_gAMA)
- png_handle_gAMA(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_hIST_SUPPORTED
- else if (chunk_name == png_hIST)
- png_handle_hIST(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_mDCV_SUPPORTED
- else if (chunk_name == png_mDCV)
- png_handle_mDCV(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_oFFs_SUPPORTED
- else if (chunk_name == png_oFFs)
- png_handle_oFFs(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_pCAL_SUPPORTED
- else if (chunk_name == png_pCAL)
- png_handle_pCAL(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sCAL_SUPPORTED
- else if (chunk_name == png_sCAL)
- png_handle_sCAL(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_pHYs_SUPPORTED
- else if (chunk_name == png_pHYs)
- png_handle_pHYs(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sBIT_SUPPORTED
- else if (chunk_name == png_sBIT)
- png_handle_sBIT(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sRGB_SUPPORTED
- else if (chunk_name == png_sRGB)
- png_handle_sRGB(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_iCCP_SUPPORTED
- else if (chunk_name == png_iCCP)
- png_handle_iCCP(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sPLT_SUPPORTED
- else if (chunk_name == png_sPLT)
- png_handle_sPLT(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_tEXt_SUPPORTED
- else if (chunk_name == png_tEXt)
- png_handle_tEXt(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_tIME_SUPPORTED
- else if (chunk_name == png_tIME)
- png_handle_tIME(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_tRNS_SUPPORTED
- else if (chunk_name == png_tRNS)
- png_handle_tRNS(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_zTXt_SUPPORTED
- else if (chunk_name == png_zTXt)
- png_handle_zTXt(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_iTXt_SUPPORTED
- else if (chunk_name == png_iTXt)
- png_handle_iTXt(png_ptr, info_ptr, length);
-#endif
-
else
- png_handle_unknown(png_ptr, info_ptr, length,
- PNG_HANDLE_CHUNK_AS_DEFAULT);
+ png_handle_chunk(png_ptr, info_ptr, length);
}
}
#endif /* SEQUENTIAL_READ */
@@ -816,10 +705,10 @@
png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
if (chunk_name == png_IEND)
- png_handle_IEND(png_ptr, info_ptr, length);
+ png_handle_chunk(png_ptr, info_ptr, length);
else if (chunk_name == png_IHDR)
- png_handle_IHDR(png_ptr, info_ptr, length);
+ png_handle_chunk(png_ptr, info_ptr, length);
else if (info_ptr == NULL)
png_crc_finish(png_ptr, length);
@@ -853,117 +742,9 @@
png_crc_finish(png_ptr, length);
}
- else if (chunk_name == png_PLTE)
- png_handle_PLTE(png_ptr, info_ptr, length);
-#ifdef PNG_READ_bKGD_SUPPORTED
- else if (chunk_name == png_bKGD)
- png_handle_bKGD(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_cHRM_SUPPORTED
- else if (chunk_name == png_cHRM)
- png_handle_cHRM(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_cICP_SUPPORTED
- else if (chunk_name == png_cICP)
- png_handle_cICP(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_cLLI_SUPPORTED
- else if (chunk_name == png_cLLI)
- png_handle_cLLI(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_eXIf_SUPPORTED
- else if (chunk_name == png_eXIf)
- png_handle_eXIf(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_gAMA_SUPPORTED
- else if (chunk_name == png_gAMA)
- png_handle_gAMA(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_hIST_SUPPORTED
- else if (chunk_name == png_hIST)
- png_handle_hIST(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_mDCV_SUPPORTED
- else if (chunk_name == png_mDCV)
- png_handle_mDCV(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_oFFs_SUPPORTED
- else if (chunk_name == png_oFFs)
- png_handle_oFFs(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_pCAL_SUPPORTED
- else if (chunk_name == png_pCAL)
- png_handle_pCAL(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sCAL_SUPPORTED
- else if (chunk_name == png_sCAL)
- png_handle_sCAL(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_pHYs_SUPPORTED
- else if (chunk_name == png_pHYs)
- png_handle_pHYs(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sBIT_SUPPORTED
- else if (chunk_name == png_sBIT)
- png_handle_sBIT(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sRGB_SUPPORTED
- else if (chunk_name == png_sRGB)
- png_handle_sRGB(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_iCCP_SUPPORTED
- else if (chunk_name == png_iCCP)
- png_handle_iCCP(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_sPLT_SUPPORTED
- else if (chunk_name == png_sPLT)
- png_handle_sPLT(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_tEXt_SUPPORTED
- else if (chunk_name == png_tEXt)
- png_handle_tEXt(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_tIME_SUPPORTED
- else if (chunk_name == png_tIME)
- png_handle_tIME(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_tRNS_SUPPORTED
- else if (chunk_name == png_tRNS)
- png_handle_tRNS(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_zTXt_SUPPORTED
- else if (chunk_name == png_zTXt)
- png_handle_zTXt(png_ptr, info_ptr, length);
-#endif
-
-#ifdef PNG_READ_iTXt_SUPPORTED
- else if (chunk_name == png_iTXt)
- png_handle_iTXt(png_ptr, info_ptr, length);
-#endif
-
else
- png_handle_unknown(png_ptr, info_ptr, length,
- PNG_HANDLE_CHUNK_AS_DEFAULT);
+ png_handle_chunk(png_ptr, info_ptr, length);
} while ((png_ptr->mode & PNG_HAVE_IEND) == 0);
}
#endif /* SEQUENTIAL_READ */
@@ -1414,6 +1195,31 @@
return format;
}
+static int
+chromaticities_match_sRGB(const png_xy *xy)
+{
+# define sRGB_TOLERANCE 1000
+ static const png_xy sRGB_xy = /* From ITU-R BT.709-3 */
+ {
+ /* color x y */
+ /* red */ 64000, 33000,
+ /* green */ 30000, 60000,
+ /* blue */ 15000, 6000,
+ /* white */ 31270, 32900
+ };
+
+ if (PNG_OUT_OF_RANGE(xy->whitex, sRGB_xy.whitex,sRGB_TOLERANCE) ||
+ PNG_OUT_OF_RANGE(xy->whitey, sRGB_xy.whitey,sRGB_TOLERANCE) ||
+ PNG_OUT_OF_RANGE(xy->redx, sRGB_xy.redx, sRGB_TOLERANCE) ||
+ PNG_OUT_OF_RANGE(xy->redy, sRGB_xy.redy, sRGB_TOLERANCE) ||
+ PNG_OUT_OF_RANGE(xy->greenx, sRGB_xy.greenx,sRGB_TOLERANCE) ||
+ PNG_OUT_OF_RANGE(xy->greeny, sRGB_xy.greeny,sRGB_TOLERANCE) ||
+ PNG_OUT_OF_RANGE(xy->bluex, sRGB_xy.bluex, sRGB_TOLERANCE) ||
+ PNG_OUT_OF_RANGE(xy->bluey, sRGB_xy.bluey, sRGB_TOLERANCE))
+ return 0;
+ return 1;
+}
+
/* Is the given gamma significantly different from sRGB? The test is the same
* one used in pngrtran.c when deciding whether to do gamma correction. The
* arithmetic optimizes the division by using the fact that the inverse of the
@@ -1422,16 +1228,11 @@
static int
png_gamma_not_sRGB(png_fixed_point g)
{
- if (g < PNG_FP_1)
- {
- /* An uninitialized gamma is assumed to be sRGB for the simplified API. */
- if (g == 0)
- return 0;
+ /* 1.6.47: use the same sanity checks as used in pngrtran.c */
+ if (g < PNG_LIB_GAMMA_MIN || g > PNG_LIB_GAMMA_MAX)
+ return 0; /* Includes the uninitialized value 0 */
- return png_gamma_significant((g * 11 + 2)/5 /* i.e. *2.2, rounded */);
- }
-
- return 1;
+ return png_gamma_significant((g * 11 + 2)/5 /* i.e. *2.2, rounded */);
}
/* Do the main body of a 'png_image_begin_read' function; read the PNG file
@@ -1439,6 +1240,33 @@
* unlike the init routine above.
*/
static int
+png_image_is_not_sRGB(png_const_structrp png_ptr)
+{
+ /* Does the colorspace **not** match sRGB? The flag is only set if the
+ * answer can be determined reliably.
+ *
+ * png_struct::chromaticities always exists since the simplified API
+ * requires rgb-to-gray. The mDCV, cICP and cHRM chunks may all set it to
+ * a non-sRGB value, so it needs to be checked but **only** if one of
+ * those chunks occured in the file.
+ */
+ /* Highest priority: check to be safe. */
+ if (png_has_chunk(png_ptr, cICP) || png_has_chunk(png_ptr, mDCV))
+ return !chromaticities_match_sRGB(&png_ptr->chromaticities);
+
+ /* If the image is marked as sRGB then it is... */
+ if (png_has_chunk(png_ptr, sRGB))
+ return 0;
+
+ /* Last stop: cHRM, must check: */
+ if (png_has_chunk(png_ptr, cHRM))
+ return !chromaticities_match_sRGB(&png_ptr->chromaticities);
+
+ /* Else default to sRGB */
+ return 0;
+}
+
+static int
png_image_read_header(png_voidp argument)
{
png_imagep image = png_voidcast(png_imagep, argument);
@@ -1459,17 +1287,13 @@
image->format = format;
-#ifdef PNG_COLORSPACE_SUPPORTED
- /* Does the colorspace match sRGB? If there is no color endpoint
- * (colorant) information assume yes, otherwise require the
- * 'ENDPOINTS_MATCHP_sRGB' colorspace flag to have been set. If the
- * colorspace has been determined to be invalid ignore it.
+ /* Greyscale images don't (typically) have colour space information and
+ * using it is pretty much impossible, so use sRGB for grayscale (it
+ * doesn't matter r==g==b so the transform is irrelevant.)
*/
- if ((format & PNG_FORMAT_FLAG_COLOR) != 0 && ((png_ptr->colorspace.flags
- & (PNG_COLORSPACE_HAVE_ENDPOINTS|PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB|
- PNG_COLORSPACE_INVALID)) == PNG_COLORSPACE_HAVE_ENDPOINTS))
+ if ((format & PNG_FORMAT_FLAG_COLOR) != 0 &&
+ png_image_is_not_sRGB(png_ptr))
image->flags |= PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB;
-#endif
}
/* We need the maximum number of entries regardless of the format the
@@ -1504,7 +1328,7 @@
#ifdef PNG_STDIO_SUPPORTED
int PNGAPI
-png_image_begin_read_from_stdio(png_imagep image, FILE* file)
+png_image_begin_read_from_stdio(png_imagep image, FILE *file)
{
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{
@@ -1657,21 +1481,18 @@
* potential vulnerability to security problems in the unused chunks.
*
* At present the iCCP chunk data isn't used, so iCCP chunk can be ignored
- * too. This allows the simplified API to be compiled without iCCP support,
- * however if the support is there the chunk is still checked to detect
- * errors (which are unfortunately quite common.)
+ * too. This allows the simplified API to be compiled without iCCP support.
*/
{
static const png_byte chunks_to_process[] = {
98, 75, 71, 68, '\0', /* bKGD */
99, 72, 82, 77, '\0', /* cHRM */
+ 99, 73, 67, 80, '\0', /* cICP */
103, 65, 77, 65, '\0', /* gAMA */
-# ifdef PNG_READ_iCCP_SUPPORTED
- 105, 67, 67, 80, '\0', /* iCCP */
-# endif
+ 109, 68, 67, 86, '\0', /* mDCV */
115, 66, 73, 84, '\0', /* sBIT */
115, 82, 71, 66, '\0', /* sRGB */
- };
+ };
/* Ignore unknown chunks and all other chunks except for the
* IHDR, PLTE, tRNS, IDAT, and IEND chunks.
@@ -1700,7 +1521,15 @@
static void
set_file_encoding(png_image_read_control *display)
{
- png_fixed_point g = display->image->opaque->png_ptr->colorspace.gamma;
+ png_structrp png_ptr = display->image->opaque->png_ptr;
+ png_fixed_point g = png_resolve_file_gamma(png_ptr);
+
+ /* PNGv3: the result may be 0 however the 'default_gamma' should have been
+ * set before this is called so zero is an error:
+ */
+ if (g == 0)
+ png_error(png_ptr, "internal: default gamma not set");
+
if (png_gamma_significant(g) != 0)
{
if (png_gamma_not_sRGB(g) != 0)
@@ -2188,25 +2017,19 @@
/* Default the input file gamma if required - this is necessary because
* libpng assumes that if no gamma information is present the data is in the
* output format, but the simplified API deduces the gamma from the input
- * format.
+ * format. The 'default' gamma value is also set by png_set_alpha_mode, but
+ * this is happening before any such call, so:
+ *
+ * TODO: should be an internal API and all this code should be copied into a
+ * single common gamma+colorspace file.
*/
- if ((png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_GAMMA) == 0)
- {
- /* Do this directly, not using the png_colorspace functions, to ensure
- * that it happens even if the colorspace is invalid (though probably if
- * it is the setting will be ignored) Note that the same thing can be
- * achieved at the application interface with png_set_gAMA.
- */
- if (png_ptr->bit_depth == 16 &&
- (image->flags & PNG_IMAGE_FLAG_16BIT_sRGB) == 0)
- png_ptr->colorspace.gamma = PNG_GAMMA_LINEAR;
+ if (png_ptr->bit_depth == 16 &&
+ (image->flags & PNG_IMAGE_FLAG_16BIT_sRGB) == 0)
+ png_ptr->default_gamma = PNG_GAMMA_LINEAR;
- else
- png_ptr->colorspace.gamma = PNG_GAMMA_sRGB_INVERSE;
+ else
+ png_ptr->default_gamma = PNG_GAMMA_sRGB_INVERSE;
- png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
- }
-
/* Decide what to do based on the PNG color type of the input data. The
* utility function png_create_colormap_entry deals with most aspects of the
* output transformations; this code works out how to produce bytes of
@@ -2583,6 +2406,8 @@
else
{
+ const png_fixed_point gamma = png_resolve_file_gamma(png_ptr);
+
/* Either the input or the output has no alpha channel, so there
* will be no non-opaque pixels in the color-map; it will just be
* grayscale.
@@ -2597,10 +2422,13 @@
* this case and doing it in the palette; this will result in
* duplicate palette entries, but that's better than the
* alternative of double gamma correction.
+ *
+ * NOTE: PNGv3: check the resolved result of all the potentially
+ * different colour space chunks.
*/
if ((png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
png_ptr->num_trans > 0) &&
- png_gamma_not_sRGB(png_ptr->colorspace.gamma) != 0)
+ png_gamma_not_sRGB(gamma) != 0)
{
cmap_entries = (unsigned int)make_gray_file_colormap(display);
data_encoding = P_FILE;
@@ -2632,8 +2460,8 @@
if (output_encoding == P_sRGB)
gray = png_sRGB_table[gray]; /* now P_LINEAR */
- gray = PNG_DIV257(png_gamma_16bit_correct(gray,
- png_ptr->colorspace.gamma)); /* now P_FILE */
+ gray = PNG_DIV257(png_gamma_16bit_correct(gray, gamma));
+ /* now P_FILE */
/* And make sure the corresponding palette entry contains
* exactly the required sRGB value.
@@ -3764,6 +3592,12 @@
/* Set the gamma appropriately, linear for 16-bit input, sRGB otherwise.
*/
{
+ /* This is safe but should no longer be necessary as
+ * png_ptr->default_gamma should have been set after the
+ * info-before-IDAT was read in png_image_read_header.
+ *
+ * TODO: 1.8: remove this and see what happens.
+ */
png_fixed_point input_gamma_default;
if ((base_format & PNG_FORMAT_FLAG_LINEAR) != 0 &&
@@ -3819,8 +3653,9 @@
* yet; it's set below. png_struct::gamma, however, is set to the
* final value.
*/
- if (png_muldiv(>est, output_gamma, png_ptr->colorspace.gamma,
- PNG_FP_1) != 0 && png_gamma_significant(gtest) == 0)
+ if (png_muldiv(>est, output_gamma,
+ png_resolve_file_gamma(png_ptr), PNG_FP_1) != 0 &&
+ png_gamma_significant(gtest) == 0)
do_local_background = 0;
else if (mode == PNG_ALPHA_STANDARD)
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngrio.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngrio.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngrio.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngrio.c - functions for data input
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -56,7 +56,7 @@
/* fread() returns 0 on error, so it is OK to store this in a size_t
* instead of an int, which is what fread() actually returns.
*/
- check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
+ check = fread(data, 1, length, png_voidcast(FILE *, png_ptr->io_ptr));
if (check != length)
png_error(png_ptr, "Read Error");
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -218,9 +218,59 @@
#endif
#if defined(PNG_READ_ALPHA_MODE_SUPPORTED) || defined(PNG_READ_GAMMA_SUPPORTED)
+/* PNGv3 conformance: this private API exists to resolve the now mandatory error
+ * resolution when multiple conflicting sources of gamma or colour space
+ * information are available.
+ *
+ * Terminology (assuming power law, "gamma", encodings):
+ * "screen" gamma: a power law imposed by the output device when digital
+ * samples are converted to visible light output. The EOTF - volage to
+ * luminance on output.
+ *
+ * "file" gamma: a power law used to encode luminance levels from the input
+ * data (the scene or the mastering display system) into digital voltages.
+ * The OETF - luminance to voltage on input.
+ *
+ * gamma "correction": a power law matching the **inverse** of the overall
+ * transfer function from input luminance levels to output levels. The
+ * **inverse** of the OOTF; the correction "corrects" for the OOTF by aiming
+ * to make the overall OOTF (including the correction) linear.
+ *
+ * It is important to understand this terminology because the defined terms are
+ * scattered throughout the libpng code and it is very easy to end up with the
+ * inverse of the power law required.
+ *
+ * Variable and struct::member names:
+ * file_gamma OETF how the PNG data was encoded
+ *
+ * screen_gamma EOTF how the screen will decode digital levels
+ *
+ * -- not used -- OOTF the net effect OETF x EOTF
+ * gamma_correction the inverse of OOTF to make the result linear
+ *
+ * All versions of libpng require a call to "png_set_gamma" to establish the
+ * "screen" gamma, the power law representing the EOTF. png_set_gamma may also
+ * set or default the "file" gamma; the OETF. gamma_correction is calculated
+ * internally.
+ *
+ * The earliest libpng versions required file_gamma to be supplied to set_gamma.
+ * Later versions started allowing png_set_gamma and, later, png_set_alpha_mode,
+ * to cause defaulting from the file data.
+ *
+ * PNGv3 mandated a particular form for this defaulting, one that is compatible
+ * with what libpng did except that if libpng detected inconsistencies it marked
+ * all the chunks as "invalid". PNGv3 effectively invalidates this prior code.
+ *
+ * Behaviour implemented below:
+ * translate_gamma_flags(gamma, is_screen)
+ * The libpng-1.6 API for the gamma parameters to libpng APIs
+ * (png_set_gamma and png_set_alpha_mode at present). This allows the
+ * 'gamma' value to be passed as a png_fixed_point number or as one of a
+ * set of integral values for specific "well known" examples of transfer
+ * functions. This is compatible with PNGv3.
+ */
static png_fixed_point
-translate_gamma_flags(png_structrp png_ptr, png_fixed_point output_gamma,
- int is_screen)
+translate_gamma_flags(png_fixed_point output_gamma, int is_screen)
{
/* Check for flag values. The main reason for having the old Mac value as a
* flag is that it is pretty near impossible to work out what the correct
@@ -230,14 +280,6 @@
if (output_gamma == PNG_DEFAULT_sRGB ||
output_gamma == PNG_FP_1 / PNG_DEFAULT_sRGB)
{
- /* If there is no sRGB support this just sets the gamma to the standard
- * sRGB value. (This is a side effect of using this function!)
- */
-# ifdef PNG_READ_sRGB_SUPPORTED
- png_ptr->flags |= PNG_FLAG_ASSUME_sRGB;
-# else
- PNG_UNUSED(png_ptr)
-# endif
if (is_screen != 0)
output_gamma = PNG_GAMMA_sRGB;
else
@@ -279,6 +321,33 @@
return (png_fixed_point)output_gamma;
}
# endif
+
+static int
+unsupported_gamma(png_structrp png_ptr, png_fixed_point gamma, int warn)
+{
+ /* Validate a gamma value to ensure it is in a reasonable range. The value
+ * is expected to be 1 or greater, but this range test allows for some
+ * viewing correction values. The intent is to weed out the API users
+ * who might use the inverse of the gamma value accidentally!
+ *
+ * 1.6.47: apply the test in png_set_gamma as well but only warn and return
+ * false if it fires.
+ *
+ * TODO: 1.8: make this an app_error in png_set_gamma as well.
+ */
+ if (gamma < PNG_LIB_GAMMA_MIN || gamma > PNG_LIB_GAMMA_MAX)
+ {
+# define msg "gamma out of supported range"
+ if (warn)
+ png_app_warning(png_ptr, msg);
+ else
+ png_app_error(png_ptr, msg);
+ return 1;
+# undef msg
+ }
+
+ return 0;
+}
#endif /* READ_ALPHA_MODE || READ_GAMMA */
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
@@ -286,8 +355,8 @@
png_set_alpha_mode_fixed(png_structrp png_ptr, int mode,
png_fixed_point output_gamma)
{
+ png_fixed_point file_gamma;
int compose = 0;
- png_fixed_point file_gamma;
png_debug(1, "in png_set_alpha_mode_fixed");
@@ -294,23 +363,21 @@
if (png_rtran_ok(png_ptr, 0) == 0)
return;
- output_gamma = translate_gamma_flags(png_ptr, output_gamma, 1/*screen*/);
+ output_gamma = translate_gamma_flags(output_gamma, 1/*screen*/);
+ if (unsupported_gamma(png_ptr, output_gamma, 0/*error*/))
+ return;
- /* Validate the value to ensure it is in a reasonable range. The value
- * is expected to be 1 or greater, but this range test allows for some
- * viewing correction values. The intent is to weed out the API users
- * who might use the inverse of the gamma value accidentally!
- *
- * In libpng 1.6.0, we changed from 0.07..3 to 0.01..100, to accommodate
- * the optimal 16-bit gamma of 36 and its reciprocal.
- */
- if (output_gamma < 1000 || output_gamma > 10000000)
- png_error(png_ptr, "output gamma out of expected range");
-
/* The default file gamma is the inverse of the output gamma; the output
- * gamma may be changed below so get the file value first:
+ * gamma may be changed below so get the file value first. The default_gamma
+ * is set here and from the simplified API (which uses a different algorithm)
+ * so don't overwrite a set value:
*/
- file_gamma = png_reciprocal(output_gamma);
+ file_gamma = png_ptr->default_gamma;
+ if (file_gamma == 0)
+ {
+ file_gamma = png_reciprocal(output_gamma);
+ png_ptr->default_gamma = file_gamma;
+ }
/* There are really 8 possibilities here, composed of any combination
* of:
@@ -361,17 +428,7 @@
png_error(png_ptr, "invalid alpha mode");
}
- /* Only set the default gamma if the file gamma has not been set (this has
- * the side effect that the gamma in a second call to png_set_alpha_mode will
- * be ignored.)
- */
- if (png_ptr->colorspace.gamma == 0)
- {
- png_ptr->colorspace.gamma = file_gamma;
- png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
- }
-
- /* But always set the output gamma: */
+ /* Set the screen gamma values: */
png_ptr->screen_gamma = output_gamma;
/* Finally, if pre-multiplying, set the background fields to achieve the
@@ -381,7 +438,7 @@
{
/* And obtain alpha pre-multiplication by composing on black: */
memset(&png_ptr->background, 0, (sizeof png_ptr->background));
- png_ptr->background_gamma = png_ptr->colorspace.gamma; /* just in case */
+ png_ptr->background_gamma = file_gamma; /* just in case */
png_ptr->background_gamma_type = PNG_BACKGROUND_GAMMA_FILE;
png_ptr->transformations &= ~PNG_BACKGROUND_EXPAND;
@@ -819,8 +876,8 @@
return;
/* New in libpng-1.5.4 - reserve particular negative values as flags. */
- scrn_gamma = translate_gamma_flags(png_ptr, scrn_gamma, 1/*screen*/);
- file_gamma = translate_gamma_flags(png_ptr, file_gamma, 0/*file*/);
+ scrn_gamma = translate_gamma_flags(scrn_gamma, 1/*screen*/);
+ file_gamma = translate_gamma_flags(file_gamma, 0/*file*/);
/* Checking the gamma values for being >0 was added in 1.5.4 along with the
* premultiplied alpha support; this actually hides an undocumented feature
@@ -834,17 +891,19 @@
* libpng-1.6.0.
*/
if (file_gamma <= 0)
- png_error(png_ptr, "invalid file gamma in png_set_gamma");
-
+ png_app_error(png_ptr, "invalid file gamma in png_set_gamma");
if (scrn_gamma <= 0)
- png_error(png_ptr, "invalid screen gamma in png_set_gamma");
+ png_app_error(png_ptr, "invalid screen gamma in png_set_gamma");
- /* Set the gamma values unconditionally - this overrides the value in the PNG
- * file if a gAMA chunk was present. png_set_alpha_mode provides a
- * different, easier, way to default the file gamma.
+ if (unsupported_gamma(png_ptr, file_gamma, 1/*warn*/) ||
+ unsupported_gamma(png_ptr, scrn_gamma, 1/*warn*/))
+ return;
+
+ /* 1.6.47: png_struct::file_gamma and png_struct::screen_gamma are now only
+ * written by this API. This removes dependencies on the order of API calls
+ * and allows the complex gamma checks to be delayed until needed.
*/
- png_ptr->colorspace.gamma = file_gamma;
- png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
+ png_ptr->file_gamma = file_gamma;
png_ptr->screen_gamma = scrn_gamma;
}
@@ -1022,26 +1081,9 @@
png_ptr->rgb_to_gray_coefficients_set = 1;
}
- else
- {
- if (red >= 0 && green >= 0)
- png_app_warning(png_ptr,
- "ignoring out of range rgb_to_gray coefficients");
-
- /* Use the defaults, from the cHRM chunk if set, else the historical
- * values which are close to the sRGB/HDTV/ITU-Rec 709 values. See
- * png_do_rgb_to_gray for more discussion of the values. In this case
- * the coefficients are not marked as 'set' and are not overwritten if
- * something has already provided a default.
- */
- if (png_ptr->rgb_to_gray_red_coeff == 0 &&
- png_ptr->rgb_to_gray_green_coeff == 0)
- {
- png_ptr->rgb_to_gray_red_coeff = 6968;
- png_ptr->rgb_to_gray_green_coeff = 23434;
- /* png_ptr->rgb_to_gray_blue_coeff = 2366; */
- }
- }
+ else if (red >= 0 && green >= 0)
+ png_app_warning(png_ptr,
+ "ignoring out of range rgb_to_gray coefficients");
}
}
@@ -1282,6 +1324,80 @@
#endif /* READ_EXPAND && READ_BACKGROUND */
}
+#ifdef PNG_READ_GAMMA_SUPPORTED
+png_fixed_point /* PRIVATE */
+png_resolve_file_gamma(png_const_structrp png_ptr)
+{
+ png_fixed_point file_gamma;
+
+ /* The file gamma is determined by these precedence rules, in this order
+ * (i.e. use the first value found):
+ *
+ * png_set_gamma; png_struct::file_gammma if not zero, then:
+ * png_struct::chunk_gamma if not 0 (determined the PNGv3 rules), then:
+ * png_set_gamma; 1/png_struct::screen_gamma if not zero
+ *
+ * 0 (i.e. do no gamma handling)
+ */
+ file_gamma = png_ptr->file_gamma;
+ if (file_gamma != 0)
+ return file_gamma;
+
+ file_gamma = png_ptr->chunk_gamma;
+ if (file_gamma != 0)
+ return file_gamma;
+
+ file_gamma = png_ptr->default_gamma;
+ if (file_gamma != 0)
+ return file_gamma;
+
+ /* If png_reciprocal oveflows it returns 0 which indicates to the caller that
+ * there is no usable file gamma. (The checks added to png_set_gamma and
+ * png_set_alpha_mode should prevent a screen_gamma which would overflow.)
+ */
+ if (png_ptr->screen_gamma != 0)
+ file_gamma = png_reciprocal(png_ptr->screen_gamma);
+
+ return file_gamma;
+}
+
+static int
+png_init_gamma_values(png_structrp png_ptr)
+{
+ /* The following temporary indicates if overall gamma correction is
+ * required.
+ */
+ int gamma_correction = 0;
+ png_fixed_point file_gamma, screen_gamma;
+
+ /* Resolve the file_gamma. See above: if png_ptr::screen_gamma is set
+ * file_gamma will always be set here:
+ */
+ file_gamma = png_resolve_file_gamma(png_ptr);
+ screen_gamma = png_ptr->screen_gamma;
+
+ if (file_gamma > 0) /* file has been set */
+ {
+ if (screen_gamma > 0) /* screen set too */
+ gamma_correction = png_gamma_threshold(file_gamma, screen_gamma);
+
+ else
+ /* Assume the output matches the input; a long time default behavior
+ * of libpng, although the standard has nothing to say about this.
+ */
+ screen_gamma = png_reciprocal(file_gamma);
+ }
+
+ else /* both unset, prevent corrections: */
+ file_gamma = screen_gamma = PNG_FP_1;
+
+ png_ptr->file_gamma = file_gamma;
+ png_ptr->screen_gamma = screen_gamma;
+ return gamma_correction;
+
+}
+#endif /* READ_GAMMA */
+
void /* PRIVATE */
png_init_read_transformations(png_structrp png_ptr)
{
@@ -1301,59 +1417,22 @@
* the test needs to be performed later - here. In addition prior to 1.5.4
* the tests were repeated for the PALETTE color type here - this is no
* longer necessary (and doesn't seem to have been necessary before.)
+ *
+ * PNGv3: the new mandatory precedence/priority rules for colour space chunks
+ * are handled here (by calling the above function).
+ *
+ * Turn the gamma transformation on or off as appropriate. Notice that
+ * PNG_GAMMA just refers to the file->screen correction. Alpha composition
+ * may independently cause gamma correction because it needs linear data
+ * (e.g. if the file has a gAMA chunk but the screen gamma hasn't been
+ * specified.) In any case this flag may get turned off in the code
+ * immediately below if the transform can be handled outside the row loop.
*/
- {
- /* The following temporary indicates if overall gamma correction is
- * required.
- */
- int gamma_correction = 0;
+ if (png_init_gamma_values(png_ptr) != 0)
+ png_ptr->transformations |= PNG_GAMMA;
- if (png_ptr->colorspace.gamma != 0) /* has been set */
- {
- if (png_ptr->screen_gamma != 0) /* screen set too */
- gamma_correction = png_gamma_threshold(png_ptr->colorspace.gamma,
- png_ptr->screen_gamma);
-
- else
- /* Assume the output matches the input; a long time default behavior
- * of libpng, although the standard has nothing to say about this.
- */
- png_ptr->screen_gamma = png_reciprocal(png_ptr->colorspace.gamma);
- }
-
- else if (png_ptr->screen_gamma != 0)
- /* The converse - assume the file matches the screen, note that this
- * perhaps undesirable default can (from 1.5.4) be changed by calling
- * png_set_alpha_mode (even if the alpha handling mode isn't required
- * or isn't changed from the default.)
- */
- png_ptr->colorspace.gamma = png_reciprocal(png_ptr->screen_gamma);
-
- else /* neither are set */
- /* Just in case the following prevents any processing - file and screen
- * are both assumed to be linear and there is no way to introduce a
- * third gamma value other than png_set_background with 'UNIQUE', and,
- * prior to 1.5.4
- */
- png_ptr->screen_gamma = png_ptr->colorspace.gamma = PNG_FP_1;
-
- /* We have a gamma value now. */
- png_ptr->colorspace.flags |= PNG_COLORSPACE_HAVE_GAMMA;
-
- /* Now turn the gamma transformation on or off as appropriate. Notice
- * that PNG_GAMMA just refers to the file->screen correction. Alpha
- * composition may independently cause gamma correction because it needs
- * linear data (e.g. if the file has a gAMA chunk but the screen gamma
- * hasn't been specified.) In any case this flag may get turned off in
- * the code immediately below if the transform can be handled outside the
- * row loop.
- */
- if (gamma_correction != 0)
- png_ptr->transformations |= PNG_GAMMA;
-
- else
- png_ptr->transformations &= ~PNG_GAMMA;
- }
+ else
+ png_ptr->transformations &= ~PNG_GAMMA;
#endif
/* Certain transformations have the effect of preventing other
@@ -1425,7 +1504,7 @@
* appropriately.
*/
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0)
- png_colorspace_set_rgb_coefficients(png_ptr);
+ png_set_rgb_coefficients(png_ptr);
#endif
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
@@ -1568,10 +1647,10 @@
*/
if ((png_ptr->transformations & PNG_GAMMA) != 0 ||
((png_ptr->transformations & PNG_RGB_TO_GRAY) != 0 &&
- (png_gamma_significant(png_ptr->colorspace.gamma) != 0 ||
+ (png_gamma_significant(png_ptr->file_gamma) != 0 ||
png_gamma_significant(png_ptr->screen_gamma) != 0)) ||
((png_ptr->transformations & PNG_COMPOSE) != 0 &&
- (png_gamma_significant(png_ptr->colorspace.gamma) != 0 ||
+ (png_gamma_significant(png_ptr->file_gamma) != 0 ||
png_gamma_significant(png_ptr->screen_gamma) != 0
# ifdef PNG_READ_BACKGROUND_SUPPORTED
|| (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_UNIQUE &&
@@ -1627,8 +1706,8 @@
break;
case PNG_BACKGROUND_GAMMA_FILE:
- g = png_reciprocal(png_ptr->colorspace.gamma);
- gs = png_reciprocal2(png_ptr->colorspace.gamma,
+ g = png_reciprocal(png_ptr->file_gamma);
+ gs = png_reciprocal2(png_ptr->file_gamma,
png_ptr->screen_gamma);
break;
@@ -1736,8 +1815,8 @@
break;
case PNG_BACKGROUND_GAMMA_FILE:
- g = png_reciprocal(png_ptr->colorspace.gamma);
- gs = png_reciprocal2(png_ptr->colorspace.gamma,
+ g = png_reciprocal(png_ptr->file_gamma);
+ gs = png_reciprocal2(png_ptr->file_gamma,
png_ptr->screen_gamma);
break;
@@ -1987,11 +2066,11 @@
* been called before this from png_read_update_info->png_read_start_row
* sometimes does the gamma transform and cancels the flag.
*
- * TODO: this looks wrong; the info_ptr should end up with a gamma equal to
- * the screen_gamma value. The following probably results in weirdness if
- * the info_ptr is used by the app after the rows have been read.
+ * TODO: this is confusing. It only changes the result of png_get_gAMA and,
+ * yes, it does return the value that the transformed data effectively has
+ * but does any app really understand this?
*/
- info_ptr->colorspace.gamma = png_ptr->colorspace.gamma;
+ info_ptr->gamma = png_ptr->file_gamma;
#endif
if (info_ptr->bit_depth == 16)
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -17,6 +17,11 @@
#ifdef PNG_READ_SUPPORTED
+/* The minimum 'zlib' stream is assumed to be just the 2 byte header, 5 bytes
+ * minimum 'deflate' stream, and the 4 byte checksum.
+ */
+#define LZ77Min (2U+5U+4U)
+
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Arrays to facilitate interlacing - use pass (0 - 6) as index. */
@@ -43,30 +48,6 @@
return uval;
}
-#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_READ_cHRM_SUPPORTED)
-/* The following is a variation on the above for use with the fixed
- * point values used for gAMA and cHRM. Instead of png_error it
- * issues a warning and returns (-1) - an invalid value because both
- * gAMA and cHRM use *unsigned* integers for fixed point values.
- */
-#define PNG_FIXED_ERROR (-1)
-
-static png_fixed_point /* PRIVATE */
-png_get_fixed_point(png_structrp png_ptr, png_const_bytep buf)
-{
- png_uint_32 uval = png_get_uint_32(buf);
-
- if (uval <= PNG_UINT_31_MAX)
- return (png_fixed_point)uval; /* known to be in range */
-
- /* The caller can turn off the warning by passing NULL. */
- if (png_ptr != NULL)
- png_warning(png_ptr, "PNG fixed point integer out of range");
-
- return PNG_FIXED_ERROR;
-}
-#endif
-
#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
/* NOTE: the read macros will obscure these definitions, so that if
* PNG_USE_READ_MACROS is set the library will not use them internally,
@@ -163,6 +144,38 @@
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
}
+/* This function is called to verify that a chunk name is valid.
+ * Do this using the bit-whacking approach from contrib/tools/pngfix.c
+ *
+ * Copied from libpng 1.7.
+ */
+static int
+check_chunk_name(png_uint_32 name)
+{
+ png_uint_32 t;
+
+ /* Remove bit 5 from all but the reserved byte; this means
+ * every 8-bit unit must be in the range 65-90 to be valid.
+ * So bit 5 must be zero, bit 6 must be set and bit 7 zero.
+ */
+ name &= ~PNG_U32(32,32,0,32);
+ t = (name & ~0x1f1f1f1fU) ^ 0x40404040U;
+
+ /* Subtract 65 for each 8-bit quantity, this must not
+ * overflow and each byte must then be in the range 0-25.
+ */
+ name -= PNG_U32(65,65,65,65);
+ t |= name;
+
+ /* Subtract 26, handling the overflow which should set the
+ * top three bits of each byte.
+ */
+ name -= PNG_U32(25,25,25,26);
+ t |= ~name;
+
+ return (t & 0xe0e0e0e0U) == 0U;
+}
+
/* Read the chunk header (length + type name).
* Put the type name into png_ptr->chunk_name, and return the length.
*/
@@ -170,34 +183,37 @@
png_read_chunk_header(png_structrp png_ptr)
{
png_byte buf[8];
- png_uint_32 length;
+ png_uint_32 chunk_name, length;
#ifdef PNG_IO_STATE_SUPPORTED
png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_HDR;
#endif
- /* Read the length and the chunk name.
- * This must be performed in a single I/O call.
+ /* Read the length and the chunk name. png_struct::chunk_name is immediately
+ * updated even if they are detectably wrong. This aids error message
+ * handling by allowing png_chunk_error to be used.
*/
png_read_data(png_ptr, buf, 8);
length = png_get_uint_31(png_ptr, buf);
+ png_ptr->chunk_name = chunk_name = PNG_CHUNK_FROM_STRING(buf+4);
- /* Put the chunk name into png_ptr->chunk_name. */
- png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(buf+4);
+ /* Reset the crc and run it over the chunk name. */
+ png_reset_crc(png_ptr);
+ png_calculate_crc(png_ptr, buf + 4, 4);
png_debug2(0, "Reading chunk typeid = 0x%lx, length = %lu",
(unsigned long)png_ptr->chunk_name, (unsigned long)length);
- /* Reset the crc and run it over the chunk name. */
- png_reset_crc(png_ptr);
- png_calculate_crc(png_ptr, buf + 4, 4);
+ /* Sanity check the length (first by <= 0x80) and the chunk name. An error
+ * here indicates a broken stream and libpng has no recovery from this.
+ */
+ if (buf[0] >= 0x80U)
+ png_chunk_error(png_ptr, "bad header (invalid length)");
/* Check to see if chunk name is valid. */
- png_check_chunk_name(png_ptr, png_ptr->chunk_name);
+ if (!check_chunk_name(chunk_name))
+ png_chunk_error(png_ptr, "bad header (invalid type)");
- /* Check for too-large chunk length */
- png_check_chunk_length(png_ptr, length);
-
#ifdef PNG_IO_STATE_SUPPORTED
png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA;
#endif
@@ -216,13 +232,85 @@
png_calculate_crc(png_ptr, buf, length);
}
+/* Compare the CRC stored in the PNG file with that calculated by libpng from
+ * the data it has read thus far.
+ */
+static int
+png_crc_error(png_structrp png_ptr, int handle_as_ancillary)
+{
+ png_byte crc_bytes[4];
+ png_uint_32 crc;
+ int need_crc = 1;
+
+ /* There are four flags two for ancillary and two for critical chunks. The
+ * default setting of these flags is all zero.
+ *
+ * PNG_FLAG_CRC_ANCILLARY_USE
+ * PNG_FLAG_CRC_ANCILLARY_NOWARN
+ * USE+NOWARN: no CRC calculation (implemented here), else;
+ * NOWARN: png_chunk_error on error (implemented in png_crc_finish)
+ * else: png_chunk_warning on error (implemented in png_crc_finish)
+ * This is the default.
+ *
+ * I.e. NOWARN without USE produces png_chunk_error. The default setting
+ * where neither are set does the same thing.
+ *
+ * PNG_FLAG_CRC_CRITICAL_USE
+ * PNG_FLAG_CRC_CRITICAL_IGNORE
+ * IGNORE: no CRC calculation (implemented here), else;
+ * USE: png_chunk_warning on error (implemented in png_crc_finish)
+ * else: png_chunk_error on error (implemented in png_crc_finish)
+ * This is the default.
+ *
+ * This arose because of original mis-implementation and has persisted for
+ * compatibility reasons.
+ *
+ * TODO: the flag names are internal so maybe this can be changed to
+ * something comprehensible.
+ */
+ if (handle_as_ancillary || PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0)
+ {
+ if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
+ (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
+ need_crc = 0;
+ }
+
+ else /* critical */
+ {
+ if ((png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) != 0)
+ need_crc = 0;
+ }
+
+#ifdef PNG_IO_STATE_SUPPORTED
+ png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_CRC;
+#endif
+
+ /* The chunk CRC must be serialized in a single I/O call. */
+ png_read_data(png_ptr, crc_bytes, 4);
+
+ if (need_crc != 0)
+ {
+ crc = png_get_uint_32(crc_bytes);
+ return crc != png_ptr->crc;
+ }
+
+ else
+ return 0;
+}
+
/* Optionally skip data and then check the CRC. Depending on whether we
* are reading an ancillary or critical chunk, and how the program has set
* things up, we may calculate the CRC on the data and print a message.
* Returns '1' if there was a CRC error, '0' otherwise.
+ *
+ * There is one public version which is used in most places and another which
+ * takes the value for the 'critical' flag to check. This allows PLTE and IEND
+ * handling code to ignore the CRC error and removes some confusing code
+ * duplication.
*/
-int /* PRIVATE */
-png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
+static int
+png_crc_finish_critical(png_structrp png_ptr, png_uint_32 skip,
+ int handle_as_ancillary)
{
/* The size of the local buffer for inflate is a good guess as to a
* reasonable size to use for buffering reads from the application.
@@ -240,14 +328,24 @@
png_crc_read(png_ptr, tmpbuf, len);
}
- if (png_crc_error(png_ptr) != 0)
+ /* If 'handle_as_ancillary' has been requested and this is a critical chunk
+ * but PNG_FLAG_CRC_CRITICAL_IGNORE was set then png_read_crc did not, in
+ * fact, calculate the CRC so the ANCILLARY settings should not be used
+ * instead.
+ */
+ if (handle_as_ancillary &&
+ (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) != 0)
+ handle_as_ancillary = 0;
+
+ /* TODO: this might be more comprehensible if png_crc_error was inlined here.
+ */
+ if (png_crc_error(png_ptr, handle_as_ancillary) != 0)
{
- if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0 ?
+ /* See above for the explanation of how the flags work. */
+ if (handle_as_ancillary || PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0 ?
(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) == 0 :
(png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE) != 0)
- {
png_chunk_warning(png_ptr, "CRC error");
- }
else
png_chunk_error(png_ptr, "CRC error");
@@ -258,61 +356,29 @@
return 0;
}
-/* Compare the CRC stored in the PNG file with that calculated by libpng from
- * the data it has read thus far.
- */
int /* PRIVATE */
-png_crc_error(png_structrp png_ptr)
+png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
{
- png_byte crc_bytes[4];
- png_uint_32 crc;
- int need_crc = 1;
-
- if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) != 0)
- {
- if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
- (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
- need_crc = 0;
- }
-
- else /* critical */
- {
- if ((png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) != 0)
- need_crc = 0;
- }
-
-#ifdef PNG_IO_STATE_SUPPORTED
- png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_CRC;
-#endif
-
- /* The chunk CRC must be serialized in a single I/O call. */
- png_read_data(png_ptr, crc_bytes, 4);
-
- if (need_crc != 0)
- {
- crc = png_get_uint_32(crc_bytes);
- return crc != png_ptr->crc;
- }
-
- else
- return 0;
+ return png_crc_finish_critical(png_ptr, skip, 0/*critical handling*/);
}
#if defined(PNG_READ_iCCP_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) ||\
defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_READ_sCAL_SUPPORTED) ||\
defined(PNG_READ_sPLT_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) ||\
- defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_SEQUENTIAL_READ_SUPPORTED)
+ defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_eXIf_SUPPORTED) ||\
+ defined(PNG_SEQUENTIAL_READ_SUPPORTED)
/* Manage the read buffer; this simply reallocates the buffer if it is not small
* enough (or if it is not allocated). The routine returns a pointer to the
* buffer; if an error occurs and 'warn' is set the routine returns NULL, else
- * it will call png_error (via png_malloc) on failure. (warn == 2 means
- * 'silent').
+ * it will call png_error on failure.
*/
static png_bytep
-png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn)
+png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size)
{
png_bytep buffer = png_ptr->read_buffer;
+ if (new_size > png_chunk_max(png_ptr)) return NULL;
+
if (buffer != NULL && new_size > png_ptr->read_buffer_size)
{
png_ptr->read_buffer = NULL;
@@ -327,24 +393,17 @@
if (buffer != NULL)
{
- memset(buffer, 0, new_size); /* just in case */
+# ifndef PNG_NO_MEMZERO /* for detecting UIM bugs **only** */
+ memset(buffer, 0, new_size); /* just in case */
+# endif
png_ptr->read_buffer = buffer;
png_ptr->read_buffer_size = new_size;
}
-
- else if (warn < 2) /* else silent */
- {
- if (warn != 0)
- png_chunk_warning(png_ptr, "insufficient memory to read chunk");
-
- else
- png_chunk_error(png_ptr, "insufficient memory to read chunk");
- }
}
return buffer;
}
-#endif /* READ_iCCP|iTXt|pCAL|sCAL|sPLT|tEXt|zTXt|SEQUENTIAL_READ */
+#endif /* READ_iCCP|iTXt|pCAL|sCAL|sPLT|tEXt|zTXt|eXIf|SEQUENTIAL_READ */
/* png_inflate_claim: claim the zstream for some nefarious purpose that involves
* decompression. Returns Z_OK on success, else a zlib error code. It checks
@@ -631,17 +690,8 @@
* maybe a '\0' terminator too. We have to assume that 'prefix_size' is
* limited only by the maximum chunk size.
*/
- png_alloc_size_t limit = PNG_SIZE_MAX;
+ png_alloc_size_t limit = png_chunk_max(png_ptr);
-# ifdef PNG_SET_USER_LIMITS_SUPPORTED
- if (png_ptr->user_chunk_malloc_max > 0 &&
- png_ptr->user_chunk_malloc_max < limit)
- limit = png_ptr->user_chunk_malloc_max;
-# elif PNG_USER_CHUNK_MALLOC_MAX > 0
- if (PNG_USER_CHUNK_MALLOC_MAX < limit)
- limit = PNG_USER_CHUNK_MALLOC_MAX;
-# endif
-
if (limit >= prefix_size + (terminate != 0))
{
int ret;
@@ -845,9 +895,9 @@
}
#endif /* READ_iCCP */
+/* CHUNK HANDLING */
/* Read and check the IDHR chunk */
-
-void /* PRIVATE */
+static png_handle_result_code
png_handle_IHDR(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte buf[13];
@@ -857,13 +907,8 @@
png_debug(1, "in png_handle_IHDR");
- if ((png_ptr->mode & PNG_HAVE_IHDR) != 0)
- png_chunk_error(png_ptr, "out of place");
+ /* Length and position are checked by the caller. */
- /* Check the length */
- if (length != 13)
- png_chunk_error(png_ptr, "invalid");
-
png_ptr->mode |= PNG_HAVE_IHDR;
png_crc_read(png_ptr, buf, 13);
@@ -916,257 +961,196 @@
png_debug1(3, "bit_depth = %d", png_ptr->bit_depth);
png_debug1(3, "channels = %d", png_ptr->channels);
png_debug1(3, "rowbytes = %lu", (unsigned long)png_ptr->rowbytes);
+
+ /* Rely on png_set_IHDR to completely validate the data and call png_error if
+ * it's wrong.
+ */
png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth,
color_type, interlace_type, compression_type, filter_type);
+
+ return handled_ok;
+ PNG_UNUSED(length)
}
/* Read and check the palette */
-void /* PRIVATE */
+/* TODO: there are several obvious errors in this code when handling
+ * out-of-place chunks and there is much over-complexity caused by trying to
+ * patch up the problems.
+ */
+static png_handle_result_code
png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
- png_color palette[PNG_MAX_PALETTE_LENGTH];
- int max_palette_length, num, i;
-#ifdef PNG_POINTER_INDEXING_SUPPORTED
- png_colorp pal_ptr;
-#endif
+ png_const_charp errmsg = NULL;
png_debug(1, "in png_handle_PLTE");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- /* Moved to before the 'after IDAT' check below because otherwise duplicate
- * PLTE chunks are potentially ignored (the spec says there shall not be more
- * than one PLTE, the error is not treated as benign, so this check trumps
- * the requirement that PLTE appears before IDAT.)
+ /* 1.6.47: consistency. This used to be especially treated as a critical
+ * error even in an image which is not colour mapped, there isn't a good
+ * justification for treating some errors here one way and others another so
+ * everything uses the same logic.
*/
- else if ((png_ptr->mode & PNG_HAVE_PLTE) != 0)
- png_chunk_error(png_ptr, "duplicate");
+ if ((png_ptr->mode & PNG_HAVE_PLTE) != 0)
+ errmsg = "duplicate";
else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
- {
- /* This is benign because the non-benign error happened before, when an
- * IDAT was encountered in a color-mapped image with no PLTE.
- */
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
+ errmsg = "out of place";
- png_ptr->mode |= PNG_HAVE_PLTE;
+ else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0)
+ errmsg = "ignored in grayscale PNG";
- if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) == 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "ignored in grayscale PNG");
- return;
- }
+ else if (length > 3*PNG_MAX_PALETTE_LENGTH || (length % 3) != 0)
+ errmsg = "invalid";
-#ifndef PNG_READ_OPT_PLTE_SUPPORTED
- if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
- {
- png_crc_finish(png_ptr, length);
- return;
- }
-#endif
+ /* This drops PLTE in favour of tRNS or bKGD because both of those chunks
+ * can have an effect on the rendering of the image whereas PLTE only matters
+ * in the case of an 8-bit display with a decoder which controls the palette.
+ *
+ * The alternative here is to ignore the error and store the palette anyway;
+ * destroying the tRNS will definately cause problems.
+ *
+ * NOTE: the case of PNG_COLOR_TYPE_PALETTE need not be considered because
+ * the png_handle_ routines for the three 'after PLTE' chunks tRNS, bKGD and
+ * hIST all check for a preceding PLTE in these cases.
+ */
+ else if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE &&
+ (png_has_chunk(png_ptr, tRNS) || png_has_chunk(png_ptr, bKGD)))
+ errmsg = "out of place";
- if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3)
+ else
{
- png_crc_finish(png_ptr, length);
+ /* If the palette has 256 or fewer entries but is too large for the bit
+ * depth we don't issue an error to preserve the behavior of previous
+ * libpng versions. We silently truncate the unused extra palette entries
+ * here.
+ */
+ const unsigned max_palette_length =
+ (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
+ 1U << png_ptr->bit_depth : PNG_MAX_PALETTE_LENGTH;
- if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
- png_chunk_benign_error(png_ptr, "invalid");
+ /* The cast is safe because 'length' is less than
+ * 3*PNG_MAX_PALETTE_LENGTH
+ */
+ const unsigned num = (length > 3U*max_palette_length) ?
+ max_palette_length : (unsigned)length / 3U;
- else
- png_chunk_error(png_ptr, "invalid");
+ unsigned i, j;
+ png_byte buf[3*PNG_MAX_PALETTE_LENGTH];
+ png_color palette[PNG_MAX_PALETTE_LENGTH];
- return;
- }
+ /* Read the chunk into the buffer then read to the end of the chunk. */
+ png_crc_read(png_ptr, buf, num*3U);
+ png_crc_finish_critical(png_ptr, length - 3U*num,
+ /* Handle as ancillary if PLTE is optional: */
+ png_ptr->color_type != PNG_COLOR_TYPE_PALETTE);
- /* The cast is safe because 'length' is less than 3*PNG_MAX_PALETTE_LENGTH */
- num = (int)length / 3;
+ for (i = 0U, j = 0U; i < num; i++)
+ {
+ palette[i].red = buf[j++];
+ palette[i].green = buf[j++];
+ palette[i].blue = buf[j++];
+ }
- /* If the palette has 256 or fewer entries but is too large for the bit
- * depth, we don't issue an error, to preserve the behavior of previous
- * libpng versions. We silently truncate the unused extra palette entries
- * here.
- */
- if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
- max_palette_length = (1 << png_ptr->bit_depth);
- else
- max_palette_length = PNG_MAX_PALETTE_LENGTH;
+ /* A valid PLTE chunk has been read */
+ png_ptr->mode |= PNG_HAVE_PLTE;
- if (num > max_palette_length)
- num = max_palette_length;
-
-#ifdef PNG_POINTER_INDEXING_SUPPORTED
- for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
- {
- png_byte buf[3];
-
- png_crc_read(png_ptr, buf, 3);
- pal_ptr->red = buf[0];
- pal_ptr->green = buf[1];
- pal_ptr->blue = buf[2];
+ /* TODO: png_set_PLTE has the side effect of setting png_ptr->palette to
+ * its own copy of the palette. This has the side effect that when
+ * png_start_row is called (this happens after any call to
+ * png_read_update_info) the info_ptr palette gets changed. This is
+ * extremely unexpected and confusing.
+ *
+ * REVIEW: there have been consistent bugs in the past about gamma and
+ * similar transforms to colour mapped images being useless because the
+ * modified palette cannot be accessed because of the above.
+ *
+ * CONSIDER: Fix this by not sharing the palette in this way. But does
+ * this completely fix the problem?
+ */
+ png_set_PLTE(png_ptr, info_ptr, palette, num);
+ return handled_ok;
}
-#else
- for (i = 0; i < num; i++)
- {
- png_byte buf[3];
- png_crc_read(png_ptr, buf, 3);
- /* Don't depend upon png_color being any order */
- palette[i].red = buf[0];
- palette[i].green = buf[1];
- palette[i].blue = buf[2];
- }
-#endif
-
- /* If we actually need the PLTE chunk (ie for a paletted image), we do
- * whatever the normal CRC configuration tells us. However, if we
- * have an RGB image, the PLTE can be considered ancillary, so
- * we will act as though it is.
- */
-#ifndef PNG_READ_OPT_PLTE_SUPPORTED
+ /* Here on error: errmsg is non NULL. */
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
-#endif
{
- png_crc_finish(png_ptr, (png_uint_32) (length - (unsigned int)num * 3));
+ png_crc_finish(png_ptr, length);
+ png_chunk_error(png_ptr, errmsg);
}
-#ifndef PNG_READ_OPT_PLTE_SUPPORTED
- else if (png_crc_error(png_ptr) != 0) /* Only if we have a CRC error */
+ else /* not critical to this image */
{
- /* If we don't want to use the data from an ancillary chunk,
- * we have two options: an error abort, or a warning and we
- * ignore the data in this chunk (which should be OK, since
- * it's considered ancillary for a RGB or RGBA image).
- *
- * IMPLEMENTATION NOTE: this is only here because png_crc_finish uses the
- * chunk type to determine whether to check the ancillary or the critical
- * flags.
- */
- if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE) == 0)
- {
- if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) != 0)
- return;
-
- else
- png_chunk_error(png_ptr, "CRC error");
- }
-
- /* Otherwise, we (optionally) emit a warning and use the chunk. */
- else if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) == 0)
- png_chunk_warning(png_ptr, "CRC error");
+ png_crc_finish_critical(png_ptr, length, 1/*handle as ancillary*/);
+ png_chunk_benign_error(png_ptr, errmsg);
}
-#endif
- /* TODO: png_set_PLTE has the side effect of setting png_ptr->palette to its
- * own copy of the palette. This has the side effect that when png_start_row
- * is called (this happens after any call to png_read_update_info) the
- * info_ptr palette gets changed. This is extremely unexpected and
- * confusing.
- *
- * Fix this by not sharing the palette in this way.
+ /* Because PNG_UNUSED(errmsg) does not work if all the uses are compiled out
+ * (this does happen).
*/
- png_set_PLTE(png_ptr, info_ptr, palette, num);
+ return errmsg != NULL ? handled_error : handled_error;
+}
- /* The three chunks, bKGD, hIST and tRNS *must* appear after PLTE and before
- * IDAT. Prior to 1.6.0 this was not checked; instead the code merely
- * checked the apparent validity of a tRNS chunk inserted before PLTE on a
- * palette PNG. 1.6.0 attempts to rigorously follow the standard and
- * therefore does a benign error if the erroneous condition is detected *and*
- * cancels the tRNS if the benign error returns. The alternative is to
- * amend the standard since it would be rather hypocritical of the standards
- * maintainers to ignore it.
- */
-#ifdef PNG_READ_tRNS_SUPPORTED
- if (png_ptr->num_trans > 0 ||
- (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS) != 0))
- {
- /* Cancel this because otherwise it would be used if the transforms
- * require it. Don't cancel the 'valid' flag because this would prevent
- * detection of duplicate chunks.
- */
- png_ptr->num_trans = 0;
+/* On read the IDAT chunk is always handled specially, even if marked for
+ * unknown handling (this is allowed), so:
+ */
+#define png_handle_IDAT NULL
- if (info_ptr != NULL)
- info_ptr->num_trans = 0;
-
- png_chunk_benign_error(png_ptr, "tRNS must be after");
- }
-#endif
-
-#ifdef PNG_READ_hIST_SUPPORTED
- if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) != 0)
- png_chunk_benign_error(png_ptr, "hIST must be after");
-#endif
-
-#ifdef PNG_READ_bKGD_SUPPORTED
- if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) != 0)
- png_chunk_benign_error(png_ptr, "bKGD must be after");
-#endif
-}
-
-void /* PRIVATE */
+static png_handle_result_code
png_handle_IEND(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_debug(1, "in png_handle_IEND");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0 ||
- (png_ptr->mode & PNG_HAVE_IDAT) == 0)
- png_chunk_error(png_ptr, "out of place");
-
png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND);
- png_crc_finish(png_ptr, length);
-
if (length != 0)
png_chunk_benign_error(png_ptr, "invalid");
+ png_crc_finish_critical(png_ptr, length, 1/*handle as ancillary*/);
+
+ return handled_ok;
PNG_UNUSED(info_ptr)
}
#ifdef PNG_READ_gAMA_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code
png_handle_gAMA(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
- png_fixed_point igamma;
+ png_uint_32 ugamma;
png_byte buf[4];
png_debug(1, "in png_handle_gAMA");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
+ png_crc_read(png_ptr, buf, 4);
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
+ if (png_crc_finish(png_ptr, 0) != 0)
+ return handled_error;
- if (length != 4)
+ ugamma = png_get_uint_32(buf);
+
+ if (ugamma > PNG_UINT_31_MAX)
{
- png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
- png_crc_read(png_ptr, buf, 4);
+ png_set_gAMA_fixed(png_ptr, info_ptr, (png_fixed_point)/*SAFE*/ugamma);
- if (png_crc_finish(png_ptr, 0) != 0)
- return;
+#ifdef PNG_READ_GAMMA_SUPPORTED
+ /* PNGv3: chunk precedence for gamma is cICP, [iCCP], sRGB, gAMA. gAMA is
+ * at the end of the chain so simply check for an unset value.
+ */
+ if (png_ptr->chunk_gamma == 0)
+ png_ptr->chunk_gamma = (png_fixed_point)/*SAFE*/ugamma;
+#endif /*READ_GAMMA*/
- igamma = png_get_fixed_point(NULL, buf);
-
- png_colorspace_set_gamma(png_ptr, &png_ptr->colorspace, igamma);
- png_colorspace_sync(png_ptr, info_ptr);
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_gAMA NULL
#endif
#ifdef PNG_READ_sBIT_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_sBIT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
unsigned int truelen, i;
@@ -1175,23 +1159,6 @@
png_debug(1, "in png_handle_sBIT");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
{
truelen = 3;
@@ -1204,11 +1171,11 @@
sample_depth = png_ptr->bit_depth;
}
- if (length != truelen || length > 4)
+ if (length != truelen)
{
- png_chunk_benign_error(png_ptr, "invalid");
png_crc_finish(png_ptr, length);
- return;
+ png_chunk_benign_error(png_ptr, "bad length");
+ return handled_error;
}
buf[0] = buf[1] = buf[2] = buf[3] = sample_depth;
@@ -1215,7 +1182,7 @@
png_crc_read(png_ptr, buf, truelen);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
for (i=0; i<truelen; ++i)
{
@@ -1222,7 +1189,7 @@
if (buf[i] == 0 || buf[i] > sample_depth)
{
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
}
@@ -1234,7 +1201,7 @@
png_ptr->sig_bit.alpha = buf[3];
}
- else
+ else /* grayscale */
{
png_ptr->sig_bit.gray = buf[0];
png_ptr->sig_bit.red = buf[0];
@@ -1244,83 +1211,87 @@
}
png_set_sBIT(png_ptr, info_ptr, &(png_ptr->sig_bit));
+ return handled_ok;
}
+#else
+# define png_handle_sBIT NULL
#endif
#ifdef PNG_READ_cHRM_SUPPORTED
-void /* PRIVATE */
+static png_int_32
+png_get_int_32_checked(png_const_bytep buf, int *error)
+{
+ png_uint_32 uval = png_get_uint_32(buf);
+ if ((uval & 0x80000000) == 0) /* non-negative */
+ return (png_int_32)uval;
+
+ uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */
+ if ((uval & 0x80000000) == 0) /* no overflow */
+ return -(png_int_32)uval;
+
+ /* This version of png_get_int_32 has a way of returning the error to the
+ * caller, so:
+ */
+ *error = 1;
+ return 0; /* Safe */
+}
+
+static png_handle_result_code /* PRIVATE */
png_handle_cHRM(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
+ int error = 0;
+ png_xy xy;
png_byte buf[32];
- png_xy xy;
png_debug(1, "in png_handle_cHRM");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- if (length != 32)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
-
png_crc_read(png_ptr, buf, 32);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
- xy.whitex = png_get_fixed_point(NULL, buf);
- xy.whitey = png_get_fixed_point(NULL, buf + 4);
- xy.redx = png_get_fixed_point(NULL, buf + 8);
- xy.redy = png_get_fixed_point(NULL, buf + 12);
- xy.greenx = png_get_fixed_point(NULL, buf + 16);
- xy.greeny = png_get_fixed_point(NULL, buf + 20);
- xy.bluex = png_get_fixed_point(NULL, buf + 24);
- xy.bluey = png_get_fixed_point(NULL, buf + 28);
+ xy.whitex = png_get_int_32_checked(buf + 0, &error);
+ xy.whitey = png_get_int_32_checked(buf + 4, &error);
+ xy.redx = png_get_int_32_checked(buf + 8, &error);
+ xy.redy = png_get_int_32_checked(buf + 12, &error);
+ xy.greenx = png_get_int_32_checked(buf + 16, &error);
+ xy.greeny = png_get_int_32_checked(buf + 20, &error);
+ xy.bluex = png_get_int_32_checked(buf + 24, &error);
+ xy.bluey = png_get_int_32_checked(buf + 28, &error);
- if (xy.whitex == PNG_FIXED_ERROR ||
- xy.whitey == PNG_FIXED_ERROR ||
- xy.redx == PNG_FIXED_ERROR ||
- xy.redy == PNG_FIXED_ERROR ||
- xy.greenx == PNG_FIXED_ERROR ||
- xy.greeny == PNG_FIXED_ERROR ||
- xy.bluex == PNG_FIXED_ERROR ||
- xy.bluey == PNG_FIXED_ERROR)
+ if (error)
{
- png_chunk_benign_error(png_ptr, "invalid values");
- return;
+ png_chunk_benign_error(png_ptr, "invalid");
+ return handled_error;
}
- /* If a colorspace error has already been output skip this chunk */
- if ((png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0)
- return;
+ /* png_set_cHRM may complain about some of the values but this doesn't matter
+ * because it was a cHRM and it did have vaguely (if, perhaps, ridiculous)
+ * values. Ridiculousity will be checked if the values are used later.
+ */
+ png_set_cHRM_fixed(png_ptr, info_ptr, xy.whitex, xy.whitey, xy.redx, xy.redy,
+ xy.greenx, xy.greeny, xy.bluex, xy.bluey);
- if ((png_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0)
- {
- png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
- png_colorspace_sync(png_ptr, info_ptr);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
+ /* We only use 'chromaticities' for RGB to gray */
+# ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+ /* There is no need to check sRGB here, cICP is NYI and iCCP is not
+ * supported so just check mDCV.
+ */
+ if (!png_has_chunk(png_ptr, mDCV))
+ {
+ png_ptr->chromaticities = xy;
+ }
+# endif /* READ_RGB_TO_GRAY */
- png_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
- (void)png_colorspace_set_chromaticities(png_ptr, &png_ptr->colorspace, &xy,
- 1/*prefer cHRM values*/);
- png_colorspace_sync(png_ptr, info_ptr);
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_cHRM NULL
#endif
#ifdef PNG_READ_sRGB_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_sRGB(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte intent;
@@ -1327,50 +1298,45 @@
png_debug(1, "in png_handle_sRGB");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
+ png_crc_read(png_ptr, &intent, 1);
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
+ if (png_crc_finish(png_ptr, 0) != 0)
+ return handled_error;
- if (length != 1)
+ /* This checks the range of the "rendering intent" because it is specified in
+ * the PNG spec itself; the "reserved" values will result in the chunk not
+ * being accepted, just as they do with the various "reserved" values in
+ * IHDR.
+ */
+ if (intent > 3/*PNGv3 spec*/)
{
- png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
- png_crc_read(png_ptr, &intent, 1);
+ png_set_sRGB(png_ptr, info_ptr, intent);
+ /* NOTE: png_struct::chromaticities is not set here because the RGB to gray
+ * coefficients are known without a need for the chromaticities.
+ */
- if (png_crc_finish(png_ptr, 0) != 0)
- return;
+#ifdef PNG_READ_GAMMA_SUPPORTED
+ /* PNGv3: chunk precedence for gamma is cICP, [iCCP], sRGB, gAMA. iCCP is
+ * not supported by libpng so the only requirement is to check for cICP
+ * setting the gamma (this is NYI, but this check is safe.)
+ */
+ if (!png_has_chunk(png_ptr, cICP) || png_ptr->chunk_gamma == 0)
+ png_ptr->chunk_gamma = PNG_GAMMA_sRGB_INVERSE;
+#endif /*READ_GAMMA*/
- /* If a colorspace error has already been output skip this chunk */
- if ((png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0)
- return;
-
- /* Only one sRGB or iCCP chunk is allowed, use the HAVE_INTENT flag to detect
- * this.
- */
- if ((png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT) != 0)
- {
- png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
- png_colorspace_sync(png_ptr, info_ptr);
- png_chunk_benign_error(png_ptr, "too many profiles");
- return;
- }
-
- (void)png_colorspace_set_sRGB(png_ptr, &png_ptr->colorspace, intent);
- png_colorspace_sync(png_ptr, info_ptr);
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_sRGB NULL
#endif /* READ_sRGB */
#ifdef PNG_READ_iCCP_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
/* Note: this does not properly handle profiles that are > 64K under DOS */
{
@@ -1379,45 +1345,11 @@
png_debug(1, "in png_handle_iCCP");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- /* Consistent with all the above colorspace handling an obviously *invalid*
- * chunk is just ignored, so does not invalidate the color space. An
- * alternative is to set the 'invalid' flags at the start of this routine
- * and only clear them in they were not set before and all the tests pass.
+ /* PNGv3: allow PNG files with both sRGB and iCCP because the PNG spec only
+ * ever said that there "should" be only one, not "shall" and the PNGv3
+ * colour chunk precedence rules give a handling for this case anyway.
*/
-
- /* The keyword must be at least one character and there is a
- * terminator (0) byte and the compression method byte, and the
- * 'zlib' datastream is at least 11 bytes.
- */
- if (length < 14)
{
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "too short");
- return;
- }
-
- /* If a colorspace error has already been output skip this chunk */
- if ((png_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) != 0)
- {
- png_crc_finish(png_ptr, length);
- return;
- }
-
- /* Only one sRGB or iCCP chunk is allowed, use the HAVE_INTENT flag to detect
- * this.
- */
- if ((png_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_INTENT) == 0)
- {
uInt read_length, keyword_length;
char keyword[81];
@@ -1426,19 +1358,16 @@
*/
read_length = 81; /* maximum */
if (read_length > length)
- read_length = (uInt)length;
+ read_length = (uInt)/*SAFE*/length;
png_crc_read(png_ptr, (png_bytep)keyword, read_length);
length -= read_length;
- /* The minimum 'zlib' stream is assumed to be just the 2 byte header,
- * 5 bytes minimum 'deflate' stream, and the 4 byte checksum.
- */
- if (length < 11)
+ if (length < LZ77Min)
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "too short");
- return;
+ return handled_error;
}
keyword_length = 0;
@@ -1475,15 +1404,14 @@
*/
png_uint_32 profile_length = png_get_uint_32(profile_header);
- if (png_icc_check_length(png_ptr, &png_ptr->colorspace,
- keyword, profile_length) != 0)
+ if (png_icc_check_length(png_ptr, keyword, profile_length) !=
+ 0)
{
/* The length is apparently ok, so we can check the 132
* byte header.
*/
- if (png_icc_check_header(png_ptr, &png_ptr->colorspace,
- keyword, profile_length, profile_header,
- png_ptr->color_type) != 0)
+ if (png_icc_check_header(png_ptr, keyword, profile_length,
+ profile_header, png_ptr->color_type) != 0)
{
/* Now read the tag table; a variable size buffer is
* needed at this point, allocate one for the whole
@@ -1493,7 +1421,7 @@
png_uint_32 tag_count =
png_get_uint_32(profile_header + 128);
png_bytep profile = png_read_buffer(png_ptr,
- profile_length, 2/*silent*/);
+ profile_length);
if (profile != NULL)
{
@@ -1512,8 +1440,7 @@
if (size == 0)
{
if (png_icc_check_tag_table(png_ptr,
- &png_ptr->colorspace, keyword, profile_length,
- profile) != 0)
+ keyword, profile_length, profile) != 0)
{
/* The profile has been validated for basic
* security issues, so read the whole thing in.
@@ -1545,13 +1472,6 @@
png_crc_finish(png_ptr, length);
finished = 1;
-# if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0
- /* Check for a match against sRGB */
- png_icc_set_sRGB(png_ptr,
- &png_ptr->colorspace, profile,
- png_ptr->zstream.adler);
-# endif
-
/* Steal the profile for info_ptr. */
if (info_ptr != NULL)
{
@@ -1574,11 +1494,7 @@
}
else
- {
- png_ptr->colorspace.flags |=
- PNG_COLORSPACE_INVALID;
errmsg = "out of memory";
- }
}
/* else the profile remains in the read
@@ -1586,13 +1502,10 @@
* chunks.
*/
- if (info_ptr != NULL)
- png_colorspace_sync(png_ptr, info_ptr);
-
if (errmsg == NULL)
{
png_ptr->zowner = 0;
- return;
+ return handled_ok;
}
}
if (errmsg == NULL)
@@ -1633,22 +1546,21 @@
errmsg = "bad keyword";
}
- else
- errmsg = "too many profiles";
-
/* Failure: the reason is in 'errmsg' */
if (finished == 0)
png_crc_finish(png_ptr, length);
- png_ptr->colorspace.flags |= PNG_COLORSPACE_INVALID;
- png_colorspace_sync(png_ptr, info_ptr);
if (errmsg != NULL) /* else already output */
png_chunk_benign_error(png_ptr, errmsg);
+
+ return handled_error;
}
+#else
+# define png_handle_iCCP NULL
#endif /* READ_iCCP */
#ifdef PNG_READ_sPLT_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
/* Note: this does not properly handle chunks that are > 64K under DOS */
{
@@ -1669,7 +1581,7 @@
if (png_ptr->user_chunk_cache_max == 1)
{
png_crc_finish(png_ptr, length);
- return;
+ return handled_error;
}
if (--png_ptr->user_chunk_cache_max == 1)
@@ -1676,36 +1588,17 @@
{
png_warning(png_ptr, "No space in chunk cache for sPLT");
png_crc_finish(png_ptr, length);
- return;
+ return handled_error;
}
}
#endif
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
-#ifdef PNG_MAX_MALLOC_64K
- if (length > 65535U)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "too large to fit in memory");
- return;
- }
-#endif
-
- buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/);
+ buffer = png_read_buffer(png_ptr, length+1);
if (buffer == NULL)
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "out of memory");
- return;
+ return handled_error;
}
@@ -1716,7 +1609,7 @@
png_crc_read(png_ptr, buffer, length);
if (png_crc_finish(png_ptr, skip) != 0)
- return;
+ return handled_error;
buffer[length] = 0;
@@ -1729,7 +1622,7 @@
if (length < 2U || entry_start > buffer + (length - 2U))
{
png_warning(png_ptr, "malformed sPLT chunk");
- return;
+ return handled_error;
}
new_palette.depth = *entry_start++;
@@ -1743,7 +1636,7 @@
if ((data_length % (unsigned int)entry_size) != 0)
{
png_warning(png_ptr, "sPLT chunk has bad length");
- return;
+ return handled_error;
}
dl = (png_uint_32)(data_length / (unsigned int)entry_size);
@@ -1752,7 +1645,7 @@
if (dl > max_dl)
{
png_warning(png_ptr, "sPLT chunk too long");
- return;
+ return handled_error;
}
new_palette.nentries = (png_int_32)(data_length / (unsigned int)entry_size);
@@ -1763,10 +1656,9 @@
if (new_palette.entries == NULL)
{
png_warning(png_ptr, "sPLT chunk requires too much memory");
- return;
+ return handled_error;
}
-#ifdef PNG_POINTER_INDEXING_SUPPORTED
for (i = 0; i < new_palette.nentries; i++)
{
pp = new_palette.entries + i;
@@ -1789,32 +1681,7 @@
pp->frequency = png_get_uint_16(entry_start); entry_start += 2;
}
-#else
- pp = new_palette.entries;
- for (i = 0; i < new_palette.nentries; i++)
- {
-
- if (new_palette.depth == 8)
- {
- pp[i].red = *entry_start++;
- pp[i].green = *entry_start++;
- pp[i].blue = *entry_start++;
- pp[i].alpha = *entry_start++;
- }
-
- else
- {
- pp[i].red = png_get_uint_16(entry_start); entry_start += 2;
- pp[i].green = png_get_uint_16(entry_start); entry_start += 2;
- pp[i].blue = png_get_uint_16(entry_start); entry_start += 2;
- pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2;
- }
-
- pp[i].frequency = png_get_uint_16(entry_start); entry_start += 2;
- }
-#endif
-
/* Discard all chunk data except the name and stash that */
new_palette.name = (png_charp)buffer;
@@ -1821,11 +1688,14 @@
png_set_sPLT(png_ptr, info_ptr, &new_palette, 1);
png_free(png_ptr, new_palette.entries);
+ return handled_ok;
}
+#else
+# define png_handle_sPLT NULL
#endif /* READ_sPLT */
#ifdef PNG_READ_tRNS_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte readbuf[PNG_MAX_PALETTE_LENGTH];
@@ -1832,23 +1702,6 @@
png_debug(1, "in png_handle_tRNS");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY)
{
png_byte buf[2];
@@ -1857,7 +1710,7 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buf, 2);
@@ -1873,7 +1726,7 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buf, length);
@@ -1887,10 +1740,9 @@
{
if ((png_ptr->mode & PNG_HAVE_PLTE) == 0)
{
- /* TODO: is this actually an error in the ISO spec? */
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "out of place");
- return;
+ return handled_error;
}
if (length > (unsigned int) png_ptr->num_palette ||
@@ -1899,7 +1751,7 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, readbuf, length);
@@ -1910,13 +1762,13 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid with alpha channel");
- return;
+ return handled_error;
}
if (png_crc_finish(png_ptr, 0) != 0)
{
png_ptr->num_trans = 0;
- return;
+ return handled_error;
}
/* TODO: this is a horrible side effect in the palette case because the
@@ -1925,11 +1777,14 @@
*/
png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans,
&(png_ptr->trans_color));
+ return handled_ok;
}
+#else
+# define png_handle_tRNS NULL
#endif
#ifdef PNG_READ_bKGD_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
unsigned int truelen;
@@ -1938,28 +1793,18 @@
png_debug(1, "in png_handle_bKGD");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0 ||
- (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
- (png_ptr->mode & PNG_HAVE_PLTE) == 0))
+ if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
{
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
+ if ((png_ptr->mode & PNG_HAVE_PLTE) == 0)
+ {
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, "out of place");
+ return handled_error;
+ }
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
+ truelen = 1;
}
- if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
- truelen = 1;
-
else if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0)
truelen = 6;
@@ -1970,13 +1815,13 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buf, truelen);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
/* We convert the index value into RGB components so that we can allow
* arbitrary RGB values for background when we have transparency, and
@@ -1992,7 +1837,7 @@
if (buf[0] >= info_ptr->num_palette)
{
png_chunk_benign_error(png_ptr, "invalid index");
- return;
+ return handled_error;
}
background.red = (png_uint_16)png_ptr->palette[buf[0]].red;
@@ -2013,7 +1858,7 @@
if (buf[0] != 0 || buf[1] >= (unsigned int)(1 << png_ptr->bit_depth))
{
png_chunk_benign_error(png_ptr, "invalid gray level");
- return;
+ return handled_error;
}
}
@@ -2031,7 +1876,7 @@
if (buf[0] != 0 || buf[2] != 0 || buf[4] != 0)
{
png_chunk_benign_error(png_ptr, "invalid color");
- return;
+ return handled_error;
}
}
@@ -2043,11 +1888,14 @@
}
png_set_bKGD(png_ptr, info_ptr, &background);
+ return handled_ok;
}
+#else
+# define png_handle_bKGD NULL
#endif
#ifdef PNG_READ_cICP_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_cICP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte buf[4];
@@ -2054,41 +1902,39 @@
png_debug(1, "in png_handle_cICP");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
+ png_crc_read(png_ptr, buf, 4);
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
+ if (png_crc_finish(png_ptr, 0) != 0)
+ return handled_error;
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cICP) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
+ png_set_cICP(png_ptr, info_ptr, buf[0], buf[1], buf[2], buf[3]);
- else if (length != 4)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
+ /* We only use 'chromaticities' for RGB to gray */
+# ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+ if (!png_has_chunk(png_ptr, mDCV))
+ {
+ /* TODO: png_ptr->chromaticities = chromaticities; */
+ }
+# endif /* READ_RGB_TO_GRAY */
- png_crc_read(png_ptr, buf, 4);
+#ifdef PNG_READ_GAMMA_SUPPORTED
+ /* PNGv3: chunk precedence for gamma is cICP, [iCCP], sRGB, gAMA. cICP is
+ * at the head so simply set the gamma if it can be determined. If not
+ * chunk_gamma remains unchanged; sRGB and gAMA handling check it for
+ * being zero.
+ */
+ /* TODO: set png_struct::chunk_gamma when possible */
+#endif /*READ_GAMMA*/
- if (png_crc_finish(png_ptr, 0) != 0)
- return;
-
- png_set_cICP(png_ptr, info_ptr, buf[0], buf[1], buf[2], buf[3]);
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_cICP NULL
#endif
#ifdef PNG_READ_cLLI_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_cLLI(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte buf[8];
@@ -2095,77 +1941,34 @@
png_debug(1, "in png_handle_cLLI");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cLLI) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
- else if (length != 8)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
-
png_crc_read(png_ptr, buf, 8);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
/* The error checking happens here, this puts it in just one place: */
png_set_cLLI_fixed(png_ptr, info_ptr, png_get_uint_32(buf),
png_get_uint_32(buf+4));
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_cLLI NULL
#endif
#ifdef PNG_READ_mDCV_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_mDCV(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
+ png_xy chromaticities;
png_byte buf[24];
png_debug(1, "in png_handle_mDCV");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_mDCV) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
- else if (length != 24)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
-
png_crc_read(png_ptr, buf, 24);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
/* The error checking happens here, this puts it in just one place. The
* odd /50000 scaling factor makes it more difficult but the (x.y) values are
@@ -2178,86 +1981,81 @@
* stored in four bytes. This is very, very confusing. These APIs remove
* the confusion by copying the existing, well established, API.
*/
+ chromaticities.redx = png_get_uint_16(buf+ 0U) << 1; /* red x */
+ chromaticities.redy = png_get_uint_16(buf+ 2U) << 1; /* red y */
+ chromaticities.greenx = png_get_uint_16(buf+ 4U) << 1; /* green x */
+ chromaticities.greeny = png_get_uint_16(buf+ 6U) << 1; /* green y */
+ chromaticities.bluex = png_get_uint_16(buf+ 8U) << 1; /* blue x */
+ chromaticities.bluey = png_get_uint_16(buf+10U) << 1; /* blue y */
+ chromaticities.whitex = png_get_uint_16(buf+12U) << 1; /* white x */
+ chromaticities.whitey = png_get_uint_16(buf+14U) << 1; /* white y */
+
png_set_mDCV_fixed(png_ptr, info_ptr,
- png_get_uint_16(buf+12U) << 1U, /* white x */
- png_get_uint_16(buf+14U) << 1U, /* white y */
- png_get_uint_16(buf+ 0U) << 1U, /* red x */
- png_get_uint_16(buf+ 2U) << 1U, /* red y */
- png_get_uint_16(buf+ 4U) << 1U, /* green x */
- png_get_uint_16(buf+ 6U) << 1U, /* green y */
- png_get_uint_16(buf+ 8U) << 1U, /* blue x */
- png_get_uint_16(buf+10U) << 1U, /* blue y */
+ chromaticities.whitex, chromaticities.whitey,
+ chromaticities.redx, chromaticities.redy,
+ chromaticities.greenx, chromaticities.greeny,
+ chromaticities.bluex, chromaticities.bluey,
png_get_uint_32(buf+16U), /* peak luminance */
png_get_uint_32(buf+20U));/* minimum perceivable luminance */
+
+ /* We only use 'chromaticities' for RGB to gray */
+# ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+ png_ptr->chromaticities = chromaticities;
+# endif /* READ_RGB_TO_GRAY */
+
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_mDCV NULL
#endif
#ifdef PNG_READ_eXIf_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
- unsigned int i;
+ png_bytep buffer = NULL;
png_debug(1, "in png_handle_eXIf");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
+ buffer = png_read_buffer(png_ptr, length);
- if (length < 2)
+ if (buffer == NULL)
{
png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "too short");
- return;
+ png_chunk_benign_error(png_ptr, "out of memory");
+ return handled_error;
}
- else if (info_ptr == NULL || (info_ptr->valid & PNG_INFO_eXIf) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
+ png_crc_read(png_ptr, buffer, length);
- info_ptr->free_me |= PNG_FREE_EXIF;
+ if (png_crc_finish(png_ptr, 0) != 0)
+ return handled_error;
- info_ptr->eXIf_buf = png_voidcast(png_bytep,
- png_malloc_warn(png_ptr, length));
-
- if (info_ptr->eXIf_buf == NULL)
+ /* PNGv3: the code used to check the byte order mark at the start for MM or
+ * II, however PNGv3 states that the the first 4 bytes should be checked.
+ * The caller ensures that there are four bytes available.
+ */
{
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of memory");
- return;
- }
+ png_uint_32 header = png_get_uint_32(buffer);
- for (i = 0; i < length; i++)
- {
- png_byte buf[1];
- png_crc_read(png_ptr, buf, 1);
- info_ptr->eXIf_buf[i] = buf[0];
- if (i == 1)
+ /* These numbers are copied from the PNGv3 spec: */
+ if (header != 0x49492A00 && header != 0x4D4D002A)
{
- if ((buf[0] != 'M' && buf[0] != 'I') ||
- (info_ptr->eXIf_buf[0] != buf[0]))
- {
- png_crc_finish(png_ptr, length - 2);
- png_chunk_benign_error(png_ptr, "incorrect byte-order specifier");
- png_free(png_ptr, info_ptr->eXIf_buf);
- info_ptr->eXIf_buf = NULL;
- return;
- }
+ png_chunk_benign_error(png_ptr, "invalid");
+ return handled_error;
}
}
- if (png_crc_finish(png_ptr, 0) == 0)
- png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
-
- png_free(png_ptr, info_ptr->eXIf_buf);
- info_ptr->eXIf_buf = NULL;
+ png_set_eXIf_1(png_ptr, info_ptr, length, buffer);
+ return handled_ok;
}
+#else
+# define png_handle_eXIf NULL
#endif
#ifdef PNG_READ_hIST_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
unsigned int num, i;
@@ -2265,26 +2063,14 @@
png_debug(1, "in png_handle_hIST");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
+ /* This cast is safe because the chunk definition limits the length to a
+ * maximum of 1024 bytes.
+ *
+ * TODO: maybe use png_uint_32 anyway, not unsigned int, to reduce the
+ * casts.
+ */
+ num = (unsigned int)length / 2 ;
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0 ||
- (png_ptr->mode & PNG_HAVE_PLTE) == 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
- num = length / 2 ;
-
if (length != num * 2 ||
num != (unsigned int)png_ptr->num_palette ||
num > (unsigned int)PNG_MAX_PALETTE_LENGTH)
@@ -2291,7 +2077,7 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
for (i = 0; i < num; i++)
@@ -2303,14 +2089,17 @@
}
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
png_set_hIST(png_ptr, info_ptr, readbuf);
+ return handled_ok;
}
+#else
+# define png_handle_hIST NULL
#endif
#ifdef PNG_READ_pHYs_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_pHYs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte buf[9];
@@ -2319,44 +2108,24 @@
png_debug(1, "in png_handle_pHYs");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
- if (length != 9)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
-
png_crc_read(png_ptr, buf, 9);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
res_x = png_get_uint_32(buf);
res_y = png_get_uint_32(buf + 4);
unit_type = buf[8];
png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type);
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_pHYs NULL
#endif
#ifdef PNG_READ_oFFs_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_oFFs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte buf[9];
@@ -2365,45 +2134,25 @@
png_debug(1, "in png_handle_oFFs");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
- if (length != 9)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
-
png_crc_read(png_ptr, buf, 9);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
offset_x = png_get_int_32(buf);
offset_y = png_get_int_32(buf + 4);
unit_type = buf[8];
png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type);
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_oFFs NULL
#endif
#ifdef PNG_READ_pCAL_SUPPORTED
/* Read the pCAL chunk (described in the PNG Extensions document) */
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_int_32 X0, X1;
@@ -2413,40 +2162,22 @@
int i;
png_debug(1, "in png_handle_pCAL");
-
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
png_debug1(2, "Allocating and reading pCAL chunk data (%u bytes)",
length + 1);
- buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/);
+ buffer = png_read_buffer(png_ptr, length+1);
if (buffer == NULL)
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "out of memory");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buffer, length);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
buffer[length] = 0; /* Null terminate the last string */
@@ -2462,7 +2193,7 @@
if (endptr - buf <= 12)
{
png_chunk_benign_error(png_ptr, "invalid");
- return;
+ return handled_error;
}
png_debug(3, "Reading pCAL X0, X1, type, nparams, and units");
@@ -2482,7 +2213,7 @@
(type == PNG_EQUATION_HYPERBOLIC && nparams != 4))
{
png_chunk_benign_error(png_ptr, "invalid parameter count");
- return;
+ return handled_error;
}
else if (type >= PNG_EQUATION_LAST)
@@ -2501,7 +2232,7 @@
if (params == NULL)
{
png_chunk_benign_error(png_ptr, "out of memory");
- return;
+ return handled_error;
}
/* Get pointers to the start of each parameter string. */
@@ -2519,7 +2250,7 @@
{
png_free(png_ptr, params);
png_chunk_benign_error(png_ptr, "invalid data");
- return;
+ return handled_error;
}
}
@@ -2526,13 +2257,22 @@
png_set_pCAL(png_ptr, info_ptr, (png_charp)buffer, X0, X1, type, nparams,
(png_charp)units, params);
+ /* TODO: BUG: png_set_pCAL calls png_chunk_report which, in this case, calls
+ * png_benign_error and that can error out.
+ *
+ * png_read_buffer needs to be allocated with space for both nparams and the
+ * parameter strings. Not hard to do.
+ */
png_free(png_ptr, params);
+ return handled_ok;
}
+#else
+# define png_handle_pCAL NULL
#endif
#ifdef PNG_READ_sCAL_SUPPORTED
/* Read the sCAL chunk */
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_bytep buffer;
@@ -2540,42 +2280,16 @@
int state;
png_debug(1, "in png_handle_sCAL");
-
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "out of place");
- return;
- }
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
- /* Need unit type, width, \0, height: minimum 4 bytes */
- else if (length < 4)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
-
png_debug1(2, "Allocating and reading sCAL chunk data (%u bytes)",
length + 1);
- buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/);
+ buffer = png_read_buffer(png_ptr, length+1);
if (buffer == NULL)
{
+ png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "out of memory");
- png_crc_finish(png_ptr, length);
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buffer, length);
@@ -2582,13 +2296,13 @@
buffer[length] = 0; /* Null terminate the last string */
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
/* Validate the unit. */
if (buffer[0] != 1 && buffer[0] != 2)
{
png_chunk_benign_error(png_ptr, "invalid unit");
- return;
+ return handled_error;
}
/* Validate the ASCII numbers, need two ASCII numbers separated by
@@ -2617,15 +2331,22 @@
png_chunk_benign_error(png_ptr, "non-positive height");
else
+ {
/* This is the (only) success case. */
png_set_sCAL_s(png_ptr, info_ptr, buffer[0],
(png_charp)buffer+1, (png_charp)buffer+heighti);
+ return handled_ok;
+ }
}
+
+ return handled_error;
}
+#else
+# define png_handle_sCAL NULL
#endif
#ifdef PNG_READ_tIME_SUPPORTED
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_tIME(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_byte buf[7];
@@ -2633,30 +2354,17 @@
png_debug(1, "in png_handle_tIME");
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
- else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) != 0)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "duplicate");
- return;
- }
-
+ /* TODO: what is this doing here? It should be happened in pngread.c and
+ * pngpread.c, although it could be moved to png_handle_chunk below and
+ * thereby avoid some code duplication.
+ */
if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
png_ptr->mode |= PNG_AFTER_IDAT;
- if (length != 7)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "invalid");
- return;
- }
-
png_crc_read(png_ptr, buf, 7);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
mod_time.second = buf[6];
mod_time.minute = buf[5];
@@ -2666,12 +2374,16 @@
mod_time.year = png_get_uint_16(buf);
png_set_tIME(png_ptr, info_ptr, &mod_time);
+ return handled_ok;
+ PNG_UNUSED(length)
}
+#else
+# define png_handle_tIME NULL
#endif
#ifdef PNG_READ_tEXt_SUPPORTED
/* Note: this does not properly handle chunks that are > 64K under DOS */
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_text text_info;
@@ -2688,7 +2400,7 @@
if (png_ptr->user_chunk_cache_max == 1)
{
png_crc_finish(png_ptr, length);
- return;
+ return handled_error;
}
if (--png_ptr->user_chunk_cache_max == 1)
@@ -2695,38 +2407,28 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "no space in chunk cache");
- return;
+ return handled_error;
}
}
#endif
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
+ /* TODO: this doesn't work and shouldn't be necessary. */
if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
png_ptr->mode |= PNG_AFTER_IDAT;
-#ifdef PNG_MAX_MALLOC_64K
- if (length > 65535U)
- {
- png_crc_finish(png_ptr, length);
- png_chunk_benign_error(png_ptr, "too large to fit in memory");
- return;
- }
-#endif
+ buffer = png_read_buffer(png_ptr, length+1);
- buffer = png_read_buffer(png_ptr, length+1, 1/*warn*/);
-
if (buffer == NULL)
{
+ png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "out of memory");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buffer, length);
if (png_crc_finish(png_ptr, skip) != 0)
- return;
+ return handled_error;
key = (png_charp)buffer;
key[length] = 0;
@@ -2745,14 +2447,19 @@
text_info.text = text;
text_info.text_length = strlen(text);
- if (png_set_text_2(png_ptr, info_ptr, &text_info, 1) != 0)
- png_warning(png_ptr, "Insufficient memory to process text chunk");
+ if (png_set_text_2(png_ptr, info_ptr, &text_info, 1) == 0)
+ return handled_ok;
+
+ png_chunk_benign_error(png_ptr, "out of memory");
+ return handled_error;
}
+#else
+# define png_handle_tEXt NULL
#endif
#ifdef PNG_READ_zTXt_SUPPORTED
/* Note: this does not correctly handle chunks that are > 64K under DOS */
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_const_charp errmsg = NULL;
@@ -2767,7 +2474,7 @@
if (png_ptr->user_chunk_cache_max == 1)
{
png_crc_finish(png_ptr, length);
- return;
+ return handled_error;
}
if (--png_ptr->user_chunk_cache_max == 1)
@@ -2774,33 +2481,32 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "no space in chunk cache");
- return;
+ return handled_error;
}
}
#endif
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
+ /* TODO: should not be necessary. */
if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
png_ptr->mode |= PNG_AFTER_IDAT;
/* Note, "length" is sufficient here; we won't be adding
- * a null terminator later.
+ * a null terminator later. The limit check in png_handle_chunk should be
+ * sufficient.
*/
- buffer = png_read_buffer(png_ptr, length, 2/*silent*/);
+ buffer = png_read_buffer(png_ptr, length);
if (buffer == NULL)
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "out of memory");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buffer, length);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
/* TODO: also check that the keyword contents match the spec! */
for (keyword_length = 0;
@@ -2853,8 +2559,10 @@
text.lang = NULL;
text.lang_key = NULL;
- if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
- errmsg = "insufficient memory";
+ if (png_set_text_2(png_ptr, info_ptr, &text, 1) == 0)
+ return handled_ok;
+
+ errmsg = "out of memory";
}
}
@@ -2862,14 +2570,16 @@
errmsg = png_ptr->zstream.msg;
}
- if (errmsg != NULL)
- png_chunk_benign_error(png_ptr, errmsg);
+ png_chunk_benign_error(png_ptr, errmsg);
+ return handled_error;
}
+#else
+# define png_handle_zTXt NULL
#endif
#ifdef PNG_READ_iTXt_SUPPORTED
/* Note: this does not correctly handle chunks that are > 64K under DOS */
-void /* PRIVATE */
+static png_handle_result_code /* PRIVATE */
png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_const_charp errmsg = NULL;
@@ -2884,7 +2594,7 @@
if (png_ptr->user_chunk_cache_max == 1)
{
png_crc_finish(png_ptr, length);
- return;
+ return handled_error;
}
if (--png_ptr->user_chunk_cache_max == 1)
@@ -2891,30 +2601,28 @@
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "no space in chunk cache");
- return;
+ return handled_error;
}
}
#endif
- if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
- png_chunk_error(png_ptr, "missing IHDR");
-
+ /* TODO: should not be necessary. */
if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
png_ptr->mode |= PNG_AFTER_IDAT;
- buffer = png_read_buffer(png_ptr, length+1, 1/*warn*/);
+ buffer = png_read_buffer(png_ptr, length+1);
if (buffer == NULL)
{
png_crc_finish(png_ptr, length);
png_chunk_benign_error(png_ptr, "out of memory");
- return;
+ return handled_error;
}
png_crc_read(png_ptr, buffer, length);
if (png_crc_finish(png_ptr, 0) != 0)
- return;
+ return handled_error;
/* First the keyword. */
for (prefix_length=0;
@@ -3004,8 +2712,10 @@
text.text_length = 0;
text.itxt_length = uncompressed_length;
- if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
- errmsg = "insufficient memory";
+ if (png_set_text_2(png_ptr, info_ptr, &text, 1) == 0)
+ return handled_ok;
+
+ errmsg = "out of memory";
}
}
@@ -3014,7 +2724,10 @@
if (errmsg != NULL)
png_chunk_benign_error(png_ptr, errmsg);
+ return handled_error;
}
+#else
+# define png_handle_iTXt NULL
#endif
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
@@ -3022,7 +2735,7 @@
static int
png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length)
{
- png_alloc_size_t limit = PNG_SIZE_MAX;
+ const png_alloc_size_t limit = png_chunk_max(png_ptr);
if (png_ptr->unknown_chunk.data != NULL)
{
@@ -3030,16 +2743,6 @@
png_ptr->unknown_chunk.data = NULL;
}
-# ifdef PNG_SET_USER_LIMITS_SUPPORTED
- if (png_ptr->user_chunk_malloc_max > 0 &&
- png_ptr->user_chunk_malloc_max < limit)
- limit = png_ptr->user_chunk_malloc_max;
-
-# elif PNG_USER_CHUNK_MALLOC_MAX > 0
- if (PNG_USER_CHUNK_MALLOC_MAX < limit)
- limit = PNG_USER_CHUNK_MALLOC_MAX;
-# endif
-
if (length <= limit)
{
PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name);
@@ -3078,11 +2781,11 @@
#endif /* READ_UNKNOWN_CHUNKS */
/* Handle an unknown, or known but disabled, chunk */
-void /* PRIVATE */
+png_handle_result_code /*PRIVATE*/
png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
png_uint_32 length, int keep)
{
- int handled = 0; /* the chunk was handled */
+ png_handle_result_code handled = handled_discarded; /* the default */
png_debug(1, "in png_handle_unknown");
@@ -3129,7 +2832,7 @@
* error at this point unless it is to be saved.
* positive: The chunk was handled, libpng will ignore/discard it.
*/
- if (ret < 0)
+ if (ret < 0) /* handled_error */
png_chunk_error(png_ptr, "error in user chunk");
else if (ret == 0)
@@ -3163,7 +2866,7 @@
else /* chunk was handled */
{
- handled = 1;
+ handled = handled_ok;
/* Critical chunks can be safely discarded at this point. */
keep = PNG_HANDLE_CHUNK_NEVER;
}
@@ -3248,7 +2951,7 @@
*/
png_set_unknown_chunks(png_ptr, info_ptr,
&png_ptr->unknown_chunk, 1);
- handled = 1;
+ handled = handled_saved;
# ifdef PNG_USER_LIMITS_SUPPORTED
break;
}
@@ -3274,79 +2977,267 @@
#endif /* !READ_UNKNOWN_CHUNKS */
/* Check for unhandled critical chunks */
- if (handled == 0 && PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
+ if (handled < handled_saved && PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
png_chunk_error(png_ptr, "unhandled critical chunk");
+
+ return handled;
}
-/* This function is called to verify that a chunk name is valid.
- * This function can't have the "critical chunk check" incorporated
- * into it, since in the future we will need to be able to call user
- * functions to handle unknown critical chunks after we check that
- * the chunk name itself is valid.
+/* APNG handling: the minimal implementation of APNG handling in libpng 1.6
+ * requires that those significant applications which already handle APNG not
+ * get hosed. To do this ensure the code here will have to ensure than APNG
+ * data by default (at least in 1.6) gets stored in the unknown chunk list.
+ * Maybe this can be relaxed in a few years but at present it's just the only
+ * safe way.
+ *
+ * ATM just cause unknown handling for all three chunks:
*/
+#define png_handle_acTL NULL
+#define png_handle_fcTL NULL
+#define png_handle_fdAT NULL
-/* Bit hacking: the test for an invalid byte in the 4 byte chunk name is:
+/*
+ * 1.6.47: This is the new table driven interface to all the chunk handling.
*
- * ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
+ * The table describes the PNG standard rules for **reading** known chunks -
+ * every chunk which has an entry in PNG_KNOWN_CHUNKS. The table contains an
+ * entry for each PNG_INDEX_cHNK describing the rules.
+ *
+ * In this initial version the only information in the entry is the
+ * png_handle_cHNK function for the chunk in question. When chunk support is
+ * compiled out the entry will be NULL.
*/
+static const struct
+{
+ png_handle_result_code (*handler)(
+ png_structrp, png_inforp, png_uint_32 length);
+ /* A chunk-specific 'handler', NULL if the chunk is not supported in this
+ * build.
+ */
-void /* PRIVATE */
-png_check_chunk_name(png_const_structrp png_ptr, png_uint_32 chunk_name)
+ /* Crushing these values helps on modern 32-bit architectures because the
+ * pointer and the following bit fields both end up requiring 32 bits.
+ * Typically this will halve the table size. On 64-bit architectures the
+ * table entries will typically be 8 bytes.
+ */
+ png_uint_32 max_length :12; /* Length min, max in bytes */
+ png_uint_32 min_length :8;
+ /* Length errors on critical chunks have special handling to preserve the
+ * existing behaviour in libpng 1.6. Anciallary chunks are checked below
+ * and produce a 'benign' error.
+ */
+ png_uint_32 pos_before :4; /* PNG_HAVE_ values chunk must precede */
+ png_uint_32 pos_after :4; /* PNG_HAVE_ values chunk must follow */
+ /* NOTE: PLTE, tRNS and bKGD require special handling which depends on
+ * the colour type of the base image.
+ */
+ png_uint_32 multiple :1; /* Multiple occurences permitted */
+ /* This is enabled for PLTE because PLTE may, in practice, be optional */
+}
+read_chunks[PNG_INDEX_unknown] =
{
- int i;
- png_uint_32 cn=chunk_name;
+ /* Definitions as above but done indirectly by #define so that
+ * PNG_KNOWN_CHUNKS can be used safely to build the table in order.
+ *
+ * Each CDcHNK definition lists the values for the parameters **after**
+ * the first, 'handler', function. 'handler' is NULL when the chunk has no
+ * compiled in support.
+ */
+# define NoCheck 0x801U /* Do not check the maximum length */
+# define Limit 0x802U /* Limit to png_chunk_max bytes */
+# define LKMin 3U+LZ77Min /* Minimum length of keyword+LZ77 */
- png_debug(1, "in png_check_chunk_name");
+#define hIHDR PNG_HAVE_IHDR
+#define hPLTE PNG_HAVE_PLTE
+#define hIDAT PNG_HAVE_IDAT
+ /* For the two chunks, tRNS and bKGD which can occur in PNGs without a PLTE
+ * but must occur after the PLTE use this and put the check in the handler
+ * routine for colour mapped images were PLTE is required. Also put a check
+ * in PLTE for other image types to drop the PLTE if tRNS or bKGD have been
+ * seen.
+ */
+#define hCOL (PNG_HAVE_PLTE|PNG_HAVE_IDAT)
+ /* Used for the decoding chunks which must be before PLTE. */
+#define aIDAT PNG_AFTER_IDAT
- for (i=1; i<=4; ++i)
+ /* Chunks from W3C PNG v3: */
+ /* cHNK max_len, min, before, after, multiple */
+# define CDIHDR 13U, 13U, hIHDR, 0, 0
+# define CDPLTE NoCheck, 0U, 0, hIHDR, 1
+ /* PLTE errors are only critical for colour-map images, consequently the
+ * hander does all the checks.
+ */
+# define CDIDAT NoCheck, 0U, aIDAT, hIHDR, 1
+# define CDIEND NoCheck, 0U, 0, aIDAT, 0
+ /* Historically data was allowed in IEND */
+# define CDtRNS 256U, 0U, hIDAT, hIHDR, 0
+# define CDcHRM 32U, 32U, hCOL, hIHDR, 0
+# define CDgAMA 4U, 4U, hCOL, hIHDR, 0
+# define CDiCCP NoCheck, LKMin, hCOL, hIHDR, 0
+# define CDsBIT 4U, 1U, hCOL, hIHDR, 0
+# define CDsRGB 1U, 1U, hCOL, hIHDR, 0
+# define CDcICP 4U, 4U, hCOL, hIHDR, 0
+# define CDmDCV 24U, 24U, hCOL, hIHDR, 0
+# define CDeXIf Limit, 4U, 0, hIHDR, 0
+# define CDcLLI 8U, 8U, hCOL, hIHDR, 0
+# define CDtEXt NoCheck, 2U, 0, hIHDR, 1
+ /* Allocates 'length+1'; checked in the handler */
+# define CDzTXt Limit, LKMin, 0, hIHDR, 1
+# define CDiTXt NoCheck, 6U, 0, hIHDR, 1
+ /* Allocates 'length+1'; checked in the handler */
+# define CDbKGD 6U, 1U, hIDAT, hIHDR, 0
+# define CDhIST 1024U, 0U, hPLTE, hIHDR, 0
+# define CDpHYs 9U, 9U, hIDAT, hIHDR, 0
+# define CDsPLT NoCheck, 3U, hIDAT, hIHDR, 1
+ /* Allocates 'length+1'; checked in the handler */
+# define CDtIME 7U, 7U, 0, hIHDR, 0
+# define CDacTL 8U, 8U, hIDAT, hIHDR, 0
+# define CDfcTL 25U, 26U, 0, hIHDR, 1
+# define CDfdAT Limit, 4U, hIDAT, hIHDR, 1
+ /* Supported chunks from PNG extensions 1.5.0, NYI so limit */
+# define CDoFFs 9U, 9U, hIDAT, hIHDR, 0
+# define CDpCAL NoCheck, 14U, hIDAT, hIHDR, 0
+ /* Allocates 'length+1'; checked in the handler */
+# define CDsCAL Limit, 4U, hIDAT, hIHDR, 0
+ /* Allocates 'length+1'; checked in the handler */
+
+# define PNG_CHUNK(cHNK, index) { png_handle_ ## cHNK, CD ## cHNK },
+ PNG_KNOWN_CHUNKS
+# undef PNG_CHUNK
+};
+
+
+static png_index
+png_chunk_index_from_name(png_uint_32 chunk_name)
+{
+ /* For chunk png_cHNK return PNG_INDEX_cHNK. Return PNG_INDEX_unknown if
+ * chunk_name is not known. Notice that in a particular build "known" does
+ * not necessarily mean "supported", although the inverse applies.
+ */
+ switch (chunk_name)
{
- int c = cn & 0xff;
+# define PNG_CHUNK(cHNK, index)\
+ case png_ ## cHNK: return PNG_INDEX_ ## cHNK; /* == index */
- if (c < 65 || c > 122 || (c > 90 && c < 97))
- png_chunk_error(png_ptr, "invalid chunk type");
+ PNG_KNOWN_CHUNKS
- cn >>= 8;
+# undef PNG_CHUNK
+
+ default: return PNG_INDEX_unknown;
}
}
-void /* PRIVATE */
-png_check_chunk_length(png_const_structrp png_ptr, png_uint_32 length)
+png_handle_result_code /*PRIVATE*/
+png_handle_chunk(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
- png_alloc_size_t limit = PNG_UINT_31_MAX;
+ /* CSE: these things don't change, these autos are just to save typing and
+ * make the code more clear.
+ */
+ const png_uint_32 chunk_name = png_ptr->chunk_name;
+ const png_index chunk_index = png_chunk_index_from_name(chunk_name);
-# ifdef PNG_SET_USER_LIMITS_SUPPORTED
- if (png_ptr->user_chunk_malloc_max > 0 &&
- png_ptr->user_chunk_malloc_max < limit)
- limit = png_ptr->user_chunk_malloc_max;
-# elif PNG_USER_CHUNK_MALLOC_MAX > 0
- if (PNG_USER_CHUNK_MALLOC_MAX < limit)
- limit = PNG_USER_CHUNK_MALLOC_MAX;
-# endif
- if (png_ptr->chunk_name == png_IDAT)
+ png_handle_result_code handled = handled_error;
+ png_const_charp errmsg = NULL;
+
+ /* Is this a known chunk? If not there are no checks performed here;
+ * png_handle_unknown does the correct checks. This means that the values
+ * for known but unsupported chunks in the above table are not used here
+ * however the chunks_seen fields in png_struct are still set.
+ */
+ if (chunk_index == PNG_INDEX_unknown ||
+ read_chunks[chunk_index].handler == NULL)
{
- png_alloc_size_t idat_limit = PNG_UINT_31_MAX;
- size_t row_factor =
- (size_t)png_ptr->width
- * (size_t)png_ptr->channels
- * (png_ptr->bit_depth > 8? 2: 1)
- + 1
- + (png_ptr->interlaced? 6: 0);
- if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
- idat_limit = PNG_UINT_31_MAX;
- else
- idat_limit = png_ptr->height * row_factor;
- row_factor = row_factor > 32566? 32566 : row_factor;
- idat_limit += 6 + 5*(idat_limit/row_factor+1); /* zlib+deflate overhead */
- idat_limit=idat_limit < PNG_UINT_31_MAX? idat_limit : PNG_UINT_31_MAX;
- limit = limit < idat_limit? idat_limit : limit;
+ handled = png_handle_unknown(
+ png_ptr, info_ptr, length, PNG_HANDLE_CHUNK_AS_DEFAULT);
}
- if (length > limit)
+ /* First check the position. The first check is historical; the stream must
+ * start with IHDR and anything else causes libpng to give up immediately.
+ */
+ else if (chunk_index != PNG_INDEX_IHDR &&
+ (png_ptr->mode & PNG_HAVE_IHDR) == 0)
+ png_chunk_error(png_ptr, "missing IHDR"); /* NORETURN */
+
+ /* Before all the pos_before chunks, after all the pos_after chunks. */
+ else if (((png_ptr->mode & read_chunks[chunk_index].pos_before) != 0) ||
+ ((png_ptr->mode & read_chunks[chunk_index].pos_after) !=
+ read_chunks[chunk_index].pos_after))
{
- png_debug2(0," length = %lu, limit = %lu",
- (unsigned long)length,(unsigned long)limit);
- png_benign_error(png_ptr, "chunk data is too large");
+ errmsg = "out of place";
}
+
+ /* Now check for duplicates: duplicated critical chunks also produce a
+ * full error.
+ */
+ else if (read_chunks[chunk_index].multiple == 0 &&
+ png_file_has_chunk(png_ptr, chunk_index))
+ {
+ errmsg = "duplicate";
+ }
+
+ else if (length < read_chunks[chunk_index].min_length)
+ errmsg = "too short";
+ else
+ {
+ /* NOTE: apart from IHDR the critical chunks (PLTE, IDAT and IEND) are set
+ * up above not to do any length checks.
+ *
+ * The png_chunk_max check ensures that the variable length chunks are
+ * always checked at this point for being within the system allocation
+ * limits.
+ */
+ unsigned max_length = read_chunks[chunk_index].max_length;
+
+ switch (max_length)
+ {
+ case Limit:
+ /* png_read_chunk_header has already png_error'ed chunks with a
+ * length exceeding the 31-bit PNG limit, so just check the memory
+ * limit:
+ */
+ if (length <= png_chunk_max(png_ptr))
+ goto MeetsLimit;
+
+ errmsg = "length exceeds libpng limit";
+ break;
+
+ default:
+ if (length <= max_length)
+ goto MeetsLimit;
+
+ errmsg = "too long";
+ break;
+
+ case NoCheck:
+ MeetsLimit:
+ handled = read_chunks[chunk_index].handler(
+ png_ptr, info_ptr, length);
+ break;
+ }
+ }
+
+ /* If there was an error or the chunk was simply skipped it is not counted as
+ * 'seen'.
+ */
+ if (errmsg != NULL)
+ {
+ if (PNG_CHUNK_CRITICAL(chunk_name)) /* stop immediately */
+ png_chunk_error(png_ptr, errmsg);
+ else /* ancillary chunk */
+ {
+ /* The chunk data is skipped: */
+ png_crc_finish(png_ptr, length);
+ png_chunk_benign_error(png_ptr, errmsg);
+ }
+ }
+
+ else if (handled >= handled_saved)
+ {
+ if (chunk_index != PNG_INDEX_unknown)
+ png_file_add_chunk(png_ptr, chunk_index);
+ }
+
+ return handled;
}
/* Combines the row recently read in with the existing pixels in the row. This
@@ -4336,6 +4227,9 @@
avail_in = png_ptr->IDAT_read_size;
+ if (avail_in > png_chunk_max(png_ptr))
+ avail_in = (uInt)/*SAFE*/png_chunk_max(png_ptr);
+
if (avail_in > png_ptr->idat_size)
avail_in = (uInt)png_ptr->idat_size;
@@ -4343,9 +4237,14 @@
* to minimize memory usage by causing lots of re-allocs, but
* realistically doing IDAT_read_size re-allocs is not likely to be a
* big problem.
+ *
+ * An error here corresponds to the system being out of memory.
*/
- buffer = png_read_buffer(png_ptr, avail_in, 0/*error*/);
+ buffer = png_read_buffer(png_ptr, avail_in);
+ if (buffer == NULL)
+ png_chunk_error(png_ptr, "out of memory");
+
png_crc_read(png_ptr, buffer, avail_in);
png_ptr->idat_size -= avail_in;
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngset.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngset.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngset.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -41,27 +41,21 @@
png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y,
png_fixed_point blue_x, png_fixed_point blue_y)
{
- png_xy xy;
-
png_debug1(1, "in %s storage function", "cHRM fixed");
if (png_ptr == NULL || info_ptr == NULL)
return;
- xy.redx = red_x;
- xy.redy = red_y;
- xy.greenx = green_x;
- xy.greeny = green_y;
- xy.bluex = blue_x;
- xy.bluey = blue_y;
- xy.whitex = white_x;
- xy.whitey = white_y;
+ info_ptr->cHRM.redx = red_x;
+ info_ptr->cHRM.redy = red_y;
+ info_ptr->cHRM.greenx = green_x;
+ info_ptr->cHRM.greeny = green_y;
+ info_ptr->cHRM.bluex = blue_x;
+ info_ptr->cHRM.bluey = blue_y;
+ info_ptr->cHRM.whitex = white_x;
+ info_ptr->cHRM.whitey = white_y;
- if (png_colorspace_set_chromaticities(png_ptr, &info_ptr->colorspace, &xy,
- 2/* override with app values*/) != 0)
- info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
-
- png_colorspace_sync_info(png_ptr, info_ptr);
+ info_ptr->valid |= PNG_INFO_cHRM;
}
void PNGFAPI
@@ -73,6 +67,7 @@
png_fixed_point int_blue_Z)
{
png_XYZ XYZ;
+ png_xy xy;
png_debug1(1, "in %s storage function", "cHRM XYZ fixed");
@@ -89,11 +84,14 @@
XYZ.blue_Y = int_blue_Y;
XYZ.blue_Z = int_blue_Z;
- if (png_colorspace_set_endpoints(png_ptr, &info_ptr->colorspace,
- &XYZ, 2) != 0)
- info_ptr->colorspace.flags |= PNG_COLORSPACE_FROM_cHRM;
+ if (png_xy_from_XYZ(&xy, &XYZ) == 0)
+ {
+ info_ptr->cHRM = xy;
+ info_ptr->valid |= PNG_INFO_cHRM;
+ }
- png_colorspace_sync_info(png_ptr, info_ptr);
+ else
+ png_app_error(png_ptr, "invalid cHRM XYZ");
}
# ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -205,8 +203,7 @@
#ifdef PNG_mDCV_SUPPORTED
static png_uint_16
-png_ITU_fixed_16(png_const_structrp png_ptr, png_fixed_point v,
- png_const_charp text)
+png_ITU_fixed_16(int *error, png_fixed_point v)
{
/* Return a safe uint16_t value scaled according to the ITU H273 rules for
* 16-bit display chromaticities. Functions like the corresponding
@@ -216,12 +213,11 @@
*/
v /= 2; /* rounds to 0 in C: avoids insignificant arithmetic errors */
if (v > 65535 || v < 0)
- png_fixed_error(png_ptr, text);
+ {
+ *error = 1;
+ return 0;
+ }
-# ifndef PNG_ERROR_TEXT_SUPPORTED
- PNG_UNUSED(text)
-# endif
-
return (png_uint_16)/*SAFE*/v;
}
@@ -235,6 +231,7 @@
png_uint_32 minDL)
{
png_uint_16 rx, ry, gx, gy, bx, by, wx, wy;
+ int error;
png_debug1(1, "in %s storage function", "mDCV");
@@ -242,15 +239,24 @@
return;
/* Check the input values to ensure they are in the expected range: */
- rx = png_ITU_fixed_16(png_ptr, red_x, "png_set_mDCV(red(x))");
- ry = png_ITU_fixed_16(png_ptr, red_y, "png_set_mDCV(red(y))");
- gx = png_ITU_fixed_16(png_ptr, green_x, "png_set_mDCV(green(x))");
- gy = png_ITU_fixed_16(png_ptr, green_y, "png_set_mDCV(green(y))");
- bx = png_ITU_fixed_16(png_ptr, blue_x, "png_set_mDCV(blue(x))");
- by = png_ITU_fixed_16(png_ptr, blue_y, "png_set_mDCV(blue(y))");
- wx = png_ITU_fixed_16(png_ptr, white_x, "png_set_mDCV(white(x))");
- wy = png_ITU_fixed_16(png_ptr, white_y, "png_set_mDCV(white(y))");
+ error = 0;
+ rx = png_ITU_fixed_16(&error, red_x);
+ ry = png_ITU_fixed_16(&error, red_y);
+ gx = png_ITU_fixed_16(&error, green_x);
+ gy = png_ITU_fixed_16(&error, green_y);
+ bx = png_ITU_fixed_16(&error, blue_x);
+ by = png_ITU_fixed_16(&error, blue_y);
+ wx = png_ITU_fixed_16(&error, white_x);
+ wy = png_ITU_fixed_16(&error, white_y);
+ if (error)
+ {
+ png_chunk_report(png_ptr,
+ "mDCV chromaticities outside representable range",
+ PNG_CHUNK_WRITE_ERROR);
+ return;
+ }
+
/* Check the light level range: */
if (maxDL > 0x7FFFFFFFU || minDL > 0x7FFFFFFFU)
{
@@ -294,17 +300,14 @@
double maxDL, double minDL)
{
png_set_mDCV_fixed(png_ptr, info_ptr,
- /* The ITU approach is to scale by 50,000, not 100,000 so just divide
- * the input values by 2 and use png_fixed:
- */
- png_fixed(png_ptr, white_x / 2, "png_set_mDCV(white(x))"),
- png_fixed(png_ptr, white_y / 2, "png_set_mDCV(white(y))"),
- png_fixed(png_ptr, red_x / 2, "png_set_mDCV(red(x))"),
- png_fixed(png_ptr, red_y / 2, "png_set_mDCV(red(y))"),
- png_fixed(png_ptr, green_x / 2, "png_set_mDCV(green(x))"),
- png_fixed(png_ptr, green_y / 2, "png_set_mDCV(green(y))"),
- png_fixed(png_ptr, blue_x / 2, "png_set_mDCV(blue(x))"),
- png_fixed(png_ptr, blue_y / 2, "png_set_mDCV(blue(y))"),
+ png_fixed(png_ptr, white_x, "png_set_mDCV(white(x))"),
+ png_fixed(png_ptr, white_y, "png_set_mDCV(white(y))"),
+ png_fixed(png_ptr, red_x, "png_set_mDCV(red(x))"),
+ png_fixed(png_ptr, red_y, "png_set_mDCV(red(y))"),
+ png_fixed(png_ptr, green_x, "png_set_mDCV(green(x))"),
+ png_fixed(png_ptr, green_y, "png_set_mDCV(green(y))"),
+ png_fixed(png_ptr, blue_x, "png_set_mDCV(blue(x))"),
+ png_fixed(png_ptr, blue_y, "png_set_mDCV(blue(y))"),
png_fixed_ITU(png_ptr, maxDL, "png_set_mDCV(maxDL)"),
png_fixed_ITU(png_ptr, minDL, "png_set_mDCV(minDL)"));
}
@@ -362,8 +365,8 @@
if (png_ptr == NULL || info_ptr == NULL)
return;
- png_colorspace_set_gamma(png_ptr, &info_ptr->colorspace, file_gamma);
- png_colorspace_sync_info(png_ptr, info_ptr);
+ info_ptr->gamma = file_gamma;
+ info_ptr->valid |= PNG_INFO_gAMA;
}
# ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -822,8 +825,8 @@
if (png_ptr == NULL || info_ptr == NULL)
return;
- (void)png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace, srgb_intent);
- png_colorspace_sync_info(png_ptr, info_ptr);
+ info_ptr->rendering_intent = srgb_intent;
+ info_ptr->valid |= PNG_INFO_sRGB;
}
void PNGAPI
@@ -835,15 +838,20 @@
if (png_ptr == NULL || info_ptr == NULL)
return;
- if (png_colorspace_set_sRGB(png_ptr, &info_ptr->colorspace,
- srgb_intent) != 0)
- {
- /* This causes the gAMA and cHRM to be written too */
- info_ptr->colorspace.flags |=
- PNG_COLORSPACE_FROM_gAMA|PNG_COLORSPACE_FROM_cHRM;
- }
+ png_set_sRGB(png_ptr, info_ptr, srgb_intent);
- png_colorspace_sync_info(png_ptr, info_ptr);
+# ifdef PNG_gAMA_SUPPORTED
+ png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE);
+# endif /* gAMA */
+
+# ifdef PNG_cHRM_SUPPORTED
+ png_set_cHRM_fixed(png_ptr, info_ptr,
+ /* color x y */
+ /* white */ 31270, 32900,
+ /* red */ 64000, 33000,
+ /* green */ 30000, 60000,
+ /* blue */ 15000, 6000);
+# endif /* cHRM */
}
#endif /* sRGB */
@@ -866,27 +874,6 @@
if (compression_type != PNG_COMPRESSION_TYPE_BASE)
png_app_error(png_ptr, "Invalid iCCP compression method");
- /* Set the colorspace first because this validates the profile; do not
- * override previously set app cHRM or gAMA here (because likely as not the
- * application knows better than libpng what the correct values are.) Pass
- * the info_ptr color_type field to png_colorspace_set_ICC because in the
- * write case it has not yet been stored in png_ptr.
- */
- {
- int result = png_colorspace_set_ICC(png_ptr, &info_ptr->colorspace, name,
- proflen, profile, info_ptr->color_type);
-
- png_colorspace_sync_info(png_ptr, info_ptr);
-
- /* Don't do any of the copying if the profile was bad, or inconsistent. */
- if (result == 0)
- return;
-
- /* But do write the gAMA and cHRM chunks from the profile. */
- info_ptr->colorspace.flags |=
- PNG_COLORSPACE_FROM_gAMA|PNG_COLORSPACE_FROM_cHRM;
- }
-
length = strlen(name)+1;
new_iccp_name = png_voidcast(png_charp, png_malloc_warn(png_ptr, length));
@@ -1841,8 +1828,24 @@
{
png_debug(1, "in png_set_chunk_malloc_max");
+ /* pngstruct::user_chunk_malloc_max is initialized to a non-zero value in
+ * png.c. This API supports '0' for unlimited, make sure the correct
+ * (unlimited) value is set here to avoid a need to check for 0 everywhere
+ * the parameter is used.
+ */
if (png_ptr != NULL)
- png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
+ {
+ if (user_chunk_malloc_max == 0U) /* unlimited */
+ {
+# ifdef PNG_MAX_MALLOC_64K
+ png_ptr->user_chunk_malloc_max = 65536U;
+# else
+ png_ptr->user_chunk_malloc_max = PNG_SIZE_MAX;
+# endif
+ }
+ else
+ png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
+ }
}
#endif /* ?SET_USER_LIMITS */
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
-/* pngstruct.h - header file for PNG reference library
+/* pngstruct.h - internal structures for libpng
*
- * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -10,11 +10,9 @@
* and license in png.h
*/
-/* The structure that holds the information to read and write PNG files.
- * The only people who need to care about what is inside of this are the
- * people who will be modifying the library for their own special needs.
- * It should NOT be accessed directly by an application.
- */
+#ifndef PNGPRIV_H
+# error This file must not be included by applications; please include <png.h>
+#endif
#ifndef PNGSTRUCT_H
#define PNGSTRUCT_H
@@ -69,13 +67,7 @@
/* Colorspace support; structures used in png_struct, png_info and in internal
* functions to hold and communicate information about the color space.
- *
- * PNG_COLORSPACE_SUPPORTED is only required if the application will perform
- * colorspace corrections, otherwise all the colorspace information can be
- * skipped and the size of libpng can be reduced (significantly) by compiling
- * out the colorspace support.
*/
-#ifdef PNG_COLORSPACE_SUPPORTED
/* The chromaticities of the red, green and blue colorants and the chromaticity
* of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)).
*/
@@ -96,49 +88,37 @@
png_fixed_point green_X, green_Y, green_Z;
png_fixed_point blue_X, blue_Y, blue_Z;
} png_XYZ;
-#endif /* COLORSPACE */
-#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
-/* A colorspace is all the above plus, potentially, profile information;
- * however at present libpng does not use the profile internally so it is only
- * stored in the png_info struct (if iCCP is supported.) The rendering intent
- * is retained here and is checked.
- *
- * The file gamma encoding information is also stored here and gamma correction
- * is done by libpng, whereas color correction must currently be done by the
- * application.
+/* Chunk index values as an enum, PNG_INDEX_unknown is also a count of the
+ * number of chunks.
*/
-typedef struct png_colorspace
+#define PNG_CHUNK(cHNK, i) PNG_INDEX_ ## cHNK = (i),
+typedef enum
{
-#ifdef PNG_GAMMA_SUPPORTED
- png_fixed_point gamma; /* File gamma */
-#endif
+ PNG_KNOWN_CHUNKS
+ PNG_INDEX_unknown
+} png_index;
+#undef PNG_CHUNK
-#ifdef PNG_COLORSPACE_SUPPORTED
- png_xy end_points_xy; /* End points as chromaticities */
- png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */
- png_uint_16 rendering_intent; /* Rendering intent of a profile */
-#endif
+/* Chunk flag values. These are (png_uint_32 values) with exactly one bit set
+ * and can be combined into a flag set with bitwise 'or'.
+ *
+ * TODO: C23: convert these macros to C23 inlines (which are static).
+ */
+#define png_chunk_flag_from_index(i) (0x80000000U >> (31 - (i)))
+ /* The flag coresponding to the given png_index enum value. This is defined
+ * for png_unknown as well (until it reaches the value 32) but this should
+ * not be relied on.
+ */
- /* Flags are always defined to simplify the code. */
- png_uint_16 flags; /* As defined below */
-} png_colorspace, * PNG_RESTRICT png_colorspacerp;
+#define png_file_has_chunk(png_ptr, i)\
+ (((png_ptr)->chunks & png_chunk_flag_from_index(i)) != 0)
+ /* The chunk has been recorded in png_struct */
-typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp;
+#define png_file_add_chunk(pnt_ptr, i)\
+ ((void)((png_ptr)->chunks |= png_chunk_flag_from_index(i)))
+ /* Record the chunk in the png_struct */
-/* General flags for the 'flags' field */
-#define PNG_COLORSPACE_HAVE_GAMMA 0x0001
-#define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002
-#define PNG_COLORSPACE_HAVE_INTENT 0x0004
-#define PNG_COLORSPACE_FROM_gAMA 0x0008
-#define PNG_COLORSPACE_FROM_cHRM 0x0010
-#define PNG_COLORSPACE_FROM_sRGB 0x0020
-#define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040
-#define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */
-#define PNG_COLORSPACE_INVALID 0x8000
-#define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags))
-#endif /* COLORSPACE || GAMMA */
-
struct png_struct_def
{
#ifdef PNG_SETJMP_SUPPORTED
@@ -209,6 +189,11 @@
int zlib_set_strategy;
#endif
+ png_uint_32 chunks; /* PNG_CF_ for every chunk read or (NYI) written */
+# define png_has_chunk(png_ptr, cHNK)\
+ png_file_has_chunk(png_ptr, PNG_INDEX_ ## cHNK)
+ /* Convenience accessor - use this to check for a known chunk by name */
+
png_uint_32 width; /* width of image in pixels */
png_uint_32 height; /* height of image in pixels */
png_uint_32 num_rows; /* number of rows in current pass */
@@ -285,9 +270,16 @@
png_uint_32 flush_rows; /* number of rows written since last flush */
#endif
+#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
+ png_xy chromaticities; /* From mDVC, cICP, [iCCP], sRGB or cHRM */
+#endif
+
#ifdef PNG_READ_GAMMA_SUPPORTED
int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */
- png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */
+ png_fixed_point screen_gamma; /* screen gamma value (display exponent) */
+ png_fixed_point file_gamma; /* file gamma value (encoding exponent) */
+ png_fixed_point chunk_gamma; /* from cICP, iCCP, sRGB or gAMA */
+ png_fixed_point default_gamma;/* from png_set_alpha_mode */
png_bytep gamma_table; /* gamma table for 8-bit depth files */
png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
@@ -299,7 +291,7 @@
png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
-#endif
+#endif /* READ_GAMMA */
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
png_color_8 sig_bit; /* significant bits in each available channel */
@@ -349,8 +341,8 @@
/* To do: remove this from libpng-1.7 */
#ifdef PNG_TIME_RFC1123_SUPPORTED
char time_buffer[29]; /* String to hold RFC 1123 time text */
-#endif
-#endif
+#endif /* TIME_RFC1123 */
+#endif /* LIBPNG_VER < 10700 */
/* New members added in libpng-1.0.6 */
@@ -360,8 +352,8 @@
png_voidp user_chunk_ptr;
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
-#endif
-#endif
+#endif /* READ_USER_CHUNKS */
+#endif /* USER_CHUNKS */
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
int unknown_default; /* As PNG_HANDLE_* */
@@ -468,11 +460,5 @@
/* New member added in libpng-1.5.7 */
void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row);
-
-#ifdef PNG_READ_SUPPORTED
-#if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
- png_colorspace colorspace;
-#endif
-#endif
};
#endif /* PNGSTRUCT_H */
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngtest.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngtest.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngtest.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -50,7 +50,7 @@
#define STDERR stdout
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_46 Your_png_h_is_not_version_1_6_46;
+typedef png_libpng_version_1_6_48 Your_png_h_is_not_version_1_6_48;
/* Ensure that all version numbers in png.h are consistent with one another. */
#if (PNG_LIBPNG_VER != PNG_LIBPNG_VER_MAJOR * 10000 + \
@@ -60,7 +60,7 @@
PNG_LIBPNG_VER_MINOR) || \
(PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_SONUM) || \
(PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_DLLNUM)
-# error "Inconsistent version numbers in png.h"
+# error Inconsistent version numbers in "png.h"
#endif
/* In version 1.6.1, we added support for the configure test harness, which
@@ -103,10 +103,6 @@
# define PNG_ZBUF_SIZE 8192
#endif
-#ifndef PNG_STDIO_SUPPORTED
-typedef FILE * png_FILE_p;
-#endif
-
#ifndef PNG_DEBUG
# define PNG_DEBUG 0
#endif
@@ -120,7 +116,7 @@
# define pngtest_debug1(m, p1) ((void)0)
# define pngtest_debug2(m, p1, p2) ((void)0)
#else /* PNG_DEBUG < 0 */
-# error "Bad PNG_DEBUG value"
+# error Bad PNG_DEBUG value
#endif
/* Turn on CPU timing
@@ -403,7 +399,7 @@
*/
io_ptr = png_get_io_ptr(png_ptr);
if (io_ptr != NULL)
- check = fread(data, 1, length, (png_FILE_p)io_ptr);
+ check = fread(data, 1, length, (FILE *)io_ptr);
if (check != length)
png_error(png_ptr, "Read Error");
@@ -437,7 +433,7 @@
if (png_ptr == NULL)
png_error(png_ptr, "pngtest_write_data: bad png_ptr");
- check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
+ check = fwrite(data, 1, length, (FILE *)png_get_io_ptr(png_ptr));
if (check != length)
png_error(png_ptr, "Write Error");
@@ -858,8 +854,8 @@
static int
test_one_file(const char *inname, const char *outname)
{
- static png_FILE_p fpin;
- static png_FILE_p fpout; /* "static" prevents setjmp corruption */
+ static FILE *fpin;
+ static FILE *fpout; /* "static" prevents setjmp corruption */
pngtest_error_parameters error_parameters;
png_structp read_ptr;
png_infop read_info_ptr, end_info_ptr;
@@ -2137,6 +2133,7 @@
fprintf(STDERR, " libpng FAILS test\n");
dummy_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+#ifdef PNG_USER_LIMITS_SUPPORTED
fprintf(STDERR, " Default limits:\n");
fprintf(STDERR, " width_max = %lu\n",
(unsigned long) png_get_user_width_max(dummy_ptr));
@@ -2152,6 +2149,7 @@
else
fprintf(STDERR, " malloc_max = %lu\n",
(unsigned long) png_get_chunk_malloc_max(dummy_ptr));
+#endif
png_destroy_read_struct(&dummy_ptr, NULL, NULL);
return (ierror != 0);
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngwio.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngwio.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngwio.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngwio.c - functions for data output
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -54,7 +54,7 @@
if (png_ptr == NULL)
return;
- check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
+ check = fwrite(data, 1, length, (FILE *)png_ptr->io_ptr);
if (check != length)
png_error(png_ptr, "Write Error");
@@ -77,12 +77,12 @@
void PNGCBAPI
png_default_flush(png_structp png_ptr)
{
- png_FILE_p io_ptr;
+ FILE *io_ptr;
if (png_ptr == NULL)
return;
- io_ptr = png_voidcast(png_FILE_p, (png_ptr->io_ptr));
+ io_ptr = png_voidcast(FILE *, png_ptr->io_ptr);
fflush(io_ptr);
}
# endif
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -181,7 +181,6 @@
}
#endif
-#ifdef PNG_COLORSPACE_SUPPORTED
# ifdef PNG_WRITE_cICP_SUPPORTED /* Priority 4 */
if ((info_ptr->valid & PNG_INFO_cICP) != 0)
{
@@ -193,50 +192,28 @@
}
# endif
- /* PNG v3 change: it is now permitted to write both sRGB and ICC profiles,
- * however because the libpng code auto-generates an sRGB for the
- * corresponding ICC profiles and because PNG v2 disallowed this we need
- * to only write one.
- *
- * Remove the PNG v2 warning about writing an sRGB ICC profile as well
- * because it's invalid with PNG v3.
- */
# ifdef PNG_WRITE_iCCP_SUPPORTED /* Priority 3 */
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
- (info_ptr->valid & PNG_INFO_iCCP) != 0)
+ if ((info_ptr->valid & PNG_INFO_iCCP) != 0)
{
png_write_iCCP(png_ptr, info_ptr->iccp_name,
- info_ptr->iccp_profile);
+ info_ptr->iccp_profile, info_ptr->iccp_proflen);
}
-# ifdef PNG_WRITE_sRGB_SUPPORTED
- else
-# endif
# endif
# ifdef PNG_WRITE_sRGB_SUPPORTED /* Priority 2 */
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
- (info_ptr->valid & PNG_INFO_sRGB) != 0)
- png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent);
+ if ((info_ptr->valid & PNG_INFO_sRGB) != 0)
+ png_write_sRGB(png_ptr, info_ptr->rendering_intent);
# endif /* WRITE_sRGB */
-#endif /* COLORSPACE */
-#ifdef PNG_GAMMA_SUPPORTED
# ifdef PNG_WRITE_gAMA_SUPPORTED /* Priority 1 */
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_gAMA) != 0 &&
- (info_ptr->valid & PNG_INFO_gAMA) != 0)
- png_write_gAMA_fixed(png_ptr, info_ptr->colorspace.gamma);
+ if ((info_ptr->valid & PNG_INFO_gAMA) != 0)
+ png_write_gAMA_fixed(png_ptr, info_ptr->gamma);
# endif
-#endif
-#ifdef PNG_COLORSPACE_SUPPORTED
# ifdef PNG_WRITE_cHRM_SUPPORTED /* Also priority 1 */
- if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
- (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0 &&
- (info_ptr->valid & PNG_INFO_cHRM) != 0)
- png_write_cHRM_fixed(png_ptr, &info_ptr->colorspace.end_points_xy);
+ if ((info_ptr->valid & PNG_INFO_cHRM) != 0)
+ png_write_cHRM_fixed(png_ptr, &info_ptr->cHRM);
# endif
-#endif
png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE;
}
@@ -2356,7 +2333,7 @@
png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit,
const void *buffer, png_int_32 row_stride, const void *colormap)
{
- /* Write the image to the given (FILE*). */
+ /* Write the image to the given FILE object. */
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{
if (file != NULL && buffer != NULL)
Modified: branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pngwutil.c - utilities to write a PNG file
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -1132,10 +1132,9 @@
/* Write an iCCP chunk */
void /* PRIVATE */
png_write_iCCP(png_structrp png_ptr, png_const_charp name,
- png_const_bytep profile)
+ png_const_bytep profile, png_uint_32 profile_len)
{
png_uint_32 name_len;
- png_uint_32 profile_len;
png_byte new_name[81]; /* 1 byte for the compression byte */
compression_state comp;
png_uint_32 temp;
@@ -1148,11 +1147,12 @@
if (profile == NULL)
png_error(png_ptr, "No profile for iCCP chunk"); /* internal error */
- profile_len = png_get_uint_32(profile);
-
if (profile_len < 132)
png_error(png_ptr, "ICC profile too short");
+ if (png_get_uint_32(profile) != profile_len)
+ png_error(png_ptr, "Incorrect data in iCCP");
+
temp = (png_uint_32) (*(profile+8));
if (temp > 3 && (profile_len & 0x03))
png_error(png_ptr, "ICC profile length invalid (not a multiple of 4)");
Modified: branches/stable/source/src/libs/libpng/libpng-src/powerpc/filter_vsx_intrinsics.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/powerpc/filter_vsx_intrinsics.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/powerpc/filter_vsx_intrinsics.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -23,7 +23,7 @@
#if PNG_POWERPC_VSX_OPT > 0
#ifndef __VSX__
-# error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
+# error This code requires VSX support (POWER7 and later); please compile with -mvsx
#endif
#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
Modified: branches/stable/source/src/libs/libpng/libpng-src/powerpc/powerpc_init.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/powerpc/powerpc_init.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/powerpc/powerpc_init.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -46,7 +46,7 @@
#include PNG_POWERPC_VSX_FILE
#else /* PNG_POWERPC_VSX_FILE */
-# error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
+# error PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks
#endif /* PNG_POWERPC_VSX_FILE */
#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
Added: branches/stable/source/src/libs/libpng/libpng-src/scripts/cmake/PNGCheckLibconf.cmake
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/cmake/PNGCheckLibconf.cmake (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/cmake/PNGCheckLibconf.cmake 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,45 @@
+# PNGConfig.cmake
+# Utility functions for configuring and building libpng
+
+# Copyright (c) 2025 Cosmin Truta
+#
+# Use, modification and distribution are subject to
+# the same licensing terms and conditions as libpng.
+# Please see the copyright notice in png.h or visit
+# http://libpng.org/pub/png/src/libpng-LICENSE.txt
+#
+# SPDX-License-Identifier: libpng-2.0
+
+# Check libconf file (pnglibconf.h.* or *.dfa):
+# png_check_libconf([HEADER <file>] [DFA_XTRA <file>])
+function(png_check_libconf)
+ set(options)
+ set(oneValueArgs HEADER DFA_XTRA)
+ set(multiValueArgs)
+
+ cmake_parse_arguments(_CHK "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(_CHK_HEADER AND _CHK_DFA_XTRA)
+ message(FATAL_ERROR "png_check_libconf: Mutually-exclusive arguments: HEADER and DFA_XTRA")
+ endif()
+
+ if(_CHK_HEADER)
+ if(EXISTS "${_CHK_HEADER}")
+ if("x${_CHK_HEADER}" STREQUAL "x${PNG_LIBCONF_HEADER_PREBUILT}")
+ message(STATUS "Using standard libconf header: ${_CHK_HEADER}")
+ else()
+ message(STATUS "Using custom libconf header: ${_CHK_HEADER}")
+ endif()
+ else()
+ message(SEND_ERROR "Could not find libconf header: ${_CHK_HEADER}")
+ endif()
+ else()
+ if("x${_CHK_DFA_XTRA}" STREQUAL "x")
+ message(STATUS "Creating standard configuration")
+ elseif(EXISTS "${_CHK_DFA_XTRA}")
+ message(STATUS "Creating custom configuration with DFA_XTRA file: ${_CHK_DFA_XTRA}")
+ else()
+ message(SEND_ERROR "Could not find DFA_XTRA file: ${_CHK_DFA_XTRA}")
+ endif()
+ endif()
+endfunction()
Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in 2025-05-17 22:44:20 UTC (rev 964)
@@ -11,7 +11,7 @@
# Modeled after libxml-config.
-version=1.6.46
+version=1.6.48
prefix=""
libdir=""
libs=""
Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in 2025-05-17 22:44:20 UTC (rev 964)
@@ -5,6 +5,6 @@
Name: libpng
Description: Loads and saves PNG files
-Version: 1.6.46
+Version: 1.6.48
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}
Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa 2025-05-17 22:44:20 UTC (rev 964)
@@ -711,7 +711,7 @@
# processing, it just validates the data in the PNG file.
option GAMMA disabled
-option COLORSPACE enables GAMMA disabled
+option COLORSPACE disabled
# When an ICC profile is read, or png_set, it will be checked for a match
# against known sRGB profiles if the sRGB handling is enabled. The
@@ -851,9 +851,9 @@
chunk eXIf
chunk gAMA enables GAMMA
chunk hIST
-chunk iCCP enables COLORSPACE, GAMMA
+chunk iCCP enables GAMMA
chunk iTXt enables TEXT
-chunk mDCV
+chunk mDCV enables COLORSPACE
chunk oFFs
chunk pCAL
chunk pHYs
@@ -860,7 +860,7 @@
chunk sBIT
chunk sCAL
chunk sPLT
-chunk sRGB enables COLORSPACE, GAMMA, SET_OPTION
+chunk sRGB enables GAMMA, SET_OPTION
chunk tEXt requires TEXT
chunk tIME
chunk tRNS
@@ -995,7 +995,8 @@
READ_EXPAND, READ_16BIT, READ_EXPAND_16, READ_SCALE_16_TO_8,
READ_RGB_TO_GRAY, READ_ALPHA_MODE, READ_BACKGROUND, READ_STRIP_ALPHA,
READ_FILLER, READ_SWAP, READ_PACK, READ_GRAY_TO_RGB, READ_GAMMA,
- READ_tRNS, READ_bKGD, READ_gAMA, READ_cHRM, READ_sRGB, READ_sBIT
+ READ_tRNS, READ_bKGD, READ_gAMA, READ_cHRM, READ_sRGB, READ_mDCV,
+ READ_cICP, READ_sBIT
# AFIRST and BGR read options:
# Prior to libpng 1.6.8 these were disabled but switched on if the low level
Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.46 */
+/* libpng version 1.6.48 */
/* Copyright (c) 2018-2025 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
Modified: branches/stable/source/src/libs/libpng/version.ac
===================================================================
--- branches/stable/source/src/libs/libpng/version.ac 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/libs/libpng/version.ac 2025-05-17 22:44:20 UTC (rev 964)
@@ -8,4 +8,4 @@
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current libpng version
-m4_define([libpng_version], [1.6.46])
+m4_define([libpng_version], [1.6.48])
Modified: branches/stable/source/src/tardate.ac
===================================================================
--- branches/stable/source/src/tardate.ac 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/tardate.ac 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,5 +1,5 @@
-dnl $Id: tardate.ac 70573 2024-03-10 21:37:05Z karl $
-dnl Copyright 2016-2024 Karl Berry <tex-live at tug.org>
+dnl $Id: tardate.ac 74485 2025-03-06 22:52:00Z karl $
+dnl Copyright 2016-2025 Karl Berry <tex-live at tug.org>
dnl Copyright 2010-2015 Peter Breitenlohner <tex-live at tug.org>
dnl
dnl This file is free software; the copyright holder
@@ -9,4 +9,4 @@
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current TeX Live tarball version
-m4_define([tex_live_tardate], [2024-03-10])
+m4_define([tex_live_tardate], [2025-03-07])
Modified: branches/stable/source/src/texk/README
===================================================================
--- branches/stable/source/src/texk/README 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/README 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-$Id: README 73838 2025-02-09 23:45:32Z takuji $
+$Id: README 74361 2025-02-28 23:31:39Z karl $
Copyright 2006-2025 TeX Users Group.
You may freely use, modify and/or distribute this file.
@@ -67,8 +67,8 @@
https://github.com/mgieseki/dvisvgm
https://ctan.org/pkg/dvisvgm
-gregorio 6.0.0 - checked 14mar21
- https://mirror.ctan.org/support/gregoriotex/gregorio-6.0.0.zip
+gregorio 6.1.0 - checked 28feb25
+ https://mirror.ctan.org/support/gregoriotex/
gsftopk - from Paul Vojta's xdvi.
Modified: branches/stable/source/src/texk/configure
===================================================================
--- branches/stable/source/src/texk/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for TeX Live texk 2025.
+# Generated by GNU Autoconf 2.72 for TeX Live texk 2026/dev.
#
# Report bugs to <tex-live at tug.org>.
#
@@ -603,8 +603,8 @@
# Identity of this package.
PACKAGE_NAME='TeX Live texk'
PACKAGE_TARNAME='tex-live-texk'
-PACKAGE_VERSION='2025'
-PACKAGE_STRING='TeX Live texk 2025'
+PACKAGE_VERSION='2026/dev'
+PACKAGE_STRING='TeX Live texk 2026/dev'
PACKAGE_BUGREPORT='tex-live at tug.org'
PACKAGE_URL=''
@@ -1471,7 +1471,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures TeX Live texk 2025 to adapt to many kinds of systems.
+'configure' configures TeX Live texk 2026/dev to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1542,7 +1542,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of TeX Live texk 2025:";;
+ short | recursive ) echo "Configuration of TeX Live texk 2026/dev:";;
esac
cat <<\_ACEOF
@@ -1839,7 +1839,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-TeX Live texk configure 2025
+TeX Live texk configure 2026/dev
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1999,7 +1999,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by TeX Live texk $as_me 2025, which was
+It was created by TeX Live texk $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -7617,7 +7617,7 @@
# Define the identity of the package.
PACKAGE='tex-live-texk'
- VERSION='2025'
+ VERSION='2026/dev'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -8722,7 +8722,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by TeX Live texk $as_me 2025, which was
+This file was extended by TeX Live texk $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8781,7 +8781,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-TeX Live texk config.status 2025
+TeX Live texk config.status 2026/dev
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: branches/stable/source/src/texk/kpathsea/ChangeLog
===================================================================
--- branches/stable/source/src/texk/kpathsea/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,29 @@
+2025-05-04 Karl Berry <karl at freefriends.org>
+
+ * expand.c (kpathsea_expand_kpse_dot): doc fix.
+
+2025-04-18 Karl Berry <karl at freefriends.org>
+
+ * c-ctype.h (kpse_isascii): new macro, since isascii() can
+ apparently longer be used portably, thanks to POSIX and gcc 15.
+ (ISALNUM, ..., ISBLANK): use it. Discussion:
+ https://tug.org/pipermail/tlbuild/2025q2/005743.html
+
+2025-04-08 Karl Berry <karl at freefriends.org>
+
+ * c-memstr.h (strtok, strstr): remove () fallback declarations,
+ since C23 considers that the same as (void). Apparently
+ HAVE_STRING_H was not defined, either.
+ Report from Hilmar, 3 Apr 2025 23:54:54.
+
+2025-03-08 Karl Berry <karl at tug.org>
+
+ * version.ac: 6.4.2/dev.
+
+2025-03-07 Karl Berry <karl at tug.org>
+
+ * TL'25 release.
+
2025-02-12 Karl Berry <karl at freefriends.org>
* texmf.cnf (shell_escape_commands): doc link to
Modified: branches/stable/source/src/texk/kpathsea/NEWS
===================================================================
--- branches/stable/source/src/texk/kpathsea/NEWS 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/NEWS 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,7 +1,7 @@
-$Id: NEWS 73591 2025-01-25 18:41:15Z karl $
+$Id: NEWS 74485 2025-03-06 22:52:00Z karl $
This file records noteworthy changes. (Public domain.)
-6.4.1 (for TeX Live 2025)
+6.4.1 (for TeX Live 2025, 7 March 2025)
* kpsewhich outputs a blank line when a given file cannot be found,
if more than one file to search for is specified.
Modified: branches/stable/source/src/texk/kpathsea/c-auto.in
===================================================================
--- branches/stable/source/src/texk/kpathsea/c-auto.in 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/c-auto.in 2025-05-17 22:44:20 UTC (rev 964)
@@ -23,7 +23,7 @@
#define KPATHSEA_C_AUTO_H
/* kpathsea: the version string. */
-#define KPSEVERSION "kpathsea version 6.4.1"
+#define KPSEVERSION "kpathsea version 6.4.2/dev"
/* Define to 1 if the 'closedir' function returns void instead of int. */
#undef CLOSEDIR_VOID
Modified: branches/stable/source/src/texk/kpathsea/c-ctype.h
===================================================================
--- branches/stable/source/src/texk/kpathsea/c-ctype.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/c-ctype.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
/* c-ctype.h: ASCII-safe versions of the <ctype.h> macros.
- Copyright 1992, 1994, 2008, 2010, 2011, 2015 Karl Berry.
+ Copyright 1992, 1994, 2008, 2010, 2011, 2015, 2025 Karl Berry.
Copyright 1998, 2000, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -28,28 +28,42 @@
#endif
#endif
-#define ISALNUM(c) (isascii (c) && isalnum((unsigned char)c))
-#define ISALPHA(c) (isascii (c) && isalpha((unsigned char)c))
-#define ISASCII isascii
-#define ISCNTRL(c) (isascii (c) && iscntrl((unsigned char)c))
-#define ISDIGIT(c) (isascii (c) && isdigit ((unsigned char)c))
-#define ISGRAPH(c) (isascii (c) && isgraph((unsigned char)c))
-#define ISLOWER(c) (isascii (c) && islower((unsigned char)c))
-#define ISPRINT(c) (isascii (c) && isprint((unsigned char)c))
-#define ISPUNCT(c) (isascii (c) && ispunct((unsigned char)c))
-#define ISSPACE(c) (isascii (c) && isspace((unsigned char)c))
-#define ISUPPER(c) (isascii (c) && isupper((unsigned char)c))
-#define ISXDIGIT(c) (isascii (c) && isxdigit((unsigned char)c))
+/* However, we don't use isascii, since POSIX + compilers have made it
+ impossible to do so portably (first failure reports for gcc 15;
+ underlying reason is unclear). Leave the definition above just
+ because we've always defined it, but for our use here, apparently we
+ now have to define and use our own macro. Discussion:
+ https://tug.org/pipermail/tlbuild/2025q2/005743.html */
+
+/* We want to possibly accept integers as an argument, because of the
+ old problems described in the comment below. So cast to unsigned
+ since otherwise checking for (i)>0 runs the risk of more useless
+ compiler warnings/errors about redundant comparisons. */
+#define kpse_isascii(i) ((unsigned) (i) <= 127)
+
+#define ISALNUM(c) (kpse_isascii (c) && isalnum((unsigned char)c))
+#define ISALPHA(c) (kpse_isascii (c) && isalpha((unsigned char)c))
+#define KPSE_ISASCII kpse_isascii
+#define ISCNTRL(c) (kpse_isascii (c) && iscntrl((unsigned char)c))
+#define ISDIGIT(c) (kpse_isascii (c) && isdigit ((unsigned char)c))
+#define ISGRAPH(c) (kpse_isascii (c) && isgraph((unsigned char)c))
+#define ISLOWER(c) (kpse_isascii (c) && islower((unsigned char)c))
+#define ISPRINT(c) (kpse_isascii (c) && isprint((unsigned char)c))
+#define ISPUNCT(c) (kpse_isascii (c) && ispunct((unsigned char)c))
+#define ISSPACE(c) (kpse_isascii (c) && isspace((unsigned char)c))
+#define ISUPPER(c) (kpse_isascii (c) && isupper((unsigned char)c))
+#define ISXDIGIT(c) (kpse_isascii (c) && isxdigit((unsigned char)c))
#define TOASCII toascii
#define TOLOWER(c) (ISUPPER (c) ? tolower ((unsigned char)c) : (c))
#define TOUPPER(c) (ISLOWER (c) ? toupper ((unsigned char)c) : (c))
-/* This isn't part of the usual <ctype.h>, but it's useful sometimes. */
+/* This isn't part of the usual <ctype.h>, but it's useful sometimes.
+ We don't consider vertical tab blank, since in normal use, it isn't. */
#ifndef isblank
#define isblank(c) ((c) == ' ' || (c) == '\t')
#endif
-#define ISBLANK(c) (isascii (c) && isblank ((unsigned char)c))
+#define ISBLANK(c) (kpse_isascii (c) && isblank ((unsigned char)c))
/* Here's why this mess is necessary:
@@ -70,7 +84,7 @@
own versions of the ctype macros.
A pretty clean approach to using <ctype.h> and isascii was
- suggested by David MacKenzie:
+ suggested by David MacKenzie: [but as of 2025, no longer works; see above]
#ifndef isascii
#define isascii(c) 1
Modified: branches/stable/source/src/texk/kpathsea/c-memstr.h
===================================================================
--- branches/stable/source/src/texk/kpathsea/c-memstr.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/c-memstr.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -53,11 +53,4 @@
#define memcpy(to, from, len) bcopy ((from), (to), (len))
#endif
-#if !defined(HAVE_STRING_H)
-extern char *strtok ();
-#ifndef strstr
-extern char *strstr ();
-#endif
-#endif
-
#endif /* not KPATHSEA_C_MEMSTR_H */
Modified: branches/stable/source/src/texk/kpathsea/configure
===================================================================
--- branches/stable/source/src/texk/kpathsea/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for Kpathsea 6.4.1.
+# Generated by GNU Autoconf 2.72 for Kpathsea 6.4.2/dev.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -614,8 +614,8 @@
# Identity of this package.
PACKAGE_NAME='Kpathsea'
PACKAGE_TARNAME='kpathsea'
-PACKAGE_VERSION='6.4.1'
-PACKAGE_STRING='Kpathsea 6.4.1'
+PACKAGE_VERSION='6.4.2/dev'
+PACKAGE_STRING='Kpathsea 6.4.2/dev'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1376,7 +1376,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures Kpathsea 6.4.1 to adapt to many kinds of systems.
+'configure' configures Kpathsea 6.4.2/dev to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1447,7 +1447,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Kpathsea 6.4.1:";;
+ short | recursive ) echo "Configuration of Kpathsea 6.4.2/dev:";;
esac
cat <<\_ACEOF
@@ -1576,7 +1576,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Kpathsea configure 6.4.1
+Kpathsea configure 6.4.2/dev
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2357,7 +2357,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Kpathsea $as_me 6.4.1, which was
+It was created by Kpathsea $as_me 6.4.2/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -3137,14 +3137,14 @@
-KPSEVERSION=6.4.1
+KPSEVERSION=6.4.2/dev
-KPSE_LT_VERSINFO=10:1:4
+KPSE_LT_VERSINFO=10:2:4
- WEB2CVERSION=" (TeX Live 2025)"
+ WEB2CVERSION=" (TeX Live 2026/dev)"
am__api_version='1.17'
@@ -9259,7 +9259,7 @@
# Define the identity of the package.
PACKAGE='kpathsea'
- VERSION='6.4.1'
+ VERSION='6.4.2/dev'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -16888,7 +16888,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Kpathsea $as_me 6.4.1, which was
+This file was extended by Kpathsea $as_me 6.4.2/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16956,7 +16956,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-Kpathsea config.status 6.4.1
+Kpathsea config.status 6.4.2/dev
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: branches/stable/source/src/texk/kpathsea/expand.c
===================================================================
--- branches/stable/source/src/texk/kpathsea/expand.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/expand.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,7 +1,7 @@
/* expand.c: general expansion.
Copyright 1993, 1994, 1995, 1996, 1997, 2005, 2008, 2009, 2011,
- 2012, 2016, 2017 Karl Berry.
+ 2012, 2016, 2017, 2025 Karl Berry.
Copyright 1997-2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -50,7 +50,7 @@
static str_list_type brace_expand (kpathsea, const_string*);
/* If $KPSE_DOT is defined in the environment, prepend it to any relative
- path components. */
+ path components in PATH and return result in new memory. */
static string
kpathsea_expand_kpse_dot (kpathsea kpse, string path)
@@ -63,7 +63,7 @@
if (kpse_dot == NULL)
return path;
- ret = (string)xmalloc(1);
+ ret = (string) xmalloc(1);
*ret = 0;
#ifdef MSDOS
@@ -84,26 +84,33 @@
elt = kpathsea_path_element (kpse, NULL)) {
string save_ret = ret;
boolean ret_copied = true;
- /* We assume that the !! magic is only used on absolute components.
- Single "." gets special treatment, as does "./" or its equivalent. */
+ /* We assume that the !! magic is only used on absolute components. */
if (kpathsea_absolute_p (kpse, elt, false)
|| (elt[0] == '!' && elt[1] == '!')) {
- ret = concat3(ret, elt, ENV_SEP_STRING);
+ ret = concat3 (ret, elt, ENV_SEP_STRING);
+
+ /* Path element is sole '.' -> replace with kpse_dot. */
} else if (elt[0] == '.' && elt[1] == 0) {
ret = concat3 (ret, kpse_dot, ENV_SEP_STRING);
+
#ifndef VMS
+ /* Path element is './foo' -> replace the '.' with kpse_dot. */
} else if (elt[0] == '.' && IS_DIR_SEP(elt[1])) {
ret = concatn (ret, kpse_dot, elt + 1, ENV_SEP_STRING, NULL);
+
+ /* Path element is anything element -> prepend "kpse_dot/" to elt. */
} else if (*elt) {
ret = concatn (ret, kpse_dot, DIR_SEP_STRING, elt, ENV_SEP_STRING, NULL);
#endif
+
} else {
/* omit empty path elements from TEXMFCNF.
- See http://bugs.debian.org/358330. */
+ See https://bugs.debian.org/358330. */
ret_copied = false;
}
- if (ret_copied)
+ if (ret_copied) {
free (save_ret);
+ }
}
#ifdef MSDOS
Modified: branches/stable/source/src/texk/kpathsea/version.ac
===================================================================
--- branches/stable/source/src/texk/kpathsea/version.ac 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/kpathsea/version.ac 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-dnl $Id: version.ac 73591 2025-01-25 18:41:15Z karl $
+dnl $Id: version.ac 74529 2025-03-08 18:17:45Z karl $
dnl Copyright 2016-2025 Karl Berry <tex-live at tug.org>
dnl Copyright 2011-2015 Peter Breitenlohner <tex-live at tug.org>
dnl
@@ -23,4 +23,4 @@
dnl --------------------------------------------------------
dnl
dnl This file is m4-included from configure.ac.
-m4_define([kpse_version], [6.4.1])
+m4_define([kpse_version], [6.4.2/dev])
Modified: branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm
===================================================================
--- branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm 2025-05-17 22:44:20 UTC (rev 964)
@@ -7,7 +7,7 @@
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 73770 $';
+my $svnrev = '$Revision: 74083 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -3665,6 +3665,9 @@
tlwarn("Updating $dest, backup copy in $dest.backup\n");
copy("-f", $dest, "$dest.backup");
}
+ # ensure destination directory exists.
+ my $destdir = dirname ($dest);
+ -d $destdir || mkdirhier $destdir; # if fails, the next open will die.
open(OUTFILE,">$dest")
or die("Cannot open $dest for writing: $!");
@@ -3684,6 +3687,7 @@
my $default_lefthyphenmin = -1;
my $default_righthyphenmin = -1;
$ret{"synonyms"} = [];
+ $ret{"databases"} = ["dat", "def", "lua"];
for my $p (quotewords('\s+', 0, "$line")) {
my ($a, $b) = split /=/, $p;
if ($a eq "name") {
@@ -3738,7 +3742,7 @@
}
if ($a eq "databases") {
if (!$b) {
- $ret{"error"} = "AddHyphen line needs databases=something: $line";
+ $ret{"error"} = "AddHyphen line needs databases=foo[,bar]: $line";
return %ret;
}
@{$ret{"databases"}} = split /,/, $b;
@@ -3746,7 +3750,7 @@
}
if ($a eq "synonyms") {
if (!$b) {
- $ret{"error"} = "AddHyphen line needs synonyms=something: $line";
+ $ret{"error"} = "AddHyphen line needs synonyms=foo[,bar]: $line";
return %ret;
}
@{$ret{"synonyms"}} = split /,/, $b;
@@ -3776,15 +3780,6 @@
. " righthyphenmin ($ret{righthyphenmin}): $line";
return %ret;
}
- # this default value couldn't be set earlier
- if (not defined($ret{"databases"})) {
- if (defined $ret{"file_patterns"} or defined $ret{"file_exceptions"}
- or defined $ret{"luaspecial"}) {
- @{$ret{"databases"}} = qw(dat def lua);
- } else {
- @{$ret{"databases"}} = qw(dat def);
- }
- }
return %ret;
}
Modified: branches/stable/source/src/texk/web2c/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,75 @@
+2025-05-05 Karl Berry <karl at freefriends.org>
+
+ * tex.ch (26.449): avoid spurious additional errors
+ from \mkern <non-mu-dimen-or-skip>. Fix from David Fuchs.
+ Report from Tyge Tiessen,
+ https://tug.org/pipermail/tex-k/2025-January/004150.html
+ https://tug.org/texmfbug/newbug.html#B182muerror
+ * tests/invalidmu.tex: test file.
+
+2025-04-30 Andreas Scherer <https://ascherer.github.io>
+
+ * cwebboot.cin,
+ * help.h: Restore 'verbose' diagnostics in CWEB.
+
+2025-04-18 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: Amend special characters.
+
+2025-04-17 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: Make proper use of 'ishigh' macro.
+
+2025-04-09 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: Replace type 'boolean' with 'bool.
+
+2025-04-09 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: Revert bool change for C23.
+
+2025-03-31 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: Discard trailing whitespace in macros.
+
+2025-03-12 Andreas Scherer <https://ascherer.github.io>
+
+ * weave.ch: Prevent get_line() when parsing module name.
+ Report and patch from Benjamin Gray
+ (https://tug.org/pipermail/tex-k/2025-March/004166.html).
+
+2025-03-12 Andreas Scherer <https://ascherer.github.io>
+
+ * weave.ch: Parse and reject verbatim in TeX part.
+ Report and patch from Benjamin Gray
+ (https://tug.org/pipermail/tex-k/2025-March/004169.html).
+
+2025-03-11 Andreas Scherer <https://ascherer.github.io>
+
+ * tangle.ch,
+ * tangleboot.pin: Prevent integer overflow in scan_numeric().
+ Report and initial patch from Benjamin Gray
+ (https://tug.org/pipermail/tex-k/2025-March/004165.html).
+
+2025-03-10 Andreas Scherer <https://ascherer.github.io>
+
+ * tangle.ch,
+ * tangleboot.pin: Reject strings as macro names.
+ Report and initial patch from Benjamin Gray
+ (https://tug.org/pipermail/tex-k/2025-March/004163.html).
+
+2025-03-10 Andreas Scherer <https://ascherer.github.io>
+
+ * tangle.ch,
+ * tangleboot.pin: Change case for letters only.
+ Report and initial patch from Benjamin Gray
+ (https://tug.org/pipermail/tex-k/2025-March/004161.html).
+
2025-02-01 Karl Berry <karl at freefriends.org>
* tex.ch (24.336): comment out this patch for interactive deletion
@@ -201,13 +273,13 @@
* tex.ch (check_outer_validity): don't check unless OK_to_interrupt,
to avoid getting into an erroneous state if an \outer token
is deleted interactively.
- Report from Tyge Thiessen:
+ Report from Tyge Tiessen:
https://tug.org/pipermail/tex-k/2024-March/004021.html
DEK bug entry: https://tug.org/texmfbug/newbug.html#B142outer
2024-06-03 Karl Berry <karl at freefriends.org>
- * tests/fix-changefile-lines.py: new script from Tyge Thiessen
+ * tests/fix-changefile-lines.py: new script from Tyge Tiessen
to update the chapter/section/line numbers in a .ch file,
following my request:
https://tug.org/pipermail/tex-k/2024-June/004064.html
Modified: branches/stable/source/src/texk/web2c/Makefile.in
===================================================================
--- branches/stable/source/src/texk/web2c/Makefile.in 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/Makefile.in 2025-05-17 22:44:20 UTC (rev 964)
@@ -3256,7 +3256,6 @@
ptexdir/ptex.defines ptexdir/COPYRIGHT ptexdir/COPYRIGHT.jis \
ptexdir/ChangeLog ptexdir/Changes.txt ptexdir/INSTALL.txt \
ptexdir/README.txt $(ptex_tests) $(pweb_tests) \
- ptexdir/tests/nissya.bst ptexdir/tests/sample.bib \
tests/testfield.bst tests/enc-asc.bib tests/enc-jis.bib \
tests/enc-sjis.bib tests/enc-euc.bib tests/enc-utf8.bib \
tests/enc-utf8a.bib tests/enc-utf8b.bib tests/enc-amb0.bib \
@@ -3264,69 +3263,94 @@
tests/enc-e.aux tests/enc-s.aux tests/enc-u.aux \
tests/enc-p.bbl tests/enc-ep.bbl tests/enc-sp.bbl \
tests/enc-up.bbl tests/memdata1.bst tests/memdata2.bst \
- tests/memdata3.bst ptexdir/tests/ptex3.tex \
- ptexdir/tests/ptex3.dvi ptexdir/tests/ptex4.tex \
- ptexdir/tests/ptex4.dvi ptexdir/tests/ptex3a-jis.typ \
- ptexdir/tests/ptex3a-utf8.typ ptexdir/tests/ptex4a-jis.typ \
- ptexdir/tests/ptex4a-utf8.typ ptexdir/tests/goth10.tfm \
- ptexdir/tests/sample.dvi ptexdir/tests/samplea.typ \
- ptexdir/tests/min10.pl ptexdir/tests/min10.tfm \
- ptexdir/tests/tmin10.pl ptexdir/tests/tmin10.tfm \
- ptexdir/tests/chcode.pl ptexdir/tests/chcode-jis.pl \
- ptexdir/tests/chcode.tfm ptexdir/tests/chcode-utf8.pl \
- ptexdir/tests/chcode-euc.pl ptexdir/tests/chcode-sjis.pl \
- ptexdir/tests/skipjfmp.pl ptexdir/tests/skipjfmp.tfm \
- ptexdir/ptrip/ptrip.diffs ptexdir/ptrip/texmf.cnf \
- ptexdir/tests/ctrlsym.tex ptexdir/tests/ctrlsym.log \
- ptexdir/tests/endlinechar.tex ptexdir/tests/endline.log \
- ptexdir/tests/control-symbol.tex ptexdir/tests/jctrlsym.log \
- ptexdir/tests/p-endlinea.typ ptexdir/tests/p-jctrlsyma.typ \
- ptexdir/tests/let_char_token.tex ptexdir/tests/chartoken.log \
- ptexdir/tests/ptexlineendmode.tex ptexdir/tests/p-lineenda.typ \
- ptexdir/tests/printkanji.tex ptexdir/tests/pknj-s.log \
- ptexdir/tests/pknj-e.log ptexdir/tests/p-pknj-sa.typ \
- ptexdir/tests/p-pknj-ea.typ ptexdir/tests/ucs.tex \
- ptexdir/tests/ucs-s.log ptexdir/tests/ucs-e.log \
- ptexdir/tests/p-jchwidow.log $(uptex_web_srcs) \
+ tests/memdata3.bst ptexdir/ptrip/ptrip.diffs \
+ ptexdir/ptrip/texmf.cnf ptexdir/tests/pver1.tex \
+ ptexdir/tests/pver2.tex ptexdir/tests/ctrlsym.tex \
+ ptexdir/tests/ctrlsym.log ptexdir/tests/endlinechar.tex \
+ ptexdir/tests/endline.log ptexdir/tests/control-symbol.tex \
+ ptexdir/tests/jctrlsym.log ptexdir/tests/p-endlinea.typ \
+ ptexdir/tests/p-jctrlsyma.typ ptexdir/tests/let_char_token.tex \
+ ptexdir/tests/chartoken.log ptexdir/tests/ptexlineendmode.tex \
+ ptexdir/tests/p-lineenda.typ ptexdir/tests/printkanji.tex \
+ ptexdir/tests/pknj-s.log ptexdir/tests/pknj-e.log \
+ ptexdir/tests/p-pknj-sa.typ ptexdir/tests/p-pknj-ea.typ \
+ ptexdir/tests/ucs.tex ptexdir/tests/ucs-s.log \
+ ptexdir/tests/ucs-e.log ptexdir/tests/p-jchwidow-e.log \
+ ptexdir/tests/p-jchwidow-s.log $(uptex_web_srcs) \
$(uptex_ch_srcs) uptexdir/uptex.defines uptexdir/upbibtex.ch \
uptexdir/updvitype.ch uptexdir/uppltotf.ch \
uptexdir/uptftopl.ch uptexdir/COPYRIGHT uptexdir/COPYRIGHT.ja \
uptexdir/ChangeLog $(uptex_tests) $(upweb_tests) \
+ uptexdir/tests/nissya.bst uptexdir/tests/sample.bib \
+ uptexdir/tests/nissya_bib.aux uptexdir/tests/nissya_bib.bbl \
tests/enc-u.bbl tests/enc-eu.bbl tests/enc-su.bbl \
- tests/enc-uu.bbl uptexdir/tests/uptex3.tex \
+ tests/enc-uu.bbl uptexdir/tests/ptex3.tex \
+ uptexdir/tests/ptex3.dvi uptexdir/tests/ptex4.tex \
+ uptexdir/tests/ptex4.dvi uptexdir/tests/ptex3a-jis.typ \
+ uptexdir/tests/ptex3a-utf8.typ uptexdir/tests/ptex4a-jis.typ \
+ uptexdir/tests/ptex4a-utf8.typ uptexdir/tests/uptex3.tex \
uptexdir/tests/uptex3.dvi uptexdir/tests/uptex4.tex \
uptexdir/tests/uptex4.dvi uptexdir/tests/uptex5.tex \
uptexdir/tests/uptex5.dvi uptexdir/tests/uptex3a.typ \
uptexdir/tests/uptex4a.typ uptexdir/tests/uptex5a.typ \
- uptexdir/tests/umin10.pl uptexdir/tests/umin10.tfm \
- uptexdir/tests/utmin10.pl uptexdir/tests/utmin10.tfm \
- uptexdir/tests/testnewu.pl uptexdir/tests/testnewu.tfm \
- uptexdir/tests/testnewu8.pl uptexdir/tests/testnewu8.tfm \
- uptexdir/tests/uparse.pl uptexdir/tests/uparse.tfm \
- uptexdir/tests/gkhugeok.tfm uptexdir/tests/gkhugeng.tfm \
- uptexdir/tests/gkhugeng.err uptexdir/tests/gk256g.tfm \
- uptexdir/tests/gk256k.tfm uptexdir/uptrip/uptrip.diffs \
- uptexdir/uptrip/texmf.cnf uptexdir/tests/up-ofm.tex \
- uptexdir/tests/up-ofm.log uptexdir/tests/up-ofma.typ \
- uptexdir/tests/up-prim.tex uptexdir/tests/up-prim.log \
- uptexdir/tests/lmr1.tex uptexdir/tests/up-lmr1.log \
- uptexdir/tests/lmr2.tex uptexdir/tests/up-lmr2.log \
- uptexdir/tests/catcd.tex uptexdir/tests/up-cat.log \
- uptexdir/tests/noto1.tex uptexdir/tests/up-noto1.log \
- uptexdir/tests/jchwidow.tex uptexdir/tests/up-jchwidow.log \
- $(euptex_web_srcs) $(euptex_ch_srcs) euptexdir/euptex.defines \
- euptexdir/COPYRIGHT euptexdir/COPYRIGHT.jis \
- euptexdir/ChangeLog euptexdir/EUPTEX.txt $(euptex_tests) \
+ uptexdir/tests/goth10.tfm uptexdir/tests/sample.dvi \
+ uptexdir/tests/samplea.typ uptexdir/tests/min10.pl \
+ uptexdir/tests/min10.tfm uptexdir/tests/tmin10.pl \
+ uptexdir/tests/tmin10.tfm uptexdir/tests/chcode.pl \
+ uptexdir/tests/chcode-jis.pl uptexdir/tests/chcode.tfm \
+ ptexdir/tests/chcode-utf8.pl uptexdir/tests/chcode-euc.pl \
+ uptexdir/tests/chcode-sjis.pl uptexdir/tests/umin10.pl \
+ uptexdir/tests/umin10.tfm uptexdir/tests/utmin10.pl \
+ uptexdir/tests/utmin10.tfm uptexdir/tests/testnewu.pl \
+ uptexdir/tests/testnewu.tfm uptexdir/tests/testnewu8.pl \
+ uptexdir/tests/testnewu8.tfm uptexdir/tests/uparse.pl \
+ uptexdir/tests/uparse.tfm uptexdir/tests/gkhugeok.tfm \
+ uptexdir/tests/gkhugeng.tfm uptexdir/tests/gkhugeng.err \
+ uptexdir/tests/gk256g.tfm uptexdir/tests/gk256k.tfm \
+ uptexdir/tests/skipjfmp.pl uptexdir/tests/skipjfmp.tfm \
+ uptexdir/tests/skipjfmp.tex uptexdir/uptrip/uptrip.diffs \
+ uptexdir/uptrip/texmf.cnf uptexdir/tests/pver1.tex \
+ uptexdir/tests/pver2.tex uptexdir/tests/ctrlsym.tex \
+ uptexdir/tests/ctrlsym-e.log uptexdir/tests/ctrlsym-u.log \
+ uptexdir/tests/endlinechar.tex uptexdir/tests/endline.log \
+ uptexdir/tests/control-symbol.tex \
+ uptexdir/tests/jctrlsym-e.log uptexdir/tests/jctrlsym-u.log \
+ uptexdir/tests/up-endlinea.typ \
+ uptexdir/tests/up-jctrlsyma-e.typ \
+ uptexdir/tests/up-jctrlsyma-u.typ \
+ uptexdir/tests/let_char_token.tex uptexdir/tests/chartoken.log \
+ uptexdir/tests/ptexlineendmode.tex \
+ uptexdir/tests/up-lineenda.typ uptexdir/tests/printkanji.tex \
+ uptexdir/tests/pknj-s.log uptexdir/tests/pknj-e.log \
+ uptexdir/tests/pknj-u.log uptexdir/tests/up-pknj-sa.typ \
+ uptexdir/tests/up-pknj-ea.typ uptexdir/tests/up-pknj-ua.typ \
+ uptexdir/tests/up-ofm.tex uptexdir/tests/up-ofm.log \
+ uptexdir/tests/up-ofma.typ uptexdir/tests/up-prim.tex \
+ uptexdir/tests/up-prim.log uptexdir/tests/lmr1.tex \
+ uptexdir/tests/up-lmr1.log uptexdir/tests/lmr2.tex \
+ uptexdir/tests/up-lmr2.log uptexdir/tests/catcd.tex \
+ uptexdir/tests/up-cat.log uptexdir/tests/noto1.tex \
+ uptexdir/tests/up-noto1.log uptexdir/tests/ucs.tex \
+ uptexdir/tests/ucs-s.log uptexdir/tests/ucs-e.log \
+ uptexdir/tests/ucs-u.log uptexdir/tests/jchwidow.tex \
+ uptexdir/tests/up-jchwidow-s.log \
+ uptexdir/tests/up-jchwidow-e.log \
+ uptexdir/tests/up-jchwidow.log $(euptex_web_srcs) \
+ $(euptex_ch_srcs) euptexdir/euptex.defines euptexdir/COPYRIGHT \
+ euptexdir/COPYRIGHT.jis euptexdir/ChangeLog \
+ euptexdir/EUPTEX.txt $(euptex_tests) \
euptexdir/eptrip/eptrip.log euptexdir/eptrip/eptrip.tex \
euptexdir/euptrip/euptrip.diffs euptexdir/euptrip/texmf.cnf \
euptexdir/pdfprimitive.test \
euptexdir/tests/pdfprimitive-test.tex \
euptexdir/tests/pdfprimitive-euptex.log \
- euptexdir/tests/ctrlsym.tex euptexdir/tests/ctrlsym.log \
- euptexdir/tests/endlinechar.tex euptexdir/tests/endline.log \
- euptexdir/tests/control-symbol.tex \
- euptexdir/tests/jctrlsym.log euptexdir/tests/eup-endlinea.typ \
- euptexdir/tests/eup-jctrlsyma.typ \
+ euptexdir/tests/ctrlsym.tex euptexdir/tests/ctrlsym-e.log \
+ euptexdir/tests/ctrlsym-u.log euptexdir/tests/endlinechar.tex \
+ euptexdir/tests/endline.log euptexdir/tests/control-symbol.tex \
+ euptexdir/tests/jctrlsym-e.log euptexdir/tests/jctrlsym-u.log \
+ euptexdir/tests/eup-endlinea.typ \
+ euptexdir/tests/eup-jctrlsyma-e.typ \
+ euptexdir/tests/eup-jctrlsyma-u.typ \
euptexdir/tests/printkanji.tex euptexdir/tests/pknj-s.log \
euptexdir/tests/pknj-e.log euptexdir/tests/pknj-u.log \
euptexdir/tests/eup-pknj-sa.typ \
@@ -3343,23 +3367,24 @@
euptexdir/tests/eup-ofm.log euptexdir/tests/eup-prim.tex \
euptexdir/tests/eup-prim.log euptexdir/tests/ucs.tex \
euptexdir/tests/ucs-s.log euptexdir/tests/ucs-e.log \
- euptexdir/tests/ucs-u.log euptexdir/tests/eup-jchwidow.log \
- hitexdir/ChangeLog $(hitex_web) $(hitex_tests) \
- hitexdir/tests/hello.tex hitexdir/tests/rule.tex \
- pdftexdir/regex/COPYING.LIB pdftexdir/regex/README \
- $(pdftex_ch_srcs) pdftexdir/pdftex.defines pdftexdir/ChangeLog \
- pdftexdir/NEWS pdftexdir/README pdftexdir/change-files.txt \
- $(pdftex_tests) tests/wprob.tex pdftexdir/tests/pdfimage.tex \
- tests/1-4.jpg tests/B.pdf tests/basic.tex \
- tests/lily-ledger-broken.png tests/expanded.tex \
- tests/expanded.txt tests/cnfline.tex tests/partoken-ok.tex \
- tests/partoken-xfail.tex $(ttf2afm_tests) \
- pdftexdir/tests/postV3.afm pdftexdir/tests/postV3.ttf \
- pdftexdir/tests/postV7.afm pdftexdir/tests/postV7.ttf \
- $(pdftosrc_tests) pdftexdir/tests/test-13.pdf \
- pdftexdir/tests/test-13.xref pdftexdir/tests/test-15.pdf \
- pdftexdir/tests/test-15.xref $(libluasocket_sources) \
- luatexdir/luasocket/src/ftp_lua.c \
+ euptexdir/tests/ucs-u.log euptexdir/tests/eup-jchwidow-s.log \
+ euptexdir/tests/eup-jchwidow-e.log \
+ euptexdir/tests/eup-jchwidow.log hitexdir/ChangeLog \
+ $(hitex_web) $(hitex_tests) hitexdir/tests/hello.tex \
+ hitexdir/tests/rule.tex pdftexdir/regex/COPYING.LIB \
+ pdftexdir/regex/README $(pdftex_ch_srcs) \
+ pdftexdir/pdftex.defines pdftexdir/ChangeLog pdftexdir/NEWS \
+ pdftexdir/README pdftexdir/change-files.txt $(pdftex_tests) \
+ tests/wprob.tex pdftexdir/tests/pdfimage.tex tests/1-4.jpg \
+ tests/B.pdf tests/basic.tex tests/lily-ledger-broken.png \
+ tests/expanded.tex tests/expanded.txt tests/cnfline.tex \
+ tests/partoken-ok.tex tests/partoken-xfail.tex \
+ $(ttf2afm_tests) pdftexdir/tests/postV3.afm \
+ pdftexdir/tests/postV3.ttf pdftexdir/tests/postV7.afm \
+ pdftexdir/tests/postV7.ttf $(pdftosrc_tests) \
+ pdftexdir/tests/test-13.pdf pdftexdir/tests/test-13.xref \
+ pdftexdir/tests/test-15.pdf pdftexdir/tests/test-15.xref \
+ $(libluasocket_sources) luatexdir/luasocket/src/ftp_lua.c \
luatexdir/luasocket/src/headers_lua.c \
luatexdir/luasocket/src/http_lua.c \
luatexdir/luasocket/src/ltn12_lua.c \
@@ -3654,33 +3679,32 @@
ptex.pool ptex-tangle $(pweb_programs:=.c) \
$(pweb_programs:=.h) $(pweb_programs:=.p) \
$(pweb_programs:=-web2c) $(pweb_programs:=.web) \
- ptests/nissya_bib.* ptests/xexampl.aux ptests/xexampl.bbl \
- ptests/xexampl.blg ptests/xenc*.* ptests/fn*.* \
- ptests/memtest.bib ptests/memtest?.* ptests/xstory.dvityp \
- ptests/xpagenum.typ ptests/xptex[34]*.typ ptests/xcmr10.tfm \
- ptests/xcmr10.pl ptests/xsample*.typ ptests/x*min10.* \
- ptests/xchcode*.* ptests/xskipjfmp.* ptrip.diffs p-ctrlsym.log \
- p-ctrlsym.out p-ctrlsym.tex p-endline*.* p-jctrlsym*.* \
- p-chartoken.* p-lineend.* p-pknj-*.* p-ucs*.* p-jchwidow*.* \
- $(nodist_uptex_SOURCES) uptex.web uptex.ch uptex-web2c uptex.p \
- uptex.pool uptex-tangle $(upweb_programs:=.c) \
- $(upweb_programs:=.h) $(upweb_programs:=.p) \
- $(upweb_programs:=-web2c) $(upweb_programs:=.web) \
- uptests/nissya_bib.* uptests/xexampl.aux uptests/xexampl.bbl \
- uptests/xexampl.blg uptests/xenc*.* uptests/fn*.* \
- uptests/memtest.bib uptests/memtest?.* uptests/xstory.dvityp \
- uptests/xpagenum.typ uptests/x*ptex[345]*.typ \
- uptests/xcmr10.tfm uptests/xcmr10.pl uptests/xsample*.typ \
- uptests/x*min10.* uptests/xchcode*.* uptests/xtestnewu*.* \
- uptests/xuparse.* uptests/yuparse.* uptests/ygkhuge*.* \
- uptests/ygk256*.* uptests/xskipjfmp.* uptrip.diffs up-ofm.* \
- up-prim.* up-lmr*.* up-cat.* up-noto*.* up-jchwidow.* \
- $(nodist_euptex_SOURCES) euptex.web euptex.ch euptex-web2c \
- euptex.p euptex.pool euptex-tangle euptrip.diffs \
- pdfprimitive-euptex.* eup-ctrlsym.log eup-ctrlsym.out \
- eup-ctrlsym.tex eup-endline*.* eup-jctrlsym*.* eup-pknj-*.* \
- eup-postpena*.* eup-free_*.* eup-inhibitglue*.* eup-kinsoku*.* \
- eup-ofm.* eup-prim.* eup-ucs*.* eup-jchwidow.* \
+ ptests/xexampl.aux ptests/xexampl.bbl ptests/xexampl.blg \
+ ptests/xenc*.* ptests/fn*.* ptests/memtest.bib \
+ ptests/memtest?.* ptests/xcmr10.tfm ptests/xcmr10.pl \
+ ptrip.diffs p-ctrlsym.log p-ctrlsym.out p-ctrlsym.tex \
+ p-endline*.* p-jctrlsym*.* p-chartoken.* p-lineend.* \
+ p-pknj-*.* p-ucs*.* p-jchwidow*.* $(nodist_uptex_SOURCES) \
+ uptex.web uptex.ch uptex-web2c uptex.p uptex.pool uptex-tangle \
+ $(upweb_programs:=.c) $(upweb_programs:=.h) \
+ $(upweb_programs:=.p) $(upweb_programs:=-web2c) \
+ $(upweb_programs:=.web) uptests/nissya_bib.* \
+ uptests/xexampl.aux uptests/xexampl.bbl uptests/xexampl.blg \
+ uptests/xenc*.* uptests/fn*.* uptests/memtest.bib \
+ uptests/memtest?.* uptests/xstory.dvityp uptests/xpagenum.typ \
+ uptests/x*ptex[345]*.typ uptests/xcmr10.tfm uptests/xcmr10.pl \
+ uptests/xsample*.typ uptests/x*min10.* uptests/xchcode*.* \
+ uptests/xtestnewu*.* uptests/xuparse.* uptests/yuparse.* \
+ uptests/ygkhuge*.* uptests/ygk256*.* uptests/xskipjfmp.* \
+ uptrip.diffs up-ctrlsym.log up-ctrlsym.out up-ctrlsym.tex \
+ up-endline*.* up-jctrlsym*.* up-chartoken.* up-lineend.* \
+ up-pknj-*.* up-ofm.* up-prim.* up-lmr*.* up-cat.* up-noto*.* \
+ up-ucs*.* up-jchwidow*.* $(nodist_euptex_SOURCES) euptex.web \
+ euptex.ch euptex-web2c euptex.p euptex.pool euptex-tangle \
+ euptrip.diffs pdfprimitive-euptex.* eup-ctrlsym.log \
+ eup-ctrlsym.out eup-ctrlsym.tex eup-endline*.* eup-jctrlsym*.* \
+ eup-pknj-*.* eup-postpena*.* eup-free_*.* eup-inhibitglue*.* \
+ eup-kinsoku*.* eup-ofm.* eup-prim.* eup-ucs*.* eup-jchwidow*.* \
$(nodist_hitex_SOURCES) $(nodist_hishrink_SOURCES) \
$(nodist_histretch_SOURCES) hiformat-tangle hitex-tangle \
hello.log rule.log $(nodist_pdftex_SOURCES) pdftex-final.ch \
@@ -4569,9 +4593,12 @@
uptexdir/upver.test \
uptexdir/upkcat.test \
uptexdir/wcfname.test uptexdir/wcfname0.test \
+ uptexdir/uptex-ctrlsym.test \
+ uptexdir/uptex-prntknj.test \
uptexdir/uptex-ofm.test uptexdir/uptex-prim.test \
uptexdir/uptex-lmr.test uptexdir/uptex-cat.test \
- uptexdir/uptex-noto.test uptexdir/uptex-widow.test
+ uptexdir/uptex-noto.test \
+ uptexdir/uptex-ucs.test uptexdir/uptex-widow.test
# uppPLtoTF/upTFtoPL
upweb_tests = uptexdir/upbibtex.test uptexdir/updvitype.test \
@@ -22152,9 +22179,11 @@
uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
uptexdir/upver.log uptexdir/upkcat.log \
uptexdir/wcfname.log uptexdir/wcfname0.log \
+ uptexdir/uptex-ctrlsym.log uptexdir/uptex-prntknj.log \
uptexdir/uptex-ofm.log uptexdir/uptex-prim.log \
uptexdir/uptex-lmr.log uptexdir/uptex-cat.log \
- uptexdir/uptex-noto.log uptexdir/uptex-widow.log: uptex$(EXEEXT)
+ uptexdir/uptex-noto.log \
+ uptexdir/uptex-ucs.log uptexdir/uptex-widow.log: uptex$(EXEEXT)
uptexdir/upbibtex.log: upbibtex$(EXEEXT)
uptexdir/updvitype.log: updvitype$(EXEEXT)
uptexdir/uppltotf.log: uppltotf$(EXEEXT)
Modified: branches/stable/source/src/texk/web2c/NEWS
===================================================================
--- branches/stable/source/src/texk/web2c/NEWS 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/NEWS 2025-05-17 22:44:20 UTC (rev 964)
@@ -2,7 +2,7 @@
See also */NEWS, */ChangeLog, etc.
-2025 (for TeX Live 2025)
+2025 (for TeX Live 2025, 7 March 2025)
* Most engines: new primitive parameter \ignoreprimitiveerror: if set to 1,
the error "Infinite glue shrinkage found in box being split"
becomes a warning (thus program exit status remains 0). Other values
Modified: branches/stable/source/src/texk/web2c/configure
===================================================================
--- branches/stable/source/src/texk/web2c/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for Web2C 2025.
+# Generated by GNU Autoconf 2.72 for Web2C 2026/dev.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -614,8 +614,8 @@
# Identity of this package.
PACKAGE_NAME='Web2C'
PACKAGE_TARNAME='web2c'
-PACKAGE_VERSION='2025'
-PACKAGE_STRING='Web2C 2025'
+PACKAGE_VERSION='2026/dev'
+PACKAGE_STRING='Web2C 2026/dev'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1672,7 +1672,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures Web2C 2025 to adapt to many kinds of systems.
+'configure' configures Web2C 2026/dev to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1747,7 +1747,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Web2C 2025:";;
+ short | recursive ) echo "Configuration of Web2C 2026/dev:";;
esac
cat <<\_ACEOF
@@ -1979,7 +1979,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Web2C configure 2025
+Web2C configure 2026/dev
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -3001,7 +3001,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Web2C $as_me 2025, which was
+It was created by Web2C $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -3997,7 +3997,7 @@
-WEB2CVERSION=2025
+WEB2CVERSION=2026/dev
# LuaTeX requires system extensions for socket support.
@@ -9993,7 +9993,7 @@
# Define the identity of the package.
PACKAGE='web2c'
- VERSION='2025'
+ VERSION='2026/dev'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -27427,7 +27427,7 @@
Report bugs to <bug-libtool at gnu.org>."
lt_cl_version="\
-Web2C config.lt 2025
+Web2C config.lt 2026/dev
configured by $0, generated by GNU Autoconf 2.72.
Copyright (C) 2024 Free Software Foundation, Inc.
@@ -31345,7 +31345,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Web2C $as_me 2025, which was
+This file was extended by Web2C $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31417,7 +31417,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-Web2C config.status 2025
+Web2C config.status 2026/dev
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: branches/stable/source/src/texk/web2c/ctangleboot.cin
===================================================================
--- branches/stable/source/src/texk/web2c/ctangleboot.cin 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/ctangleboot.cin 2025-05-17 22:44:20 UTC (rev 964)
@@ -2,10 +2,10 @@
#line 66 "cwebdir/ctangle.w"
/*5:*/
-#line 57 "cwebdir/comm-w2c.h"
+#line 53 "cwebdir/comm-w2c.h"
#include <ctype.h>
-#include <kpathsea/simpletypes.h>
+#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
@@ -15,24 +15,21 @@
#ifndef HAVE_GETTEXT
#define HAVE_GETTEXT 0
#endif
-#line 69 "cwebdir/comm-w2c.h"
+#line 65 "cwebdir/comm-w2c.h"
#if HAVE_GETTEXT
#include <libintl.h>
#else
-#line 73 "cwebdir/comm-w2c.h"
+#line 69 "cwebdir/comm-w2c.h"
#define gettext(a) a
#endif
-#line 75 "cwebdir/comm-w2c.h"
+#line 71 "cwebdir/comm-w2c.h"
/*:5*/
#line 67 "cwebdir/ctangle.w"
-#define banner "This is CTANGLE, Version 4.12.1" \
- \
-
-#define _(s) gettext(s) \
-
+#define banner "This is CTANGLE, Version 4.12.1"
+#define _(s) gettext(s)
#define and_and 04
#define lt_lt 020
#define gt_gt 021
@@ -47,38 +44,29 @@
#define dot_dot_dot 016
#define colon_colon 06
#define period_ast 026
-#define minus_gt_ast 027 \
-
-#define compress(c) if(loc++<=limit) return c \
-
-#define xisalpha(c) (isalpha((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisdigit(c) (isdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisspace(c) (isspace((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xislower(c) (islower((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisupper(c) (isupper((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisxdigit(c) (isxdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define isxalpha(c) ((c) =='_'||(c) =='$') \
-
-#define ishigh(c) ((eight_bits) (c) > 0177) \
- \
-
-#define max_include_depth 10 \
-
+#define minus_gt_ast 027
+#define compress(c) if(loc++<=limit) return c
+#define xisalpha(c) (isalpha((int) (c) ) &&!ishigh(c) )
+#define xisdigit(c) (isdigit((int) (c) ) &&!ishigh(c) )
+#define xisspace(c) (isspace((int) (c) ) &&!ishigh(c) )
+#define xislower(c) (islower((int) (c) ) &&!ishigh(c) )
+#define xisupper(c) (isupper((int) (c) ) &&!ishigh(c) )
+#define xisxdigit(c) (isxdigit((int) (c) ) &&!ishigh(c) )
+#define isxalpha(c) ((c) =='_'||(c) =='$')
+#define ishigh(c) ((eight_bits) (c) > 0177)
+#define max_include_depth 10
#define max_file_name_length 1024
#define cur_file file[include_depth]
#define cur_file_name file_name[include_depth]
#define cur_line line[include_depth]
#define web_file file[0]
-#define web_file_name file_name[0] \
-
-#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
-#define print_id(c) term_write((c) ->byte_start,length(c) )
+#define web_file_name file_name[0]
+#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
+#define print_id(c) term_write((c) ->byte_start,length(c) )
#define llink link
#define rlink dummy.Rlink
-#define root name_dir->rlink \
-
-#define ilk dummy.Ilk \
-
+#define root name_dir->rlink
+#define ilk dummy.Ilk
#define spotless 0
#define harmless_message 1
#define error_message 2
@@ -85,70 +73,50 @@
#define fatal_message 3
#define mark_harmless() if(history==spotless) history= harmless_message
#define mark_error() history= error_message
-#define confusion(s) fatal(_("! This can't happen: ") ,s) \
- \
-
+#define confusion(s) fatal(_("! This can't happen: ") ,s)
#define show_banner flags['b']
#define show_progress flags['p']
#define show_happiness flags['h']
#define show_stats flags['s']
#define make_xrefs flags['x']
-#define check_for_change flags['c'] \
-
-#define update_terminal() fflush(stdout)
-#define new_line() putchar('\n')
-#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \
-
+#define check_for_change flags['c']
+#define update_terminal() fflush(stdout)
+#define new_line() putchar('\n')
+#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout)
#define buf_size 1000
-#define longest_name 10000 \
-
-#define long_buf_size (buf_size+longest_name)
-#define max_bytes 1000000 \
-
-#define max_names 10239 \
-
-#define max_sections 4000 \
-
+#define longest_name 10000
+#define long_buf_size (buf_size+longest_name)
+#define max_bytes 1000000
+#define max_names 10239
+#define max_sections 4000
#define max_texts 10239
#define max_toks 1000000
-#define equiv equiv_or_xref \
-
+#define equiv equiv_or_xref
#define macro 0
-#define section_flag max_texts \
-
+#define section_flag max_texts
#define string 02
#define constant 03
#define join 0177
-#define output_defs_flag (2*024000-1) \
-
+#define output_defs_flag (2*024000-1)
#define stack_size 50
-#define cur_state stack[stack_size+1] \
-
+#define cur_state stack[stack_size+1]
#define cur_byte cur_state.byte_field
#define cur_name cur_state.name_field
#define cur_repl cur_state.repl_field
#define cur_section cur_state.section_field
-#define cur_end (cur_repl+1) ->tok_start \
-
+#define cur_end (cur_repl+1) ->tok_start
#define section_number 0201
-#define identifier 0202 \
-
+#define identifier 0202
#define normal 0
#define num_or_id 1
#define post_slash 2
#define unbreakable 3
-#define verbatim 4 \
-
+#define verbatim 4
#define max_files 256
-#define macro_end (cur_text+1) ->tok_start \
-
-#define C_printf(c,a) fprintf(C_file,c,a)
-#define C_putc(c) fputc((int) (c) ,C_file) \
-
-#define translit_length 10 \
-
-#define transliterate_utf_eight flags['u'] \
-
+#define C_printf(c,a) fprintf(C_file,c,a)
+#define C_putc(c) fputc((int) (c) ,C_file)
+#define translit_length 10
+#define transliterate_utf_eight flags['u']
#define ignore 00
#define ord 0302
#define control_text 0303
@@ -158,26 +126,21 @@
#define definition 0307
#define begin_C 0310
#define section_name 0311
-#define new_section 0312 \
-
+#define new_section 0312
#define app_repl(c) { \
if(tok_ptr==tok_mem_end) overflow(_("token") ) ; \
else*(tok_ptr++) = (eight_bits) c; \
-} \
-
+}
#define store_id(a) a= id_lookup(id_first,id_loc,'\0') -name_dir; \
app_repl((a/0400) +0200) ; \
-app_repl(a%0400) \
+app_repl(a%0400)
+#define keep_digit_separators flags['k']
+#define max_banner 50
-#define keep_digit_separators flags['k'] \
-
-#define max_banner 50 \
-
-
#line 68 "cwebdir/ctangle.w"
/*3:*/
-#line 33 "cwebdir/comm-w2c.h"
+#line 32 "cwebdir/comm-w2c.h"
typedef uint8_t eight_bits;
typedef uint16_t sixteen_bits;
@@ -188,7 +151,7 @@
extern int phase;
/*:3*//*6:*/
-#line 97 "cwebdir/comm-w2c.h"
+#line 108 "cwebdir/comm-w2c.h"
extern char section_text[];
extern char*section_text_end;
@@ -196,7 +159,7 @@
extern char*id_loc;
/*:6*//*7:*/
-#line 115 "cwebdir/comm-w2c.h"
+#line 126 "cwebdir/comm-w2c.h"
extern char buffer[];
extern char*buffer_end;
@@ -204,7 +167,7 @@
extern char*limit;
/*:7*//*8:*/
-#line 132 "cwebdir/comm-w2c.h"
+#line 143 "cwebdir/comm-w2c.h"
extern int include_depth;
extern FILE*file[];
@@ -216,20 +179,20 @@
extern int line[];
extern int change_line;
extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
+extern bool input_has_ended;
+extern bool changing;
+extern bool web_file_open;
/*:8*//*10:*/
-#line 153 "cwebdir/comm-w2c.h"
+#line 164 "cwebdir/comm-w2c.h"
extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
+extern bool changed_section[];
+extern bool change_pending;
+extern bool print_where;
/*:10*//*11:*/
-#line 168 "cwebdir/comm-w2c.h"
+#line 179 "cwebdir/comm-w2c.h"
typedef struct name_info{
char*byte_start;
@@ -254,12 +217,12 @@
extern hash_pointer hash_ptr;
/*:11*//*13:*/
-#line 213 "cwebdir/comm-w2c.h"
+#line 224 "cwebdir/comm-w2c.h"
extern int history;
/*:13*//*15:*/
-#line 234 "cwebdir/comm-w2c.h"
+#line 245 "cwebdir/comm-w2c.h"
extern int argc;
extern char**argv;
@@ -268,11 +231,11 @@
extern char idx_file_name[];
extern char scn_file_name[];
extern char check_file_name[];
-extern boolean flags[];
+extern bool flags[];
extern const char*use_language;
/*:15*//*16:*/
-#line 250 "cwebdir/comm-w2c.h"
+#line 261 "cwebdir/comm-w2c.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -282,7 +245,7 @@
extern FILE*check_file;
/*:16*//*116:*/
-#line 541 "cwebdir/ctang-w2c.ch"
+#line 539 "cwebdir/ctang-w2c.ch"
extern char cb_banner[];
@@ -344,7 +307,7 @@
#line 457 "cwebdir/ctangle.w"
static eight_bits out_state;
-static boolean protect;
+static bool protect;
/*:42*//*45:*/
#line 488 "cwebdir/ctangle.w"
@@ -357,7 +320,7 @@
/*:45*//*53:*/
#line 584 "cwebdir/ctangle.w"
-static boolean output_defs_seen= false;
+static bool output_defs_seen= false;
/*:53*//*57:*/
#line 694 "cwebdir/ctangle.w"
@@ -372,13 +335,13 @@
/*:62*//*66:*/
#line 827 "cwebdir/ctangle.w"
-static boolean comment_continues= false;
+static bool comment_continues= false;
/*:66*//*68:*/
#line 864 "cwebdir/ctangle.w"
static name_pointer cur_section_name;
-static boolean no_where;
+static bool no_where;
/*:68*//*82:*/
#line 1182 "cwebdir/ctangle.w"
@@ -390,33 +353,33 @@
#line 71 "cwebdir/ctangle.w"
/*4:*/
-#line 43 "cwebdir/comm-w2c.h"
+#line 42 "cwebdir/comm-w2c.h"
extern void common_init(void);
/*:4*//*9:*/
-#line 147 "cwebdir/comm-w2c.h"
+#line 158 "cwebdir/comm-w2c.h"
-extern boolean get_line(void);
+extern bool get_line(void);
extern void check_complete(void);
extern void reset_input(void);
/*:9*//*12:*/
-#line 191 "cwebdir/comm-w2c.h"
+#line 202 "cwebdir/comm-w2c.h"
extern name_pointer id_lookup(const char*,const char*,eight_bits);
-extern name_pointer section_lookup(char*,char*,boolean);
+extern name_pointer section_lookup(char*,char*,bool);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern bool names_match(name_pointer,const char*,size_t,eight_bits);
extern void init_node(name_pointer);
/*:12*//*14:*/
-#line 216 "cwebdir/comm-w2c.h"
+#line 227 "cwebdir/comm-w2c.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -435,7 +398,7 @@
#line 347 "cwebdir/ctangle.w"
static void push_level(name_pointer);
-static void pop_level(boolean);
+static void pop_level(bool);
static void get_output(void);
/*:37*//*44:*/
@@ -453,7 +416,7 @@
#line 807 "cwebdir/ctangle.w"
static eight_bits skip_ahead(void);
-static boolean skip_comment(boolean);
+static bool skip_comment(bool);
/*:65*//*70:*/
#line 915 "cwebdir/ctangle.w"
@@ -540,7 +503,7 @@
section_text[0]= ' ';
/*:78*//*117:*/
-#line 544 "cwebdir/ctang-w2c.ch"
+#line 542 "cwebdir/ctang-w2c.ch"
strncpy(cb_banner,banner,max_banner-1);
@@ -559,7 +522,7 @@
/*:2*//*24:*/
#line 155 "cwebdir/ctangle.w"
-boolean names_match(
+bool names_match(
name_pointer p,
const char*first,
size_t l,
@@ -616,7 +579,7 @@
static void
pop_level(
-boolean flag)
+bool flag)
{
if(flag&&cur_repl->text_link<section_flag){
cur_repl= cur_repl->text_link+text_info;
@@ -752,13 +715,13 @@
if(check_for_change){
fclose(C_file);C_file= NULL;
/*106:*/
-#line 424 "cwebdir/ctang-w2c.ch"
+#line 422 "cwebdir/ctang-w2c.ch"
if((C_file= fopen(C_file_name,"r"))!=NULL){
/*107:*/
-#line 431 "cwebdir/ctang-w2c.ch"
+#line 429 "cwebdir/ctang-w2c.ch"
-boolean comparison= false;
+bool comparison= false;
if((check_file= fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
@@ -765,7 +728,7 @@
/*108:*/
-#line 445 "cwebdir/ctang-w2c.ch"
+#line 443 "cwebdir/ctang-w2c.ch"
do{
char x[BUFSIZ],y[BUFSIZ];
@@ -775,7 +738,7 @@
}while(comparison&&!feof(C_file)&&!feof(check_file));
/*:108*/
-#line 438 "cwebdir/ctang-w2c.ch"
+#line 436 "cwebdir/ctang-w2c.ch"
fclose(C_file);C_file= NULL;
@@ -782,10 +745,10 @@
fclose(check_file);check_file= NULL;
/*:107*/
-#line 426 "cwebdir/ctang-w2c.ch"
+#line 424 "cwebdir/ctang-w2c.ch"
/*109:*/
-#line 456 "cwebdir/ctang-w2c.ch"
+#line 454 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -795,7 +758,7 @@
}
/*:109*/
-#line 427 "cwebdir/ctang-w2c.ch"
+#line 425 "cwebdir/ctang-w2c.ch"
}else
rename(check_file_name,C_file_name);
@@ -808,7 +771,7 @@
an_output_file--;
sprint_section_name(output_file_name,*an_output_file);
if(check_for_change)/*105:*/
-#line 415 "cwebdir/ctang-w2c.ch"
+#line 413 "cwebdir/ctang-w2c.ch"
{
if((C_file= fopen(output_file_name,"a"))==NULL)
fatal(_("! Cannot open output file "),output_file_name);
@@ -853,24 +816,24 @@
if(check_for_change){
fclose(C_file);C_file= NULL;
/*110:*/
-#line 469 "cwebdir/ctang-w2c.ch"
+#line 467 "cwebdir/ctang-w2c.ch"
if(0==strcmp("/dev/stdout",output_file_name))
/*112:*/
-#line 496 "cwebdir/ctang-w2c.ch"
+#line 494 "cwebdir/ctang-w2c.ch"
{
/*115:*/
-#line 527 "cwebdir/ctang-w2c.ch"
+#line 525 "cwebdir/ctang-w2c.ch"
char in_buf[BUFSIZ+1];
int in_size;
-boolean comparison= true;
+bool comparison= true;
if((check_file= fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
/*:115*/
-#line 497 "cwebdir/ctang-w2c.ch"
+#line 495 "cwebdir/ctang-w2c.ch"
do{
in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -879,7 +842,7 @@
}while(!feof(check_file));
fclose(check_file);check_file= NULL;
/*111:*/
-#line 486 "cwebdir/ctang-w2c.ch"
+#line 484 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -889,29 +852,29 @@
}
/*:111*/
-#line 504 "cwebdir/ctang-w2c.ch"
+#line 502 "cwebdir/ctang-w2c.ch"
}
/*:112*/
-#line 471 "cwebdir/ctang-w2c.ch"
+#line 469 "cwebdir/ctang-w2c.ch"
else if(0==strcmp("/dev/stderr",output_file_name))
/*113:*/
-#line 509 "cwebdir/ctang-w2c.ch"
+#line 507 "cwebdir/ctang-w2c.ch"
{
/*115:*/
-#line 527 "cwebdir/ctang-w2c.ch"
+#line 525 "cwebdir/ctang-w2c.ch"
char in_buf[BUFSIZ+1];
int in_size;
-boolean comparison= true;
+bool comparison= true;
if((check_file= fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
/*:115*/
-#line 510 "cwebdir/ctang-w2c.ch"
+#line 508 "cwebdir/ctang-w2c.ch"
do{
in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -920,7 +883,7 @@
}while(!feof(check_file));
fclose(check_file);check_file= NULL;
/*111:*/
-#line 486 "cwebdir/ctang-w2c.ch"
+#line 484 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -930,20 +893,20 @@
}
/*:111*/
-#line 517 "cwebdir/ctang-w2c.ch"
+#line 515 "cwebdir/ctang-w2c.ch"
}
/*:113*/
-#line 473 "cwebdir/ctang-w2c.ch"
+#line 471 "cwebdir/ctang-w2c.ch"
else if(0==strcmp("/dev/null",output_file_name))
/*114:*/
-#line 522 "cwebdir/ctang-w2c.ch"
+#line 520 "cwebdir/ctang-w2c.ch"
{
-boolean comparison= true;
+bool comparison= true;
/*111:*/
-#line 486 "cwebdir/ctang-w2c.ch"
+#line 484 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -953,19 +916,19 @@
}
/*:111*/
-#line 524 "cwebdir/ctang-w2c.ch"
+#line 522 "cwebdir/ctang-w2c.ch"
}
/*:114*/
-#line 475 "cwebdir/ctang-w2c.ch"
+#line 473 "cwebdir/ctang-w2c.ch"
else{
if((C_file= fopen(output_file_name,"r"))!=NULL){
/*107:*/
-#line 431 "cwebdir/ctang-w2c.ch"
+#line 429 "cwebdir/ctang-w2c.ch"
-boolean comparison= false;
+bool comparison= false;
if((check_file= fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
@@ -972,7 +935,7 @@
/*108:*/
-#line 445 "cwebdir/ctang-w2c.ch"
+#line 443 "cwebdir/ctang-w2c.ch"
do{
char x[BUFSIZ],y[BUFSIZ];
@@ -982,7 +945,7 @@
}while(comparison&&!feof(C_file)&&!feof(check_file));
/*:108*/
-#line 438 "cwebdir/ctang-w2c.ch"
+#line 436 "cwebdir/ctang-w2c.ch"
fclose(C_file);C_file= NULL;
@@ -989,10 +952,10 @@
fclose(check_file);check_file= NULL;
/*:107*/
-#line 478 "cwebdir/ctang-w2c.ch"
+#line 476 "cwebdir/ctang-w2c.ch"
/*111:*/
-#line 486 "cwebdir/ctang-w2c.ch"
+#line 484 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -1002,7 +965,7 @@
}
/*:111*/
-#line 479 "cwebdir/ctang-w2c.ch"
+#line 477 "cwebdir/ctang-w2c.ch"
}else
rename(check_file_name,output_file_name);
@@ -1030,22 +993,24 @@
}
/*:48*//*54:*/
-#line 592 "cwebdir/ctangle.w"
+#line 590 "cwebdir/ctangle.w"
static void
output_defs(void)
{
-sixteen_bits a;
+sixteen_bits a;eight_bits*macro_end;
push_level(NULL);
for(cur_text= text_info+1;cur_text<text_ptr;cur_text++)
if(cur_text->text_link==macro){
cur_byte= cur_text->tok_start;
+macro_end= (cur_text+1)->tok_start;
C_printf("%s","#define ");
out_state= normal;
protect= true;
-while(cur_byte<macro_end){
+do macro_end--;while(isspace(*macro_end)&&plus_plus!=*macro_end);
+
+while(cur_byte<=macro_end){
a= *cur_byte++;
-if(cur_byte==macro_end&&a=='\n')break;
if(out_state==verbatim&&a!=string&&a!=constant&&a!='\n')
C_putc(a);
@@ -1092,7 +1057,7 @@
if(out_state==num_or_id)C_putc(' ');
for(j= (cur_val+name_dir)->byte_start;
j<(cur_val+name_dir+1)->byte_start;j++)
-#line 200 "cwebdir/ctang-w2c.ch"
+#line 199 "cwebdir/ctang-w2c.ch"
if(ishigh(*j)){
if(transliterate_utf_eight){
@@ -1102,8 +1067,8 @@
}
C_printf("%s",translit[(eight_bits)(*j)-0200]);
}
+#line 710 "cwebdir/ctangle.w"
else C_putc(*j);
-#line 711 "cwebdir/ctangle.w"
out_state= num_or_id;break;
/*:59*/
@@ -1200,8 +1165,8 @@
/*:64*//*67:*/
#line 830 "cwebdir/ctangle.w"
-static boolean skip_comment(
-boolean is_long_comment)
+static bool skip_comment(
+bool is_long_comment)
{
char c;
while(true){
@@ -1209,7 +1174,7 @@
if(is_long_comment){
if(get_line())return comment_continues= true;
else{
-#line 215 "cwebdir/ctang-w2c.ch"
+#line 213 "cwebdir/ctang-w2c.ch"
err_print(_("! Input ended in mid-comment"));
#line 841 "cwebdir/ctangle.w"
@@ -1224,7 +1189,7 @@
}
if(c=='@'){
if(ccode[(eight_bits)*loc]==new_section){
-#line 221 "cwebdir/ctang-w2c.ch"
+#line 219 "cwebdir/ctang-w2c.ch"
err_print(_("! Section name ended in mid-comment"));loc--;
#line 854 "cwebdir/ctangle.w"
@@ -1241,7 +1206,7 @@
static eight_bits
get_next(void)
{
-static boolean preprocessing= false;
+static bool preprocessing= false;
eight_bits c;
while(true){
if(loc> limit){
@@ -1282,7 +1247,7 @@
if(xisdigit(c)||c=='.')/*73:*/
#line 956 "cwebdir/ctangle.w"
{
-boolean hex_flag= false;
+bool hex_flag= false;
id_first= loc-1;
if(*id_first=='.'&&!xisdigit(*loc))goto mistake;
if(*id_first=='0'){
@@ -1332,13 +1297,13 @@
while(true){
if(loc>=limit){
if(*(limit-1)!='\\'){
-#line 227 "cwebdir/ctang-w2c.ch"
+#line 225 "cwebdir/ctang-w2c.ch"
err_print(_("! String didn't end"));loc= limit;break;
#line 1005 "cwebdir/ctangle.w"
}
if(get_line()==false){
-#line 233 "cwebdir/ctang-w2c.ch"
+#line 231 "cwebdir/ctang-w2c.ch"
err_print(_("! Input ended in middle of string"));loc= buffer;break;
#line 1009 "cwebdir/ctangle.w"
@@ -1358,7 +1323,7 @@
if(++id_loc<=section_text_end)*id_loc= (char)c;
}
if(id_loc>=section_text_end){
-#line 239 "cwebdir/ctang-w2c.ch"
+#line 237 "cwebdir/ctang-w2c.ch"
printf("%s",_("\n! String too long: "));
#line 1027 "cwebdir/ctangle.w"
@@ -1392,7 +1357,7 @@
switch(c= ccode[(eight_bits)*loc++]){
case ignore:continue;
-#line 245 "cwebdir/ctang-w2c.ch"
+#line 243 "cwebdir/ctang-w2c.ch"
case translit_code:err_print(_("! Use @l in limbo only"));continue;
#line 1042 "cwebdir/ctangle.w"
@@ -1399,7 +1364,7 @@
case control_text:while((c= skip_ahead())=='@');
if(*(loc-1)!='>')
-#line 251 "cwebdir/ctang-w2c.ch"
+#line 249 "cwebdir/ctang-w2c.ch"
err_print(_("! Double @ should be used in control text"));
#line 1047 "cwebdir/ctangle.w"
@@ -1415,7 +1380,7 @@
while(true){
if(loc> limit&&get_line()==false){
-#line 269 "cwebdir/ctang-w2c.ch"
+#line 267 "cwebdir/ctang-w2c.ch"
err_print(_("! Input ended in section name"));
#line 1109 "cwebdir/ctangle.w"
@@ -1431,13 +1396,13 @@
loc+= 2;break;
}
if(ccode[(eight_bits)c]==new_section){
-#line 281 "cwebdir/ctang-w2c.ch"
+#line 279 "cwebdir/ctang-w2c.ch"
err_print(_("! Section name didn't end"));break;
#line 1136 "cwebdir/ctangle.w"
}
if(ccode[(eight_bits)c]==section_name){
-#line 287 "cwebdir/ctang-w2c.ch"
+#line 285 "cwebdir/ctang-w2c.ch"
err_print(_("! Nesting of section names not allowed"));break;
#line 1140 "cwebdir/ctangle.w"
@@ -1455,7 +1420,7 @@
*k= (char)c;
}
if(k>=section_text_end){
-#line 275 "cwebdir/ctang-w2c.ch"
+#line 273 "cwebdir/ctang-w2c.ch"
printf("%s",_("\n! Section name too long: "));
#line 1122 "cwebdir/ctangle.w"
@@ -1503,7 +1468,7 @@
id_first= loc++;*(limit+1)= '@';*(limit+2)= '>';
while(*loc!='@'||*(loc+1)!='>')loc++;
-#line 293 "cwebdir/ctang-w2c.ch"
+#line 291 "cwebdir/ctang-w2c.ch"
if(loc>=limit)err_print(_("! Verbatim string didn't end"));
#line 1154 "cwebdir/ctangle.w"
@@ -1522,7 +1487,7 @@
while(*loc!='\''){
if(*loc=='@'){
if(*(loc+1)!='@')
-#line 257 "cwebdir/ctang-w2c.ch"
+#line 255 "cwebdir/ctang-w2c.ch"
err_print(_("! Double @ should be used in ASCII constant"));
#line 1071 "cwebdir/ctangle.w"
@@ -1530,7 +1495,7 @@
}
loc++;
if(loc> limit){
-#line 263 "cwebdir/ctang-w2c.ch"
+#line 261 "cwebdir/ctang-w2c.ch"
err_print(_("! String didn't end"));loc= limit-1;break;
#line 1077 "cwebdir/ctangle.w"
@@ -1635,7 +1600,7 @@
while(*try_loc==' '&&try_loc<limit)try_loc++;
if(*try_loc=='+'&&try_loc<limit)try_loc++;
while(*try_loc==' '&&try_loc<limit)try_loc++;
-#line 329 "cwebdir/ctang-w2c.ch"
+#line 327 "cwebdir/ctang-w2c.ch"
if(*try_loc=='=')err_print(_("! Missing `@ ' before a named section"));
#line 1279 "cwebdir/ctangle.w"
@@ -1670,7 +1635,7 @@
}
break;
-#line 317 "cwebdir/ctang-w2c.ch"
+#line 315 "cwebdir/ctang-w2c.ch"
case output_defs_code:if(t!=section_name)err_print(_("! Misplaced @h"));
#line 1251 "cwebdir/ctangle.w"
@@ -1708,7 +1673,7 @@
while(id_first<id_loc){
if(*id_first=='@'){
if(*(id_first+1)=='@')id_first++;
-#line 335 "cwebdir/ctang-w2c.ch"
+#line 333 "cwebdir/ctang-w2c.ch"
else err_print(_("! Double @ should be used in string"));
#line 1296 "cwebdir/ctangle.w"
@@ -1762,7 +1727,7 @@
case'\\':c= '\\';break;
case'\'':c= '\'';break;
case'\"':c= '\"';break;
-#line 341 "cwebdir/ctang-w2c.ch"
+#line 339 "cwebdir/ctang-w2c.ch"
default:err_print(_("! Unrecognized escape sequence"));
#line 1345 "cwebdir/ctangle.w"
@@ -1782,7 +1747,7 @@
break;
case definition:case format_code:case begin_C:if(t!=section_name)goto done;
else{
-#line 323 "cwebdir/ctang-w2c.ch"
+#line 321 "cwebdir/ctang-w2c.ch"
err_print(_("! @d, @f and @c are ignored in C text"));continue;
#line 1269 "cwebdir/ctangle.w"
@@ -1798,7 +1763,7 @@
default:app_repl(a);
}
done:next_control= (eight_bits)a;
-#line 311 "cwebdir/ctang-w2c.ch"
+#line 309 "cwebdir/ctang-w2c.ch"
if(text_ptr> text_info_end)overflow(_("text"));
#line 1205 "cwebdir/ctangle.w"
cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr;
@@ -1837,7 +1802,7 @@
while((next_control= get_next())=='\n');
if(next_control!=identifier){
-#line 347 "cwebdir/ctang-w2c.ch"
+#line 345 "cwebdir/ctang-w2c.ch"
err_print(_("! Definition flushed, must start with identifier"));
#line 1418 "cwebdir/ctangle.w"
@@ -1948,7 +1913,7 @@
loc+= 3;
if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2))
||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
-#line 367 "cwebdir/ctang-w2c.ch"
+#line 365 "cwebdir/ctang-w2c.ch"
err_print(_("! Improper hex number following @l"));
#line 1517 "cwebdir/ctangle.w"
@@ -1960,7 +1925,7 @@
beg= loc;
while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||isxalpha(*loc)))loc++;
if(loc-beg>=translit_length)
-#line 373 "cwebdir/ctang-w2c.ch"
+#line 371 "cwebdir/ctang-w2c.ch"
err_print(_("! Replacement string in @l too long"));
#line 1527 "cwebdir/ctangle.w"
@@ -1977,12 +1942,12 @@
case control_text:if(c=='q'||c=='Q'){
while((c= (char)skip_ahead())=='@');
if(*(loc-1)!='>')
-#line 353 "cwebdir/ctang-w2c.ch"
+#line 351 "cwebdir/ctang-w2c.ch"
err_print(_("! Double @ should be used in control text"));
#line 1499 "cwebdir/ctangle.w"
break;
-#line 360 "cwebdir/ctang-w2c.ch"
+#line 358 "cwebdir/ctang-w2c.ch"
}/* otherwise fall through */
default:err_print(_("! Double @ should be used in limbo"));
#line 1503 "cwebdir/ctangle.w"
@@ -1997,7 +1962,7 @@
void
print_stats(void){
-#line 386 "cwebdir/ctang-w2c.ch"
+#line 384 "cwebdir/ctang-w2c.ch"
puts(_("\nMemory usage statistics:"));
printf(_("%td names (out of %ld)\n"),
(ptrdiff_t)(name_ptr-name_dir),(long)max_names);
@@ -2010,5 +1975,5 @@
(ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks);
}
-#line 399 "cwebdir/ctang-w2c.ch"
+#line 397 "cwebdir/ctang-w2c.ch"
/*:103*/
Modified: branches/stable/source/src/texk/web2c/cwebboot.cin
===================================================================
--- branches/stable/source/src/texk/web2c/cwebboot.cin 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebboot.cin 2025-05-17 22:44:20 UTC (rev 964)
@@ -2,10 +2,10 @@
#line 62 "cwebdir/common.w"
/*4:*/
-#line 57 "cwebdir/comm-w2c.h"
+#line 53 "cwebdir/comm-w2c.h"
#include <ctype.h>
-#include <kpathsea/simpletypes.h>
+#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
@@ -15,31 +15,31 @@
#ifndef HAVE_GETTEXT
#define HAVE_GETTEXT 0
#endif
-#line 69 "cwebdir/comm-w2c.h"
+#line 65 "cwebdir/comm-w2c.h"
#if HAVE_GETTEXT
#include <libintl.h>
#else
-#line 73 "cwebdir/comm-w2c.h"
+#line 69 "cwebdir/comm-w2c.h"
#define gettext(a) a
#endif
-#line 75 "cwebdir/comm-w2c.h"
+#line 71 "cwebdir/comm-w2c.h"
/*:4*//*91:*/
-#line 739 "cwebdir/comm-w2c.ch"
+#line 699 "cwebdir/comm-w2c.ch"
#if HAVE_GETTEXT
#include <locale.h>
#else
-#line 743 "cwebdir/comm-w2c.ch"
+#line 703 "cwebdir/comm-w2c.ch"
#define setlocale(a,b) ""
#define bindtextdomain(a,b) ""
#define textdomain(a) ""
#endif
-#line 747 "cwebdir/comm-w2c.ch"
+#line 707 "cwebdir/comm-w2c.ch"
/*:91*//*93:*/
-#line 786 "cwebdir/comm-w2c.ch"
+#line 746 "cwebdir/comm-w2c.ch"
#include <kpathsea/kpathsea.h>
@@ -47,7 +47,7 @@
#include <lib/lib.h>
/*:93*//*96:*/
-#line 823 "cwebdir/comm-w2c.ch"
+#line 783 "cwebdir/comm-w2c.ch"
#define CWEB
#include "help.h"
@@ -55,8 +55,7 @@
/*:96*/
#line 63 "cwebdir/common.w"
-#define _(s) gettext(s) \
-
+#define _(s) gettext(s)
#define and_and 04
#define lt_lt 020
#define gt_gt 021
@@ -71,38 +70,29 @@
#define dot_dot_dot 016
#define colon_colon 06
#define period_ast 026
-#define minus_gt_ast 027 \
-
-#define compress(c) if(loc++<=limit) return c \
-
-#define xisalpha(c) (isalpha((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisdigit(c) (isdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisspace(c) (isspace((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xislower(c) (islower((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisupper(c) (isupper((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisxdigit(c) (isxdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define isxalpha(c) ((c) =='_'||(c) =='$') \
-
-#define ishigh(c) ((eight_bits) (c) > 0177) \
- \
-
-#define max_include_depth 10 \
-
+#define minus_gt_ast 027
+#define compress(c) if(loc++<=limit) return c
+#define xisalpha(c) (isalpha((int) (c) ) &&!ishigh(c) )
+#define xisdigit(c) (isdigit((int) (c) ) &&!ishigh(c) )
+#define xisspace(c) (isspace((int) (c) ) &&!ishigh(c) )
+#define xislower(c) (islower((int) (c) ) &&!ishigh(c) )
+#define xisupper(c) (isupper((int) (c) ) &&!ishigh(c) )
+#define xisxdigit(c) (isxdigit((int) (c) ) &&!ishigh(c) )
+#define isxalpha(c) ((c) =='_'||(c) =='$')
+#define ishigh(c) ((eight_bits) (c) > 0177)
+#define max_include_depth 10
#define max_file_name_length 1024
#define cur_file file[include_depth]
#define cur_file_name file_name[include_depth]
#define cur_line line[include_depth]
#define web_file file[0]
-#define web_file_name file_name[0] \
-
-#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
-#define print_id(c) term_write((c) ->byte_start,length(c) )
+#define web_file_name file_name[0]
+#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
+#define print_id(c) term_write((c) ->byte_start,length(c) )
#define llink link
#define rlink dummy.Rlink
-#define root name_dir->rlink \
-
-#define ilk dummy.Ilk \
-
+#define root name_dir->rlink
+#define ilk dummy.Ilk
#define spotless 0
#define harmless_message 1
#define error_message 2
@@ -109,77 +99,54 @@
#define fatal_message 3
#define mark_harmless() if(history==spotless) history= harmless_message
#define mark_error() history= error_message
-#define confusion(s) fatal(_("! This can't happen: ") ,s) \
- \
-
+#define confusion(s) fatal(_("! This can't happen: ") ,s)
#define show_banner flags['b']
#define show_progress flags['p']
#define show_happiness flags['h']
#define show_stats flags['s']
#define make_xrefs flags['x']
-#define check_for_change flags['c'] \
-
-#define update_terminal() fflush(stdout)
-#define new_line() putchar('\n')
-#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \
-
+#define check_for_change flags['c']
+#define update_terminal() fflush(stdout)
+#define new_line() putchar('\n')
+#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout)
#define buf_size 1000
-#define longest_name 10000 \
-
-#define long_buf_size (buf_size+longest_name)
-#define max_bytes 1000000 \
-
-#define max_names 10239 \
-
-#define max_sections 4000 \
-
+#define longest_name 10000
+#define long_buf_size (buf_size+longest_name)
+#define max_bytes 1000000
+#define max_names 10239
+#define max_sections 4000
#define lines_dont_match (change_limit-change_buffer!=limit-buffer|| \
-strncmp(buffer,change_buffer,(size_t) (limit-buffer) ) !=0) \
-
+strncmp(buffer,change_buffer,(size_t) (limit-buffer) ) !=0)
#define if_section_start_make_pending(b) \
*limit= '!'; \
for(loc= buffer;xisspace(*loc) ;loc++) ; \
*limit= ' '; \
-if(*loc=='@'&&(xisspace(*(loc+1) ) ||*(loc+1) =='*') ) change_pending= b \
-
+if(*loc=='@'&&(xisspace(*(loc+1) ) ||*(loc+1) =='*') ) change_pending= b
#define too_long() {include_depth--; \
-err_print(_("! Include file name too long") ) ;goto restart;} \
-
-#define hash_size 8501 \
-
-#define first_chunk(p) ((p) ->byte_start+2)
+err_print(_("! Include file name too long") ) ;goto restart;}
+#define hash_size 8501
+#define first_chunk(p) ((p) ->byte_start+2)
#define prefix_length(p) (size_t) ((eight_bits) *((p) ->byte_start) *256+ \
-(eight_bits) *((p) ->byte_start+1) )
+(eight_bits) *((p) ->byte_start+1) )
#define set_prefix_length(p,m) (*((p) ->byte_start) = (char) ((m) /256) , \
-*((p) ->byte_start+1) = (char) ((m) %256) ) \
-
+*((p) ->byte_start+1) = (char) ((m) %256) )
#define less 0
#define equal 1
#define greater 2
#define prefix 3
-#define extension 4 \
-
-#define bad_extension 5 \
-
-#define RETURN_OK 0
-#define RETURN_WARN 5
-#define RETURN_ERROR 10
-#define RETURN_FAIL 20 \
-
-#define flag_change (**argv!='-')
-#define max_banner 50 \
-
+#define extension 4
+#define bad_extension 5
+#define flag_change (**argv!='-')
+#define max_banner 50
#define PATH_SEPARATOR separators[0]
#define DIR_SEPARATOR separators[1]
-#define DEVICE_SEPARATOR separators[2] \
+#define DEVICE_SEPARATOR separators[2]
+#define kpse_find_cweb(name) kpse_find_file(name,kpse_cweb_format,true)
-#define kpse_find_cweb(name) kpse_find_file(name,kpse_cweb_format,true) \
-
-
#line 64 "cwebdir/common.w"
/*2:*/
-#line 33 "cwebdir/comm-w2c.h"
+#line 32 "cwebdir/comm-w2c.h"
typedef uint8_t eight_bits;
typedef uint16_t sixteen_bits;
@@ -190,7 +157,7 @@
extern int phase;
/*:2*//*5:*/
-#line 97 "cwebdir/comm-w2c.h"
+#line 108 "cwebdir/comm-w2c.h"
extern char section_text[];
extern char*section_text_end;
@@ -198,7 +165,7 @@
extern char*id_loc;
/*:5*//*6:*/
-#line 115 "cwebdir/comm-w2c.h"
+#line 126 "cwebdir/comm-w2c.h"
extern char buffer[];
extern char*buffer_end;
@@ -206,7 +173,7 @@
extern char*limit;
/*:6*//*7:*/
-#line 132 "cwebdir/comm-w2c.h"
+#line 143 "cwebdir/comm-w2c.h"
extern int include_depth;
extern FILE*file[];
@@ -218,20 +185,20 @@
extern int line[];
extern int change_line;
extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
+extern bool input_has_ended;
+extern bool changing;
+extern bool web_file_open;
/*:7*//*9:*/
-#line 153 "cwebdir/comm-w2c.h"
+#line 164 "cwebdir/comm-w2c.h"
extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
+extern bool changed_section[];
+extern bool change_pending;
+extern bool print_where;
/*:9*//*10:*/
-#line 168 "cwebdir/comm-w2c.h"
+#line 179 "cwebdir/comm-w2c.h"
typedef struct name_info{
char*byte_start;
@@ -256,12 +223,12 @@
extern hash_pointer hash_ptr;
/*:10*//*12:*/
-#line 213 "cwebdir/comm-w2c.h"
+#line 224 "cwebdir/comm-w2c.h"
extern int history;
/*:12*//*14:*/
-#line 234 "cwebdir/comm-w2c.h"
+#line 245 "cwebdir/comm-w2c.h"
extern int argc;
extern char**argv;
@@ -270,11 +237,11 @@
extern char idx_file_name[];
extern char scn_file_name[];
extern char check_file_name[];
-extern boolean flags[];
+extern bool flags[];
extern const char*use_language;
/*:14*//*15:*/
-#line 250 "cwebdir/comm-w2c.h"
+#line 261 "cwebdir/comm-w2c.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -329,9 +296,9 @@
int line[max_include_depth];
int change_line;
int change_depth;
-boolean input_has_ended;
-boolean changing;
-boolean web_file_open= false;
+bool input_has_ended;
+bool changing;
+bool web_file_open= false;
/*:25*//*26:*/
#line 216 "cwebdir/common.w"
@@ -343,10 +310,10 @@
#line 545 "cwebdir/common.w"
sixteen_bits section_count;
-boolean changed_section[max_sections];
-boolean change_pending;
+bool changed_section[max_sections];
+bool change_pending;
-boolean print_where= false;
+bool print_where= false;
/*:42*//*43:*/
#line 590 "cwebdir/common.w"
@@ -382,11 +349,11 @@
char C_file_name[max_file_name_length];
char tex_file_name[max_file_name_length];
char idx_file_name[max_file_name_length];
-#line 456 "cwebdir/comm-w2c.ch"
+#line 422 "cwebdir/comm-w2c.ch"
char scn_file_name[max_file_name_length];
char check_file_name[max_file_name_length];
#line 1131 "cwebdir/common.w"
-boolean flags[128];
+bool flags[128];
/*:73*//*83:*/
#line 1267 "cwebdir/common.w"
@@ -395,20 +362,20 @@
FILE*tex_file;
FILE*idx_file;
FILE*scn_file;
-#line 584 "cwebdir/comm-w2c.ch"
+#line 544 "cwebdir/comm-w2c.ch"
FILE*active_file;
FILE*check_file;
#line 1273 "cwebdir/common.w"
-#line 601 "cwebdir/comm-w2c.ch"
+#line 561 "cwebdir/comm-w2c.ch"
/*:83*//*86:*/
-#line 629 "cwebdir/comm-w2c.ch"
+#line 589 "cwebdir/comm-w2c.ch"
const char*use_language= "";
/*:86*//*87:*/
-#line 642 "cwebdir/comm-w2c.ch"
+#line 602 "cwebdir/comm-w2c.ch"
char cb_banner[max_banner];
string texmf_locale;
@@ -415,7 +382,7 @@
#ifndef SEPARATORS
#define SEPARATORS "://"
#endif
-#line 648 "cwebdir/comm-w2c.ch"
+#line 608 "cwebdir/comm-w2c.ch"
char separators[]= SEPARATORS;
/*:87*/
@@ -422,33 +389,33 @@
#line 66 "cwebdir/common.w"
/*3:*/
-#line 43 "cwebdir/comm-w2c.h"
+#line 42 "cwebdir/comm-w2c.h"
extern void common_init(void);
/*:3*//*8:*/
-#line 147 "cwebdir/comm-w2c.h"
+#line 158 "cwebdir/comm-w2c.h"
-extern boolean get_line(void);
+extern bool get_line(void);
extern void check_complete(void);
extern void reset_input(void);
/*:8*//*11:*/
-#line 191 "cwebdir/comm-w2c.h"
+#line 202 "cwebdir/comm-w2c.h"
extern name_pointer id_lookup(const char*,const char*,eight_bits);
-extern name_pointer section_lookup(char*,char*,boolean);
+extern name_pointer section_lookup(char*,char*,bool);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern bool names_match(name_pointer,const char*,size_t,eight_bits);
extern void init_node(name_pointer);
/*:11*//*13:*/
-#line 216 "cwebdir/comm-w2c.h"
+#line 227 "cwebdir/comm-w2c.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -461,7 +428,7 @@
/*:13*//*24:*/
#line 176 "cwebdir/common.w"
-static boolean input_ln(FILE*);
+static bool input_ln(FILE*);
/*:24*//*28:*/
#line 237 "cwebdir/common.w"
@@ -475,8 +442,8 @@
#line 760 "cwebdir/common.w"
static int web_strcmp(char*,size_t,char*,size_t);
-static name_pointer add_section_name(name_pointer,int,char*,char*,boolean);
-static void extend_section_name(name_pointer,char*,char*,boolean);
+static name_pointer add_section_name(name_pointer,int,char*,char*,bool);
+static void extend_section_name(name_pointer,char*,char*,bool);
/*:55*//*64:*/
#line 987 "cwebdir/common.w"
@@ -486,9 +453,9 @@
#line 1184 "cwebdir/common.w"
static void scan_args(void);
-#line 514 "cwebdir/comm-w2c.ch"
+#line 474 "cwebdir/comm-w2c.ch"
/*:76*//*98:*/
-#line 836 "cwebdir/comm-w2c.ch"
+#line 796 "cwebdir/comm-w2c.ch"
static void cb_usage(const_string str);
static void cb_usagehelp(const_string*message);
@@ -516,7 +483,7 @@
#line 78 "cwebdir/comm-w2c.ch"
/*94:*/
-#line 798 "cwebdir/comm-w2c.ch"
+#line 758 "cwebdir/comm-w2c.ch"
kpse_set_program_name(argv[0],"cweb");
@@ -525,7 +492,7 @@
#line 85 "cwebdir/comm-w2c.ch"
/*92:*/
-#line 748 "cwebdir/comm-w2c.ch"
+#line 708 "cwebdir/comm-w2c.ch"
setlocale(LC_MESSAGES,setlocale(LC_CTYPE,""));
texmf_locale= kpse_var_expand("${TEXMFLOCALEDIR}");
@@ -546,9 +513,7 @@
/*74:*/
#line 1137 "cwebdir/common.w"
-#line 463 "cwebdir/comm-w2c.ch"
-make_xrefs= true;
-#line 1139 "cwebdir/common.w"
+show_banner= show_happiness= show_progress= make_xrefs= true;
/*:74*/
#line 86 "cwebdir/comm-w2c.ch"
@@ -555,12 +520,12 @@
#line 101 "cwebdir/common.w"
/*84:*/
-#line 601 "cwebdir/comm-w2c.ch"
+#line 561 "cwebdir/comm-w2c.ch"
scan_args();
if(program==ctangle){
if(check_for_change)/*88:*/
-#line 659 "cwebdir/comm-w2c.ch"
+#line 619 "cwebdir/comm-w2c.ch"
{
if((C_file= fopen(C_file_name,"a"))==NULL)
fatal(_("! Cannot open output file "),C_file_name);
@@ -577,7 +542,7 @@
}
/*:88*/
-#line 604 "cwebdir/comm-w2c.ch"
+#line 564 "cwebdir/comm-w2c.ch"
else if((C_file= fopen(C_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "),C_file_name);
@@ -585,7 +550,7 @@
}
else{
if(check_for_change)/*89:*/
-#line 674 "cwebdir/comm-w2c.ch"
+#line 634 "cwebdir/comm-w2c.ch"
{
if((tex_file= fopen(tex_file_name,"a"))==NULL)
fatal(_("! Cannot open output file "),tex_file_name);
@@ -602,7 +567,7 @@
}
/*:89*/
-#line 610 "cwebdir/comm-w2c.ch"
+#line 570 "cwebdir/comm-w2c.ch"
else if((tex_file= fopen(tex_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "),tex_file_name);
@@ -609,7 +574,7 @@
}
#line 1285 "cwebdir/common.w"
-#line 619 "cwebdir/comm-w2c.ch"
+#line 579 "cwebdir/comm-w2c.ch"
/*:84*/
#line 101 "cwebdir/common.w"
@@ -618,7 +583,7 @@
/*:20*//*23:*/
#line 156 "cwebdir/common.w"
-static boolean input_ln(
+static bool input_ln(
FILE*fp)
{
int c= EOF;
@@ -776,7 +741,7 @@
/*:32*//*35:*/
#line 362 "cwebdir/common.w"
-boolean get_line(void)
+bool get_line(void)
{
restart:
if(changing&&include_depth==change_depth)
@@ -1107,7 +1072,7 @@
int c,
char*first,
char*last,
-boolean ispref)
+bool ispref)
{
name_pointer p= name_ptr;
char*s= first_chunk(p);
@@ -1138,7 +1103,7 @@
name_pointer p,
char*first,
char*last,
-boolean ispref)
+bool ispref)
{
char*s;
name_pointer q= p+1;
@@ -1164,7 +1129,7 @@
name_pointer
section_lookup(
char*first,char*last,
-boolean ispref)
+bool ispref)
{
int c= less;
name_pointer p= root;
@@ -1275,7 +1240,7 @@
name_pointer q= r+1;
char*ss,*s= first_chunk(r);
int c= less;
-boolean ispref;
+bool ispref;
while(true){
ss= (r+1)->byte_start-1;
if(*ss==' '&&ss>=r->byte_start)ispref= true,q= q->link;
@@ -1343,12 +1308,12 @@
if(show_progress||show_happiness||history!=spotless)new_line();
if(show_stats)
print_stats();
-#line 403 "cwebdir/comm-w2c.ch"
+#line 381 "cwebdir/comm-w2c.ch"
/*69:*/
#line 1073 "cwebdir/common.w"
switch(history){
-#line 429 "cwebdir/comm-w2c.ch"
+#line 395 "cwebdir/comm-w2c.ch"
case spotless:
if(show_happiness)puts(_("(No errors were found.)"));break;
case harmless_message:
@@ -1361,10 +1326,10 @@
}
/*:69*/
-#line 403 "cwebdir/comm-w2c.ch"
+#line 381 "cwebdir/comm-w2c.ch"
/*90:*/
-#line 692 "cwebdir/comm-w2c.ch"
+#line 652 "cwebdir/comm-w2c.ch"
if(C_file)fclose(C_file);
if(tex_file)fclose(tex_file);
@@ -1373,17 +1338,12 @@
remove(check_file_name);
/*:90*/
-#line 404 "cwebdir/comm-w2c.ch"
+#line 382 "cwebdir/comm-w2c.ch"
-#line 411 "cwebdir/comm-w2c.ch"
-switch(history){
-case spotless:return RETURN_OK;
-case harmless_message:return RETURN_WARN;
-case error_message:return RETURN_ERROR;
-case fatal_message:default:return RETURN_FAIL;
+#line 1069 "cwebdir/common.w"
+if(history> harmless_message)return EXIT_FAILURE;
+else return EXIT_SUCCESS;
}
-#line 1071 "cwebdir/common.w"
-}
/*:68*//*70:*/
#line 1091 "cwebdir/common.w"
@@ -1402,7 +1362,7 @@
overflow(
const char*t)
{
-#line 442 "cwebdir/comm-w2c.ch"
+#line 408 "cwebdir/comm-w2c.ch"
printf(_("\n! Sorry, %s capacity exceeded"),t);fatal("","");
#line 1107 "cwebdir/common.w"
}
@@ -1417,20 +1377,20 @@
char*dot_pos;
char*name_pos;
char*s;
-boolean found_web= false,found_change= false,found_out= false;
+bool found_web= false,found_change= false,found_out= false;
-#line 486 "cwebdir/comm-w2c.ch"
+#line 446 "cwebdir/comm-w2c.ch"
strcpy(change_file_name,"/dev/null");
#if defined DEV_NULL
strncpy(change_file_name,DEV_NULL,max_file_name_length-2);
change_file_name[max_file_name_length-2]= '\0';
#elif defined _DEV_NULL
-#line 491 "cwebdir/comm-w2c.ch"
+#line 451 "cwebdir/comm-w2c.ch"
strncpy(change_file_name,_DEV_NULL,max_file_name_length-2);
change_file_name[max_file_name_length-2]= '\0';
#endif
-#line 494 "cwebdir/comm-w2c.ch"
+#line 454 "cwebdir/comm-w2c.ch"
#line 1166 "cwebdir/common.w"
while(--argc> 0){
@@ -1437,12 +1397,12 @@
if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/
#line 1245 "cwebdir/common.w"
-#line 527 "cwebdir/comm-w2c.ch"
+#line 487 "cwebdir/comm-w2c.ch"
{
if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0)
/*97:*/
-#line 827 "cwebdir/comm-w2c.ch"
+#line 787 "cwebdir/comm-w2c.ch"
cb_usagehelp(program==ctangle?CTANGLEHELP:
program==cweave?CWEAVEHELP:CTWILLHELP);
@@ -1449,12 +1409,12 @@
/*:97*/
-#line 530 "cwebdir/comm-w2c.ch"
+#line 490 "cwebdir/comm-w2c.ch"
if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0)
/*100:*/
-#line 873 "cwebdir/comm-w2c.ch"
+#line 833 "cwebdir/comm-w2c.ch"
printversionandexit(cb_banner,
program==ctwill?"Donald E. Knuth":"Silvio Levy and Donald E. Knuth",
@@ -1462,7 +1422,7 @@
/*:100*/
-#line 533 "cwebdir/comm-w2c.ch"
+#line 493 "cwebdir/comm-w2c.ch"
if(strcmp("-verbose",*argv)==0||strcmp("--verbose",*argv)==0)
@@ -1476,15 +1436,15 @@
case'q':show_banner= show_progress= show_happiness= false;continue;
case'd':
if(sscanf(++dot_pos,"%u",&kpathsea_debug)!=1)/*81:*/
-#line 570 "cwebdir/comm-w2c.ch"
+#line 530 "cwebdir/comm-w2c.ch"
cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill");
#line 1260 "cwebdir/common.w"
-#line 578 "cwebdir/comm-w2c.ch"
+#line 538 "cwebdir/comm-w2c.ch"
/*:81*/
-#line 545 "cwebdir/comm-w2c.ch"
+#line 505 "cwebdir/comm-w2c.ch"
while(isdigit(*dot_pos))dot_pos++;
dot_pos--;
@@ -1497,7 +1457,7 @@
}
#line 1248 "cwebdir/common.w"
-#line 570 "cwebdir/comm-w2c.ch"
+#line 530 "cwebdir/comm-w2c.ch"
/*:80*/
#line 1167 "cwebdir/common.w"
@@ -1504,7 +1464,7 @@
else{
s= name_pos= *argv;dot_pos= NULL;
while(*s)
-#line 502 "cwebdir/comm-w2c.ch"
+#line 462 "cwebdir/comm-w2c.ch"
if(*s=='.')dot_pos= s++;
else if(*s==DIR_SEPARATOR||*s==DEVICE_SEPARATOR||*s=='/')
dot_pos= NULL,name_pos= ++s;
@@ -1517,7 +1477,7 @@
{
if(s-*argv> max_file_name_length-5)
/*82:*/
-#line 578 "cwebdir/comm-w2c.ch"
+#line 538 "cwebdir/comm-w2c.ch"
fatal(_("! Filename too long\n"),*argv);
#line 1262 "cwebdir/common.w"
@@ -1551,7 +1511,7 @@
if(strcmp(*argv,"-")!=0){
if(s-*argv> max_file_name_length-4)
/*82:*/
-#line 578 "cwebdir/comm-w2c.ch"
+#line 538 "cwebdir/comm-w2c.ch"
fatal(_("! Filename too long\n"),*argv);
#line 1262 "cwebdir/common.w"
@@ -1575,7 +1535,7 @@
{
if(s-*argv> max_file_name_length-5)
/*82:*/
-#line 578 "cwebdir/comm-w2c.ch"
+#line 538 "cwebdir/comm-w2c.ch"
fatal(_("! Filename too long\n"),*argv);
#line 1262 "cwebdir/common.w"
@@ -1602,13 +1562,13 @@
#line 1177 "cwebdir/common.w"
else/*81:*/
-#line 570 "cwebdir/comm-w2c.ch"
+#line 530 "cwebdir/comm-w2c.ch"
cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill");
#line 1260 "cwebdir/common.w"
-#line 578 "cwebdir/comm-w2c.ch"
+#line 538 "cwebdir/comm-w2c.ch"
/*:81*/
#line 1178 "cwebdir/common.w"
@@ -1615,13 +1575,13 @@
}
}
if(!found_web)/*81:*/
-#line 570 "cwebdir/comm-w2c.ch"
+#line 530 "cwebdir/comm-w2c.ch"
cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill");
#line 1260 "cwebdir/common.w"
-#line 578 "cwebdir/comm-w2c.ch"
+#line 538 "cwebdir/comm-w2c.ch"
/*:81*/
#line 1181 "cwebdir/common.w"
@@ -1628,7 +1588,7 @@
}
/*:75*//*99:*/
-#line 840 "cwebdir/comm-w2c.ch"
+#line 800 "cwebdir/comm-w2c.ch"
static void cb_usage(const_string str)
{
@@ -1660,7 +1620,7 @@
}
/*:99*//*101:*/
-#line 881 "cwebdir/comm-w2c.ch"
+#line 841 "cwebdir/comm-w2c.ch"
void cb_show_banner(void)
{
Modified: branches/stable/source/src/texk/web2c/cwebdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,80 @@
+2025-04-30 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.ch,
+ * po/de/web2c-help.po,
+ * po/web2c-help.pot: Restore default behavior of generic CWEB.
+
+2025-04-18 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.h,
+ * common.c,
+ * common.h,
+ * ctangle.c: Amend special characters.
+
+2025-04-17 Andreas Scherer <https://ascherer.github.io>
+
+ * Makefile,
+ * comm-w2c.h,
+ * common.c,
+ * common.h,
+ * ctang-w2c.ch,
+ * ctangle.c,
+ * ctangle.w: Make proper use of 'ishigh' macro.
+
+2025-04-09 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-bs.ch,
+ * comm-mac.ch,
+ * comm-mini.ch,
+ * comm-w2c.ch,
+ * comm-w2c.h,
+ * comm-w32.ch,
+ * common.bux,
+ * common.c,
+ * common.h,
+ * common.w,
+ * ctang-w2c.ch,
+ * ctang-w32.ch,
+ * ctangle.c,
+ * ctangle.w,
+ * ctwill-hint.ch,
+ * ctwill-mini.ch,
+ * ctwill-w2c.ch,
+ * ctwill.bux,
+ * cweav-w2c.ch,
+ * cweav-w32.ch,
+ * cweave.w: Replace type 'boolean' with 'bool'.
+
+2025-04-09 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.ch,
+ * comm-w2c.h,
+ * ctwill-mini.ch,
+ * ctwill-w2c.ch: Revert bool change for C23.
+
+2025-03-31 Andreas Scherer <https://ascherer.github.io>
+
+ * common.c,
+ * ctangle.c,
+ * ctangle.w: Discard trailing whitespace in macros.
+
+2025-03-12 Andreas Scherer <https://ascherer.github.io>
+
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch,
+ * cweave.w,
+ * po/cweb.pot,
+ * po/de/cweb.po,
+ * po/it/cweb.po: Handle verbatim strings in TeX part.
+
+2025-02-26 Andreas Scherer <https://ascherer.github.io>
+
+ * tests/ham-sorted.tex,
+ * tests/ham.ch,
+ * tests/ham.ref,
+ * tests/ham.sref,
+ * tests/ham.tex: Command-line option 'm' is no SGB variable.
+
2025-02-02 Andreas Scherer <https://ascherer.github.io>
* ctwill-mini.ch: Avoid several 'Overfull \vbox'es.
Modified: branches/stable/source/src/texk/web2c/cwebdir/Makefile
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/Makefile 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/Makefile 2025-05-17 22:44:20 UTC (rev 964)
@@ -56,7 +56,7 @@
#LINKFLAGS = -s # for smaller (stripped) executables on many UNIX systems
# What C compiler are you using?
-CC = cc
+#CC = cc
# RM and CP are used below in case rm and cp are aliased
RM= /bin/rm
Modified: branches/stable/source/src/texk/web2c/cwebdir/comm-bs.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/comm-bs.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/comm-bs.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -141,7 +141,7 @@
int c, /* right or left? */
char *first, /* first character of section name */
char *last, /* last character of section name, plus one */
-boolean ispref) /* are we adding a prefix or a full name? */
+bool ispref) /* are we adding a prefix or a full name? */
{
name_pointer p=name_ptr; /* new node */
char *s=first_chunk(p);
@@ -152,7 +152,7 @@
int c, /* right or left? */
char huge* first, /* first character of section name */
char huge* last, /* last character of section name, plus one */
-boolean ispref) /* are we adding a prefix or a full name? */
+bool ispref) /* are we adding a prefix or a full name? */
{
name_pointer p=name_ptr; /* new node */
char huge* s=first_chunk(p);
@@ -165,7 +165,7 @@
name_pointer p, /* name to be extended */
char *first, /* beginning of extension text */
char *last, /* one beyond end of extension text */
-boolean ispref) /* are we adding a prefix or a full name? */
+bool ispref) /* are we adding a prefix or a full name? */
{
char *s;
@y
@@ -174,7 +174,7 @@
name_pointer p, /* name to be extended */
char huge* first, /* beginning of extension text */
char huge* last, /* one beyond end of extension text */
-boolean ispref) /* are we adding a prefix or a full name? */
+bool ispref) /* are we adding a prefix or a full name? */
{
char huge* s;
@z
Modified: branches/stable/source/src/texk/web2c/cwebdir/comm-mac.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/comm-mac.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/comm-mac.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -15,7 +15,7 @@
@^system dependencies@>
@c
-static boolean input_ln( /* copies a line into |buffer| or returns |false| */
+static bool input_ln( /* copies a line into |buffer| or returns |false| */
FILE *fp) /* what file to read from */
{
int c=EOF; /* character read; initialized so some compilers won't complain */
@@ -43,7 +43,7 @@
@^system dependencies@>
@c
-static boolean input_ln( /* copies a line into |buffer| or returns |false| */
+static bool input_ln( /* copies a line into |buffer| or returns |false| */
FILE *fp) /* what file to read from */
{
int c=EOF; /* character read; initialized so some compilers won't complain */
Modified: branches/stable/source/src/texk/web2c/cwebdir/comm-mini.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/comm-mini.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/comm-mini.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -58,11 +58,11 @@
Section 24.
@x
-@ @<Predecl...@>=@+static boolean input_ln(FILE *);
+@ @<Predecl...@>=@+static bool input_ln(FILE *);
@y
-@ @<Predecl...@>=@+static boolean input_ln(FILE *);
+@ @<Predecl...@>=@+static bool input_ln(FILE *);
@-input_ln@>
-@$input_ln {COMMON}23 \&{static} \&{boolean} (\,)@>
+@$input_ln {COMMON}23 \&{static} \&{bool} (\,)@>
@z
ẞection 28.
Modified: branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -67,7 +67,7 @@
@z
@x [1.18] l.80
-boolean program; /* \.{CWEAVE} or \.{CTANGLE}? */
+bool program; /* \.{CWEAVE} or \.{CTANGLE}? */
@y
cweb program; /* \.{CTANGLE} or \.{CWEAVE} or \.{CTWILL}? */
@z
@@ -375,28 +375,6 @@
else printf(_(". (l. %d of include file %s)\n"), cur_line, cur_file_name);
@z
- at x [6.68] l.1057
-Some implementations may wish to pass the |history| value to the
-operating system so that it can be used to govern whether or not other
-programs are started. Here, for instance, we pass the operating system
-a status of |EXIT_SUCCESS| if and only if only harmless messages were printed.
-@^system dependencies@>
- at y
-On multi-tasking systems like the {\mc AMIGA} it is very convenient to
-know a little bit more about the reasons why a program failed. The four
-levels of return indicated by the |history| value are very suitable for
-this purpose. Here, for instance, we pass the operating system a status
-of~0 if and only if the run was a complete success. Any warning or error
-message will result in a higher return value, so that {\mc AREXX} scripts
-can be made sensitive to these conditions.
-@^system dependencies@>
-
- at d RETURN_OK 0 /* No problems, success */
- at d RETURN_WARN 5 /* A warning only */
- at d RETURN_ERROR 10 /* Something wrong */
- at d RETURN_FAIL 20 /* Complete or severe failure */
- at z
-
@x [6.68] l.1068
@<Print the job |history|@>@;
@y
@@ -404,18 +382,6 @@
@<Remove the temporary file if not already done@>@;
@z
- at x [6.68] l.1069
- if (history > harmless_message) return EXIT_FAILURE;
- else return EXIT_SUCCESS;
- at y
- switch(history) {
- case spotless: return RETURN_OK;
- case harmless_message: return RETURN_WARN;
- case error_message: return RETURN_ERROR;
- case fatal_message: default: return RETURN_FAIL;
- }
- at z
-
@x [6.69] l.1075
case spotless:
if (show_happiness) puts("(No errors were found.)"); break;
@@ -457,12 +423,6 @@
char check_file_name[max_file_name_length]; /* name of |check_file| */
@z
- at x [7.74] l.1138
-show_banner=show_happiness=show_progress=make_xrefs=true;
- at y
-make_xrefs=true;
- at z
-
@x [7.75] l.1142
file. It may have an extension, or it may omit the extension to get |".w"| or
|".web"| added. The \TEX/ output file name is formed by replacing the \.{CWEB}
Modified: branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.h
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -29,7 +29,6 @@
@i iso_types.w
- at s boolean bool
@<Common code...@>=@^system dependencies@>
typedef uint8_t eight_bits;
typedef uint16_t sixteen_bits;
@@ -48,15 +47,12 @@
`|@!gettext|' function from the ``GNU~gettext utilities.'' For systems that do
not have this library installed, we wrap things for neutral behavior without
internationalization.
-For backward compatibility with pre-{\mc ANSI} compilers, we replace the
-``standard'' header file `\.{stdbool.h}' with the@^system dependencies@>
-{\mc KPATHSEA\spacefactor1000} interface `\.{simpletypes.h}'.
@d _(s) gettext(s)
@<Include files@>=
#include <ctype.h> /* definition of |@!isalpha|, |@!isdigit| and so on */
-#include <kpathsea/simpletypes.h> /* |@!boolean|, |@!true| and |@!false| */
+#include <stdbool.h> /* definition of |@!bool|, |@!true| and |@!false| */
#include <stddef.h> /* definition of |@!ptrdiff_t| */
#include <stdint.h> /* definition of |@!uint8_t| and |@!uint16_t| */
#include <stdio.h> /* definition of |@!printf| and friends */
@@ -76,21 +72,36 @@
@ Code related to the character set:
@^ASCII code dependencies@>
- at d and_and 04 /* `\.{\&\&}'\,; corresponds to MIT's {\tentex\char'4} */
- at d lt_lt 020 /* `\.{<<}'\,; corresponds to MIT's {\tentex\char'20} */
- at d gt_gt 021 /* `\.{>>}'\,; corresponds to MIT's {\tentex\char'21} */
- at d plus_plus 013 /* `\.{++}'\,; corresponds to MIT's {\tentex\char'13} */
- at d minus_minus 01 /* `\.{--}'\,; corresponds to MIT's {\tentex\char'1} */
- at d minus_gt 031 /* `\.{->}'\,; corresponds to MIT's {\tentex\char'31} */
- at d non_eq 032 /* `\.{!=}'\,; corresponds to MIT's {\tentex\char'32} */
- at d lt_eq 034 /* `\.{<=}'\,; corresponds to MIT's {\tentex\char'34} */
- at d gt_eq 035 /* `\.{>=}'\,; corresponds to MIT's {\tentex\char'35} */
- at d eq_eq 036 /* `\.{==}'\,; corresponds to MIT's {\tentex\char'36} */
- at d or_or 037 /* `\.{\v\v}'\,; corresponds to MIT's {\tentex\char'37} */
- at d dot_dot_dot 016 /* `\.{...}'\,; corresponds to MIT's {\tentex\char'16} */
- at d colon_colon 06 /* `\.{::}'\,; corresponds to MIT's {\tentex\char'6} */
- at d period_ast 026 /* `\.{.*}'\,; corresponds to MIT's {\tentex\char'26} */
- at d minus_gt_ast 027 /* `\.{->*}'\,; corresponds to MIT's {\tentex\char'27} */
+ at d and_and 04 /* `\.{\&\&}'\,; corresponds to MIT's {\tentex\char'4}
+ and ASCII~\.{EOT} */
+ at d lt_lt 020 /* `\.{<<}'\,; corresponds to MIT's {\tentex\char'20}
+ and ASCII~\.{DLE} */
+ at d gt_gt 021 /* `\.{>>}'\,; corresponds to MIT's {\tentex\char'21}
+ and ASCII~\.{DC1} */
+ at d plus_plus 013 /* `\.{++}'\,; corresponds to MIT's {\tentex\char'13}
+ and ASCII~\.{VT} aka~|'\v'| */
+ at d minus_minus 01 /* `\.{--}'\,; corresponds to MIT's {\tentex\char'1}
+ and ASCII~\.{SOH} */
+ at d minus_gt 031 /* `\.{->}'\,; corresponds to MIT's {\tentex\char'31}
+ and ASCII~\.{EM} */
+ at d non_eq 032 /* `\.{!=}'\,; corresponds to MIT's {\tentex\char'32}
+ and ASCII~\.{SUB} */
+ at d lt_eq 034 /* `\.{<=}'\,; corresponds to MIT's {\tentex\char'34}
+ and ASCII~\.{FS} */
+ at d gt_eq 035 /* `\.{>=}'\,; corresponds to MIT's {\tentex\char'35}
+ and ASCII~\.{GS} */
+ at d eq_eq 036 /* `\.{==}'\,; corresponds to MIT's {\tentex\char'36}
+ and ASCII~\.{RS} */
+ at d or_or 037 /* `\.{\v\v}'\,; corresponds to MIT's {\tentex\char'37}
+ and ASCII~\.{US} */
+ at d dot_dot_dot 016 /* `\.{...}'\,; corresponds to MIT's {\tentex\char'16}
+ and ASCII~\.{SO} */
+ at d colon_colon 06 /* `\.{::}'\,; corresponds to MIT's {\tentex\char'6}
+ and ASCII~\.{ACK} */
+ at d period_ast 026 /* `\.{.*}'\,; corresponds to MIT's {\tentex\char'26}
+ and ASCII~\.{SYN} */
+ at d minus_gt_ast 027 /* `\.{->*}'\,; corresponds to MIT's {\tentex\char'27}
+ and ASCII~\.{ETB} */
@#
@d compress(c) if (loc++<=limit) return c
@@ -101,12 +112,12 @@
extern char *id_loc; /* just after the current identifier in the buffer */
@ Code related to input routines:
- at d xisalpha(c) (isalpha((int)(c))&&((eight_bits)(c)<0200))
- at d xisdigit(c) (isdigit((int)(c))&&((eight_bits)(c)<0200))
- at d xisspace(c) (isspace((int)(c))&&((eight_bits)(c)<0200))
- at d xislower(c) (islower((int)(c))&&((eight_bits)(c)<0200))
- at d xisupper(c) (isupper((int)(c))&&((eight_bits)(c)<0200))
- at d xisxdigit(c) (isxdigit((int)(c))&&((eight_bits)(c)<0200))
+ at d xisalpha(c) (isalpha((int)(c))&&!ishigh(c))
+ at d xisdigit(c) (isdigit((int)(c))&&!ishigh(c))
+ at d xisspace(c) (isspace((int)(c))&&!ishigh(c))
+ at d xislower(c) (islower((int)(c))&&!ishigh(c))
+ at d xisupper(c) (isupper((int)(c))&&!ishigh(c))
+ at d xisxdigit(c) (isxdigit((int)(c))&&!ishigh(c))
@d isxalpha(c) ((c)=='_' || (c)=='$')
/* non-alpha characters allowed in identifier */
@d ishigh(c) ((eight_bits)(c)>0177)
@@ -140,12 +151,12 @@
extern int line[]; /* number of current line in the stacked files */
extern int change_line; /* number of current line in change file */
extern int change_depth; /* where \.{@@y} originated during a change */
-extern boolean input_has_ended; /* if there is no more input */
-extern boolean changing; /* if the current line is from |change_file| */
-extern boolean web_file_open; /* if the web file is being read */
+extern bool input_has_ended; /* if there is no more input */
+extern bool changing; /* if the current line is from |change_file| */
+extern bool web_file_open; /* if the web file is being read */
@ @<Predecl...@>=
-extern boolean get_line(void); /* inputs the next line */
+extern bool get_line(void); /* inputs the next line */
extern void check_complete(void); /* checks that all changes were picked up */
extern void reset_input(void); /* initialize to read the web file and change file */
@@ -152,9 +163,9 @@
@ Code related to section numbers:
@<Common code...@>=
extern sixteen_bits section_count; /* the current section number */
-extern boolean changed_section[]; /* is the section changed? */
-extern boolean change_pending; /* is a decision about change still unclear? */
-extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */
+extern bool changed_section[]; /* is the section changed? */
+extern bool change_pending; /* is a decision about change still unclear? */
+extern bool print_where; /* tells \.{CTANGLE} to print line and file info */
@ Code related to identifier and section name storage:
@d length(c) (size_t)((c+1)->byte_start-(c)->byte_start) /* the length of a name */
@@ -191,12 +202,12 @@
@ @<Predecl...@>=
extern name_pointer id_lookup(const char *,const char *,eight_bits);
/* looks up a string in the identifier table */
-extern name_pointer section_lookup(char *,char *,boolean); /* finds section name */
+extern name_pointer section_lookup(char *,char *,bool); /* finds section name */
extern void print_prefix_name(name_pointer);@/
extern void print_section_name(name_pointer);@/
extern void sprint_section_name(char *,name_pointer);
@#
-extern boolean names_match(name_pointer,const char *,size_t,eight_bits);
+extern bool names_match(name_pointer,const char *,size_t,eight_bits);
/* two routines defined in \.{ctangle.w} and \.{cweave.w} */
extern void init_node(name_pointer);
@@ -239,7 +250,7 @@
extern char idx_file_name[]; /* name of |idx_file| */
extern char scn_file_name[]; /* name of |scn_file| */
extern char check_file_name[]; /* name of |check_file| */
-extern boolean flags[]; /* an option for each 7-bit code */
+extern bool flags[]; /* an option for each 7-bit code */
extern const char *use_language; /* prefix to \.{cwebmac.tex} in \TEX/ output */
@ Code related to output:
Modified: branches/stable/source/src/texk/web2c/cwebdir/comm-w32.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/comm-w32.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/comm-w32.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -35,9 +35,9 @@
set of programs using the __fastcall convention.
@x section 11
-extern boolean names_match(name_pointer,const char *,size_t,eight_bits);
+extern bool names_match(name_pointer,const char *,size_t,eight_bits);
@y
-extern boolean __cdecl names_match(name_pointer,const char *,size_t,eight_bits);
+extern bool __cdecl names_match(name_pointer,const char *,size_t,eight_bits);
@z
@x section 75
Modified: branches/stable/source/src/texk/web2c/cwebdir/common.bux
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/common.bux 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/common.bux 2025-05-17 22:44:20 UTC (rev 964)
@@ -17,7 +17,7 @@
@$xref {CWEAVE.W}24 \\{equiv\_or\_xref}@>
@$init_node {CWEAVE.W}32 \&{void} (\,)@>
-@$names_match {CWEAVE.W}32 \&{boolean} (\,)@>
+@$names_match {CWEAVE.W}32 \&{bool} (\,)@>
@$print_stats {CWEAVE.W}270 \&{void} (\,)@>
Modified: branches/stable/source/src/texk/web2c/cwebdir/common.c
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/common.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/common.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -2,7 +2,7 @@
#line 62 "common.w"
/*4:*/
-#line 48 "common.h"
+#line 47 "common.h"
#include <ctype.h>
#include <stdbool.h>
@@ -16,8 +16,7 @@
#line 63 "common.w"
#define ctangle false
-#define cweave true \
-
+#define cweave true
#define and_and 04
#define lt_lt 020
#define gt_gt 021
@@ -32,38 +31,29 @@
#define dot_dot_dot 016
#define colon_colon 06
#define period_ast 026
-#define minus_gt_ast 027 \
-
-#define compress(c) if(loc++<=limit) return c \
-
-#define xisalpha(c) (isalpha((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisdigit(c) (isdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisspace(c) (isspace((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xislower(c) (islower((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisupper(c) (isupper((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisxdigit(c) (isxdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define isxalpha(c) ((c) =='_'||(c) =='$') \
-
-#define ishigh(c) ((eight_bits) (c) > 0177) \
- \
-
-#define max_include_depth 10 \
-
+#define minus_gt_ast 027
+#define compress(c) if(loc++<=limit) return c
+#define xisalpha(c) (isalpha((int) (c) ) &&!ishigh(c) )
+#define xisdigit(c) (isdigit((int) (c) ) &&!ishigh(c) )
+#define xisspace(c) (isspace((int) (c) ) &&!ishigh(c) )
+#define xislower(c) (islower((int) (c) ) &&!ishigh(c) )
+#define xisupper(c) (isupper((int) (c) ) &&!ishigh(c) )
+#define xisxdigit(c) (isxdigit((int) (c) ) &&!ishigh(c) )
+#define isxalpha(c) ((c) =='_'||(c) =='$')
+#define ishigh(c) ((eight_bits) (c) > 0177)
+#define max_include_depth 10
#define max_file_name_length 60
#define cur_file file[include_depth]
#define cur_file_name file_name[include_depth]
#define cur_line line[include_depth]
#define web_file file[0]
-#define web_file_name file_name[0] \
-
-#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
-#define print_id(c) term_write((c) ->byte_start,length(c) )
+#define web_file_name file_name[0]
+#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
+#define print_id(c) term_write((c) ->byte_start,length(c) )
#define llink link
#define rlink dummy.Rlink
-#define root name_dir->rlink \
-
-#define ilk dummy.Ilk \
-
+#define root name_dir->rlink
+#define ilk dummy.Ilk
#define spotless 0
#define harmless_message 1
#define error_message 2
@@ -70,72 +60,56 @@
#define fatal_message 3
#define mark_harmless() if(history==spotless) history= harmless_message
#define mark_error() history= error_message
-#define confusion(s) fatal("! This can't happen: ",s) \
- \
-
+#define confusion(s) fatal("! This can't happen: ",s)
#define show_banner flags['b']
#define show_progress flags['p']
#define show_happiness flags['h']
#define show_stats flags['s']
-#define make_xrefs flags['x'] \
-
-#define update_terminal() fflush(stdout)
-#define new_line() putchar('\n')
-#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \
-
+#define make_xrefs flags['x']
+#define update_terminal() fflush(stdout)
+#define new_line() putchar('\n')
+#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout)
#define buf_size 200
-#define longest_name 10000 \
-
-#define long_buf_size (buf_size+longest_name)
-#define max_bytes 100000 \
-
-#define max_names 5000 \
-
-#define max_sections 2000 \
-
+#define longest_name 10000
+#define long_buf_size (buf_size+longest_name)
+#define max_bytes 100000
+#define max_names 5000
+#define max_sections 2000
#define lines_dont_match (change_limit-change_buffer!=limit-buffer|| \
-strncmp(buffer,change_buffer,(size_t) (limit-buffer) ) !=0) \
-
+strncmp(buffer,change_buffer,(size_t) (limit-buffer) ) !=0)
#define if_section_start_make_pending(b) \
*limit= '!'; \
for(loc= buffer;xisspace(*loc) ;loc++) ; \
*limit= ' '; \
-if(*loc=='@'&&(xisspace(*(loc+1) ) ||*(loc+1) =='*') ) change_pending= b \
-
+if(*loc=='@'&&(xisspace(*(loc+1) ) ||*(loc+1) =='*') ) change_pending= b
#define too_long() {include_depth--; \
-err_print("! Include file name too long") ;goto restart;} \
-
-#define hash_size 353 \
-
-#define first_chunk(p) ((p) ->byte_start+2)
+err_print("! Include file name too long") ;goto restart;}
+#define hash_size 353
+#define first_chunk(p) ((p) ->byte_start+2)
#define prefix_length(p) (size_t) ((eight_bits) *((p) ->byte_start) *256+ \
-(eight_bits) *((p) ->byte_start+1) )
+(eight_bits) *((p) ->byte_start+1) )
#define set_prefix_length(p,m) (*((p) ->byte_start) = (char) ((m) /256) , \
-*((p) ->byte_start+1) = (char) ((m) %256) ) \
-
+*((p) ->byte_start+1) = (char) ((m) %256) )
#define less 0
#define equal 1
#define greater 2
#define prefix 3
-#define extension 4 \
+#define extension 4
+#define bad_extension 5
+#define flag_change (**argv!='-')
-#define bad_extension 5 \
-
-#define flag_change (**argv!='-')
-
#line 64 "common.w"
/*2:*/
#line 35 "common.h"
-typedef bool boolean;
typedef uint8_t eight_bits;
typedef uint16_t sixteen_bits;
-extern boolean program;
+extern bool program;
extern int phase;
/*:2*//*5:*/
-#line 78 "common.h"
+#line 92 "common.h"
extern char section_text[];
extern char*section_text_end;
@@ -143,7 +117,7 @@
extern char*id_loc;
/*:5*//*6:*/
-#line 96 "common.h"
+#line 110 "common.h"
extern char buffer[];
extern char*buffer_end;
@@ -151,7 +125,7 @@
extern char*limit;
/*:6*//*7:*/
-#line 113 "common.h"
+#line 127 "common.h"
extern int include_depth;
extern FILE*file[];
@@ -162,20 +136,20 @@
extern int line[];
extern int change_line;
extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
+extern bool input_has_ended;
+extern bool changing;
+extern bool web_file_open;
/*:7*//*9:*/
-#line 133 "common.h"
+#line 147 "common.h"
extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
+extern bool changed_section[];
+extern bool change_pending;
+extern bool print_where;
/*:9*//*10:*/
-#line 148 "common.h"
+#line 162 "common.h"
typedef struct name_info{
char*byte_start;
@@ -200,12 +174,12 @@
extern hash_pointer hash_ptr;
/*:10*//*12:*/
-#line 193 "common.h"
+#line 207 "common.h"
extern int history;
/*:12*//*14:*/
-#line 211 "common.h"
+#line 225 "common.h"
extern int argc;
extern char**argv;
@@ -213,10 +187,10 @@
extern char tex_file_name[];
extern char idx_file_name[];
extern char scn_file_name[];
-extern boolean flags[];
+extern bool flags[];
/*:14*//*15:*/
-#line 225 "common.h"
+#line 239 "common.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -230,7 +204,7 @@
/*18:*/
#line 79 "common.w"
-boolean program;
+bool program;
/*:18*//*19:*/
#line 88 "common.w"
@@ -266,9 +240,9 @@
int line[max_include_depth];
int change_line;
int change_depth;
-boolean input_has_ended;
-boolean changing;
-boolean web_file_open= false;
+bool input_has_ended;
+bool changing;
+bool web_file_open= false;
/*:25*//*26:*/
#line 216 "common.w"
@@ -280,10 +254,10 @@
#line 545 "common.w"
sixteen_bits section_count;
-boolean changed_section[max_sections];
-boolean change_pending;
+bool changed_section[max_sections];
+bool change_pending;
-boolean print_where= false;
+bool print_where= false;
/*:42*//*43:*/
#line 590 "common.w"
@@ -320,7 +294,7 @@
char tex_file_name[max_file_name_length];
char idx_file_name[max_file_name_length];
char scn_file_name[max_file_name_length];
-boolean flags[128];
+bool flags[128];
/*:73*//*83:*/
#line 1267 "common.w"
@@ -335,33 +309,33 @@
#line 66 "common.w"
/*3:*/
-#line 43 "common.h"
+#line 42 "common.h"
extern void common_init(void);
/*:3*//*8:*/
-#line 127 "common.h"
+#line 141 "common.h"
-extern boolean get_line(void);
+extern bool get_line(void);
extern void check_complete(void);
extern void reset_input(void);
/*:8*//*11:*/
-#line 171 "common.h"
+#line 185 "common.h"
extern name_pointer id_lookup(const char*,const char*,eight_bits);
-extern name_pointer section_lookup(char*,char*,boolean);
+extern name_pointer section_lookup(char*,char*,bool);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern bool names_match(name_pointer,const char*,size_t,eight_bits);
extern void init_node(name_pointer);
/*:11*//*13:*/
-#line 196 "common.h"
+#line 210 "common.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -372,7 +346,7 @@
/*:13*//*24:*/
#line 176 "common.w"
-static boolean input_ln(FILE*);
+static bool input_ln(FILE*);
/*:24*//*28:*/
#line 237 "common.w"
@@ -386,8 +360,8 @@
#line 760 "common.w"
static int web_strcmp(char*,size_t,char*,size_t);
-static name_pointer add_section_name(name_pointer,int,char*,char*,boolean);
-static void extend_section_name(name_pointer,char*,char*,boolean);
+static name_pointer add_section_name(name_pointer,int,char*,char*,bool);
+static void extend_section_name(name_pointer,char*,char*,bool);
/*:55*//*64:*/
#line 987 "common.w"
@@ -448,7 +422,7 @@
/*:20*//*23:*/
#line 156 "common.w"
-static boolean input_ln(
+static bool input_ln(
FILE*fp)
{
int c= EOF;
@@ -590,7 +564,7 @@
/*:32*//*35:*/
#line 362 "common.w"
-boolean get_line(void)
+bool get_line(void)
{
restart:
if(changing&&include_depth==change_depth)
@@ -903,7 +877,7 @@
int c,
char*first,
char*last,
-boolean ispref)
+bool ispref)
{
name_pointer p= name_ptr;
char*s= first_chunk(p);
@@ -932,7 +906,7 @@
name_pointer p,
char*first,
char*last,
-boolean ispref)
+bool ispref)
{
char*s;
name_pointer q= p+1;
@@ -954,7 +928,7 @@
name_pointer
section_lookup(
char*first,char*last,
-boolean ispref)
+bool ispref)
{
int c= less;
name_pointer p= root;
@@ -1053,7 +1027,7 @@
name_pointer q= r+1;
char*ss,*s= first_chunk(r);
int c= less;
-boolean ispref;
+bool ispref;
while(true){
ss= (r+1)->byte_start-1;
if(*ss==' '&&ss>=r->byte_start)ispref= true,q= q->link;
@@ -1170,7 +1144,7 @@
char*dot_pos;
char*name_pos;
char*s;
-boolean found_web= false,found_change= false,found_out= false;
+bool found_web= false,found_change= false,found_out= false;
strcpy(change_file_name,"/dev/null");
Modified: branches/stable/source/src/texk/web2c/cwebdir/common.h
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/common.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/common.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -33,10 +33,9 @@
@d cweave true
@<Common code...@>=@^system dependencies@>
-typedef bool boolean;
typedef uint8_t eight_bits;
typedef uint16_t sixteen_bits;
-extern boolean program; /* \.{CWEAVE} or \.{CTANGLE}? */
+extern bool program; /* \.{CWEAVE} or \.{CTANGLE}? */
extern int phase; /* which phase are we in? */
@ The procedure that gets everything rolling:
@@ -57,21 +56,36 @@
@ Code related to the character set:
@^ASCII code dependencies@>
- at d and_and 04 /* `\.{\&\&}'\,; corresponds to MIT's {\tentex\char'4} */
- at d lt_lt 020 /* `\.{<<}'\,; corresponds to MIT's {\tentex\char'20} */
- at d gt_gt 021 /* `\.{>>}'\,; corresponds to MIT's {\tentex\char'21} */
- at d plus_plus 013 /* `\.{++}'\,; corresponds to MIT's {\tentex\char'13} */
- at d minus_minus 01 /* `\.{--}'\,; corresponds to MIT's {\tentex\char'1} */
- at d minus_gt 031 /* `\.{->}'\,; corresponds to MIT's {\tentex\char'31} */
- at d non_eq 032 /* `\.{!=}'\,; corresponds to MIT's {\tentex\char'32} */
- at d lt_eq 034 /* `\.{<=}'\,; corresponds to MIT's {\tentex\char'34} */
- at d gt_eq 035 /* `\.{>=}'\,; corresponds to MIT's {\tentex\char'35} */
- at d eq_eq 036 /* `\.{==}'\,; corresponds to MIT's {\tentex\char'36} */
- at d or_or 037 /* `\.{\v\v}'\,; corresponds to MIT's {\tentex\char'37} */
- at d dot_dot_dot 016 /* `\.{...}'\,; corresponds to MIT's {\tentex\char'16} */
- at d colon_colon 06 /* `\.{::}'\,; corresponds to MIT's {\tentex\char'6} */
- at d period_ast 026 /* `\.{.*}'\,; corresponds to MIT's {\tentex\char'26} */
- at d minus_gt_ast 027 /* `\.{->*}'\,; corresponds to MIT's {\tentex\char'27} */
+ at d and_and 04 /* `\.{\&\&}'\,; corresponds to MIT's {\tentex\char'4}
+ and ASCII~\.{EOT} */
+ at d lt_lt 020 /* `\.{<<}'\,; corresponds to MIT's {\tentex\char'20}
+ and ASCII~\.{DLE} */
+ at d gt_gt 021 /* `\.{>>}'\,; corresponds to MIT's {\tentex\char'21}
+ and ASCII~\.{DC1} */
+ at d plus_plus 013 /* `\.{++}'\,; corresponds to MIT's {\tentex\char'13}
+ and ASCII~\.{VT} aka~|'\v'| */
+ at d minus_minus 01 /* `\.{--}'\,; corresponds to MIT's {\tentex\char'1}
+ and ASCII~\.{SOH} */
+ at d minus_gt 031 /* `\.{->}'\,; corresponds to MIT's {\tentex\char'31}
+ and ASCII~\.{EM} */
+ at d non_eq 032 /* `\.{!=}'\,; corresponds to MIT's {\tentex\char'32}
+ and ASCII~\.{SUB} */
+ at d lt_eq 034 /* `\.{<=}'\,; corresponds to MIT's {\tentex\char'34}
+ and ASCII~\.{FS} */
+ at d gt_eq 035 /* `\.{>=}'\,; corresponds to MIT's {\tentex\char'35}
+ and ASCII~\.{GS} */
+ at d eq_eq 036 /* `\.{==}'\,; corresponds to MIT's {\tentex\char'36}
+ and ASCII~\.{RS} */
+ at d or_or 037 /* `\.{\v\v}'\,; corresponds to MIT's {\tentex\char'37}
+ and ASCII~\.{US} */
+ at d dot_dot_dot 016 /* `\.{...}'\,; corresponds to MIT's {\tentex\char'16}
+ and ASCII~\.{SO} */
+ at d colon_colon 06 /* `\.{::}'\,; corresponds to MIT's {\tentex\char'6}
+ and ASCII~\.{ACK} */
+ at d period_ast 026 /* `\.{.*}'\,; corresponds to MIT's {\tentex\char'26}
+ and ASCII~\.{SYN} */
+ at d minus_gt_ast 027 /* `\.{->*}'\,; corresponds to MIT's {\tentex\char'27}
+ and ASCII~\.{ETB} */
@#
@d compress(c) if (loc++<=limit) return c
@@ -82,12 +96,12 @@
extern char *id_loc; /* just after the current identifier in the buffer */
@ Code related to input routines:
- at d xisalpha(c) (isalpha((int)(c))&&((eight_bits)(c)<0200))
- at d xisdigit(c) (isdigit((int)(c))&&((eight_bits)(c)<0200))
- at d xisspace(c) (isspace((int)(c))&&((eight_bits)(c)<0200))
- at d xislower(c) (islower((int)(c))&&((eight_bits)(c)<0200))
- at d xisupper(c) (isupper((int)(c))&&((eight_bits)(c)<0200))
- at d xisxdigit(c) (isxdigit((int)(c))&&((eight_bits)(c)<0200))
+ at d xisalpha(c) (isalpha((int)(c))&&!ishigh(c))
+ at d xisdigit(c) (isdigit((int)(c))&&!ishigh(c))
+ at d xisspace(c) (isspace((int)(c))&&!ishigh(c))
+ at d xislower(c) (islower((int)(c))&&!ishigh(c))
+ at d xisupper(c) (isupper((int)(c))&&!ishigh(c))
+ at d xisxdigit(c) (isxdigit((int)(c))&&!ishigh(c))
@d isxalpha(c) ((c)=='_' || (c)=='$')
/* non-alpha characters allowed in identifier */
@d ishigh(c) ((eight_bits)(c)>0177)
@@ -120,12 +134,12 @@
extern int line[]; /* number of current line in the stacked files */
extern int change_line; /* number of current line in change file */
extern int change_depth; /* where \.{@@y} originated during a change */
-extern boolean input_has_ended; /* if there is no more input */
-extern boolean changing; /* if the current line is from |change_file| */
-extern boolean web_file_open; /* if the web file is being read */
+extern bool input_has_ended; /* if there is no more input */
+extern bool changing; /* if the current line is from |change_file| */
+extern bool web_file_open; /* if the web file is being read */
@ @<Predecl...@>=
-extern boolean get_line(void); /* inputs the next line */
+extern bool get_line(void); /* inputs the next line */
extern void check_complete(void); /* checks that all changes were picked up */
extern void reset_input(void); /* initialize to read the web file and change file */
@@ -132,9 +146,9 @@
@ Code related to section numbers:
@<Common code...@>=
extern sixteen_bits section_count; /* the current section number */
-extern boolean changed_section[]; /* is the section changed? */
-extern boolean change_pending; /* is a decision about change still unclear? */
-extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */
+extern bool changed_section[]; /* is the section changed? */
+extern bool change_pending; /* is a decision about change still unclear? */
+extern bool print_where; /* tells \.{CTANGLE} to print line and file info */
@ Code related to identifier and section name storage:
@d length(c) (size_t)((c+1)->byte_start-(c)->byte_start) /* the length of a name */
@@ -171,12 +185,12 @@
@ @<Predecl...@>=
extern name_pointer id_lookup(const char *,const char *,eight_bits);
/* looks up a string in the identifier table */
-extern name_pointer section_lookup(char *,char *,boolean); /* finds section name */
+extern name_pointer section_lookup(char *,char *,bool); /* finds section name */
extern void print_prefix_name(name_pointer);@/
extern void print_section_name(name_pointer);@/
extern void sprint_section_name(char *,name_pointer);
@#
-extern boolean names_match(name_pointer,const char *,size_t,eight_bits);
+extern bool names_match(name_pointer,const char *,size_t,eight_bits);
/* two routines defined in \.{ctangle.w} and \.{cweave.w} */
extern void init_node(name_pointer);
@@ -215,7 +229,7 @@
extern char tex_file_name[]; /* name of |tex_file| */
extern char idx_file_name[]; /* name of |idx_file| */
extern char scn_file_name[]; /* name of |scn_file| */
-extern boolean flags[]; /* an option for each 7-bit code */
+extern bool flags[]; /* an option for each 7-bit code */
@ Code related to output:
@d update_terminal() fflush(stdout) /* empty the terminal output buffer */
Modified: branches/stable/source/src/texk/web2c/cwebdir/common.w
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/common.w 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/common.w 2025-05-17 22:44:20 UTC (rev 964)
@@ -77,7 +77,7 @@
|program|.
@<Global var...@>=
-boolean program; /* \.{CWEAVE} or \.{CTANGLE}? */
+bool program; /* \.{CWEAVE} or \.{CTANGLE}? */
@ \.{CWEAVE} operates in three phases: First it inputs the source
file and stores cross-reference data, then it inputs the source once again and
@@ -154,7 +154,7 @@
@^system dependencies@>
@c
-static boolean input_ln( /* copies a line into |buffer| or returns |false| */
+static bool input_ln( /* copies a line into |buffer| or returns |false| */
FILE *fp) /* what file to read from */
{
int c=EOF; /* character read; initialized so some compilers won't complain */
@@ -173,7 +173,7 @@
return true;
}
-@ @<Predecl...@>=@+static boolean input_ln(FILE *);
+@ @<Predecl...@>=@+static bool input_ln(FILE *);
@* File handling. Now comes the problem of deciding which file to read from
next. Recall that the actual text that \.{CWEB} should process comes from two
@@ -198,9 +198,9 @@
int line[max_include_depth]; /* number of current line in the stacked files */
int change_line; /* number of current line in change file */
int change_depth; /* where \.{@@y} originated during a change */
-boolean input_has_ended; /* if there is no more input */
-boolean changing; /* if the current line is from |change_file| */
-boolean web_file_open=false; /* if the web file is being read */
+bool input_has_ended; /* if there is no more input */
+bool changing; /* if the current line is from |change_file| */
+bool web_file_open=false; /* if the web file is being read */
@ When |changing==false|, the next line of |change_file| is kept in
|change_buffer|, for purposes of comparison with the next
@@ -360,7 +360,7 @@
information in the \CEE/ file by means of the |print_where| flag.
@c
-boolean get_line(void) /* inputs the next line */
+bool get_line(void) /* inputs the next line */
{
restart:
if (changing && include_depth==change_depth)
@@ -544,10 +544,10 @@
@ @<Global var...@>=
sixteen_bits section_count; /* the current section number */
-boolean changed_section[max_sections]; /* is the section changed? */
-boolean change_pending; /* if the current change is not yet recorded in
+bool changed_section[max_sections]; /* is the section changed? */
+bool change_pending; /* if the current change is not yet recorded in
|changed_section[section_count]| */
-boolean print_where=false; /* should \.{CTANGLE} print line and file info? */
+bool print_where=false; /* should \.{CTANGLE} print line and file info? */
@* Storage of names and strings.
Both \.{CWEAVE} and \.{CTANGLE} store identifiers, section names and
@@ -759,8 +759,8 @@
@<Predecl...@>=
static int web_strcmp(char *,size_t,char *,size_t);@/
-static name_pointer add_section_name(name_pointer,int,char *,char *,boolean);@/
-static void extend_section_name(name_pointer,char *,char *,boolean);
+static name_pointer add_section_name(name_pointer,int,char *,char *,bool);@/
+static void extend_section_name(name_pointer,char *,char *,bool);
@ @c
static int web_strcmp( /* fuller comparison than |strcmp| */
@@ -798,7 +798,7 @@
int c, /* right or left? */
char *first, /* first character of section name */
char *last, /* last character of section name, plus one */
-boolean ispref) /* are we adding a prefix or a full name? */
+bool ispref) /* are we adding a prefix or a full name? */
{
name_pointer p=name_ptr; /* new node */
char *s=first_chunk(p);
@@ -825,7 +825,7 @@
name_pointer p, /* name to be extended */
char *first, /* beginning of extension text */
char *last, /* one beyond end of extension text */
-boolean ispref) /* are we adding a prefix or a full name? */
+bool ispref) /* are we adding a prefix or a full name? */
{
char *s;
name_pointer q=p+1;
@@ -851,7 +851,7 @@
name_pointer
section_lookup( /* find or install section name in tree */
char *first,char *last, /* first and last characters of new name */
-boolean ispref) /* is the new name a prefix or a full name? */
+bool ispref) /* is the new name a prefix or a full name? */
{
int c=less; /* comparison between two names; initialized so some compilers won't complain */
name_pointer p=root; /* current node of the search tree */
@@ -962,7 +962,7 @@
name_pointer q=r+1; /* access to subsequent chunks */
char *ss, *s=first_chunk(r);
int c=less; /* comparison */
- boolean ispref; /* is chunk |r| a prefix? */
+ bool ispref; /* is chunk |r| a prefix? */
while (true) {
ss=(r+1)->byte_start-1;
if (*ss==' ' && ss>=r->byte_start) ispref=true,q=q->link;
@@ -1128,7 +1128,7 @@
char tex_file_name[max_file_name_length]; /* name of |tex_file| */
char idx_file_name[max_file_name_length]; /* name of |idx_file| */
char scn_file_name[max_file_name_length]; /* name of |scn_file| */
-boolean flags[128]; /* an option for each 7-bit code */
+bool flags[128]; /* an option for each 7-bit code */
@ The |flags| will be initially |false|. Some of them are set to~|true| before
scanning the arguments; if additional flags are |true| by default they
@@ -1159,7 +1159,7 @@
char *dot_pos; /* position of |'.'| in the argument */
char *name_pos; /* file name beginning, sans directory */
char *s; /* pointer for scanning strings */
- boolean found_web=false,found_change=false,found_out=false;
+ bool found_web=false,found_change=false,found_out=false;
/* have these names been seen? */
strcpy(change_file_name,"/dev/null");
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctang-w2c.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctang-w2c.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctang-w2c.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -193,9 +193,8 @@
@z
@x [6.59] l.708
- if ((eight_bits)(*j)<0200) C_putc(*j);
+ if (ishigh(*j)) C_printf("%s",translit[(eight_bits)(*j)-0200]);
@^high-bit character handling@>
- else C_printf("%s",translit[(eight_bits)(*j)-0200]);
@y
if (ishigh(*j)) {
@^high-bit character handling@>
@@ -206,7 +205,6 @@
}
C_printf("%s",translit[(eight_bits)(*j)-0200]);
}
- else C_putc(*j);
@z
@x [7.67] l.840
@@ -429,7 +427,7 @@
rename(check_file_name,C_file_name); /* This was the first run */
@ @<Set up the comparison of temporary output@>=
- boolean comparison=false;
+ bool comparison=false;
if((check_file=fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
@@ -520,7 +518,7 @@
@ No copying necessary, just remove the temporary output file.
@<Redirect temporary output to \.{/dev/null}@>={
- boolean comparison=true;
+ bool comparison=true;
@<Create the secondary output...@>@;
}
@@ -527,7 +525,7 @@
@ @<Setup system redirection@>=
char in_buf[BUFSIZ+1];
int in_size;
-boolean comparison=true;
+bool comparison=true;
if((check_file=fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
@.Cannot open output file@>
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctang-w32.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctang-w32.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctang-w32.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -10,13 +10,13 @@
@z
@x section 24
-boolean names_match(
+bool names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
eight_bits t) /* not used by \.{CTANGLE} */
@y
-boolean __cdecl names_match(
+bool __cdecl names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctangle.c
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctangle.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctangle.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -2,7 +2,7 @@
#line 66 "ctangle.w"
/*5:*/
-#line 48 "common.h"
+#line 47 "common.h"
#include <ctype.h>
#include <stdbool.h>
@@ -15,11 +15,9 @@
/*:5*/
#line 67 "ctangle.w"
-#define banner "This is CTANGLE (Version 4.12.1)" \
-
+#define banner "This is CTANGLE (Version 4.12.1)"
#define ctangle false
-#define cweave true \
-
+#define cweave true
#define and_and 04
#define lt_lt 020
#define gt_gt 021
@@ -34,38 +32,29 @@
#define dot_dot_dot 016
#define colon_colon 06
#define period_ast 026
-#define minus_gt_ast 027 \
-
-#define compress(c) if(loc++<=limit) return c \
-
-#define xisalpha(c) (isalpha((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisdigit(c) (isdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisspace(c) (isspace((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xislower(c) (islower((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisupper(c) (isupper((int) (c) ) &&((eight_bits) (c) <0200) )
-#define xisxdigit(c) (isxdigit((int) (c) ) &&((eight_bits) (c) <0200) )
-#define isxalpha(c) ((c) =='_'||(c) =='$') \
-
-#define ishigh(c) ((eight_bits) (c) > 0177) \
- \
-
-#define max_include_depth 10 \
-
+#define minus_gt_ast 027
+#define compress(c) if(loc++<=limit) return c
+#define xisalpha(c) (isalpha((int) (c) ) &&!ishigh(c) )
+#define xisdigit(c) (isdigit((int) (c) ) &&!ishigh(c) )
+#define xisspace(c) (isspace((int) (c) ) &&!ishigh(c) )
+#define xislower(c) (islower((int) (c) ) &&!ishigh(c) )
+#define xisupper(c) (isupper((int) (c) ) &&!ishigh(c) )
+#define xisxdigit(c) (isxdigit((int) (c) ) &&!ishigh(c) )
+#define isxalpha(c) ((c) =='_'||(c) =='$')
+#define ishigh(c) ((eight_bits) (c) > 0177)
+#define max_include_depth 10
#define max_file_name_length 60
#define cur_file file[include_depth]
#define cur_file_name file_name[include_depth]
#define cur_line line[include_depth]
#define web_file file[0]
-#define web_file_name file_name[0] \
-
-#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
-#define print_id(c) term_write((c) ->byte_start,length(c) )
+#define web_file_name file_name[0]
+#define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start)
+#define print_id(c) term_write((c) ->byte_start,length(c) )
#define llink link
#define rlink dummy.Rlink
-#define root name_dir->rlink \
-
-#define ilk dummy.Ilk \
-
+#define root name_dir->rlink
+#define ilk dummy.Ilk
#define spotless 0
#define harmless_message 1
#define error_message 2
@@ -72,67 +61,48 @@
#define fatal_message 3
#define mark_harmless() if(history==spotless) history= harmless_message
#define mark_error() history= error_message
-#define confusion(s) fatal("! This can't happen: ",s) \
- \
-
+#define confusion(s) fatal("! This can't happen: ",s)
#define show_banner flags['b']
#define show_progress flags['p']
#define show_happiness flags['h']
#define show_stats flags['s']
-#define make_xrefs flags['x'] \
-
-#define update_terminal() fflush(stdout)
-#define new_line() putchar('\n')
-#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \
-
+#define make_xrefs flags['x']
+#define update_terminal() fflush(stdout)
+#define new_line() putchar('\n')
+#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout)
#define buf_size 200
-#define longest_name 10000 \
-
-#define long_buf_size (buf_size+longest_name)
-#define max_bytes 100000 \
-
-#define max_names 5000 \
-
-#define max_sections 2000 \
-
+#define longest_name 10000
+#define long_buf_size (buf_size+longest_name)
+#define max_bytes 100000
+#define max_names 5000
+#define max_sections 2000
#define max_texts 4000
#define max_toks 270000
-#define equiv equiv_or_xref \
-
+#define equiv equiv_or_xref
#define macro 0
-#define section_flag max_texts \
-
+#define section_flag max_texts
#define string 02
#define constant 03
#define join 0177
-#define output_defs_flag (2*024000-1) \
-
+#define output_defs_flag (2*024000-1)
#define stack_size 50
-#define cur_state stack[stack_size+1] \
-
+#define cur_state stack[stack_size+1]
#define cur_byte cur_state.byte_field
#define cur_name cur_state.name_field
#define cur_repl cur_state.repl_field
#define cur_section cur_state.section_field
-#define cur_end (cur_repl+1) ->tok_start \
-
+#define cur_end (cur_repl+1) ->tok_start
#define section_number 0201
-#define identifier 0202 \
-
+#define identifier 0202
#define normal 0
#define num_or_id 1
#define post_slash 2
#define unbreakable 3
-#define verbatim 4 \
-
+#define verbatim 4
#define max_files 256
-#define macro_end (cur_text+1) ->tok_start \
-
-#define C_printf(c,a) fprintf(C_file,c,a)
-#define C_putc(c) fputc((int) (c) ,C_file) \
-
-#define translit_length 10 \
-
+#define C_printf(c,a) fprintf(C_file,c,a)
+#define C_putc(c) fputc((int) (c) ,C_file)
+#define translit_length 10
#define ignore 00
#define ord 0302
#define control_text 0303
@@ -142,33 +112,28 @@
#define definition 0307
#define begin_C 0310
#define section_name 0311
-#define new_section 0312 \
-
+#define new_section 0312
#define app_repl(c) { \
if(tok_ptr==tok_mem_end) overflow("token") ; \
else*(tok_ptr++) = (eight_bits) c; \
-} \
-
+}
#define store_id(a) a= id_lookup(id_first,id_loc,'\0') -name_dir; \
app_repl((a/0400) +0200) ; \
-app_repl(a%0400) \
+app_repl(a%0400)
+#define keep_digit_separators flags['k']
-#define keep_digit_separators flags['k'] \
-
-
#line 68 "ctangle.w"
/*3:*/
#line 35 "common.h"
-typedef bool boolean;
typedef uint8_t eight_bits;
typedef uint16_t sixteen_bits;
-extern boolean program;
+extern bool program;
extern int phase;
/*:3*//*6:*/
-#line 78 "common.h"
+#line 92 "common.h"
extern char section_text[];
extern char*section_text_end;
@@ -176,7 +141,7 @@
extern char*id_loc;
/*:6*//*7:*/
-#line 96 "common.h"
+#line 110 "common.h"
extern char buffer[];
extern char*buffer_end;
@@ -184,7 +149,7 @@
extern char*limit;
/*:7*//*8:*/
-#line 113 "common.h"
+#line 127 "common.h"
extern int include_depth;
extern FILE*file[];
@@ -195,20 +160,20 @@
extern int line[];
extern int change_line;
extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
+extern bool input_has_ended;
+extern bool changing;
+extern bool web_file_open;
/*:8*//*10:*/
-#line 133 "common.h"
+#line 147 "common.h"
extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
+extern bool changed_section[];
+extern bool change_pending;
+extern bool print_where;
/*:10*//*11:*/
-#line 148 "common.h"
+#line 162 "common.h"
typedef struct name_info{
char*byte_start;
@@ -233,12 +198,12 @@
extern hash_pointer hash_ptr;
/*:11*//*13:*/
-#line 193 "common.h"
+#line 207 "common.h"
extern int history;
/*:13*//*15:*/
-#line 211 "common.h"
+#line 225 "common.h"
extern int argc;
extern char**argv;
@@ -246,10 +211,10 @@
extern char tex_file_name[];
extern char idx_file_name[];
extern char scn_file_name[];
-extern boolean flags[];
+extern bool flags[];
/*:15*//*16:*/
-#line 225 "common.h"
+#line 239 "common.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -314,7 +279,7 @@
#line 457 "ctangle.w"
static eight_bits out_state;
-static boolean protect;
+static bool protect;
/*:42*//*45:*/
#line 488 "ctangle.w"
@@ -327,7 +292,7 @@
/*:45*//*53:*/
#line 584 "ctangle.w"
-static boolean output_defs_seen= false;
+static bool output_defs_seen= false;
/*:53*//*57:*/
#line 694 "ctangle.w"
@@ -342,13 +307,13 @@
/*:62*//*66:*/
#line 827 "ctangle.w"
-static boolean comment_continues= false;
+static bool comment_continues= false;
/*:66*//*68:*/
#line 864 "ctangle.w"
static name_pointer cur_section_name;
-static boolean no_where;
+static bool no_where;
/*:68*//*82:*/
#line 1182 "ctangle.w"
@@ -360,33 +325,33 @@
#line 71 "ctangle.w"
/*4:*/
-#line 43 "common.h"
+#line 42 "common.h"
extern void common_init(void);
/*:4*//*9:*/
-#line 127 "common.h"
+#line 141 "common.h"
-extern boolean get_line(void);
+extern bool get_line(void);
extern void check_complete(void);
extern void reset_input(void);
/*:9*//*12:*/
-#line 171 "common.h"
+#line 185 "common.h"
extern name_pointer id_lookup(const char*,const char*,eight_bits);
-extern name_pointer section_lookup(char*,char*,boolean);
+extern name_pointer section_lookup(char*,char*,bool);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern bool names_match(name_pointer,const char*,size_t,eight_bits);
extern void init_node(name_pointer);
/*:12*//*14:*/
-#line 196 "common.h"
+#line 210 "common.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -403,7 +368,7 @@
#line 347 "ctangle.w"
static void push_level(name_pointer);
-static void pop_level(boolean);
+static void pop_level(bool);
static void get_output(void);
/*:37*//*44:*/
@@ -421,7 +386,7 @@
#line 807 "ctangle.w"
static eight_bits skip_ahead(void);
-static boolean skip_comment(boolean);
+static bool skip_comment(bool);
/*:65*//*70:*/
#line 915 "ctangle.w"
@@ -519,7 +484,7 @@
/*:2*//*24:*/
#line 155 "ctangle.w"
-boolean names_match(
+bool names_match(
name_pointer p,
const char*first,
size_t l,
@@ -572,7 +537,7 @@
static void
pop_level(
-boolean flag)
+bool flag)
{
if(flag&&cur_repl->text_link<section_flag){
cur_repl= cur_repl->text_link+text_info;
@@ -742,22 +707,24 @@
}
/*:48*//*54:*/
-#line 592 "ctangle.w"
+#line 590 "ctangle.w"
static void
output_defs(void)
{
-sixteen_bits a;
+sixteen_bits a;eight_bits*macro_end;
push_level(NULL);
for(cur_text= text_info+1;cur_text<text_ptr;cur_text++)
if(cur_text->text_link==macro){
cur_byte= cur_text->tok_start;
+macro_end= (cur_text+1)->tok_start;
C_printf("%s","#define ");
out_state= normal;
protect= true;
-while(cur_byte<macro_end){
+do macro_end--;while(isspace(*macro_end)&&plus_plus!=*macro_end);
+
+while(cur_byte<=macro_end){
a= *cur_byte++;
-if(cur_byte==macro_end&&a=='\n')break;
if(out_state==verbatim&&a!=string&&a!=constant&&a!='\n')
C_putc(a);
@@ -801,9 +768,9 @@
if(out_state==num_or_id)C_putc(' ');
for(j= (cur_val+name_dir)->byte_start;
j<(cur_val+name_dir+1)->byte_start;j++)
-if((eight_bits)(*j)<0200)C_putc(*j);
+if(ishigh(*j))C_printf("%s",translit[(eight_bits)(*j)-0200]);
-else C_printf("%s",translit[(eight_bits)(*j)-0200]);
+else C_putc(*j);
out_state= num_or_id;break;
/*:59*/
@@ -900,8 +867,8 @@
/*:64*//*67:*/
#line 830 "ctangle.w"
-static boolean skip_comment(
-boolean is_long_comment)
+static bool skip_comment(
+bool is_long_comment)
{
char c;
while(true){
@@ -937,7 +904,7 @@
static eight_bits
get_next(void)
{
-static boolean preprocessing= false;
+static bool preprocessing= false;
eight_bits c;
while(true){
if(loc> limit){
@@ -978,7 +945,7 @@
if(xisdigit(c)||c=='.')/*73:*/
#line 956 "ctangle.w"
{
-boolean hex_flag= false;
+bool hex_flag= false;
id_first= loc-1;
if(*id_first=='.'&&!xisdigit(*loc))goto mistake;
if(*id_first=='0'){
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctangle.w
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctangle.w 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctangle.w 2025-05-17 22:44:20 UTC (rev 964)
@@ -153,7 +153,7 @@
starting at position |first| equals the identifier pointed to by |p|:
@c
-boolean names_match(
+bool names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
@@ -334,7 +334,7 @@
@c
static void
pop_level( /* do this when |cur_byte| reaches |cur_end| */
-boolean flag) /* |flag==false| means we are in |output_defs| */
+bool flag) /* |flag==false| means we are in |output_defs| */
{
if (flag && cur_repl->text_link<section_flag) { /* link to a continuation */
cur_repl=cur_repl->text_link+text_info; /* stay on the same level */
@@ -346,7 +346,7 @@
@ @<Predecl...@>=
static void push_level(name_pointer);@/
-static void pop_level(boolean);@/
+static void pop_level(bool);@/
static void get_output(void);
@ The heart of the output procedure is the function |get_output|,
@@ -456,7 +456,7 @@
@<Private...@>=
static eight_bits out_state; /* current status of partial output */
-static boolean protect; /* should newline characters be quoted? */
+static bool protect; /* should newline characters be quoted? */
@ Here is a routine that is invoked when we want to output the current line.
During the output process, |cur_line| equals the number of the next line
@@ -582,11 +582,9 @@
output_defs();
@ @<Private...@>=
-static boolean output_defs_seen=false;
+static bool output_defs_seen=false;
-@ @d macro_end (cur_text+1)->tok_start /* end of |macro| replacement text */
-@#
- at d C_printf(c,a) fprintf(C_file,c,a)
+@ @d C_printf(c,a) fprintf(C_file,c,a)
@d C_putc(c) fputc((int)(c),C_file) /* isn't \CEE/ wonderfully consistent? */
@c
@@ -593,17 +591,19 @@
static void
output_defs(void)
{
- sixteen_bits a;
+ sixteen_bits a; eight_bits *macro_end;
push_level(NULL);
for (cur_text=text_info+1; cur_text<text_ptr; cur_text++)
if (cur_text->text_link==macro) { /* |cur_text| is the text for a |macro| */
cur_byte=cur_text->tok_start;
+ macro_end=(cur_text+1)->tok_start; /* end of |macro| replacement text */
C_printf("%s","#define ");
out_state=normal;
protect=true; /* newlines should be preceded by |'\\'| */
- while (cur_byte<macro_end) {
+ do macro_end--; while (isspace(*macro_end)&&plus_plus!=*macro_end);
+ /* discard trailing whitespace; |plus_plus=='\v'| */
+ while (cur_byte<=macro_end) {
a=*cur_byte++;
- if (cur_byte==macro_end && a=='\n') break; /* disregard a final newline */
if (out_state==verbatim && a!=string && a!=constant && a!='\n')
C_putc(a); /* a high-bit character can occur in a string */
@^high-bit character handling@>
@@ -705,9 +705,9 @@
if (out_state==num_or_id) C_putc(' ');
for (j=(cur_val+name_dir)->byte_start;
j<(cur_val+name_dir+1)->byte_start; j++)
- if ((eight_bits)(*j)<0200) C_putc(*j);
+ if (ishigh(*j)) C_printf("%s",translit[(eight_bits)(*j)-0200]);
@^high-bit character handling@>
- else C_printf("%s",translit[(eight_bits)(*j)-0200]);
+ else C_putc(*j);
out_state=num_or_id; break;
@ @<Case of a sec...@>=@t\1\quad@>
@@ -806,7 +806,7 @@
@ @<Predecl...@>=
static eight_bits skip_ahead(void);@/
-static boolean skip_comment(boolean);
+static bool skip_comment(bool);
@ The |skip_comment| procedure reads through the input at somewhat high
speed in order to pass over comments, which \.{CTANGLE} does not transmit
@@ -825,11 +825,11 @@
No comment, long or short, is allowed to contain `\.{@@\ }' or `\.{@@*}'.
@<Private...@>=
-static boolean comment_continues=false; /* are we scanning a comment? */
+static bool comment_continues=false; /* are we scanning a comment? */
@ @c
-static boolean skip_comment( /* skips over comments */
-boolean is_long_comment)
+static bool skip_comment( /* skips over comments */
+bool is_long_comment)
{
char c; /* current character */
while (true) {
@@ -863,7 +863,7 @@
@<Private...@>=
static name_pointer cur_section_name; /* name of section just scanned */
-static boolean no_where; /* suppress |print_where|? */
+static bool no_where; /* suppress |print_where|? */
@ As one might expect, |get_next| consists mostly of a big switch
that branches to the various special cases that can arise.
@@ -872,7 +872,7 @@
static eight_bits
get_next(void) /* produces the next input token */
{
- static boolean preprocessing=false;
+ static bool preprocessing=false;
eight_bits c; /* the current character */
while (true) {
if (loc>limit) {
@@ -954,7 +954,7 @@
}
@ @<Get a constant@>= {
- boolean hex_flag = false; /* are we reading a hexadecimal literal? */
+ bool hex_flag = false; /* are we reading a hexadecimal literal? */
id_first=loc-1;
if (*id_first=='.' && !xisdigit(*loc)) goto mistake; /* not a constant */
if (*id_first=='0') {
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctwill-hint.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctwill-hint.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctwill-hint.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -662,10 +662,10 @@
@x
finish_C( /* finishes a definition or a \CEE/ part */
- boolean visible) /* |true| if we should produce \TeX\ output */
+ bool visible) /* |true| if we should produce \TeX\ output */
@y
finish_C( /* finishes a definition or a \CEE/ part */
- boolean visible) /* |true| if we should produce \TeX\ output */
+ bool visible) /* |true| if we should produce \TeX\ output */
@-finish_C@>
@$finish_C {CTWILL}234 \&{static} \&{void} (\,)@>
@z
@@ -673,9 +673,9 @@
Section 235.
@x
-@ @<Predecl...@>=@+static void finish_C(boolean);
+@ @<Predecl...@>=@+static void finish_C(bool);
@y
-@ @<Predecl...@>=@+static void finish_C(boolean);
+@ @<Predecl...@>=@+static void finish_C(bool);
@-finish_C@>
@z
@@ -877,9 +877,9 @@
Section 282.
@x
-@ @<Predec...@>=@+static boolean app_supp(text_pointer);
+@ @<Predec...@>=@+static bool app_supp(text_pointer);
@y
-@ @<Predec...@>=@+static boolean app_supp(text_pointer);
+@ @<Predec...@>=@+static bool app_supp(text_pointer);
@-app_supp@>
@z
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctwill-mini.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctwill-mini.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctwill-mini.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -88,12 +88,6 @@
Section 5.
@x
-For backward compatibility with pre-{\mc ANSI} compilers, we replace the
- at y
-And we replace the
- at z
-
- at x
@d _(s) gettext(s)
@y
@d _(s) gettext(s)
@@ -1657,9 +1651,12 @@
Section 215.
@x
-@<Append a \9{s}string or...@>={@+ int count=-1; /* characters remaining before string break */
+ if (count==0) { /* insert a discretionary break in a long string */
+ app_str(@q(@>@q{@>"}\\)\\.{"@q}@>); count=20;
@y
-@<Append a \9{s}string or...@>={@+ int count=-1; /* characters remaining before string break */
+ if (count==0) {
+ count=20; @/ /* insert a discretionary break in a long string */
+ app_str(@q(@>@q{@>"}\\)\\.{"@q}@>);
@z
Section 220.
@@ -1903,14 +1900,22 @@
@ @<Translate the \9{c}current section@>= @+ {
@z
+Section 249.
+
+ at x
+ case section_name: loc-=2; next_control=get_next(); /* reprocess */
+ at y
+ case section_name: @/ loc-=2; @/ next_control=get_next(); /* reprocess */
+ at z
+
Section 251.
@x
finish_C( /* finishes a definition or a \CEE/ part */
- boolean visible) /* |true| if we should produce \TeX\ output */
+ bool visible) /* |true| if we should produce \TeX\ output */
@y
finish_C( /* finishes a definition or a \CEE/ part */
- boolean visible) /* |true| if we should produce \TeX\ output */
+ bool visible) /* |true| if we should produce \TeX\ output */
@-finish_C@>
@$finish_C {CTWILL}251 \&{static} \&{void} (\,)@>
@z
@@ -1918,9 +1923,9 @@
Section 252.
@x
-@ @<Predecl...@>=@+static void finish_C(boolean);
+@ @<Predecl...@>=@+static void finish_C(bool);
@y
-@ @<Predecl...@>=@+static void finish_C(boolean);
+@ @<Predecl...@>=@+static void finish_C(bool);
@-finish_C@>
@z
@@ -2218,9 +2223,9 @@
Section 300.
@x
-@ @<Predec...@>=@+static boolean app_supp(text_pointer);
+@ @<Predec...@>=@+static bool app_supp(text_pointer);
@y
-@ @<Predec...@>=@+static boolean app_supp(text_pointer);
+@ @<Predec...@>=@+static bool app_supp(text_pointer);
@-app_supp@>
@z
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctwill-w2c.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctwill-w2c.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctwill-w2c.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -127,7 +127,7 @@
turned on during the first phase.
@<Private...@>=
-static boolean change_exists; /* has any section changed? */
+static bool change_exists; /* has any section changed? */
@y
turned on during the first phase---NOT!
@z
@@ -950,14 +950,14 @@
@z
@x [12.229] l.4212
-static boolean group_found=false; /* has a starred section occurred? */
+static bool group_found=false; /* has a starred section occurred? */
@ @<Translate the \9{c}current section@>= {
section_count++;
@y
-static boolean group_found=false; /* has a starred section occurred? */
-static boolean right_start_switch; /* has `\.{@@r}' occurred recently? */
-static boolean temp_switch; /* has `\.{@@\%}' occurred recently? */
+static bool group_found=false; /* has a starred section occurred? */
+static bool right_start_switch; /* has `\.{@@r}' occurred recently? */
+static bool temp_switch; /* has `\.{@@\%}' occurred recently? */
@ @d usage_sentinel (struct perm_meaning *)1
@<Translate the \9{c}current section@>= {
@@ -1016,18 +1016,24 @@
@z
@x [12.232] l.4268
- err_print("! TeX string should be in C text only"); break;
+ err_print("! TeX string should be in C text only");
@y
- err_print(_("! TeX string should be in C text only")); break;
+ err_print(_("! TeX string should be in C text only"));
@z
- at x [12.232] l.4274
+ at x [12.232] l.4271
+ err_print("! Verbatim string should be in C text only"); break;
+ at y
+ err_print(_("! Verbatim string should be in C text only")); break;
+ at z
+
+ at x [12.232] l.4277
err_print("! You can't do that in TeX text"); break;
@y
err_print(_("! You can't do that in TeX text")); break;
@z
- at x [12.233] l.4288
+ at x [12.233] l.4291
outer_parse(); finish_C(format_visible); format_visible=true;
doing_format=false;
}
@@ -1039,7 +1045,7 @@
}
@z
- at x [12.236] l.4340
+ at x [12.236] l.4343
@<Start \9{a}a macro...@>= {
@y
@<Start \9{a}a macro...@>= {
@@ -1046,13 +1052,13 @@
is_macro=true;
@z
- at x [12.236] l.4346
+ at x [12.236] l.4349
err_print("! Improper macro definition");
@y
err_print(_("! Improper macro definition"));
@z
- at x [12.236] l.4347
+ at x [12.236] l.4350
@.Improper macro definition@>
else {
app('$'); app_cur_id(false);
@@ -1064,7 +1070,7 @@
def_diff=(*loc!='(');
@z
- at x [12.236] l.4359
+ at x [12.236] l.4362
} @=/* otherwise fall through */@>@;
default: err_print("! Improper macro definition"); break;
@y
@@ -1072,7 +1078,7 @@
default: err_print(_("! Improper macro definition")); break;
@z
- at x [12.237] l.4369
+ at x [12.237] l.4372
@ @<Start \9{a}a format...@>= {
doing_format=true;
@y
@@ -1081,25 +1087,25 @@
is_macro=false;
@z
- at x [12.237] l.4386
+ at x [12.237] l.4389
if (scrap_ptr!=scrap_info+2) err_print("! Improper format definition");
@y
if (scrap_ptr!=scrap_info+2) err_print(_("! Improper format definition"));
@z
- at x [12.240] l.4421
+ at x [12.240] l.4424
err_print("! You need an = sign after the section name");
@y
err_print(_("! You need an = sign after the section name"));
@z
- at x [12.241] l.4443
+ at x [12.241] l.4446
err_print("! You can't do that in C text");
@y
err_print(_("! You can't do that in C text"));
@z
- at x [12.246] l.4513
+ at x [12.246] l.4516
out_str("\\fi"); finish_line();
@.\\fi@>
@y
@@ -1110,13 +1116,13 @@
@.\\FI@>
@z
- at x [13.247] l.4534
+ at x [13.247] l.4537
if (show_progress) printf("%s","\nWriting the index...");
@y
if (show_progress) printf("%s",_("\nWriting the index..."));
@z
- at x [13.247] l.4536
+ at x [13.247] l.4539
if (change_exists) {
@<Tell about changed sections@>@;
finish_line(); flush_buffer(out_buf,false,false);
@@ -1125,19 +1131,19 @@
@y
@z
- at x [13.247] l.4545
+ at x [13.247] l.4548
fatal("! Cannot open index file ",idx_file_name);
@y
fatal(_("! Cannot open index file "),idx_file_name);
@z
- at x [13.247] l.4557
+ at x [13.247] l.4560
fatal("! Cannot open section file ",scn_file_name);
@y
fatal(_("! Cannot open section file "),scn_file_name);
@z
- at x [13.247] l.4569
+ at x [13.247] l.4572
fclose(active_file);
@y
fclose(active_file); active_file=tex_file=NULL;
@@ -1144,13 +1150,13 @@
if (check_for_change) @<Update the result when it has changed@>@;
@z
- at x [13.247] l.4572
+ at x [13.247] l.4575
printf("%s","Done.");
@y
printf("%s",_("Done."));
@z
- at x [13.249] l.4580
+ at x [13.249] l.4583
the index section itself.
@<Tell about changed sections@>=
@@ -1169,13 +1175,13 @@
the index section itself---NOT!
@z
- at x [13.257] l.4724
+ at x [13.257] l.4727
if (sort_ptr>=scrap_info_end) overflow("sorting");
@y
if (sort_ptr>=scrap_info_end) overflow(_("sorting"));
@z
- at x [13.262] l.4769
+ at x [13.262] l.4772
@ @<Output the name...@>=
switch (cur_name->ilk) {@+char *p; /* index into |byte_mem| */@+ at t}\6{\4@>
@y
@@ -1186,20 +1192,20 @@
switch (cur_name->ilk) {
@z
- at x [13.262] l.4771
+ at x [13.262] l.4774
case normal: case func_template:
@y
case normal:
@z
- at x [13.262] l.4773
- else {@+boolean all_caps=true;@+ at t}\6{@>
+ at x [13.262] l.4776
+ else {@+bool all_caps=true;@+ at t}\6{@>
@y
- else {@+boolean all_caps=true;@+char *p;
+ else {@+bool all_caps=true;@+char *p;
/* index into |byte_mem| */ @+ at t}\6{@>
@z
- at x [13.262] l.4788
+ at x [13.262] l.4791
case roman: not_an_identifier: out_name(cur_name,false); goto name_done;
case custom:
out_str("$\\");
@@ -1214,13 +1220,13 @@
@.\\\$@>
@z
- at x [13.262] l.4798
+ at x [13.262] l.4801
out_name(cur_name,true);
@y
out_name(cur_name,proofing);
@z
- at x [13.269] l.4861
+ at x [13.269] l.4864
puts("\nMemory usage statistics:");
@.Memory usage statistics:@>
printf("%td names (out of %ld)\n",@^system dependencies@>
@@ -1269,7 +1275,7 @@
(ptrdiff_t)(max_sort_ptr-scrap_info),(long)max_scraps);
@z
- at x [14.270] l.4883
+ at x [14.270] l.4886
@** Index.
@y
@q Section 270. @>
@@ -1480,7 +1486,7 @@
static char *ministring_buf_end=ministring_buf+max_tex_chars-1;
/* end of |ministring_buf| */
static char *ministring_ptr; /* first available slot in |ministring_buf| */
-static boolean ms_mode; /* are we outputting to |ministring_buf|? */
+static bool ms_mode; /* are we outputting to |ministring_buf|? */
@q Section 27->274. @>
@ @<Set init...@>=
@@ -1578,10 +1584,10 @@
should set |ident_seen=false| first. (This is admittedly tricky.)
@<Private var...@>=
-static boolean ident_seen;
+static bool ident_seen;
@ @c
-static boolean app_supp(
+static bool app_supp(
text_pointer p)
{ token_pointer j;
if (ident_seen && **p>=tok_flag)
@@ -1601,7 +1607,7 @@
}
@q Section 282. @>
-@ @<Predec...@>=@+static boolean app_supp(text_pointer);
+@ @<Predec...@>=@+static bool app_supp(text_pointer);
@q Section 142->283. @>
@ The trickiest part of \.{CTWILL} is the procedure |make_ministring(pp+l)|,
@@ -1654,7 +1660,7 @@
text_pointer q=(p-1)->trans, r;
token t;
int ast_count=0; /* asterisks preceding the expression */
- boolean non_ast_seen=false; /* have we seen a non-asterisk? */
+ bool non_ast_seen=false; /* have we seen a non-asterisk? */
while (true) {
if (*(q+1)==*q+1) {
r=q;@+break; /* e.g., \&{struct}; we're doing production 45 or 46 */
@@ -1693,8 +1699,8 @@
@q Section 253->288. @>
@ @<Private...@>=
-static boolean is_macro; /* it's a macro def, not a format def */
-static boolean def_diff; /* |false| iff the current macro has parameters */
+static bool is_macro; /* it's a macro def, not a format def */
+static bool def_diff; /* |false| iff the current macro has parameters */
static name_pointer id_being_defined; /* the definee */
@q Section 257->289. @>
@@ -1826,7 +1832,7 @@
switch (cur_name->ilk) {@+char *p; /* index into |byte_mem| */@+ at t}\6{\4@>
case normal: case func_template:
if (is_tiny(cur_name)) out_str("\\|");
- else {@+boolean all_caps=true;@+ at t}\6{@>
+ else {@+bool all_caps=true;@+ at t}\6{@>
for (p=cur_name->byte_start;p<(cur_name+1)->byte_start;p++)
if (xislower(*p)) { /* not entirely uppercase */
all_caps=false; break;
@@ -1936,7 +1942,7 @@
@<Update the result...@>= {
if((tex_file=fopen(tex_file_name,"r"))!=NULL) {
- boolean comparison=false;
+ bool comparison=false;
if((check_file=fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
Modified: branches/stable/source/src/texk/web2c/cwebdir/ctwill.bux
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/ctwill.bux 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/ctwill.bux 2025-05-17 22:44:20 UTC (rev 964)
@@ -19,11 +19,11 @@
@$line {COMMON.W}25 \&{int} [\,]@>
@$change_line {COMMON.W}25 \&{int}@>
@$change_depth {COMMON.W}25 \&{int}@>
-@$input_has_ended {COMMON.W}25 \&{boolean}@>
-@$changing {COMMON.W}25 \&{boolean}@>
-@$web_file_open {COMMON.W}25 \&{boolean}@>
+@$input_has_ended {COMMON.W}25 \&{bool}@>
+@$changing {COMMON.W}25 \&{bool}@>
+@$web_file_open {COMMON.W}25 \&{bool}@>
-@$get_line {COMMON.W}35 \&{boolean} (\,)@>
+@$get_line {COMMON.W}35 \&{bool} (\,)@>
@$check_complete {COMMON.W}39 \&{void} (\,)@>
@@ -30,9 +30,9 @@
@$reset_input {COMMON.W}40 \&{void} (\,)@>
@$section_count {COMMON.W}42 \&{sixteen\_bits}@>
-@$changed_section {COMMON.W}42 \&{boolean} [\,]@>
-@$change_pending {COMMON.W}42 \&{boolean}@>
-@$print_where {COMMON.W}42 \&{boolean}@>
+@$changed_section {COMMON.W}42 \&{bool} [\,]@>
+@$change_pending {COMMON.W}42 \&{bool}@>
+@$print_where {COMMON.W}42 \&{bool}@>
@$byte_mem {COMMON.W}43 \&{char} [\,]@>
@$byte_mem_end {COMMON.W}43 \&{char} ${*}$@>
@@ -70,7 +70,7 @@
@$idx_file_name {COMMON.W}73 \&{char} [\,]@>
@$scn_file_name {COMMON.W}73 \&{char} [\,]@>
@$check_file_name {COMMON.W}73 \&{char} [\,]@>
-@$flags {COMMON.W}73 \&{boolean} [\,]@>
+@$flags {COMMON.W}73 \&{bool} [\,]@>
@$C_file {COMMON.W}83 \&{FILE} ${*}$@>
@$tex_file {COMMON.W}83 \&{FILE} ${*}$@>
Modified: branches/stable/source/src/texk/web2c/cwebdir/cweav-w2c.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/cweav-w2c.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/cweav-w2c.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -471,24 +471,30 @@
@z
@x [12.232] l.4268
- err_print("! TeX string should be in C text only"); break;
+ err_print("! TeX string should be in C text only");
@y
- err_print(_("! TeX string should be in C text only")); break;
+ err_print(_("! TeX string should be in C text only"));
@z
- at x [12.232] l.4274
+ at x [12.232] l.4271
+ err_print("! Verbatim string should be in C text only"); break;
+ at y
+ err_print(_("! Verbatim string should be in C text only")); break;
+ at z
+
+ at x [12.232] l.4277
err_print("! You can't do that in TeX text"); break;
@y
err_print(_("! You can't do that in TeX text")); break;
@z
- at x [12.236] l.4346
+ at x [12.236] l.4349
err_print("! Improper macro definition");
@y
err_print(_("! Improper macro definition"));
@z
- at x [12.236] l.4359
+ at x [12.236] l.4362
} @=/* otherwise fall through */@>@;
default: err_print("! Improper macro definition"); break;
@y
@@ -496,43 +502,43 @@
default: err_print(_("! Improper macro definition")); break;
@z
- at x [12.237] l.4386
+ at x [12.237] l.4389
if (scrap_ptr!=scrap_info+2) err_print("! Improper format definition");
@y
if (scrap_ptr!=scrap_info+2) err_print(_("! Improper format definition"));
@z
- at x [12.240] l.4421
+ at x [12.240] l.4424
err_print("! You need an = sign after the section name");
@y
err_print(_("! You need an = sign after the section name"));
@z
- at x [12.241] l.4443
+ at x [12.241] l.4446
err_print("! You can't do that in C text");
@y
err_print(_("! You can't do that in C text"));
@z
- at x [13.247] l.4534
+ at x [13.247] l.4537
if (show_progress) printf("%s","\nWriting the index...");
@y
if (show_progress) printf("%s",_("\nWriting the index..."));
@z
- at x [13.247] l.4545
+ at x [13.247] l.4548
fatal("! Cannot open index file ",idx_file_name);
@y
fatal(_("! Cannot open index file "),idx_file_name);
@z
- at x [13.247] l.4557
+ at x [13.247] l.4560
fatal("! Cannot open section file ",scn_file_name);
@y
fatal(_("! Cannot open section file "),scn_file_name);
@z
- at x [13.247] l.4569
+ at x [13.247] l.4572
fclose(active_file);
@y
fclose(active_file); active_file=tex_file=NULL;
@@ -539,19 +545,19 @@
if (check_for_change) @<Update the result when it has changed@>@;
@z
- at x [13.247] l.4572
+ at x [13.247] l.4575
printf("%s","Done.");
@y
printf("%s",_("Done."));
@z
- at x [13.257] l.4724
+ at x [13.257] l.4727
if (sort_ptr>=scrap_info_end) overflow("sorting");
@y
if (sort_ptr>=scrap_info_end) overflow(_("sorting"));
@z
- at x [13.269] l.4861
+ at x [13.269] l.4864
puts("\nMemory usage statistics:");
@.Memory usage statistics:@>
printf("%td names (out of %ld)\n",@^system dependencies@>
@@ -595,7 +601,7 @@
(ptrdiff_t)(max_sort_ptr-scrap_info),(long)max_scraps);
@z
- at x [14.270] l.4883
+ at x [14.270] l.4886
@** Index.
@y
@** Extensions to {\tentex CWEB}. The following sections introduce new or
@@ -636,7 +642,7 @@
@<Update the result...@>= {
if((tex_file=fopen(tex_file_name,"r"))!=NULL) {
- boolean comparison=false;
+ bool comparison=false;
if((check_file=fopen(check_file_name,"r"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
Modified: branches/stable/source/src/texk/web2c/cwebdir/cweav-w32.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/cweav-w32.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/cweav-w32.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -8,13 +8,13 @@
@z
@x section 32
-boolean names_match(
+bool names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
eight_bits t) /* desired |ilk| */
@y
-boolean __cdecl names_match(
+bool __cdecl names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
Modified: branches/stable/source/src/texk/web2c/cwebdir/cweave.w
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/cweave.w 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/cweave.w 2025-05-17 22:44:20 UTC (rev 964)
@@ -182,7 +182,7 @@
turned on during the first phase.
@<Private...@>=
-static boolean change_exists; /* has any section changed? */
+static bool change_exists; /* has any section changed? */
@ The other large memory area in \.{CWEAVE} keeps the cross-reference data.
All uses of the name |p| are recorded in a linked list beginning at
@@ -355,7 +355,7 @@
@ Here are the two procedures needed to complete |id_lookup|:
@c
-boolean names_match(
+bool names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
@@ -730,7 +730,7 @@
@d right_preproc 0217 /* ends a preprocessor command */
@<Private...@>=
-static boolean preprocessing=false; /* are we scanning a preprocessor command? */
+static bool preprocessing=false; /* are we scanning a preprocessor command? */
@ @<Raise prep...@>= {
preprocessing=true;
@@ -743,7 +743,7 @@
name as a string.
@<Private...@>=
-static boolean sharp_include_line=false;
+static bool sharp_include_line=false;
/* are we scanning a \#\&{include} line? */
@ @<Check if next token is |include|@>=
@@ -1140,7 +1140,7 @@
if (next_control!=begin_comment && next_control!=begin_short_comment)
C_xref(ignore);
else {
- boolean is_long_comment=(next_control==begin_comment);
+ bool is_long_comment=(next_control==begin_comment);
bal=copy_comment(is_long_comment,1); next_control='|';
while (bal>0) {
C_xref(section_name); /* do not reference section names in comments */
@@ -1282,7 +1282,7 @@
@<Private...@>=
static xref_pointer cur_xref; /* temporary cross-reference pointer */
-static boolean an_output; /* did |file_flag| precede |cur_xref|? */
+static bool an_output; /* did |file_flag| precede |cur_xref|? */
@ The following recursive procedure
walks through the tree of section names and prints out anomalies.
@@ -1348,7 +1348,7 @@
@d tex_puts(c) fputs(c,active_file)
@<Predecl...@>=
-static void flush_buffer(char *,boolean,boolean);@/
+static void flush_buffer(char *,bool,bool);@/
static void finish_line(void);
@ @c
@@ -1355,7 +1355,7 @@
static void
flush_buffer(
char *b, /* outputs from |out_buf+1| to |b|, where |b<=out_ptr| */
-boolean per_cent,boolean carryover)
+bool per_cent,bool carryover)
{
char *j=b; /* pointer into |out_buf| */
if (! per_cent) /* remove trailing blanks */
@@ -1472,7 +1472,7 @@
@<Predecl...@>=
static void out_section(sixteen_bits);@/
-static void out_name(name_pointer,boolean);
+static void out_name(name_pointer,bool);
@ @c
static void
@@ -1492,7 +1492,7 @@
static void
out_name(
name_pointer p,
-boolean quote_xalpha)
+bool quote_xalpha)
{
char *k; /* pointer into |byte_mem| */
out('{');
@@ -1519,7 +1519,7 @@
@<Predecl...@>=
static void copy_limbo(void);@/
static eight_bits copy_TeX(void);@/
-static int copy_comment(boolean,int);
+static int copy_comment(bool,int);
@ @c
static void
@@ -1585,7 +1585,7 @@
@c
static int copy_comment( /* copies \TeX\ code in comments */
-boolean is_long_comment, /* is this a traditional \CEE/ comment? */
+bool is_long_comment, /* is this a traditional \CEE/ comment? */
int bal) /* brace balance */
{
char c; /* current character being copied */
@@ -3627,7 +3627,7 @@
token list; it also builds a new scrap if |scrapping==true|.
@<Predec...@>=
-static void app_cur_id(boolean);@/
+static void app_cur_id(bool);@/
static text_pointer C_translate(void);@/
static void outer_parse(void);
@@ -3634,7 +3634,7 @@
@ @c
static void
app_cur_id(
-boolean scrapping) /* are we making this into a scrap? */
+bool scrapping) /* are we making this into a scrap? */
{
name_pointer p=id_lookup(id_first,id_loc,normal);
if (p->ilk<=custom) { /* not a reserved word */
@@ -3698,7 +3698,7 @@
if (next_control!=begin_comment && next_control!=begin_short_comment)
C_parse(ignore);
else {
- boolean is_long_comment=(next_control==begin_comment);
+ bool is_long_comment=(next_control==begin_comment);
@<Make sure that there is room for the new...@>@;
app(cancel); app(inserted);
if (is_long_comment) app_str("\\C{"@q}@>);
@@ -3911,8 +3911,8 @@
char delim; /* first and last character of string being copied */
char *save_loc, *save_limit; /* |loc| and |limit| to be restored */
name_pointer cur_section_name; /* name of section being output */
- boolean save_mode; /* value of |cur_mode| before a sequence of breaks */
- boolean dindent_pending=false; /* should a |dindent| be output? */
+ bool save_mode; /* value of |cur_mode| before a sequence of breaks */
+ bool dindent_pending=false; /* should a |dindent| be output? */
app(end_translation); /* append a sentinel */
freeze_text(); push_level(text_ptr-1);
while (true) {
@@ -4206,10 +4206,10 @@
static int save_line; /* former value of |out_line| */
static char *save_place; /* former value of |out_ptr| */
static int sec_depth; /* the integer, if any, following \.{@@*} */
-static boolean space_checked; /* have we done |emit_space_if_needed|? */
-static boolean format_visible; /* should the next format declaration be output? */
-static boolean doing_format=false; /* are we outputting a format declaration? */
-static boolean group_found=false; /* has a starred section occurred? */
+static bool space_checked; /* have we done |emit_space_if_needed|? */
+static bool format_visible; /* should the next format declaration be output? */
+static bool doing_format=false; /* are we outputting a format declaration? */
+static bool group_found=false; /* has a starred section occurred? */
@ @<Translate the \9{c}current section@>= {
section_count++;
@@ -4261,12 +4261,15 @@
switch (next_control=copy_TeX()) {
case '|': init_stack(); output_C(); break;
case '@@': out('@@'); break;
- case TeX_string: case noop:
+ case TeX_string: case verbatim: case noop:
case xref_roman: case xref_wildcard: case xref_typewriter:
case section_name: loc-=2; next_control=get_next(); /* skip to \.{@@>} */
if (next_control==TeX_string)
- err_print("! TeX string should be in C text only"); break;
+ err_print("! TeX string should be in C text only");
@.TeX string should be...@>
+ if (next_control==verbatim)
+ err_print("! Verbatim string should be in C text only"); break;
+ at .Verbatim string should be...@>
case thin_space: case math_break: case ord:
case line_break: case big_line_break: case no_line_break: case join:
case pseudo_semi: case macro_arg_open: case macro_arg_close:
@@ -4302,7 +4305,7 @@
@c
static void
finish_C( /* finishes a definition or a \CEE/ part */
- boolean visible) /* |true| if we should produce \TeX\ output */
+ bool visible) /* |true| if we should produce \TeX\ output */
{
text_pointer p; /* translation of the scraps */
if (visible) {
@@ -4327,7 +4330,7 @@
/* forget the tokens and the scraps */
}
-@ @<Predecl...@>=@+static void finish_C(boolean);
+@ @<Predecl...@>=@+static void finish_C(bool);
@ Keeping in line with the conventions of the \CEE/ preprocessor (and
otherwise contrary to the rules of \.{CWEB}) we distinguish here
@@ -4770,7 +4773,7 @@
switch (cur_name->ilk) {@+char *p; /* index into |byte_mem| */@+ at t}\6{\4@>
case normal: case func_template:
if (is_tiny(cur_name)) out_str("\\|");
- else {@+boolean all_caps=true;@+ at t}\6{@>
+ else {@+bool all_caps=true;@+ at t}\6{@>
for (p=cur_name->byte_start;p<(cur_name+1)->byte_start;p++)
if (xislower(*p)) { /* not entirely uppercase */
all_caps=false; break;
Modified: branches/stable/source/src/texk/web2c/cwebdir/po/cweb.pot
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/po/cweb.pot 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/po/cweb.pot 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,14 +1,14 @@
# International version of CWEB (CWEBbin).
-# Copyright (C) 2021 Andreas Scherer et al.
+# Copyright (C) 2025 Andreas Scherer et al.
# This file is distributed under the same license as the CWEB package.
-# Andreas Scherer <https://ascherer/github.io>, 2021.
+# Andreas Scherer <https://ascherer.github.io>, 2025.
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: CWEBbin 2021\n"
+"Project-Id-Version: CWEBbin 2025\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-02-06 15:25+0100\n"
+"POT-Creation-Date: 2025-03-12 11:51+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -84,13 +84,13 @@
"! Section name incompatible with <"
msgstr ""
-#: ctang-i18n.ch:173 cweav-i18n.ch:67
+#: ctang-i18n.ch:163 cweav-i18n.ch:67
msgid ""
"\n"
"! Section name too long: "
msgstr ""
-#: comm-i18n.ch:248
+#: comm-i18n.ch:252
#, c-format
msgid ""
"\n"
@@ -97,7 +97,7 @@
"! Sorry, %s capacity exceeded"
msgstr ""
-#: ctang-i18n.ch:131 cweav-i18n.ch:45
+#: ctang-i18n.ch:121 cweav-i18n.ch:45
msgid ""
"\n"
"! String too long: "
@@ -110,7 +110,7 @@
"Irreducible scrap sequence in section %d:"
msgstr ""
-#: ctang-i18n.ch:300 cweav-i18n.ch:430
+#: ctang-i18n.ch:298 cweav-i18n.ch:436
msgid ""
"\n"
"Memory usage statistics:"
@@ -123,13 +123,13 @@
"Tracing after l. %d:\n"
msgstr ""
-#: cweav-i18n.ch:377
+#: cweav-i18n.ch:383
msgid ""
"\n"
"Writing the index..."
msgstr ""
-#: ctang-i18n.ch:63
+#: ctang-i18n.ch:64
#, c-format
msgid ""
"\n"
@@ -142,13 +142,14 @@
"Writing the output file..."
msgstr ""
-#: ctang-i18n.ch:69
+#: ctang-i18n.ch:65
+#, c-format
msgid ""
"\n"
-"Writing the output files:"
+"Writing the output files: (%s)"
msgstr ""
-#: ctang-i18n.ch:225
+#: ctang-i18n.ch:221
msgid "! @d, @f and @c are ignored in C text"
msgstr ""
@@ -156,33 +157,33 @@
msgid "! CWEB file ended during a change"
msgstr ""
-#: cweav-twill.ch:1029
+#: cweav-twill.ch:1243
msgid "! Cannot open aux output file "
msgstr ""
-#: comm-i18n.ch:84
+#: comm-i18n.ch:134
msgid "! Cannot open change file "
msgstr ""
-#: comm-i18n.ch:112
+#: comm-i18n.ch:98
msgid "! Cannot open include file"
msgstr ""
-#: cweav-i18n.ch:383
+#: cweav-i18n.ch:389
msgid "! Cannot open index file "
msgstr ""
-#: comm-i18n.ch:78
+#: comm-i18n.ch:128
msgid "! Cannot open input file "
msgstr ""
-#: comm-i18n.ch:300 comm-i18n.ch:306 comm-i18n.ch:312 comm-i18n.ch:318
-#: ctang-i18n.ch:83 ctang-i18n.ch:89 ctang-i18n.ch:315 ctang-i18n.ch:321
-#: cweav-i18n.ch:455
+#: comm-i18n.ch:304 comm-i18n.ch:310 comm-i18n.ch:324 comm-i18n.ch:330
+#: comm-i18n.ch:336 comm-i18n.ch:342 ctang-i18n.ch:79 ctang-i18n.ch:313
+#: ctang-i18n.ch:319 ctang-i18n.ch:325 ctang-i18n.ch:331 cweav-i18n.ch:461
msgid "! Cannot open output file "
msgstr ""
-#: cweav-i18n.ch:389
+#: cweav-i18n.ch:395
msgid "! Cannot open section file "
msgstr ""
@@ -194,11 +195,11 @@
msgid "! Change file ended before @y"
msgstr ""
-#: comm-i18n.ch:120
+#: comm-i18n.ch:106
msgid "! Change file ended without @z"
msgstr ""
-#: comm-i18n.ch:134
+#: comm-i18n.ch:120
msgid "! Change file entry did not match"
msgstr ""
@@ -214,23 +215,23 @@
msgid "! Control text didn't end"
msgstr ""
-#: ctang-i18n.ch:257
+#: ctang-i18n.ch:253
msgid "! Definition flushed, must start with identifier"
msgstr ""
-#: ctang-i18n.ch:153
+#: ctang-i18n.ch:143
msgid "! Double @ should be used in ASCII constant"
msgstr ""
-#: ctang-i18n.ch:145 ctang-i18n.ch:265
+#: ctang-i18n.ch:135 ctang-i18n.ch:261
msgid "! Double @ should be used in control text"
msgstr ""
-#: ctang-i18n.ch:271 cweav-i18n.ch:167 cweav-twill.ch:661 cweav-twill.ch:664
+#: ctang-i18n.ch:269 cweav-i18n.ch:167 cweav-twill.ch:364 cweav-twill.ch:367
msgid "! Double @ should be used in limbo"
msgstr ""
-#: ctang-i18n.ch:241
+#: ctang-i18n.ch:237
msgid "! Double @ should be used in string"
msgstr ""
@@ -242,11 +243,11 @@
msgid "! Extra } in comment"
msgstr ""
-#: comm-i18n.ch:292
+#: comm-i18n.ch:296
msgid "! Filename too long\n"
msgstr ""
-#: cweav-twill.ch:541
+#: cweav-twill.ch:1024
msgid "! Identifier in meaning should be followed by space"
msgstr ""
@@ -254,39 +255,39 @@
msgid "! Illegal use of @ in comment"
msgstr ""
-#: cweav-i18n.ch:353
+#: cweav-i18n.ch:359
msgid "! Improper format definition"
msgstr ""
-#: ctang-i18n.ch:279
+#: ctang-i18n.ch:277
msgid "! Improper hex number following @l"
msgstr ""
-#: cweav-i18n.ch:339 cweav-i18n.ch:345
+#: cweav-i18n.ch:343 cweav-i18n.ch:351
msgid "! Improper macro definition"
msgstr ""
-#: comm-i18n.ch:92
+#: comm-i18n.ch:78
msgid "! Include file name not given"
msgstr ""
-#: comm-i18n.ch:106
+#: comm-i18n.ch:92
msgid "! Include file name too long"
msgstr ""
-#: comm-i18n.ch:324
+#: comm-i18n.ch:316
msgid "! Include path too long"
msgstr ""
-#: ctang-i18n.ch:105 cweav-i18n.ch:181
+#: ctang-i18n.ch:95 cweav-i18n.ch:181
msgid "! Input ended in mid-comment"
msgstr ""
-#: ctang-i18n.ch:125 cweav-i18n.ch:39
+#: ctang-i18n.ch:115 cweav-i18n.ch:39
msgid "! Input ended in middle of string"
msgstr ""
-#: ctang-i18n.ch:167 cweav-i18n.ch:61
+#: ctang-i18n.ch:157 cweav-i18n.ch:61
msgid "! Input ended in section name"
msgstr ""
@@ -294,11 +295,11 @@
msgid "! Input line too long"
msgstr ""
-#: cweav-twill.ch:548
+#: cweav-twill.ch:1032
msgid "! Location in meaning should be followed by space"
msgstr ""
-#: ctang-i18n.ch:219
+#: ctang-i18n.ch:215
msgid "! Misplaced @h"
msgstr ""
@@ -310,7 +311,7 @@
msgid "! Missing @x in change file"
msgstr ""
-#: ctang-i18n.ch:233
+#: ctang-i18n.ch:229
msgid "! Missing `@ ' before a named section"
msgstr ""
@@ -326,27 +327,27 @@
msgid "! Missing } in comment"
msgstr ""
-#: ctang-i18n.ch:187
+#: ctang-i18n.ch:177
msgid "! Nesting of section names not allowed"
msgstr ""
-#: cweav-twill.ch:1025
+#: cweav-twill.ch:1239
msgid "! Only @$ is allowed in aux and bux files"
msgstr ""
-#: ctang-i18n.ch:285
+#: ctang-i18n.ch:283
msgid "! Replacement string in @l too long"
msgstr ""
-#: ctang-i18n.ch:181 cweav-i18n.ch:75
+#: ctang-i18n.ch:171 cweav-i18n.ch:75
msgid "! Section name didn't end"
msgstr ""
-#: ctang-i18n.ch:111
+#: ctang-i18n.ch:101
msgid "! Section name ended in mid-comment"
msgstr ""
-#: ctang-i18n.ch:119 ctang-i18n.ch:159 cweav-i18n.ch:33
+#: ctang-i18n.ch:109 ctang-i18n.ch:149 cweav-i18n.ch:33
msgid "! String didn't end"
msgstr ""
@@ -354,146 +355,150 @@
msgid "! TeX string should be in C text only"
msgstr ""
-#: comm-i18n.hch:42
+#: comm-i18n.hch:56
msgid "! This can't happen: "
msgstr ""
-#: cweav-twill.ch:307
+#: cweav-twill.ch:1370
msgid "! Title name didn't end"
msgstr ""
-#: cweav-twill.ch:305
+#: cweav-twill.ch:1368
msgid "! Title should be enclosed in braces or doublequotes"
msgstr ""
-#: comm-i18n.ch:98
+#: comm-i18n.ch:84
msgid "! Too many nested includes"
msgstr ""
-#: ctang-i18n.ch:249
+#: ctang-i18n.ch:245
msgid "! Unrecognized escape sequence"
msgstr ""
-#: comm-i18n.ch:272
+#: comm-i18n.ch:276
msgid ""
"! Usage: ctangle [options] webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\n"
msgstr ""
-#: comm-i18n.ch:281
+#: comm-i18n.ch:285
msgid ""
"! Usage: ctwill [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
msgstr ""
-#: comm-i18n.ch:277
+#: comm-i18n.ch:281
msgid ""
"! Usage: cweave [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
msgstr ""
-#: ctang-i18n.ch:139 cweav-i18n.ch:53 cweav-i18n.ch:119
+#: ctang-i18n.ch:129 cweav-i18n.ch:53 cweav-i18n.ch:119
msgid "! Use @l in limbo only"
msgstr ""
-#: ctang-i18n.ch:195 cweav-i18n.ch:103
+#: ctang-i18n.ch:185 cweav-i18n.ch:103
msgid "! Verbatim string didn't end"
msgstr ""
+#: cweav-i18n.ch:330
+msgid "! Verbatim string should be in C text only"
+msgstr ""
+
#: comm-i18n.ch:64
msgid "! Where is the matching @y?"
msgstr ""
-#: comm-i18n.ch:126
+#: comm-i18n.ch:112
msgid "! Where is the matching @z?"
msgstr ""
-#: cweav-i18n.ch:369
+#: cweav-i18n.ch:375
msgid "! You can't do that in C text"
msgstr ""
-#: cweav-i18n.ch:331
+#: cweav-i18n.ch:335
msgid "! You can't do that in TeX text"
msgstr ""
-#: cweav-i18n.ch:361
+#: cweav-i18n.ch:367
msgid "! You need an = sign after the section name"
msgstr ""
-#: ctang-i18n.ch:305 cweav-i18n.ch:436 cweav-twill.ch:1335 cweav-twill.ch:1338
+#: ctang-i18n.ch:303 cweav-i18n.ch:442 cweav-twill.ch:754 cweav-twill.ch:757
#, c-format
-msgid "%ld bytes (out of %ld)\n"
+msgid "%td bytes (out of %ld)\n"
msgstr ""
-#: cweav-i18n.ch:434
+#: cweav-i18n.ch:440
#, c-format
-msgid "%ld cross-references (out of %ld)\n"
+msgid "%td cross-references (out of %ld)\n"
msgstr ""
-#: cweav-i18n.ch:445 cweav-i18n.ch:448
+#: cweav-i18n.ch:451 cweav-i18n.ch:454
#, c-format
-msgid "%ld levels (out of %ld)\n"
+msgid "%td levels (out of %ld)\n"
msgstr ""
-#: ctang-i18n.ch:301 cweav-i18n.ch:432
+#: ctang-i18n.ch:299 cweav-i18n.ch:438
#, c-format
-msgid "%ld names (out of %ld)\n"
+msgid "%td names (out of %ld)\n"
msgstr ""
-#: ctang-i18n.ch:303
+#: ctang-i18n.ch:301
#, c-format
-msgid "%ld replacement texts (out of %ld)\n"
+msgid "%td replacement texts (out of %ld)\n"
msgstr ""
-#: cweav-i18n.ch:439
+#: cweav-i18n.ch:445
#, c-format
-msgid "%ld scraps (out of %ld)\n"
+msgid "%td scraps (out of %ld)\n"
msgstr ""
-#: cweav-twill.ch:1340
+#: cweav-twill.ch:759
#, c-format
-msgid "%ld temp meanings (out of %ld)\n"
+msgid "%td temp meanings (out of %ld)\n"
msgstr ""
-#: cweav-i18n.ch:441
+#: cweav-i18n.ch:447
#, c-format
-msgid "%ld texts (out of %ld)\n"
+msgid "%td texts (out of %ld)\n"
msgstr ""
-#: cweav-twill.ch:1343
+#: cweav-twill.ch:762
#, c-format
-msgid "%ld titles (out of %ld)\n"
+msgid "%td titles (out of %ld)\n"
msgstr ""
-#: ctang-i18n.ch:307 cweav-i18n.ch:443
+#: ctang-i18n.ch:305 cweav-i18n.ch:449
#, c-format
-msgid "%ld tokens (out of %ld)\n"
+msgid "%td tokens (out of %ld)\n"
msgstr ""
-#: comm-i18n.ch:236
+#: comm-i18n.ch:240
msgid "(Did you see the warning message above?)"
msgstr ""
-#: comm-i18n.ch:234
+#: comm-i18n.ch:238
msgid "(No errors were found.)"
msgstr ""
-#: comm-i18n.ch:238
+#: comm-i18n.ch:242
msgid "(Pardon me, but I think I spotted something wrong.)"
msgstr ""
-#: comm-i18n.ch:240
+#: comm-i18n.ch:244
msgid "(That was a fatal error, my friend.)"
msgstr ""
-#: comm-i18n.ch:218
+#: comm-i18n.ch:219
#, c-format
msgid ". (l. %d of change file)\n"
msgstr ""
-#: comm-i18n.ch:220
+#: comm-i18n.ch:222
#, c-format
msgid ". (l. %d of include file %s)\n"
msgstr ""
-#: comm-i18n.ch:219
+#: comm-i18n.ch:221
#, c-format
msgid ". (l. %d)\n"
msgstr ""
@@ -510,15 +515,15 @@
" which abbreviates <"
msgstr ""
-#: ctang-i18n.ch:75 cweav-i18n.ch:395
+#: ctang-i18n.ch:71 cweav-i18n.ch:401
msgid "Done."
msgstr ""
-#: cweav-i18n.ch:438
+#: cweav-i18n.ch:444
msgid "Parsing:"
msgstr ""
-#: cweav-i18n.ch:447
+#: cweav-i18n.ch:453
msgid "Sorting:"
msgstr ""
@@ -526,11 +531,11 @@
msgid "This is CTANGLE (Version 4.12.1 [CWEBbin 2025])"
msgstr ""
-#: cweav-twill.ch:61
+#: cweav-twill.ch:93
msgid "This is CTWILL (Version 4.12.1 [CWEBbin 2025])"
msgstr ""
-#: cweav-i18n.ch:17 cweav-twill.ch:42
+#: cweav-i18n.ch:17 cweav-twill.ch:69
msgid "This is CWEAVE (Version 4.12.1 [CWEBbin 2025])"
msgstr ""
@@ -546,15 +551,15 @@
msgid "cross-reference"
msgstr ""
-#: cweav-twill.ch:818
+#: cweav-twill.ch:1161
msgid "find type"
msgstr ""
-#: cweav-twill.ch:757
+#: cweav-twill.ch:1096
msgid "inner"
msgstr ""
-#: ctang-i18n.ch:97
+#: ctang-i18n.ch:87
msgid "macro defs have strange char"
msgstr ""
@@ -578,7 +583,7 @@
msgid "section number"
msgstr ""
-#: cweav-i18n.ch:403
+#: cweav-i18n.ch:409
msgid "sorting"
msgstr ""
@@ -586,19 +591,19 @@
msgid "stack"
msgstr ""
-#: cweav-twill.ch:561
+#: cweav-twill.ch:1057
msgid "temp meanings"
msgstr ""
-#: ctang-i18n.ch:211 cweav-i18n.ch:223
+#: ctang-i18n.ch:207 cweav-i18n.ch:223
msgid "text"
msgstr ""
-#: cweav-twill.ch:308
+#: cweav-twill.ch:1371
msgid "titles"
msgstr ""
-#: ctang-i18n.ch:25 ctang-i18n.ch:203 cweav-i18n.ch:175 cweav-i18n.ch:217
+#: ctang-i18n.ch:25 ctang-i18n.ch:197 cweav-i18n.ch:175 cweav-i18n.ch:217
#: cweav-i18n.ch:231
msgid "token"
msgstr ""
Modified: branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb.po
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb.po 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb.po 2025-05-17 22:44:20 UTC (rev 964)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: CWEBbin 2025\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-01-01 15:08+0100\n"
+"POT-Creation-Date: 2025-03-12 11:51+0100\n"
"PO-Revision-Date: 2025-01-01 15:08+0100\n"
"Last-Translator: Andreas Scherer <andreas_github at freenet.de>\n"
"Language-Team: German\n"
@@ -106,7 +106,7 @@
"\n"
"! Abschnittname passt nicht zu <"
-#: ctang-i18n.ch:173 cweav-i18n.ch:67
+#: ctang-i18n.ch:163 cweav-i18n.ch:67
msgid ""
"\n"
"! Section name too long: "
@@ -114,7 +114,7 @@
"\n"
"! Abschnittname ist zu lang: "
-#: comm-i18n.ch:248
+#: comm-i18n.ch:252
#, c-format
msgid ""
"\n"
@@ -123,7 +123,7 @@
"\n"
"! Tut mir leid, Kapazität für %s überschritten"
-#: ctang-i18n.ch:131 cweav-i18n.ch:45
+#: ctang-i18n.ch:121 cweav-i18n.ch:45
msgid ""
"\n"
"! String too long: "
@@ -140,7 +140,7 @@
"\n"
"Nicht reduzierbare Scrap-Folge in Abschnitt %d:"
-#: ctang-i18n.ch:300 cweav-i18n.ch:430
+#: ctang-i18n.ch:298 cweav-i18n.ch:436
msgid ""
"\n"
"Memory usage statistics:"
@@ -157,7 +157,7 @@
"\n"
"Analyse nach Zeile %d:\n"
-#: cweav-i18n.ch:377
+#: cweav-i18n.ch:383
msgid ""
"\n"
"Writing the index..."
@@ -165,7 +165,7 @@
"\n"
"Schreibe den Index..."
-#: ctang-i18n.ch:63
+#: ctang-i18n.ch:64
#, c-format
msgid ""
"\n"
@@ -182,15 +182,16 @@
"\n"
"Schreibe die Ausgabedatei..."
-#: ctang-i18n.ch:69
+#: ctang-i18n.ch:65
+#, c-format
msgid ""
"\n"
-"Writing the output files:"
+"Writing the output files: (%s)"
msgstr ""
"\n"
-"Schreibe die Ausgabedateien:"
+"Schreibe die Ausgabedateien: (%s)"
-#: ctang-i18n.ch:225
+#: ctang-i18n.ch:221
msgid "! @d, @f and @c are ignored in C text"
msgstr "! @d, @f und @c werden im C-Text ignoriert"
@@ -198,33 +199,33 @@
msgid "! CWEB file ended during a change"
msgstr "! CWEB-Datei endete während einer Änderung"
-#: cweav-twill.ch:1029
+#: cweav-twill.ch:1243
msgid "! Cannot open aux output file "
msgstr "! Kann aux-Ausgabedatei nicht öffnen: "
-#: comm-i18n.ch:84
+#: comm-i18n.ch:134
msgid "! Cannot open change file "
msgstr "! Kann Änderungsdatei nicht öffnen: "
-#: comm-i18n.ch:112
+#: comm-i18n.ch:98
msgid "! Cannot open include file"
msgstr "! Kann Einfügedatei nicht öffnen"
-#: cweav-i18n.ch:383
+#: cweav-i18n.ch:389
msgid "! Cannot open index file "
msgstr "! Kann Indexdatei nicht öffnen: "
-#: comm-i18n.ch:78
+#: comm-i18n.ch:128
msgid "! Cannot open input file "
msgstr "! Kann Eingabedatei nicht öffnen: "
-#: comm-i18n.ch:300 comm-i18n.ch:306 comm-i18n.ch:312 comm-i18n.ch:318
-#: ctang-i18n.ch:83 ctang-i18n.ch:89 ctang-i18n.ch:315 ctang-i18n.ch:321
-#: cweav-i18n.ch:455
+#: comm-i18n.ch:304 comm-i18n.ch:310 comm-i18n.ch:324 comm-i18n.ch:330
+#: comm-i18n.ch:336 comm-i18n.ch:342 ctang-i18n.ch:79 ctang-i18n.ch:313
+#: ctang-i18n.ch:319 ctang-i18n.ch:325 ctang-i18n.ch:331 cweav-i18n.ch:461
msgid "! Cannot open output file "
msgstr "! Kann Ausgabedatei nicht öffnen: "
-#: cweav-i18n.ch:389
+#: cweav-i18n.ch:395
msgid "! Cannot open section file "
msgstr "! Kann die Abschnittdatei nicht öffnen: "
@@ -236,11 +237,11 @@
msgid "! Change file ended before @y"
msgstr "! Änderungsdatei endete vor @y"
-#: comm-i18n.ch:120
+#: comm-i18n.ch:106
msgid "! Change file ended without @z"
msgstr "! Änderungsdatei endete ohne @z"
-#: comm-i18n.ch:134
+#: comm-i18n.ch:120
msgid "! Change file entry did not match"
msgstr "! Eintrag in der Änderungsdatei stimmt nicht überein"
@@ -256,23 +257,23 @@
msgid "! Control text didn't end"
msgstr "! Kontrolltext nicht beendet"
-#: ctang-i18n.ch:257
+#: ctang-i18n.ch:253
msgid "! Definition flushed, must start with identifier"
msgstr "! Definition übergangen, muss mit einem Bezeichner anfangen"
-#: ctang-i18n.ch:153
+#: ctang-i18n.ch:143
msgid "! Double @ should be used in ASCII constant"
msgstr "! In ASCII Konstanten sollten doppelte @ verwendet werden"
-#: ctang-i18n.ch:145 ctang-i18n.ch:265
+#: ctang-i18n.ch:135 ctang-i18n.ch:261
msgid "! Double @ should be used in control text"
msgstr "! In Kontrolltexten sollten doppelte @ verwendet werden"
-#: ctang-i18n.ch:271 cweav-i18n.ch:167 cweav-twill.ch:661 cweav-twill.ch:664
+#: ctang-i18n.ch:269 cweav-i18n.ch:167 cweav-twill.ch:364 cweav-twill.ch:367
msgid "! Double @ should be used in limbo"
msgstr "! Im Einführungsteil sollten doppelte @ verwendet werden"
-#: ctang-i18n.ch:241
+#: ctang-i18n.ch:237
msgid "! Double @ should be used in string"
msgstr "! In einer Zeichenkette sollten doppelte @ verwendet werden"
@@ -284,11 +285,11 @@
msgid "! Extra } in comment"
msgstr "! Zusätzliche } in Kommentar"
-#: comm-i18n.ch:292
+#: comm-i18n.ch:296
msgid "! Filename too long\n"
msgstr "! Dateiname zu lang\n"
-#: cweav-twill.ch:541
+#: cweav-twill.ch:1024
msgid "! Identifier in meaning should be followed by space"
msgstr "! Bezeichner in Bedeutung sollte Leerzeichen folgen"
@@ -296,39 +297,39 @@
msgid "! Illegal use of @ in comment"
msgstr "! Unerlaubte Verwendung von @ in Kommentar"
-#: cweav-i18n.ch:353
+#: cweav-i18n.ch:359
msgid "! Improper format definition"
msgstr "! Ungültige Formatdefinition"
-#: ctang-i18n.ch:279
+#: ctang-i18n.ch:277
msgid "! Improper hex number following @l"
msgstr "! Ungültige Hexadezimalzahl nach @l"
-#: cweav-i18n.ch:339 cweav-i18n.ch:345
+#: cweav-i18n.ch:343 cweav-i18n.ch:351
msgid "! Improper macro definition"
msgstr "! Ungültige Makrodefinition"
-#: comm-i18n.ch:92
+#: comm-i18n.ch:78
msgid "! Include file name not given"
msgstr "! Name der Einfügedatei nicht angegeben"
-#: comm-i18n.ch:106
+#: comm-i18n.ch:92
msgid "! Include file name too long"
msgstr "! Name der Einfügedatei zu lang"
-#: comm-i18n.ch:324
+#: comm-i18n.ch:316
msgid "! Include path too long"
msgstr "! Einfügepfad zu lang"
-#: ctang-i18n.ch:105 cweav-i18n.ch:181
+#: ctang-i18n.ch:95 cweav-i18n.ch:181
msgid "! Input ended in mid-comment"
msgstr "! Eingabe endete mitten in einem Kommentar"
-#: ctang-i18n.ch:125 cweav-i18n.ch:39
+#: ctang-i18n.ch:115 cweav-i18n.ch:39
msgid "! Input ended in middle of string"
msgstr "! Eingabe endete mitten in einer Zeichenkette"
-#: ctang-i18n.ch:167 cweav-i18n.ch:61
+#: ctang-i18n.ch:157 cweav-i18n.ch:61
msgid "! Input ended in section name"
msgstr "! Eingabe endete in einem Abschnittnamen"
@@ -336,11 +337,11 @@
msgid "! Input line too long"
msgstr "! Eingabezeile zu lang"
-#: cweav-twill.ch:548
+#: cweav-twill.ch:1032
msgid "! Location in meaning should be followed by space"
msgstr "! Herkunftsort in Bedeutung sollte Leerzeichen folgen"
-#: ctang-i18n.ch:219
+#: ctang-i18n.ch:215
msgid "! Misplaced @h"
msgstr "! Falsch platziertes @h"
@@ -352,7 +353,7 @@
msgid "! Missing @x in change file"
msgstr "! Fehlendes @x in der Änderungsdatei"
-#: ctang-i18n.ch:233
+#: ctang-i18n.ch:229
msgid "! Missing `@ ' before a named section"
msgstr "! Fehlendes `@ ' vor einem Abschnittnamen"
@@ -368,27 +369,27 @@
msgid "! Missing } in comment"
msgstr "! Fehlende } in Kommentar"
-#: ctang-i18n.ch:187
+#: ctang-i18n.ch:177
msgid "! Nesting of section names not allowed"
msgstr "! Verschachtelung von Abschnittnamen nicht erlaubt"
-#: cweav-twill.ch:1025
+#: cweav-twill.ch:1239
msgid "! Only @$ is allowed in aux and bux files"
msgstr "! Nur @$ ist in aux- und bux-Dateien erlaubt"
-#: ctang-i18n.ch:285
+#: ctang-i18n.ch:283
msgid "! Replacement string in @l too long"
msgstr "! Ersetzungstext in @l zu lang"
-#: ctang-i18n.ch:181 cweav-i18n.ch:75
+#: ctang-i18n.ch:171 cweav-i18n.ch:75
msgid "! Section name didn't end"
msgstr "! Abschnittname nicht beendet"
-#: ctang-i18n.ch:111
+#: ctang-i18n.ch:101
msgid "! Section name ended in mid-comment"
msgstr "! Abschnittname endete mitten in einem Kommentar"
-#: ctang-i18n.ch:119 ctang-i18n.ch:159 cweav-i18n.ch:33
+#: ctang-i18n.ch:109 ctang-i18n.ch:149 cweav-i18n.ch:33
msgid "! String didn't end"
msgstr "! Zeichenkette nicht beendet"
@@ -396,27 +397,27 @@
msgid "! TeX string should be in C text only"
msgstr "! TeX-Zeichenkette sollte nur in C-Text stehen"
-#: comm-i18n.hch:42
+#: comm-i18n.hch:56
msgid "! This can't happen: "
msgstr "! Das kann nicht sein: "
-#: cweav-twill.ch:307
+#: cweav-twill.ch:1370
msgid "! Title name didn't end"
msgstr "! Titel nicht beendet"
-#: cweav-twill.ch:305
+#: cweav-twill.ch:1368
msgid "! Title should be enclosed in braces or doublequotes"
msgstr "! Titel sollte in geschweiften Klammern oder Anführungszeichen stehen"
-#: comm-i18n.ch:98
+#: comm-i18n.ch:84
msgid "! Too many nested includes"
msgstr "! Zu viele verschachtelte Einfügungen"
-#: ctang-i18n.ch:249
+#: ctang-i18n.ch:245
msgid "! Unrecognized escape sequence"
msgstr "! Unbekannte Escape-Sequenz"
-#: comm-i18n.ch:272
+#: comm-i18n.ch:276
msgid ""
"! Usage: ctangle [options] webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\n"
msgstr ""
@@ -428,7 +429,7 @@
"s [-] Melde die Verbrauchsstatistik\n"
"t [+] Vergleiche temporäre Ausgabe nach Änderungen\n"
-#: comm-i18n.ch:281
+#: comm-i18n.ch:285
msgid ""
"! Usage: ctwill [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
msgstr ""
@@ -447,7 +448,7 @@
"s [-] Melde die Verbrauchsstatistik\n"
"t [+] Vergleiche temporäre Ausgabe nach Änderungen\n"
-#: comm-i18n.ch:277
+#: comm-i18n.ch:281
msgid ""
"! Usage: cweave [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
msgstr ""
@@ -465,111 +466,115 @@
"s [-] Melde die Verbrauchsstatistik\n"
"t [+] Vergleiche temporäre Ausgabe nach Änderungen\n"
-#: ctang-i18n.ch:139 cweav-i18n.ch:53 cweav-i18n.ch:119
+#: ctang-i18n.ch:129 cweav-i18n.ch:53 cweav-i18n.ch:119
msgid "! Use @l in limbo only"
msgstr "! Verwende @l ausschließlich im Einführungsteil"
-#: ctang-i18n.ch:195 cweav-i18n.ch:103
+#: ctang-i18n.ch:185 cweav-i18n.ch:103
msgid "! Verbatim string didn't end"
msgstr "! Verbatim-Zeichenkette nicht beendet"
+#: cweav-i18n.ch:330
+msgid "! Verbatim string should be in C text only"
+msgstr "! Verbatim-Zeichenkette sollte nur in C-Text stehen"
+
#: comm-i18n.ch:64
msgid "! Where is the matching @y?"
msgstr "! Wo ist das zugehörige @y?"
-#: comm-i18n.ch:126
+#: comm-i18n.ch:112
msgid "! Where is the matching @z?"
msgstr "! Wo ist das zugehörige @z?"
-#: cweav-i18n.ch:369
+#: cweav-i18n.ch:375
msgid "! You can't do that in C text"
msgstr "! Das geht nicht im C-Text"
-#: cweav-i18n.ch:331
+#: cweav-i18n.ch:335
msgid "! You can't do that in TeX text"
msgstr "! Das geht nicht im TeX-Text"
-#: cweav-i18n.ch:361
+#: cweav-i18n.ch:367
msgid "! You need an = sign after the section name"
msgstr "! Hinter dem Abschnittnamen muss ein = Zeichen stehen"
-#: ctang-i18n.ch:305 cweav-i18n.ch:436 cweav-twill.ch:1335 cweav-twill.ch:1338
+#: ctang-i18n.ch:303 cweav-i18n.ch:442 cweav-twill.ch:754 cweav-twill.ch:757
#, c-format
-msgid "%ld bytes (out of %ld)\n"
-msgstr "%ld Bytes (von %ld)\n"
+msgid "%td bytes (out of %ld)\n"
+msgstr "%td Bytes (von %ld)\n"
-#: cweav-i18n.ch:434
+#: cweav-i18n.ch:440
#, c-format
-msgid "%ld cross-references (out of %ld)\n"
-msgstr "%ld Querverweise (von %ld)\n"
+msgid "%td cross-references (out of %ld)\n"
+msgstr "%td Querverweise (von %ld)\n"
-#: cweav-i18n.ch:445 cweav-i18n.ch:448
+#: cweav-i18n.ch:451 cweav-i18n.ch:454
#, c-format
-msgid "%ld levels (out of %ld)\n"
-msgstr "%ld Ebenen (von %ld)\n"
+msgid "%td levels (out of %ld)\n"
+msgstr "%td Ebenen (von %ld)\n"
-#: ctang-i18n.ch:301 cweav-i18n.ch:432
+#: ctang-i18n.ch:299 cweav-i18n.ch:438
#, c-format
-msgid "%ld names (out of %ld)\n"
-msgstr "%ld Namen (von %ld)\n"
+msgid "%td names (out of %ld)\n"
+msgstr "%td Namen (von %ld)\n"
-#: ctang-i18n.ch:303
+#: ctang-i18n.ch:301
#, c-format
-msgid "%ld replacement texts (out of %ld)\n"
-msgstr "%ld Ersetzungstexte (von %ld)\n"
+msgid "%td replacement texts (out of %ld)\n"
+msgstr "%td Ersetzungstexte (von %ld)\n"
-#: cweav-i18n.ch:439
+#: cweav-i18n.ch:445
#, c-format
-msgid "%ld scraps (out of %ld)\n"
-msgstr "%ld Scraps (von %ld)\n"
+msgid "%td scraps (out of %ld)\n"
+msgstr "%td Scraps (von %ld)\n"
-#: cweav-twill.ch:1340
+#: cweav-twill.ch:759
#, c-format
-msgid "%ld temp meanings (out of %ld)\n"
-msgstr "%ld temporäre Bedeutungen (von %ld)\n"
+msgid "%td temp meanings (out of %ld)\n"
+msgstr "%td temporäre Bedeutungen (von %ld)\n"
-#: cweav-i18n.ch:441
+#: cweav-i18n.ch:447
#, c-format
-msgid "%ld texts (out of %ld)\n"
-msgstr "%ld Texte (von %ld)\n"
+msgid "%td texts (out of %ld)\n"
+msgstr "%td Texte (von %ld)\n"
-#: cweav-twill.ch:1343
+#: cweav-twill.ch:762
#, c-format
-msgid "%ld titles (out of %ld)\n"
-msgstr "%ld Titel (von %ld)\n"
+msgid "%td titles (out of %ld)\n"
+msgstr "%td Titel (von %ld)\n"
-#: ctang-i18n.ch:307 cweav-i18n.ch:443
+#: ctang-i18n.ch:305 cweav-i18n.ch:449
#, c-format
-msgid "%ld tokens (out of %ld)\n"
-msgstr "%ld Token (von %ld)\n"
+msgid "%td tokens (out of %ld)\n"
+msgstr "%td Token (von %ld)\n"
-#: comm-i18n.ch:236
+#: comm-i18n.ch:240
msgid "(Did you see the warning message above?)"
msgstr "(Hast du die obige Warnung gesehen?)"
-#: comm-i18n.ch:234
+#: comm-i18n.ch:238
msgid "(No errors were found.)"
msgstr "(Keine Fehler gefunden.)"
-#: comm-i18n.ch:238
+#: comm-i18n.ch:242
msgid "(Pardon me, but I think I spotted something wrong.)"
msgstr "(Entschuldige bitte, aber ich glaube, etwas stimmt nicht.)"
-#: comm-i18n.ch:240
+#: comm-i18n.ch:244
msgid "(That was a fatal error, my friend.)"
msgstr "(Mensch, das war ein böser Fehler.)"
-#: comm-i18n.ch:218
+#: comm-i18n.ch:219
#, c-format
msgid ". (l. %d of change file)\n"
msgstr ". (Zeile %d der Änderungsdatei)\n"
-#: comm-i18n.ch:220
+#: comm-i18n.ch:222
#, c-format
msgid ". (l. %d of include file %s)\n"
msgstr ". (Zeile %d der Einfügedatei %s)\n"
-#: comm-i18n.ch:219
+#: comm-i18n.ch:221
#, c-format
msgid ". (l. %d)\n"
msgstr ". (Zeile %d)\n"
@@ -590,15 +595,15 @@
">,\n"
" einer Abkürzung von <"
-#: ctang-i18n.ch:75 cweav-i18n.ch:395
+#: ctang-i18n.ch:71 cweav-i18n.ch:401
msgid "Done."
msgstr "Fertig."
-#: cweav-i18n.ch:438
+#: cweav-i18n.ch:444
msgid "Parsing:"
msgstr "Parsen:"
-#: cweav-i18n.ch:447
+#: cweav-i18n.ch:453
msgid "Sorting:"
msgstr "Sortieren:"
@@ -606,11 +611,11 @@
msgid "This is CTANGLE (Version 4.12.1 [CWEBbin 2025])"
msgstr "Dies ist CTANGLE (Version 4.12.1 [CWEBbin 2025])"
-#: cweav-twill.ch:61
+#: cweav-twill.ch:93
msgid "This is CTWILL (Version 4.12.1 [CWEBbin 2025])"
msgstr "Dies ist CTWILL (Version 4.12.1 [CWEBbin 2025])"
-#: cweav-i18n.ch:17 cweav-twill.ch:42
+#: cweav-i18n.ch:17 cweav-twill.ch:69
msgid "This is CWEAVE (Version 4.12.1 [CWEBbin 2025])"
msgstr "Dies ist CWEAVE (Version 4.12.1 [CWEBbin 2025])"
@@ -626,15 +631,15 @@
msgid "cross-reference"
msgstr "Querverweise"
-#: cweav-twill.ch:818
+#: cweav-twill.ch:1161
msgid "find type"
msgstr "Auffindetyp"
-#: cweav-twill.ch:757
+#: cweav-twill.ch:1096
msgid "inner"
msgstr "inner"
-#: ctang-i18n.ch:97
+#: ctang-i18n.ch:87
msgid "macro defs have strange char"
msgstr "Unpassendes Zeichen in einer Makrodefinition"
@@ -658,7 +663,7 @@
msgid "section number"
msgstr "Abschnittnummer"
-#: cweav-i18n.ch:403
+#: cweav-i18n.ch:409
msgid "sorting"
msgstr "Sortieren"
@@ -666,19 +671,19 @@
msgid "stack"
msgstr "Stack"
-#: cweav-twill.ch:561
+#: cweav-twill.ch:1057
msgid "temp meanings"
msgstr "Temporäre Bedeutung"
-#: ctang-i18n.ch:211 cweav-i18n.ch:223
+#: ctang-i18n.ch:207 cweav-i18n.ch:223
msgid "text"
msgstr "Text"
-#: cweav-twill.ch:308
+#: cweav-twill.ch:1371
msgid "titles"
msgstr "Titel"
-#: ctang-i18n.ch:25 ctang-i18n.ch:203 cweav-i18n.ch:175 cweav-i18n.ch:217
+#: ctang-i18n.ch:25 ctang-i18n.ch:197 cweav-i18n.ch:175 cweav-i18n.ch:217
#: cweav-i18n.ch:231
msgid "token"
msgstr "Token"
Modified: branches/stable/source/src/texk/web2c/cwebdir/po/de/web2c-help.po
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/po/de/web2c-help.po 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/po/de/web2c-help.po 2025-05-17 22:44:20 UTC (rev 964)
@@ -7,8 +7,8 @@
msgstr ""
"Project-Id-Version: CWEBbin 2025\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-01-01 15:08+0100\n"
-"PO-Revision-Date: 2025-01-01 15:08+0100\n"
+"POT-Creation-Date: 2025-04-30 10:05+0200\n"
+"PO-Revision-Date: 2025-04-30 10:05+0200\n"
"Last-Translator: Andreas Scherer <andreas_github at freenet.de>\n"
"Language-Team: German\n"
"Language: de\n"
@@ -56,12 +56,12 @@
msgstr "+p schreibe die Fortschrittsmeldungen"
#: help.h:62 help.h:85 help.h:114
-msgid "+/-q shortcut for '-bhp'; also '--quiet' (default)"
-msgstr "+/-q Kurzform für '-bhp'; auch '--quiet' (Vorgabe)"
+msgid "+/-q shortcut for '-bhp'; also '--quiet'"
+msgstr "+/-q Kurzform für '-bhp'; auch '--quiet'"
#: help.h:63 help.h:86 help.h:115
-msgid "+/-v shortcut for '+bhp'; also '--verbose'"
-msgstr "+/-v Kurzform für '+bhp'; auch '--verbose'"
+msgid "+/-v shortcut for '+bhp'; also '--verbose' (default)"
+msgstr "+/-v Kurzform für '+bhp'; auch '--verbose' (Vorgabe)"
#: help.h:64 help.h:87 help.h:116
msgid "+c check temporary output for changes"
Modified: branches/stable/source/src/texk/web2c/cwebdir/po/it/cweb.po
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/po/it/cweb.po 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/po/it/cweb.po 2025-05-17 22:44:20 UTC (rev 964)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: CWEBbin 2025\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-01-01 15:08+0100\n"
+"POT-Creation-Date: 2025-03-12 11:51+0100\n"
"PO-Revision-Date: 2025-01-01 15:08+0100\n"
"Last-Translator: Andreas Scherer <andreas_github at freenet.de>\n"
"Language-Team: Italian\n"
@@ -17,7 +17,7 @@
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: comm-i18n.ch:182
+#: comm-i18n.ch:176
msgid ""
"\n"
"! Ambiguous prefix: matches <"
@@ -41,7 +41,7 @@
"\n"
"! Codice di controllo illegale nella sezione: <"
-#: cweav-i18n.ch:157
+#: cweav-i18n.ch:159
#, c-format
msgid ""
"\n"
@@ -50,7 +50,7 @@
"\n"
"! La linea deve essere spezzata (output l. %d):\n"
-#: cweav-i18n.ch:141
+#: cweav-i18n.ch:142
msgid ""
"\n"
"! Never defined: <"
@@ -58,7 +58,7 @@
"\n"
"! Mai definito: <"
-#: cweav-i18n.ch:148
+#: cweav-i18n.ch:150
msgid ""
"\n"
"! Never used: <"
@@ -66,7 +66,7 @@
"\n"
"! Mai usato: <"
-#: comm-i18n.ch:202
+#: comm-i18n.ch:196
msgid ""
"\n"
"! New name extends <"
@@ -74,7 +74,7 @@
"\n"
"! Il nuovo nome estende <"
-#: comm-i18n.ch:196
+#: comm-i18n.ch:190
msgid ""
"\n"
"! New name is a prefix of <"
@@ -98,7 +98,7 @@
"\n"
"! Non presente: <"
-#: comm-i18n.ch:208
+#: comm-i18n.ch:202
msgid ""
"\n"
"! Section name incompatible with <"
@@ -106,7 +106,7 @@
"\n"
"! Nome sezione incompatibile con <"
-#: ctang-i18n.ch:167 cweav-i18n.ch:67
+#: ctang-i18n.ch:163 cweav-i18n.ch:67
msgid ""
"\n"
"! Section name too long: "
@@ -114,7 +114,7 @@
"\n"
"! Nome sezione troppo lungo: "
-#: comm-i18n.ch:254
+#: comm-i18n.ch:252
#, c-format
msgid ""
"\n"
@@ -123,7 +123,7 @@
"\n"
"! Spiacente, %s capacità superata"
-#: ctang-i18n.ch:125 cweav-i18n.ch:45
+#: ctang-i18n.ch:121 cweav-i18n.ch:45
msgid ""
"\n"
"! String too long: "
@@ -140,7 +140,7 @@
"\n"
"Sequenza scrap irriducibile nella sezione %d:"
-#: ctang-i18n.ch:292 cweav-i18n.ch:431
+#: ctang-i18n.ch:298 cweav-i18n.ch:436
msgid ""
"\n"
"Memory usage statistics:"
@@ -157,7 +157,7 @@
"\n"
"Tracing dopo l. %d:\n"
-#: cweav-i18n.ch:377
+#: cweav-i18n.ch:383
msgid ""
"\n"
"Writing the index..."
@@ -165,7 +165,7 @@
"\n"
"Scrittura dell'indice..."
-#: ctang-i18n.ch:63
+#: ctang-i18n.ch:64
#, c-format
msgid ""
"\n"
@@ -182,64 +182,66 @@
"\n"
"Scrittura file di output..."
-#: ctang-i18n.ch:69
+#: ctang-i18n.ch:65
+#, c-format
msgid ""
"\n"
-"Writing the output files:"
+"Writing the output files: (%s)"
msgstr ""
"\n"
-"Scrittura dei file di output:"
+"Scrittura dei file di output: (%s)"
-#: ctang-i18n.ch:217
+#: ctang-i18n.ch:221
msgid "! @d, @f and @c are ignored in C text"
msgstr "! @d, @f e @c sono ignorati nella parte C"
-#: comm-i18n.ch:60
+#: comm-i18n.ch:56
msgid "! CWEB file ended during a change"
msgstr "! File CWEB terminato durante un change"
-#: cweav-twill.ch:1033
+#: cweav-twill.ch:1243
msgid "! Cannot open aux output file "
msgstr "! Non posso aprire il file di aux output "
-#: comm-i18n.ch:88
+#: comm-i18n.ch:134
msgid "! Cannot open change file "
msgstr "! Non posso aprire il change file "
-#: comm-i18n.ch:118
+#: comm-i18n.ch:98
msgid "! Cannot open include file"
msgstr "! Non posso aprire il file include"
-#: cweav-i18n.ch:383
+#: cweav-i18n.ch:389
msgid "! Cannot open index file "
msgstr "! Non posso aprire il file per l'indice "
-#: comm-i18n.ch:82
+#: comm-i18n.ch:128
msgid "! Cannot open input file "
msgstr "! Non posso aprire il file di input "
-#: comm-i18n.ch:300 comm-i18n.ch:308 ctang-i18n.ch:83 ctang-i18n.ch:307
-#: cweav-i18n.ch:457
+#: comm-i18n.ch:304 comm-i18n.ch:310 comm-i18n.ch:324 comm-i18n.ch:330
+#: comm-i18n.ch:336 comm-i18n.ch:342 ctang-i18n.ch:79 ctang-i18n.ch:313
+#: ctang-i18n.ch:319 ctang-i18n.ch:325 ctang-i18n.ch:331 cweav-i18n.ch:461
msgid "! Cannot open output file "
msgstr "! Non posso aprire il file di output "
-#: cweav-i18n.ch:389
+#: cweav-i18n.ch:395
msgid "! Cannot open section file "
msgstr "! Non posso aprire il section file "
-#: comm-i18n.ch:46
+#: comm-i18n.ch:42
msgid "! Change file ended after @x"
msgstr "! Change file terminato dopo @x"
-#: comm-i18n.ch:54
+#: comm-i18n.ch:50
msgid "! Change file ended before @y"
msgstr "! Change file terminato prima di @y"
-#: comm-i18n.ch:126
+#: comm-i18n.ch:106
msgid "! Change file ended without @z"
msgstr "! Change file terminato senza un @z"
-#: comm-i18n.ch:140
+#: comm-i18n.ch:120
msgid "! Change file entry did not match"
msgstr "! C'è una voce nel change file che non corrisponde"
@@ -249,30 +251,29 @@
#: cweav-i18n.ch:81
msgid "! Control codes are forbidden in section name"
-msgstr ""
-"! I codici di controllo sono vietati all'interno dei nomi delle sezioni"
+msgstr "! I codici di controllo sono vietati all'interno dei nomi delle sezioni"
#: cweav-i18n.ch:89
msgid "! Control text didn't end"
msgstr "! Control text non terminato"
-#: ctang-i18n.ch:249
+#: ctang-i18n.ch:253
msgid "! Definition flushed, must start with identifier"
msgstr "! Definizione liberata (flushed), iniziare con un identificatore"
-#: ctang-i18n.ch:147
+#: ctang-i18n.ch:143
msgid "! Double @ should be used in ASCII constant"
msgstr "! I doppi @ dovrebbero essere usati nelle costanti ASCII"
-#: ctang-i18n.ch:139 ctang-i18n.ch:257
+#: ctang-i18n.ch:135 ctang-i18n.ch:261
msgid "! Double @ should be used in control text"
msgstr "! I doppi @ dovrebbero essere usati nel \"control text\""
-#: ctang-i18n.ch:263 cweav-i18n.ch:165
+#: ctang-i18n.ch:269 cweav-i18n.ch:167 cweav-twill.ch:364 cweav-twill.ch:367
msgid "! Double @ should be used in limbo"
msgstr "! I doppi @ dovrebbero essere usati nel limbo"
-#: ctang-i18n.ch:233
+#: ctang-i18n.ch:237
msgid "! Double @ should be used in string"
msgstr "! I doppi @ dovrebbero essere usati nelle stringhe"
@@ -284,11 +285,11 @@
msgid "! Extra } in comment"
msgstr "! Extra } nel commento"
-#: comm-i18n.ch:300
+#: comm-i18n.ch:296
msgid "! Filename too long\n"
msgstr "! Nome file troppo lungo\n"
-#: cweav-twill.ch:550
+#: cweav-twill.ch:1024
msgid "! Identifier in meaning should be followed by space"
msgstr "! Identifier in meaning should be followed by space"
@@ -296,51 +297,51 @@
msgid "! Illegal use of @ in comment"
msgstr "! Uso illegale di @ nel commento"
-#: cweav-i18n.ch:353
+#: cweav-i18n.ch:359
msgid "! Improper format definition"
msgstr "! Definizione di formato impropria"
-#: ctang-i18n.ch:271
+#: ctang-i18n.ch:277
msgid "! Improper hex number following @l"
msgstr "! Un numero decimale improprio segue @l"
-#: cweav-i18n.ch:339 cweav-i18n.ch:345
+#: cweav-i18n.ch:343 cweav-i18n.ch:351
msgid "! Improper macro definition"
msgstr "! Definizione di macro impropria"
-#: comm-i18n.ch:96
+#: comm-i18n.ch:78
msgid "! Include file name not given"
msgstr "! Nome del file include assente"
-#: comm-i18n.ch:110
+#: comm-i18n.ch:92
msgid "! Include file name too long"
msgstr "! Nome file include troppo lungo"
-#: comm-i18n.ch:320
+#: comm-i18n.ch:316
msgid "! Include path too long"
msgstr "! Path include troppo lungo"
-#: ctang-i18n.ch:99 cweav-i18n.ch:181
+#: ctang-i18n.ch:95 cweav-i18n.ch:181
msgid "! Input ended in mid-comment"
msgstr "! Input terminato nel commento intermedio"
-#: ctang-i18n.ch:119 cweav-i18n.ch:39
+#: ctang-i18n.ch:115 cweav-i18n.ch:39
msgid "! Input ended in middle of string"
msgstr "! Input terminato nel mezzo di una stringa"
-#: ctang-i18n.ch:161 cweav-i18n.ch:61
+#: ctang-i18n.ch:157 cweav-i18n.ch:61
msgid "! Input ended in section name"
msgstr "! Input terminato all'interno del nome di una sezione"
-#: comm-i18n.ch:30
+#: comm-i18n.ch:26
msgid "! Input line too long"
msgstr "! Linea in input troppo lunga"
-#: cweav-twill.ch:550
+#: cweav-twill.ch:1032
msgid "! Location in meaning should be followed by space"
msgstr "! Location in meaning should be followed by space"
-#: ctang-i18n.ch:211
+#: ctang-i18n.ch:215
msgid "! Misplaced @h"
msgstr "! Mal riposto @h"
@@ -348,11 +349,11 @@
msgid "! Missing '|' after C text"
msgstr "! Omesso `|' dopo il testo in C"
-#: comm-i18n.ch:38
+#: comm-i18n.ch:34
msgid "! Missing @x in change file"
msgstr "! Omesso @x nel change file"
-#: ctang-i18n.ch:225
+#: ctang-i18n.ch:229
msgid "! Missing `@ ' before a named section"
msgstr "! Omesso `@ ' prima di una sezione con nome"
@@ -368,27 +369,27 @@
msgid "! Missing } in comment"
msgstr "! Omesso } nel commento"
-#: ctang-i18n.ch:181
+#: ctang-i18n.ch:177
msgid "! Nesting of section names not allowed"
msgstr "! Nomi di sezioni l'uno dentro l'altro non consentiti"
-#: cweav-twill.ch:1029
+#: cweav-twill.ch:1239
msgid "! Only @$ is allowed in aux and bux files"
msgstr "! Only @$ is allowed in aux and bux files"
-#: ctang-i18n.ch:277
+#: ctang-i18n.ch:283
msgid "! Replacement string in @l too long"
msgstr "! Stringa sostitutiva in @l troppo lunga"
-#: ctang-i18n.ch:175 cweav-i18n.ch:75
+#: ctang-i18n.ch:171 cweav-i18n.ch:75
msgid "! Section name didn't end"
msgstr "! Nome sezione non terminato"
-#: ctang-i18n.ch:99
+#: ctang-i18n.ch:101
msgid "! Section name ended in mid-comment"
msgstr "! Nome sezione terminato all'interno del commento intermedio"
-#: ctang-i18n.ch:113 ctang-i18n.ch:153 cweav-i18n.ch:33
+#: ctang-i18n.ch:109 ctang-i18n.ch:149 cweav-i18n.ch:33
msgid "! String didn't end"
msgstr "! Stringa non terminata"
@@ -396,27 +397,27 @@
msgid "! TeX string should be in C text only"
msgstr "! Stringa TeX dovrebbe stare solo nel testo in C"
-#: comm-i18n.ch:262 comm-i18n.hch:33
+#: comm-i18n.hch:56
msgid "! This can't happen: "
msgstr "! Questo non può avvenire: "
-#: cweav-twill.ch:316
+#: cweav-twill.ch:1370
msgid "! Title name didn't end"
msgstr "! Nome titolo non terminato"
-#: cweav-twill.ch:314
+#: cweav-twill.ch:1368
msgid "! Title should be enclosed in braces or doublequotes"
msgstr "! Title should be enclosed in braces or doublequotes"
-#: comm-i18n.ch:102
+#: comm-i18n.ch:84
msgid "! Too many nested includes"
msgstr "! Troppi include annidati"
-#: ctang-i18n.ch:241
+#: ctang-i18n.ch:245
msgid "! Unrecognized escape sequence"
msgstr "! Sequenza di escape non riconosciuta"
-#: comm-i18n.ch:283
+#: comm-i18n.ch:276
msgid ""
"! Usage: ctangle [options] webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]\n"
msgstr ""
@@ -428,11 +429,11 @@
"s [-] mostra statistiche\n"
"t [+] compare temporary output for changes\n"
-#: comm-i18n.ch:287
+#: comm-i18n.ch:285
msgid ""
-"! Usage: cweave [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
+"! Usage: ctwill [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
msgstr ""
-"! Uso: cweave [Opzioni] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
+"! Uso: ctwill [Opzioni] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
"Opzioni (+ attiva, - disattiva, default indicato tra parentesi quadre):\n"
"b [+] stampa una riga di titoli\n"
"h [+] stampa un messaggio di \"buon fine\"\n"
@@ -442,15 +443,16 @@
"i [+] rientranza delle dichiarazioni\n"
"o [+] separa dichiarazioni e statement\n"
"x [+] include indici\n"
-"lX [] usa macro in lingua X contenute in Xcwebmac.tex\n"
+"P [-] include 'proofmac.tex' invece di 'ctwimac.tex'\n"
+"lX [] usa macro in lingua X contenute in X{ctwi|proof}mac.tex\n"
"s [-] mostra statistiche\n"
"t [+] compare temporary output for changes\n"
-#: comm-i18n.ch:290
+#: comm-i18n.ch:281
msgid ""
-"! Usage: ctwill [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
+"! Usage: cweave [options] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
msgstr ""
-"! Uso: ctwill [Opzioni] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
+"! Uso: cweave [Opzioni] webfile[.w] [{changefile[.ch]|-} [outfile[.tex]]]\n"
"Opzioni (+ attiva, - disattiva, default indicato tra parentesi quadre):\n"
"b [+] stampa una riga di titoli\n"
"h [+] stampa un messaggio di \"buon fine\"\n"
@@ -460,116 +462,124 @@
"i [+] rientranza delle dichiarazioni\n"
"o [+] separa dichiarazioni e statement\n"
"x [+] include indici\n"
-"P [-] include 'proofmac.tex' invece di 'ctwimac.tex'\n"
-"lX [] usa macro in lingua X contenute in X{ctwi|proof}mac.tex\n"
+"lX [] usa macro in lingua X contenute in Xcwebmac.tex\n"
"s [-] mostra statistiche\n"
"t [+] compare temporary output for changes\n"
-#: ctang-i18n.ch:131 cweav-i18n.ch:53 cweav-i18n.ch:119
+#: ctang-i18n.ch:129 cweav-i18n.ch:53 cweav-i18n.ch:119
msgid "! Use @l in limbo only"
msgstr "! Usare @l solo nel limbo"
-#: ctang-i18n.ch:189 cweav-i18n.ch:103
+#: ctang-i18n.ch:185 cweav-i18n.ch:103
msgid "! Verbatim string didn't end"
msgstr "! Stringa verbatim non terminata"
-#: comm-i18n.ch:68
+#: cweav-i18n.ch:330
+msgid "! Verbatim string should be in C text only"
+msgstr "! Stringa verbatim dovrebbe stare solo nel testo in C"
+
+#: comm-i18n.ch:64
msgid "! Where is the matching @y?"
msgstr "! Dov'è il corrispondente @y?"
-#: comm-i18n.ch:132
+#: comm-i18n.ch:112
msgid "! Where is the matching @z?"
msgstr "! Dov'è il corrispondente @z?"
-#: cweav-i18n.ch:369
+#: cweav-i18n.ch:375
msgid "! You can't do that in C text"
msgstr "! Non puoi fare quello nella parte in C"
-#: cweav-i18n.ch:331
+#: cweav-i18n.ch:335
msgid "! You can't do that in TeX text"
msgstr "! Non puoi fare quello nel testo in TeX"
-#: cweav-i18n.ch:361
+#: cweav-i18n.ch:367
msgid "! You need an = sign after the section name"
msgstr "! È necessario un segno di = dopo il nome della sezione"
-#: ctang-i18n.ch:297 cweav-i18n.ch:437
+#: ctang-i18n.ch:303 cweav-i18n.ch:442 cweav-twill.ch:754 cweav-twill.ch:757
#, c-format
-msgid "%ld bytes (out of %ld)\n"
-msgstr "%ld byte (fuori da %ld)\n"
+msgid "%td bytes (out of %ld)\n"
+msgstr "%td byte (fuori da %ld)\n"
-#: cweav-i18n.ch:435
+#: cweav-i18n.ch:440
#, c-format
-msgid "%ld cross-references (out of %ld)\n"
-msgstr "%ld riferimenti incrociati (fuori da %ld)\n"
+msgid "%td cross-references (out of %ld)\n"
+msgstr "%td riferimenti incrociati (fuori da %ld)\n"
-#: cweav-i18n.ch:446 cweav-i18n.ch:449
+#: cweav-i18n.ch:451 cweav-i18n.ch:454
#, c-format
-msgid "%ld levels (out of %ld)\n"
-msgstr "%ld livelli (fuori da %ld)\n"
+msgid "%td levels (out of %ld)\n"
+msgstr "%td livelli (fuori da %ld)\n"
-#: ctang-i18n.ch:293 cweav-i18n.ch:433
+#: ctang-i18n.ch:299 cweav-i18n.ch:438
#, c-format
-msgid "%ld names (out of %ld)\n"
-msgstr "%ld nomi (fuori da %ld)\n"
+msgid "%td names (out of %ld)\n"
+msgstr "%td nomi (fuori da %ld)\n"
-#: ctang-i18n.ch:295
+#: ctang-i18n.ch:301
#, c-format
-msgid "%ld replacement texts (out of %ld)\n"
-msgstr "%ld replacement text (fuori da %ld)\n"
+msgid "%td replacement texts (out of %ld)\n"
+msgstr "%td replacement text (fuori da %ld)\n"
-#: cweav-i18n.ch:440
+#: cweav-i18n.ch:445
#, c-format
-msgid "%ld scraps (out of %ld)\n"
-msgstr "%ld scrap (fuori da %ld)\n"
+msgid "%td scraps (out of %ld)\n"
+msgstr "%td scrap (fuori da %ld)\n"
-#: cweav-twill.ch:1346
+#: cweav-twill.ch:759
#, c-format
-msgid "%ld temp meanings (out of %ld)\n"
-msgstr "%ld temp meanings (fuori da %ld)\n"
+msgid "%td temp meanings (out of %ld)\n"
+msgstr "%td temp meanings (fuori da %ld)\n"
-#: cweav-i18n.ch:442
+#: cweav-i18n.ch:447
#, c-format
-msgid "%ld texts (out of %ld)\n"
-msgstr "%ld text (fuori da %ld)\n"
+msgid "%td texts (out of %ld)\n"
+msgstr "%td text (fuori da %ld)\n"
-#: ctang-i18n.ch:299 cweav-i18n.ch:444
+#: cweav-twill.ch:762
#, c-format
-msgid "%ld tokens (out of %ld)\n"
-msgstr "%ld token (fuori da %ld)\n"
+msgid "%td titles (out of %ld)\n"
+msgstr "%td byte (fuori da %ld)\n"
-#: comm-i18n.ch:242
+#: ctang-i18n.ch:305 cweav-i18n.ch:449
+#, c-format
+msgid "%td tokens (out of %ld)\n"
+msgstr "%td token (fuori da %ld)\n"
+
+#: comm-i18n.ch:240
msgid "(Did you see the warning message above?)"
msgstr "(Hai visto i messaggi di warning sopra?)"
-#: comm-i18n.ch:240
+#: comm-i18n.ch:238
msgid "(No errors were found.)"
msgstr "(Nessun errore trovato.)"
-#: comm-i18n.ch:244
+#: comm-i18n.ch:242
msgid "(Pardon me, but I think I spotted something wrong.)"
msgstr "(Scusa, ma credo che sia avvenuto qualcosa di errato.)"
-#: comm-i18n.ch:246
+#: comm-i18n.ch:244
msgid "(That was a fatal error, my friend.)"
msgstr "(Caro amico, si è verificato un errore importante.)"
-#: comm-i18n.ch:224
+#: comm-i18n.ch:219
#, c-format
msgid ". (l. %d of change file)\n"
msgstr ". (l. %d del change file)\n"
-#: comm-i18n.ch:226
+#: comm-i18n.ch:222
#, c-format
msgid ". (l. %d of include file %s)\n"
msgstr ". (l. %d del file include %s)\n"
-#: comm-i18n.ch:225
+#: comm-i18n.ch:221
#, c-format
msgid ". (l. %d)\n"
msgstr ". (l. %d)\n"
-#: comm-i18n.ch:188
+#: comm-i18n.ch:182
msgid ""
">\n"
" and <"
@@ -577,7 +587,7 @@
">\n"
" e <"
-#: comm-i18n.ch:214
+#: comm-i18n.ch:208
msgid ""
">,\n"
" which abbreviates <"
@@ -585,15 +595,15 @@
">,\n"
" che abbrevia <"
-#: ctang-i18n.ch:75 cweav-i18n.ch:395
+#: ctang-i18n.ch:71 cweav-i18n.ch:401
msgid "Done."
msgstr "Fatto."
-#: cweav-i18n.ch:439
+#: cweav-i18n.ch:444
msgid "Parsing:"
msgstr "Analisi:"
-#: cweav-i18n.ch:448
+#: cweav-i18n.ch:453
msgid "Sorting:"
msgstr "Ordinamento:"
@@ -601,19 +611,19 @@
msgid "This is CTANGLE (Version 4.12.1 [CWEBbin 2025])"
msgstr "Questo è CTANGLE (Versione 4.12.1 [CWEBbin 2025])"
-#: cweav-i18n.ch:17
+#: cweav-twill.ch:93
+msgid "This is CTWILL (Version 4.12.1 [CWEBbin 2025])"
+msgstr "Questo è CTWILL (Versione 4.12.1 [CWEBbin 2025])"
+
+#: cweav-i18n.ch:17 cweav-twill.ch:69
msgid "This is CWEAVE (Version 4.12.1 [CWEBbin 2025])"
msgstr "Questo è CWEAVE (Versione 4.12.1 [CWEBbin 2025])"
-#: cweav-twill.ch:68
-msgid "This is CTWILL (Version 4.12.1 [CWEBbin 2025])"
-msgstr "Questo è CTWILL (Versione 4.12.1 [CWEBbin 2025])"
-
#: cweav-i18n.ch:301 cweav-i18n.ch:309
msgid "buffer"
msgstr "buffer"
-#: comm-i18n.ch:149 comm-i18n.ch:159 comm-i18n.ch:174
+#: comm-i18n.ch:143 comm-i18n.ch:153 comm-i18n.ch:168
msgid "byte memory"
msgstr "byte di memoria"
@@ -621,23 +631,23 @@
msgid "cross-reference"
msgstr "referimento incrociato"
-#: cweav-twill.ch:822
+#: cweav-twill.ch:1161
msgid "find type"
msgstr "find type"
-#: cweav-twill.ch:761
+#: cweav-twill.ch:1096
msgid "inner"
msgstr "inner"
-#: ctang-i18n.ch:91
+#: ctang-i18n.ch:87
msgid "macro defs have strange char"
msgstr "definizione macro contiene uno strano carattere"
-#: comm-i18n.ch:150 comm-i18n.ch:160 comm-i18n.ch:168
+#: comm-i18n.ch:144 comm-i18n.ch:154 comm-i18n.ch:162
msgid "name"
msgstr "nome"
-#: comm-i18n.ch:74
+#: comm-i18n.ch:70
msgid "of the preceding lines failed to match"
msgstr "delle linee precedenti, corrispondenza non trovata"
@@ -653,7 +663,7 @@
msgid "section number"
msgstr "numero sezione"
-#: cweav-i18n.ch:403
+#: cweav-i18n.ch:409
msgid "sorting"
msgstr "ordinamento"
@@ -661,19 +671,19 @@
msgid "stack"
msgstr "stack"
-#: cweav-twill.ch:570
+#: cweav-twill.ch:1057
msgid "temp meanings"
msgstr "temp meanings"
-#: ctang-i18n.ch:203 cweav-i18n.ch:223
+#: ctang-i18n.ch:207 cweav-i18n.ch:223
msgid "text"
msgstr "text"
-#: cweav-twill.ch:317
+#: cweav-twill.ch:1371
msgid "titles"
msgstr "titles"
-#: ctang-i18n.ch:25 ctang-i18n.ch:197 cweav-i18n.ch:173 cweav-i18n.ch:217
+#: ctang-i18n.ch:25 ctang-i18n.ch:197 cweav-i18n.ch:175 cweav-i18n.ch:217
#: cweav-i18n.ch:231
msgid "token"
msgstr "token"
Modified: branches/stable/source/src/texk/web2c/cwebdir/po/web2c-help.pot
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/po/web2c-help.pot 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/po/web2c-help.pot 2025-05-17 22:44:20 UTC (rev 964)
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: CWEBbin 2025\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-01-01 15:08+0100\n"
+"POT-Creation-Date: 2025-04-30 10:05+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -55,11 +55,11 @@
msgstr ""
#: help.h:62 help.h:85 help.h:114
-msgid "+/-q shortcut for '-bhp'; also '--quiet' (default)"
+msgid "+/-q shortcut for '-bhp'; also '--quiet'"
msgstr ""
#: help.h:63 help.h:86 help.h:115
-msgid "+/-v shortcut for '+bhp'; also '--verbose'"
+msgid "+/-v shortcut for '+bhp'; also '--verbose' (default)"
msgstr ""
#: help.h:64 help.h:87 help.h:116
Modified: branches/stable/source/src/texk/web2c/cwebdir/tests/ham-sorted.tex
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/tests/ham-sorted.tex 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/tests/ham-sorted.tex 2025-05-17 22:44:20 UTC (rev 964)
@@ -12,7 +12,7 @@
and Tools\/ \bf15} (1994), 2--11.] The input graph should be in
Stanford GraphBase format, and should be named on the command line
as, for example, \.{foo.gb}. An optional second command-line parameter
-is a modulus \PB{\|m}, which causes every $m$th solution to be printed.
+is a modulus~$m$, which causes every $m$th solution to be printed.
We use a utility field to record the vertex degrees.
@@ -65,7 +65,6 @@
\]{GB\_\,GRAPH}9 \\{arcs} \&{Arc} ${}{*}{}$
\]{GB\_\,GRAPH}20 \&{Graph} =\&{struct}
\]{GB\_\,GRAPH}8 \|{I} \&{long}
-\]{GB\_\,GRAPH}20 \|{m} \&{long}
\]{GB\_\,GRAPH}20 \|{n} \&{long}
\]{GB\_\,GRAPH}9 \\{name} \&{char} ${}{*}{}$
\]{GB\_\,GRAPH}10 \\{next} \&{Arc} ${}{*}{}$
Modified: branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ch
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -10,6 +10,12 @@
Section 1.
+ at x l.11
+is a modulus |m|, which causes every $m$th solution to be printed.
+ at y
+is a modulus~$m$, which causes every $m$th solution to be printed.
+ at z
+
@x l.15
@d deg u.I
@y
@@ -23,7 +29,7 @@
@x l.21
main(int argc,char *argv[])
@y
-@#@;@q Fix a bug in CWEB/CTWILL 4.3 @>
+@#
int main(int argc,char *argv[])
@z
Modified: branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ref
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ref 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/tests/ham.ref 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-!3
+!2
+ \]{GB\_\,GRAPH}9 \|{u} \&{util}
+ \]{GB\_\,GRAPH}10 \\{tip} \&{Vertex} ${}{*}{}$
+ \]{GB\_\,GRAPH}10 \\{next} \&{Arc} ${}{*}{}$
@@ -12,13 +12,12 @@
+ \]{GB\_\,GRAPH}20 \&{Graph} =\&{struct}
+ \]{GB\_\,SAVE}4 \\{restore\_graph} \&{Graph} ${}{*}(\,){}$
+ \]{GB\_\,GRAPH}8 \|{I} \&{long}
-+ \]{GB\_\,GRAPH}20 \|{m} \&{long}
+ \]"<stdlib.h>" \\{exit} \zip
+ \]"<stdio.h>" \\{stderr} \zip
+ \]"<stdio.h>" \\{fprintf} \zip
+ \]"<stdio.h>" \\{sscanf} \zip
+ \]{GB\_\,GRAPH}9 \|{v} \&{util}
-!5
+!4
+ \[1 \|{x} \&{register} \&{Vertex} ${}{*}{}$
+ \[1 \|{a} \&{register} \&{Arc} ${}{*}{}$
+ \[1 \|{z} \&{Vertex} ${}{*}{}$
Modified: branches/stable/source/src/texk/web2c/cwebdir/tests/ham.sref
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/tests/ham.sref 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/tests/ham.sref 2025-05-17 22:44:20 UTC (rev 964)
@@ -4,7 +4,6 @@
\]"<stdio.h>" \\{fprintf} \zip
\]{GB\_\,GRAPH}20 \&{Graph} =\&{struct}
\]{GB\_\,GRAPH}8 \|{I} \&{long}
-\]{GB\_\,GRAPH}20 \|{m} \&{long}
\]{GB\_\,GRAPH}20 \|{n} \&{long}
\]{GB\_\,GRAPH}9 \\{name} \&{char} ${}{*}{}$
\]{GB\_\,GRAPH}10 \\{next} \&{Arc} ${}{*}{}$
@@ -17,7 +16,7 @@
\]{GB\_\,GRAPH}9 \|{v} \&{util}
\]{GB\_\,GRAPH}9 \&{Vertex} =\&{struct}
\]{GB\_\,GRAPH}20 \\{vertices} \&{Vertex} ${}{*}{}$
-\donewithpage3
+\donewithpage2
\[1 \|{a} \&{register} \&{Arc} ${}{*}{}$
\]{GB\_\,GRAPH}8 \|{A} \&{Arc} ${}{*}{}$
\[1 \\{aa} \&{register} \&{Arc} ${}{*}{}$
@@ -44,4 +43,4 @@
\]{GB\_\,GRAPH}9 \|{x} \&{util}
\[1 \|{y} \&{Vertex} ${}{*}{}$
\[1 \|{z} \&{Vertex} ${}{*}{}$
-\donewithpage5
+\donewithpage4
Modified: branches/stable/source/src/texk/web2c/cwebdir/tests/ham.tex
===================================================================
--- branches/stable/source/src/texk/web2c/cwebdir/tests/ham.tex 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/cwebdir/tests/ham.tex 2025-05-17 22:44:20 UTC (rev 964)
@@ -12,7 +12,7 @@
and Tools\/ \bf15} (1994), 2--11.] The input graph should be in
Stanford GraphBase format, and should be named on the command line
as, for example, \.{foo.gb}. An optional second command-line parameter
-is a modulus \PB{\|m}, which causes every $m$th solution to be printed.
+is a modulus~$m$, which causes every $m$th solution to be printed.
We use a utility field to record the vertex degrees.
@@ -74,7 +74,6 @@
\]{GB\_\,GRAPH}20 \&{Graph} =\&{struct}
\]{GB\_\,SAVE}4 \\{restore\_graph} \&{Graph} ${}{*}(\,){}$
\]{GB\_\,GRAPH}8 \|{I} \&{long}
-\]{GB\_\,GRAPH}20 \|{m} \&{long}
}\FI
\shortpage
Modified: branches/stable/source/src/texk/web2c/doc/luatex/luatex-math.tex
===================================================================
--- branches/stable/source/src/texk/web2c/doc/luatex/luatex-math.tex 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/doc/luatex/luatex-math.tex 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-% language=uk engine=luatex runpath=texruns:manuals/luatex
+% language=us engine=luatex runpath=texruns:manuals/luatex
\environment luatex-style
@@ -773,182 +773,209 @@
hacks that users came up with but when you set \lpr {matheqdirmode} to a positive
value direction will be taken into account.
-\subsection {Nolimit correction}
+% \subsection {Nolimit correction}
+%
+% \topicindex {math+limits}
+%
+% There are two extra math parameters \lpr {Umathnolimitsupfactor} and \lpr
+% {Umathnolimitsubfactor} that were added to provide some control over how limits
+% are spaced (for example the position of super and subscripts after integral
+% operators). They relate to an extra parameter \lpr {mathnolimitsmode}. The half
+% corrections are what happens when scripts are placed above and below. The
+% problem with italic corrections is that officially that correction italic is used
+% for above|/|below placement while advanced kerns are used for placement at the
+% right end. The question is: how often is this implemented, and if so, do the
+% kerns assume correction too. Anyway, with this parameter one can control it.
-\topicindex {math+limits}
+% \starttabulate[|l|ck1|ck1|ck1|ck1|ck1|ck1|]
+% \NC % probably not ok, we need a raw int here
+% \NC \mathnolimitsmode0 $\displaystyle\mathop{\normalint}\nolimits^0_1$
+% \NC \mathnolimitsmode1 $\displaystyle\mathop{\normalint}\nolimits^0_1$
+% \NC \mathnolimitsmode2 $\displaystyle\mathop{\normalint}\nolimits^0_1$
+% \NC \mathnolimitsmode3 $\displaystyle\mathop{\normalint}\nolimits^0_1$
+% \NC \mathnolimitsmode4 $\displaystyle\mathop{\normalint}\nolimits^0_1$
+% \NC \mathnolimitsmode8000 $\displaystyle\mathop{\normalint}\nolimits^0_1$
+% \NC \NR
+% \TB
+% \BC mode
+% \NC \tttf 0
+% \NC \tttf 1
+% \NC \tttf 2
+% \NC \tttf 3
+% \NC \tttf 4
+% \NC \tttf 8000
+% \NC \NR
+% \BC superscript
+% \NC 0
+% \NC font
+% \NC 0
+% \NC 0
+% \NC +ic/2
+% \NC 0
+% \NC \NR
+% \BC subscript
+% \NC -ic
+% \NC font
+% \NC 0
+% \NC -ic/2
+% \NC -ic/2
+% \NC 8000ic/1000
+% \NC \NR
+% \stoptabulate
+%
+% When the mode is set to one, the math parameters are used. This way a macro
+% package writer can decide what looks best. Given the current state of fonts in
+% \CONTEXT\ we currently use mode 1 with factor 0 for the superscript and 750 for
+% the subscripts. Positive values are used for both parameters but the subscript
+% shifts to the left. A \lpr {mathnolimitsmode} larger that 15 is considered to
+% be a factor for the subscript correction. This feature can be handy when
+% experimenting.
-There are two extra math parameters \lpr {Umathnolimitsupfactor} and \lpr
-{Umathnolimitsubfactor} that were added to provide some control over how limits
-are spaced (for example the position of super and subscripts after integral
-operators). They relate to an extra parameter \lpr {mathnolimitsmode}. The half
-corrections are what happens when scripts are placed above and below. The
-problem with italic corrections is that officially that correction italic is used
-for above|/|below placement while advanced kerns are used for placement at the
-right end. The question is: how often is this implemented, and if so, do the
-kerns assume correction too. Anyway, with this parameter one can control it.
+% \subsection {Math italic mess}
+%
+% \topicindex {math+italics}
+%
+% The \lpr {mathitalicsmode} parameter was introduced to deal with the difference
+% in applying italic correction in traditional and \OPENTYPE\ math fonts. There are
+% \OPENTYPE\ fonts out there that have italic correction and assume them to be
+% applied like traditional \TEX\ fonts. This parameter takes several values:
+%
+% When set to zero, you get what was decided when the two code paths (traditional
+% and \OPENTYPE) were introduced.
+%
+% Values larger than zero will add the italic correction between simple noads (it
+% checks some classes so you might pay attention to for instance punctuation
+% classes assigned).
+%
+% When set to zero or one, italics are independent, so we separate width from
+% italic, while values larger than one combine both in the width but later
+% selectively has to get rid of it (depending on code path).
+%
+% A value larger than two will backtrack italics for large operators, because there
+% italic correction is used for anchoring scripts (limits and no limits). In fact,
+% \OPENTYPE\ uses italics either between characters or for this purpose but as
+% mentioned fonts are sort of messy here.
+%
+% We tested our version of plain \TEX\ and recommend to use the value of three to
+% get the best average results. More about this italic correction dilemma in
+% rendering math can be found in articles (in for instance \TUGBOAT) and various
+% documents in the \CONTEXT\ distribution, especially those that discuss the
+% upgraded math engine in \LUAMETATEX.
+%
+% % The \lpr {mathitalicsmode} parameter can be set to~1 to force italic correction
+% % before noads that represent some more complex structure (read: everything that is
+% % not an ord, bin, rel, open, close, punct or inner). A value of~2 will enforce the
+% % old school font code path for all italics. We show a Cambria example.
+% %
+% % \starttexdefinition Whatever #1
+% % \NC \type{\mathitalicsmode = #1}
+% % \NC \mathitalicsmode#1\ruledhbox{$\left|T^1\right|$}
+% % \NC \mathitalicsmode#1\ruledhbox{$\left|T\right|$}
+% % \NC \mathitalicsmode#1\ruledhbox{$T+1$}
+% % \NC \mathitalicsmode#1\ruledhbox{$T{1\over2}$}
+% % \NC \mathitalicsmode#1\ruledhbox{$T\sqrt{1}$}
+% % \NC \NR
+% % \stoptexdefinition
+% %
+% % \start
+% % \switchtobodyfont[cambria]
+% % \starttabulate[|c|c|c|c|c|c|]
+% % \Whatever{0}%
+% % \Whatever{1}%
+% % \stoptabulate
+% % \stop
+% %
+% % This kind of parameters relate to the fact that italic correction in \OPENTYPE\
+% % math is bound to fuzzy rules. So, control is the solution.
-\starttabulate[|l|ck1|ck1|ck1|ck1|ck1|ck1|]
- \NC % probably not ok, we need a raw int here
- \NC \mathnolimitsmode0 $\displaystyle\mathop{\normalint}\nolimits^0_1$
- \NC \mathnolimitsmode1 $\displaystyle\mathop{\normalint}\nolimits^0_1$
- \NC \mathnolimitsmode2 $\displaystyle\mathop{\normalint}\nolimits^0_1$
- \NC \mathnolimitsmode3 $\displaystyle\mathop{\normalint}\nolimits^0_1$
- \NC \mathnolimitsmode4 $\displaystyle\mathop{\normalint}\nolimits^0_1$
- \NC \mathnolimitsmode8000 $\displaystyle\mathop{\normalint}\nolimits^0_1$
- \NC \NR
- \TB
- \BC mode
- \NC \tttf 0
- \NC \tttf 1
- \NC \tttf 2
- \NC \tttf 3
- \NC \tttf 4
- \NC \tttf 8000
- \NC \NR
- \BC superscript
- \NC 0
- \NC font
- \NC 0
- \NC 0
- \NC +ic/2
- \NC 0
- \NC \NR
- \BC subscript
- \NC -ic
- \NC font
- \NC 0
- \NC -ic/2
- \NC -ic/2
- \NC 8000ic/1000
- \NC \NR
-\stoptabulate
+% \subsection {Script and kerning}
+%
+% \topicindex {math+kerning}
+% \topicindex {math+scripts}
+%
+% If you want to typeset text in math macro packages often provide something \type
+% {\text} which obeys the script sizes. As the definition can be anything there is
+% a good chance that the kerning doesn't come out well when used in a script. Given
+% that the first glyph ends up in a \prm {hbox} we have some control over this.
+% And, as a bonus we also added control over the normal sublist kerning. The \lpr
+% {mathscriptboxmode} parameter defaults to~1.
+%
+% \starttabulate[|c|l|]
+% \DB value \BC meaning \NC \NR
+% \TB
+% \NC \type {0} \NC forget about kerning \NC \NR
+% \NC \type {1} \NC kern math sub lists with a valid glyph \NC \NR
+% \NC \type {2} \NC also kern math sub boxes that have a valid glyph \NC \NR
+% \NC \type {2} \NC only kern math sub boxes with a boundary node present\NC \NR
+% \LL
+% \stoptabulate
+%
+% Here we show some examples. Of course this doesn't solve all our problems, if
+% only because some fonts have characters with bounding boxes that compensate for
+% italics, while other fonts can lack kerns.
+%
+% \startbuffer[1]
+% $T_{\tf fluff}$
+% \stopbuffer
+%
+% \startbuffer[2]
+% $T_{\text{fluff}}$
+% \stopbuffer
+%
+% \startbuffer[3]
+% $T_{\text{\boundary1 fluff}}$
+% \stopbuffer
+%
+% \unexpanded\def\Show#1#2#3%
+% {\doifelsenothing{#3}
+% {\small\tx\typeinlinebuffer[#1]}
+% {\doifelse{#3}{-}
+% {\small\bf\tt mode #2}
+% {\switchtobodyfont[#3]\showfontkerns\showglyphs\mathscriptboxmode#2\relax\inlinebuffer[#1]}}}
+%
+% \starttabulate[|lBT|c|c|c|c|c|]
+% \NC \NC \Show{1}{0}{} \NC\Show{1}{1}{} \NC \Show{2}{1}{} \NC \Show{2}{2}{} \NC \Show{3}{3}{} \NC \NR
+% \NC \NC \Show{1}{0}{-} \NC\Show{1}{1}{-} \NC \Show{2}{1}{-} \NC \Show{2}{2}{-} \NC \Show{3}{3}{-} \NC \NR
+% \NC modern \NC \Show{1}{0}{modern} \NC\Show{1}{1}{modern} \NC \Show{2}{1}{modern} \NC \Show{2}{2}{modern} \NC \Show{3}{3}{modern} \NC \NR
+% \NC lucidaot \NC \Show{1}{0}{lucidaot} \NC\Show{1}{1}{lucidaot} \NC \Show{2}{1}{lucidaot} \NC \Show{2}{2}{lucidaot} \NC \Show{3}{3}{lucidaot} \NC \NR
+% \NC pagella \NC \Show{1}{0}{pagella} \NC\Show{1}{1}{pagella} \NC \Show{2}{1}{pagella} \NC \Show{2}{2}{pagella} \NC \Show{3}{3}{pagella} \NC \NR
+% \NC cambria \NC \Show{1}{0}{cambria} \NC\Show{1}{1}{cambria} \NC \Show{2}{1}{cambria} \NC \Show{2}{2}{cambria} \NC \Show{3}{3}{cambria} \NC \NR
+% \NC dejavu \NC \Show{1}{0}{dejavu} \NC\Show{1}{1}{dejavu} \NC \Show{2}{1}{dejavu} \NC \Show{2}{2}{dejavu} \NC \Show{3}{3}{dejavu} \NC \NR
+% \stoptabulate
+%
+% % Kerning between a character subscript is controlled by \lpr {mathscriptcharmode}
+% % which also defaults to~1.
+%
+% Here is another example. Internally we tag kerns as italic kerns or font kerns
+% where font kerns result from the staircase kern tables. In 2018 fonts like Latin
+% Modern and Pagella rely on cheats with the boundingbox, Cambria uses staircase
+% kerns and Lucida a mixture. Depending on how fonts evolve we might add some more
+% control over what one can turn on and off.
+%
+% \def\MathSample#1#2#3%
+% {\NC
+% #1 \NC
+% #2 \NC
+% \showglyphdata \switchtobodyfont[#2,17.3pt]$#3T_{f}$ \NC
+% \showglyphdata \switchtobodyfont[#2,17.3pt]$#3\gamma_{e}$ \NC
+% \showglyphdata \switchtobodyfont[#2,17.3pt]$#3\gamma_{ee}$ \NC
+% \showglyphdata \switchtobodyfont[#2,17.3pt]$#3T_{\tf fluff}$ \NC
+% \NR}
+%
+% \starttabulate[|Tl|Tl|l|l|l|l|]
+% \FL
+% \MathSample{normal}{modern} {\mr}
+% \MathSample{} {pagella} {\mr}
+% \MathSample{} {cambria} {\mr}
+% \MathSample{} {lucidaot}{\mr}
+% \ML
+% \MathSample{bold} {modern} {\mb}
+% \MathSample{} {pagella} {\mb}
+% \MathSample{} {cambria} {\mb}
+% \MathSample{} {lucidaot}{\mb}
+% \LL
+% \stoptabulate
-When the mode is set to one, the math parameters are used. This way a macro
-package writer can decide what looks best. Given the current state of fonts in
-\CONTEXT\ we currently use mode 1 with factor 0 for the superscript and 750 for
-the subscripts. Positive values are used for both parameters but the subscript
-shifts to the left. A \lpr {mathnolimitsmode} larger that 15 is considered to
-be a factor for the subscript correction. This feature can be handy when
-experimenting.
-
-\subsection {Math italic mess}
-
-\topicindex {math+italics}
-
-The \lpr {mathitalicsmode} parameter can be set to~1 to force italic correction
-before noads that represent some more complex structure (read: everything that is
-not an ord, bin, rel, open, close, punct or inner). A value of~2 will enforce the
-old school font code path for all italics. We show a Cambria example.
-
-\starttexdefinition Whatever #1
- \NC \type{\mathitalicsmode = #1}
- \NC \mathitalicsmode#1\ruledhbox{$\left|T^1\right|$}
- \NC \mathitalicsmode#1\ruledhbox{$\left|T\right|$}
- \NC \mathitalicsmode#1\ruledhbox{$T+1$}
- \NC \mathitalicsmode#1\ruledhbox{$T{1\over2}$}
- \NC \mathitalicsmode#1\ruledhbox{$T\sqrt{1}$}
- \NC \NR
-\stoptexdefinition
-
-\start
- \switchtobodyfont[cambria]
- \starttabulate[|c|c|c|c|c|c|]
- \Whatever{0}%
- \Whatever{1}%
- \stoptabulate
-\stop
-
-This kind of parameters relate to the fact that italic correction in \OPENTYPE\
-math is bound to fuzzy rules. So, control is the solution.
-
-\subsection {Script and kerning}
-
-\topicindex {math+kerning}
-\topicindex {math+scripts}
-
-If you want to typeset text in math macro packages often provide something \type
-{\text} which obeys the script sizes. As the definition can be anything there is
-a good chance that the kerning doesn't come out well when used in a script. Given
-that the first glyph ends up in a \prm {hbox} we have some control over this.
-And, as a bonus we also added control over the normal sublist kerning. The \lpr
-{mathscriptboxmode} parameter defaults to~1.
-
-\starttabulate[|c|l|]
-\DB value \BC meaning \NC \NR
-\TB
-\NC \type {0} \NC forget about kerning \NC \NR
-\NC \type {1} \NC kern math sub lists with a valid glyph \NC \NR
-\NC \type {2} \NC also kern math sub boxes that have a valid glyph \NC \NR
-\NC \type {2} \NC only kern math sub boxes with a boundary node present\NC \NR
-\LL
-\stoptabulate
-
-Here we show some examples. Of course this doesn't solve all our problems, if
-only because some fonts have characters with bounding boxes that compensate for
-italics, while other fonts can lack kerns.
-
-\startbuffer[1]
- $T_{\tf fluff}$
-\stopbuffer
-
-\startbuffer[2]
- $T_{\text{fluff}}$
-\stopbuffer
-
-\startbuffer[3]
- $T_{\text{\boundary1 fluff}}$
-\stopbuffer
-
-\unexpanded\def\Show#1#2#3%
- {\doifelsenothing{#3}
- {\small\tx\typeinlinebuffer[#1]}
- {\doifelse{#3}{-}
- {\small\bf\tt mode #2}
- {\switchtobodyfont[#3]\showfontkerns\showglyphs\mathscriptboxmode#2\relax\inlinebuffer[#1]}}}
-
-\starttabulate[|lBT|c|c|c|c|c|]
- \NC \NC \Show{1}{0}{} \NC\Show{1}{1}{} \NC \Show{2}{1}{} \NC \Show{2}{2}{} \NC \Show{3}{3}{} \NC \NR
- \NC \NC \Show{1}{0}{-} \NC\Show{1}{1}{-} \NC \Show{2}{1}{-} \NC \Show{2}{2}{-} \NC \Show{3}{3}{-} \NC \NR
- \NC modern \NC \Show{1}{0}{modern} \NC\Show{1}{1}{modern} \NC \Show{2}{1}{modern} \NC \Show{2}{2}{modern} \NC \Show{3}{3}{modern} \NC \NR
- \NC lucidaot \NC \Show{1}{0}{lucidaot} \NC\Show{1}{1}{lucidaot} \NC \Show{2}{1}{lucidaot} \NC \Show{2}{2}{lucidaot} \NC \Show{3}{3}{lucidaot} \NC \NR
- \NC pagella \NC \Show{1}{0}{pagella} \NC\Show{1}{1}{pagella} \NC \Show{2}{1}{pagella} \NC \Show{2}{2}{pagella} \NC \Show{3}{3}{pagella} \NC \NR
- \NC cambria \NC \Show{1}{0}{cambria} \NC\Show{1}{1}{cambria} \NC \Show{2}{1}{cambria} \NC \Show{2}{2}{cambria} \NC \Show{3}{3}{cambria} \NC \NR
- \NC dejavu \NC \Show{1}{0}{dejavu} \NC\Show{1}{1}{dejavu} \NC \Show{2}{1}{dejavu} \NC \Show{2}{2}{dejavu} \NC \Show{3}{3}{dejavu} \NC \NR
-\stoptabulate
-
-Kerning between a character subscript is controlled by \lpr {mathscriptcharmode}
-which also defaults to~1.
-
-Here is another example. Internally we tag kerns as italic kerns or font kerns
-where font kerns result from the staircase kern tables. In 2018 fonts like Latin
-Modern and Pagella rely on cheats with the boundingbox, Cambria uses staircase
-kerns and Lucida a mixture. Depending on how fonts evolve we might add some more
-control over what one can turn on and off.
-
-\def\MathSample#1#2#3%
- {\NC
- #1 \NC
- #2 \NC
- \showglyphdata \switchtobodyfont[#2,17.3pt]$#3T_{f}$ \NC
- \showglyphdata \switchtobodyfont[#2,17.3pt]$#3\gamma_{e}$ \NC
- \showglyphdata \switchtobodyfont[#2,17.3pt]$#3\gamma_{ee}$ \NC
- \showglyphdata \switchtobodyfont[#2,17.3pt]$#3T_{\tf fluff}$ \NC
- \NR}
-
-\starttabulate[|Tl|Tl|l|l|l|l|]
- \FL
- \MathSample{normal}{modern} {\mr}
- \MathSample{} {pagella} {\mr}
- \MathSample{} {cambria} {\mr}
- \MathSample{} {lucidaot}{\mr}
- \ML
- \MathSample{bold} {modern} {\mb}
- \MathSample{} {pagella} {\mb}
- \MathSample{} {cambria} {\mb}
- \MathSample{} {lucidaot}{\mb}
- \LL
-\stoptabulate
-
\subsection{Fixed scripts}
We have three parameters that are used for this fixed anchoring:
@@ -1028,52 +1055,52 @@
\startsection[title={Math constructs}]
-\subsection {Unscaled fences}
+% \subsection {Unscaled fences}
+%
+% \topicindex {math+fences}
+%
+% The \lpr {mathdelimitersmode} primitive is experimental and deals with the
+% following (potential) problems. Three bits can be set. The first bit prevents an
+% unwanted shift when the fence symbol is not scaled (a cambria side effect). The
+% second bit forces italic correction between a preceding character ordinal and the
+% fenced subformula, while the third bit turns that subformula into an ordinary so
+% that the same spacing applies as with unfenced variants. Here we show Cambria
+% (with \lpr {mathitalicsmode} enabled).
+%
+% \starttexdefinition Whatever #1
+% \NC \type{\mathdelimitersmode = #1}
+% \NC \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics$f(x)$}
+% \NC \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics$f\left(x\right)$}
+% \NC \NR
+% \stoptexdefinition
+%
+% \start
+% \switchtobodyfont[cambria]
+% \starttabulate[|l|l|l|]
+% \Whatever{0}\Whatever{1}\Whatever{2}\Whatever{3}%
+% \Whatever{4}\Whatever{5}\Whatever{6}\Whatever{7}%
+% \stoptabulate
+% \stop
+%
+% So, when set to 7 fenced subformulas with unscaled delimiters come out the same
+% as unfenced ones. This can be handy for cases where one is forced to use \prm
+% {left} and \prm {right} always because of unpredictable content. As said, it's an
+% experimental feature (which somehow fits in the exceptional way fences are dealt
+% with in the engine). The full list of flags is given in the next table:
+%
+% \starttabulate[|c|l|]
+% \DB value \BC meaning \NC \NR
+% \TB
+% \NC \type{"01} \NC don't apply the usual shift \NC \NR
+% \NC \type{"02} \NC apply italic correction when possible \NC \NR
+% \NC \type{"04} \NC force an ordinary subformula \NC \NR
+% \NC \type{"08} \NC no shift when a base character \NC \NR
+% \NC \type{"10} \NC only shift when an extensible \NC \NR
+% \LL
+% \stoptabulate
+%
+% The effect can depend on the font (and for Cambria one can use for instance \type {"16}).
-\topicindex {math+fences}
-
-The \lpr {mathdelimitersmode} primitive is experimental and deals with the
-following (potential) problems. Three bits can be set. The first bit prevents an
-unwanted shift when the fence symbol is not scaled (a cambria side effect). The
-second bit forces italic correction between a preceding character ordinal and the
-fenced subformula, while the third bit turns that subformula into an ordinary so
-that the same spacing applies as with unfenced variants. Here we show Cambria
-(with \lpr {mathitalicsmode} enabled).
-
-\starttexdefinition Whatever #1
- \NC \type{\mathdelimitersmode = #1}
- \NC \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics$f(x)$}
- \NC \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics$f\left(x\right)$}
- \NC \NR
-\stoptexdefinition
-
-\start
- \switchtobodyfont[cambria]
- \starttabulate[|l|l|l|]
- \Whatever{0}\Whatever{1}\Whatever{2}\Whatever{3}%
- \Whatever{4}\Whatever{5}\Whatever{6}\Whatever{7}%
- \stoptabulate
-\stop
-
-So, when set to 7 fenced subformulas with unscaled delimiters come out the same
-as unfenced ones. This can be handy for cases where one is forced to use \prm
-{left} and \prm {right} always because of unpredictable content. As said, it's an
-experimental feature (which somehow fits in the exceptional way fences are dealt
-with in the engine). The full list of flags is given in the next table:
-
-\starttabulate[|c|l|]
-\DB value \BC meaning \NC \NR
-\TB
-\NC \type{"01} \NC don't apply the usual shift \NC \NR
-\NC \type{"02} \NC apply italic correction when possible \NC \NR
-\NC \type{"04} \NC force an ordinary subformula \NC \NR
-\NC \type{"08} \NC no shift when a base character \NC \NR
-\NC \type{"10} \NC only shift when an extensible \NC \NR
-\LL
-\stoptabulate
-
-The effect can depend on the font (and for Cambria one can use for instance \type {"16}).
-
\subsection[mathacc]{Accent handling}
\topicindex {math+accents}
@@ -1543,49 +1570,60 @@
\startsection[title={Goodies}]
-\subsection {Flattening: \lpr {mathflattenmode}}
+\subsection {Obsolete}
-\topicindex {math+flattening}
+Per TL 2026 the following primitives are \quote {ignored}. They were not used in
+two decades unless by \CONTEXT\ for exploring variants but we can do that
+differently now. Obsolete commands that trigger a warning: \typ {\mathoption},
+\typ {\mathitalicssmode}, \typ {\mathnolimitsmode}, \typ {\mathscriptboxmode},
+\typ {\mathscriptcharmode}, \typ {\mathflattenmode}, \typ {\mathdefaultsmode},
+\typ {\mathrulethicknessmode}, \typ {\mathdelimitersmode}. Also no longer used
+are the parameters \typ {\Umathnolimitsupfactor} and \typ
+{\Umathnolimitsubfactor}.
-The \TEX\ math engine collapses \type {ord} noads without sub- and superscripts
-and a character as nucleus. and which has the side effect that in \OPENTYPE\ mode
-italic corrections are applied (given that they are enabled).
+% \subsection {Flattening: \lpr {mathflattenmode}}
+%
+% \topicindex {math+flattening}
+%
+% The \TEX\ math engine collapses \type {ord} noads without sub- and superscripts
+% and a character as nucleus. and which has the side effect that in \OPENTYPE\ mode
+% italic corrections are applied (given that they are enabled).
+%
+% \startbuffer[sample]
+% \switchtobodyfont[modern]
+% $V \mathbin{\mathbin{v}} V$\par
+% $V \mathord{\mathord{v}} V$\par
+% \stopbuffer
+%
+% \typebuffer[sample]
+%
+% This renders as:
+%
+% \blank \start \mathflattenmode\plusone \getbuffer[sample] \stop \blank
+%
+% When we set \lpr {mathflattenmode} to 31 we get:
+%
+% \blank \start \mathflattenmode\numexpr1+2+4+8+16\relax \getbuffer[sample] \stop \blank
+%
+% When you see no difference, then the font probably has the proper character
+% dimensions and no italic correction is needed. For Latin Modern (at least till
+% 2018) there was a visual difference. In that respect this parameter is not always
+% needed unless of course you want efficient math lists anyway.
+%
+% You can influence flattening by adding the appropriate number to the value of the
+% mode parameter. The default value is~1.
+%
+% \starttabulate[|Tc|c|]
+% \DB mode \BC class \NC \NR
+% \TB
+% \NC 1 \NC ord \NC \NR
+% \NC 2 \NC bin \NC \NR
+% \NC 4 \NC rel \NC \NR
+% \NC 8 \NC punct \NC \NR
+% \NC 16 \NC inner \NC \NR
+% \LL
+% \stoptabulate
-\startbuffer[sample]
-\switchtobodyfont[modern]
-$V \mathbin{\mathbin{v}} V$\par
-$V \mathord{\mathord{v}} V$\par
-\stopbuffer
-
-\typebuffer[sample]
-
-This renders as:
-
-\blank \start \mathflattenmode\plusone \getbuffer[sample] \stop \blank
-
-When we set \lpr {mathflattenmode} to 31 we get:
-
-\blank \start \mathflattenmode\numexpr1+2+4+8+16\relax \getbuffer[sample] \stop \blank
-
-When you see no difference, then the font probably has the proper character
-dimensions and no italic correction is needed. For Latin Modern (at least till
-2018) there was a visual difference. In that respect this parameter is not always
-needed unless of course you want efficient math lists anyway.
-
-You can influence flattening by adding the appropriate number to the value of the
-mode parameter. The default value is~1.
-
-\starttabulate[|Tc|c|]
-\DB mode \BC class \NC \NR
-\TB
-\NC 1 \NC ord \NC \NR
-\NC 2 \NC bin \NC \NR
-\NC 4 \NC rel \NC \NR
-\NC 8 \NC punct \NC \NR
-\NC 16 \NC inner \NC \NR
-\LL
-\stoptabulate
-
\subsection {Less Tracing}
\topicindex {math+tracing}
@@ -1594,63 +1632,68 @@
to limit tracing. Only when \type {tracingassigns} and|/|or \type
{tracingrestores} are set to~2 or more they will be traced.
-\subsection {Math options with \lpr {mathdefaultsmode}}
+% \subsection {Math options with \lpr {mathdefaultsmode}}
+%
+% This option has been introduced because \LATEX\ developers wanted some of the
+% defaults to be different from the ones that were set in stone when we froze
+% \LUATEX. The default values are:
+%
+% \starttabulate[|l|c|c|]
+% \DB \BC scanning \BC rendering \NC \NR
+% \TB
+% \NC radical/root \NC cramped \NC cramped \NC \NR
+% \NC under delimiter \NC cramped \NC supstyle \NC \NR
+% \NC over delimiter \NC cramped \NC substyle \NC \NR
+% \NC delimiter under \NC cramped \NC current \NC \NR
+% \NC delimiter over \NC cramped \NC current \NC \NR
+% \LL
+% \stoptabulate
+%
+% When \type {\mathdefaultsmode} is larger than zero, we have:
+%
+% \starttabulate[|l|c|c|]
+% \DB \BC scanning \BC rendering \NC \NR
+% \TB
+% \NC radical/root \NC cramped \NC cramped \NC \NR
+% \NC under delimiter \NC substyle \NC substyle \NC \NR
+% \NC over delimiter \NC supstyle \NC supstyle \NC \NR
+% \NC delimiter under \NC current \NC current \NC \NR
+% \NC delimiter over \NC cramped \NC cramped \NC \NR
+% \LL
+% \stoptabulate
+%
+% It is outside the scope of this manual to discuss the rationale behind these
+% defaults. The zero values date back from the early times. If needed you can
+% explicitly set the style in the content argument.
-This option has been introduced because \LATEX\ developers wanted some of the
-defaults to be different from the ones that were set in stone when we froze
-\LUATEX. The default values are:
+% \subsection {Math options with \lpr {mathoption}}
+%
+% This command is now obsolete and triggers an error message. It was only meant
+% for experiments.
-\starttabulate[|l|c|c|]
-\DB \BC scanning \BC rendering \NC \NR
-\TB
-\NC radical/root \NC cramped \NC cramped \NC \NR
-\NC under delimiter \NC cramped \NC supstyle \NC \NR
-\NC over delimiter \NC cramped \NC substyle \NC \NR
-\NC delimiter under \NC cramped \NC current \NC \NR
-\NC delimiter over \NC cramped \NC current \NC \NR
-\LL
-\stoptabulate
+% % even more obsolete:
-When \type {\mathdefaultsmode} is larger than zero, we have:
+% The logic in the math engine is rather complex and there are often no universal
+% solutions (read: what works out well for one font, fails for another). Therefore
+% some variations in the implementation are driven by parameters (modes). In
+% addition there is a new primitive \lpr {mathoption} which will be used for
+% testing. Don't rely on any option to be there in a production version as they are
+% meant for development.
+%
+% This option was introduced for testing purposes when the math engine got split
+% code paths and it forces the engine to treat new fonts as old ones with respect
+% to italic correction etc. There are no guarantees given with respect to the final
+% result and unexpected side effects are not seen as bugs as they relate to font
+% properties. There is currently only one option:
+%
+% \startbuffer
+% \mathoption old 1
+% \stopbuffer
+%
+% The \type {oldmath} boolean flag in the \LUA\ font table is the official way to
+% force old treatment as it's bound to fonts. Like with all options we may
+% temporarily introduce with this command this feature is not meant for production.
-\starttabulate[|l|c|c|]
-\DB \BC scanning \BC rendering \NC \NR
-\TB
-\NC radical/root \NC cramped \NC cramped \NC \NR
-\NC under delimiter \NC substyle \NC substyle \NC \NR
-\NC over delimiter \NC supstyle \NC supstyle \NC \NR
-\NC delimiter under \NC current \NC current \NC \NR
-\NC delimiter over \NC cramped \NC cramped \NC \NR
-\LL
-\stoptabulate
-
-It is outside the scope of this manual to discuss the rationale behind these
-defaults. The zero values date back from the early times. If needed you can
-explicitly set the style in the content argument.
-
-\subsection {Math options with \lpr {mathoption}}
-
-The logic in the math engine is rather complex and there are often no universal
-solutions (read: what works out well for one font, fails for another). Therefore
-some variations in the implementation are driven by parameters (modes). In
-addition there is a new primitive \lpr {mathoption} which will be used for
-testing. Don't rely on any option to be there in a production version as they are
-meant for development.
-
-This option was introduced for testing purposes when the math engine got split
-code paths and it forces the engine to treat new fonts as old ones with respect
-to italic correction etc. There are no guarantees given with respect to the final
-result and unexpected side effects are not seen as bugs as they relate to font
-properties. There is currently only one option:
-
-\startbuffer
-\mathoption old 1
-\stopbuffer
-
-The \type {oldmath} boolean flag in the \LUA\ font table is the official way to
-force old treatment as it's bound to fonts. Like with all options we may
-temporarily introduce with this command this feature is not meant for production.
-
% % obsolete:
%
% \subsubsection {\type {\mathoption noitaliccompensation}}
Modified: branches/stable/source/src/texk/web2c/doc/luatex/luatex.pdf
===================================================================
(Binary files differ)
Modified: branches/stable/source/src/texk/web2c/etexdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/etexdir/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/etexdir/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,7 @@
+2025-03-07 Karl Berry <karl at tug.org>
+
+ * TL'25 release.
+
2025-01-27 Karl Berry <karl at freefriends.org>
* am/etex.am (etex-pool.c): exit 1 if makecpool failed.
Modified: branches/stable/source/src/texk/web2c/help.h
===================================================================
--- branches/stable/source/src/texk/web2c/help.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/help.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -59,8 +59,8 @@
"+b print banner line on terminal",
"+h print success message on completion",
"+p print progress report messages",
- "+/-q shortcut for '-bhp'; also '--quiet' (default)",
- "+/-v shortcut for '+bhp'; also '--verbose'",
+ "+/-q shortcut for '-bhp'; also '--quiet'",
+ "+/-v shortcut for '+bhp'; also '--verbose' (default)",
"+c check temporary output for changes",
"-dN set 'kpathsea_debug' to N (0..127)",
"+k keep separators in numeric literals in the output",
@@ -82,8 +82,8 @@
"+b print banner line on terminal",
"+h print success message on completion",
"+p print progress report messages",
- "+/-q shortcut for '-bhp'; also '--quiet' (default)",
- "+/-v shortcut for '+bhp'; also '--verbose'",
+ "+/-q shortcut for '-bhp'; also '--quiet'",
+ "+/-v shortcut for '+bhp'; also '--verbose' (default)",
"+c check temporary output for changes",
"-dN set 'kpathsea_debug' to N (0..127)",
"-e do not enclose C material in \\PB{...}",
@@ -111,8 +111,8 @@
"+b print banner line on terminal",
"+h print success message on completion",
"+p print progress report messages",
- "+/-q shortcut for '-bhp'; also '--quiet' (default)",
- "+/-v shortcut for '+bhp'; also '--verbose'",
+ "+/-q shortcut for '-bhp'; also '--quiet'",
+ "+/-v shortcut for '+bhp'; also '--verbose' (default)",
"+c check temporary output for changes",
"-dN set 'kpathsea_debug' to N (0..127)",
"-e do not enclose C material in \\PB{...}",
Modified: branches/stable/source/src/texk/web2c/lib/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/lib/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/lib/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,21 @@
+2025-04-26 Yukimasa Morimi <h20y6m at yahoo.co.jp>
+
+ * openclose.c: Convert recorder filename to UTF-8.
+ https://github.com/texjporg/tex-jp-build/issues/45
+
+2025-03-07 Karl Berry <karl at tug.org>
+
+ * TL'25 release.
+
+2025-03-07 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ * texmfmp.c (gettexstring) [XETEX]: correct non-BMP characters in
+ filenames with synctex.
+
+2025-02-28 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ * texmfmp.c: Remove problematic lines for windows (windows only)
+
2025-02-04 Hironori Kitagawa <h_kitagawa2001 at yahoo.co.jp>
* texmfmp.c: Avoid segmentation fault.
Modified: branches/stable/source/src/texk/web2c/lib/openclose.c
===================================================================
--- branches/stable/source/src/texk/web2c/lib/openclose.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/lib/openclose.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -142,7 +142,10 @@
recorder_change_filename (string new_name)
{
string temp = NULL;
-
+#if defined(PTEX) && !defined(WIN32)
+ string fname0 = NULL;
+#endif
+
if (!recorder_file)
return;
@@ -151,6 +154,13 @@
fclose (recorder_file);
#endif /* _WIN32 */
+#if defined(PTEX) && !defined(WIN32)
+ fname0 = ptenc_from_internal_enc_string_to_utf8(new_name);
+ if (fname0) {
+ new_name = fname0;
+ }
+#endif
+
/* If an output directory was specified, use it. */
if (output_directory) {
temp = concat3(output_directory, DIR_SEP_STRING, new_name);
@@ -173,6 +183,10 @@
if (temp)
free (temp);
+#if defined(PTEX) && !defined(WIN32)
+ if (fname0)
+ free (fname0);
+#endif
}
/* helper for recorder_record_* */
@@ -407,17 +421,10 @@
open_output (FILE **f_ptr, const_string fopen_mode)
{
string fname;
-#if defined(PTEX) && !defined(WIN32)
string fname0;
-#endif
boolean absolute = kpse_absolute_p(nameoffile+1, false);
- /* If we have an explicit output directory, use it. */
- if (output_directory && !absolute) {
- fname = concat3(output_directory, DIR_SEP_STRING, nameoffile + 1);
- } else {
- fname = nameoffile + 1;
- }
+ fname = nameoffile + 1;
#if defined(PTEX) && !defined(WIN32)
fname0 = ptenc_from_internal_enc_string_to_utf8(fname);
if (fname0) {
@@ -425,6 +432,14 @@
fname = fname0;
}
#endif
+ /* If we have an explicit output directory, use it. */
+ if (output_directory && !absolute) {
+ fname0 = concat3(output_directory, DIR_SEP_STRING, fname);
+ if (fname0) {
+ if (fname != nameoffile + 1) free(fname);
+ fname = fname0;
+ }
+ }
/* Is the filename openable as given? */
*f_ptr = fopen (fname, fopen_mode);
Modified: branches/stable/source/src/texk/web2c/lib/texmfmp.c
===================================================================
--- branches/stable/source/src/texk/web2c/lib/texmfmp.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/lib/texmfmp.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -531,6 +531,7 @@
*d++ = QUOTE;
}
*d = '\0';
+#if 0
#ifdef WIN32
{
char *p, *q, *r;
@@ -569,6 +570,7 @@
}
}
#endif
+#endif
}
return allow;
@@ -3190,7 +3192,7 @@
if (c >= 0xD800 && c <= 0xDBFF) {
unsigned lo = strpool[++i + strstart[s - 65536L]];
if (lo >= 0xDC00 && lo <= 0xDFFF)
- c = (c - 0xD800) * 0x0400 + lo - 0xDC00;
+ c = 0x10000 + (c - 0xD800) * 0x0400 + lo - 0xDC00;
else
c = 0xFFFD;
}
Modified: branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,51 @@
+2025-05-17 Karl Berry <karl at freefriends.org>
+
+ * NEWS,
+ * pdftex_version.h,
+ * pdftex.web (pdftex_revision, pdftex_version_string):
+ version [1.40.]28 for post-TL25 fix.
+
+2025-05-15 Thanh Han The <hanthethanh at gmail.com>
+
+ * pdftex.web (adv_char_width): remove dd parameter; call
+ divide_scaled by the hardwired 4, instead of dd.
+ (pdf_init_font): also check that the width of character 32 is >one_bp
+ for the pdf_font_has_space_char value.
+ (pdf_begin_string, output_one_char): change adv_char_width calls
+ similarly.
+ This is to fix overlapping text in ptmr8r and other fonts,
+ reported by Ulrike 01 May 2025 10:23:07.
+ Test: 40-overlapping-text-with-pdfinterwordspaceon.
+ (pdftex r963)
+
+2025-04-17 Karl Berry <karl at freefriends.org>
+
+ * pdftex.web (bool): rename variable to booltemp, kowtowing to C23.
+
+2025-03-07 Karl Berry <karl at tug.org>
+
+ * TL'25 release.
+
+2025-02-18 Thanh Han The <hanthethanh at gmail.com>
+
+ * pdftex.web (pdf_begin_string): more space fixes.
+ (pdftex r958)
+
+2025-02-17 Thanh Han The <hanthethanh at gmail.com>
+
+ * pdftex.web (pdf_begin_string): remove "and (not must_set_text_pos)"
+ from condition for must_insert_space := true.
+ (pdftex r955)
+
+2025-02-16 Thanh Han The <hanthethanh at gmail.com>
+
+ * pdftex.web: fixes for previous change to add missing interword
+ spaces at font switches, following reports:
+ https://tug.org/pipermail/pdftex/2025-February/009443.html
+ https://tug.org/pipermail/tex-live/2025-February/051136.html
+ https://tug.org/pipermail/tex-live/2025-February/051139.html
+ Copied from pdftex r953.
+
2025-02-11 Max Chernoff <tex at maxchernoff.ca>
* pdftex.web (scale_image): no warning if both resolutions are zero.
Modified: branches/stable/source/src/texk/web2c/pdftexdir/NEWS
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/NEWS 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/pdftexdir/NEWS 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,9 @@
-pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025)
+pdfTeX 3.141592653-2.6-1.40.28 (TeX Live 2025 post-release) (17 May March 2025)
+- bugfixes:
+ - fix overlapping text in ptmr8r and other fonts.
+
+-----------------------------------------------------------------------------
+pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025) (7 March 2025)
- changes:
- new primitive \pdfptexuseunderscore: if positive or
if \pdfmajorversion >= 2, PTEX.Fullbanner and other dictionary
Modified: branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-% Copyright 1996-2024 Han Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh,
+% Copyright 1996-2025 Han Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh,
% <thanh@@pdftex.org>
% This file is part of pdfTeX.
@@ -307,8 +307,8 @@
{printed when \eTeX\ starts}
@#
@d pdftex_version==140 { \.{\\pdftexversion} }
- at d pdftex_revision=="27" { \.{\\pdftexrevision} }
- at d pdftex_version_string=='-1.40.27' {current \pdfTeX\ version}
+ at d pdftex_revision=="28" { \.{\\pdftexrevision} }
+ at d pdftex_version_string=='-1.40.28' {current \pdfTeX\ version}
@#
@d pdfTeX_banner=='This is pdfTeX, Version 3.141592653',eTeX_version_string,pdftex_version_string
{printed when \pdfTeX\ starts}
@@ -10959,7 +10959,7 @@
@!save_scanner_status:small_number; {|scanner_status| upon entry}
@!save_def_ref: pointer; {|def_ref| upon entry, important if inside `\.{\\message}'}
@!save_warning_index: pointer;
-@!bool: boolean; {temp boolean}
+@!booltemp: boolean; {temp boolean}
@!i: integer; {first temp integer}
@!j: integer; {second temp integer}
@!b:pool_pointer; {base of temporary string}
@@ -11159,7 +11159,7 @@
save_warning_index := warning_index;
save_def_ref := def_ref;
save_cur_string;
- bool := scan_keyword("file");
+ booltemp := scan_keyword("file");
scan_pdf_ext_toks;
s := tokens_to_string(def_ref);
delete_token_ref(def_ref);
@@ -11167,7 +11167,7 @@
warning_index := save_warning_index;
scanner_status := save_scanner_status;
b := pool_ptr;
- getmd5sum(s, bool);
+ getmd5sum(s, booltemp);
link(garbage) := str_toks(b);
flush_str(s);
ins_list(link(temp_head));
@@ -11230,7 +11230,7 @@
save_def_ref := def_ref;
save_cur_string;
{scan for icase}
- bool := scan_keyword("icase");
+ booltemp := scan_keyword("icase");
{scan for subcount}
i := -1; {default for subcount}
if scan_keyword("subcount") then begin
@@ -11247,7 +11247,7 @@
warning_index := save_warning_index;
scanner_status := save_scanner_status;
b := pool_ptr;
- matchstrings(s, t, i, bool);
+ matchstrings(s, t, i, booltemp);
link(garbage) := str_toks(b);
flush_str(t);
flush_str(s);
@@ -11286,7 +11286,7 @@
end;
pdf_colorstack_init_code:
begin
- bool := scan_keyword("page");
+ booltemp := scan_keyword("page");
if scan_keyword("direct") then
cur_val := direct_always
else
@@ -11304,7 +11304,7 @@
def_ref := save_def_ref;
warning_index := save_warning_index;
scanner_status := save_scanner_status;
- cur_val := newcolorstack(s, cur_val, bool);
+ cur_val := newcolorstack(s, cur_val, booltemp);
flush_str(s);
cur_val_level := int_val;
if cur_val < 0 then begin
Modified: branches/stable/source/src/texk/web2c/pdftexdir/pdftex_version.h
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/pdftex_version.h 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/pdftexdir/pdftex_version.h 2025-05-17 22:44:20 UTC (rev 964)
@@ -1 +1 @@
-#define PDFTEX_VERSION "1.40.27"
+#define PDFTEX_VERSION "1.40.28"
Modified: branches/stable/source/src/texk/web2c/synctexdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/synctexdir/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/synctexdir/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,12 @@
+2025-03-09 Akira Kakuto <kakuto at jcom.zaq.ne.jp>
+
+ * synctex.c: improve printing of a synctex file name
+ (windows only).
+
+2025-03-07 Karl Berry <karl at tug.org>
+
+ * TL'25 release.
+
2024-10-13 <user202729 at protonmail.com>
* synctex_record_node_kern: pass "kern" instead of "glue"
Modified: branches/stable/source/src/texk/web2c/synctexdir/synctex.c
===================================================================
--- branches/stable/source/src/texk/web2c/synctexdir/synctex.c 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/synctexdir/synctex.c 2025-05-17 22:44:20 UTC (rev 964)
@@ -968,10 +968,11 @@
if (SYNCTEX_interaction>0) {
#ifdef W32UPTEXSYNCTEX
{
- char *stmp = chgto_oem(tmp);
+ int savecp = GetConsoleOutputCP();
+ SetConsoleOutputCP(file_system_codepage);
printf((synctex_ctxt.flags.quoted ? "\nSyncTeX written on \"%s\"\n" : "\nSyncTeX written on %s.\n"),
- stmp);
- free(stmp);
+ tmp);
+ SetConsoleOutputCP(savecp);
}
#else
#ifndef SYNCTEX_PRE_NL
Modified: branches/stable/source/src/texk/web2c/tangle.ch
===================================================================
--- branches/stable/source/src/texk/web2c/tangle.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/tangle.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -295,7 +295,8 @@
begin if buffer[i]>="a" then chopped_id[s]:=buffer[i]-@'40
@y
begin if (buffer[i]<>"_") or (allow_underlines and not strict_mode) then
- begin if (strict_mode or force_uppercase) and (buffer[i]>="a") then
+ begin if (strict_mode or force_uppercase)
+ and (buffer[i]>="a") and (buffer[i]<="z") then
chopped_id[s]:=buffer[i]-@'40
else if (not strict_mode and force_lowercase)
and (buffer[i]>="A") and (buffer[i]<="Z") then
@@ -313,7 +314,9 @@
begin if c>="a" then c:=c-@'40; {merge lowercase with uppercase}
@y
if c<>"_" or (allow_underlines and not strict_mode) then
- begin if (strict_mode or force_uppercase) and (c>="a") then c:=c-@'40
+ begin if (strict_mode or force_uppercase)
+ and (c>="a") and (c<="z") then
+ c:=c-@'40
else if (not strict_mode and force_lowercase)
and (c>="A") and (c<="Z") then
c:=c+@'40;
@@ -482,9 +485,11 @@
identifier: begin k:=0; j:=byte_start[cur_val]; w:=cur_val mod ww;
while (k<max_id_length)and(j<byte_start[cur_val+ww]) do
begin incr(k); out_contrib[k]:=byte_mem[w,j]; incr(j);
- if force_uppercase and (out_contrib[k]>="a") then
+ if force_uppercase
+ and (out_contrib[k]>="a") and (out_contrib[k]<="z") then
out_contrib[k]:=out_contrib[k]-@'40
- else if force_lowercase and (out_contrib[k]<="Z") then
+ else if force_lowercase
+ and (out_contrib[k]>="A") and (out_contrib[k]<="Z") then
out_contrib[k]:=out_contrib[k]+@'40
else if not allow_underlines and (out_contrib[k]="_") then decr(k);
end;
@@ -492,16 +497,11 @@
end;
@z
- at x [11.119] l.2199 - Stretch limits of constants to match what we set for expressions.
- if n>=@'2000000000 then err_print('! Constant too big')
+ at x [11.119] l.2185 - Calculate with decimal limit value INT_MAX/10.
+ if n>=@'1463146314 then err_print('! Constant too big')
@y
- if n>=@'10000000000 then err_print('! Constant too big')
+ if n>=214748364 then err_print('! Constant too big')
@z
- at x [11.119] l.2208
- if n>=@"8000000 then err_print('! Constant too big')
- at y
- if n>=@"40000000 then err_print('! Constant too big')
- at z
@x [14.157] l.2862 - Larger numerics.
if abs(accumulator)>=@'100000 then
@@ -521,6 +521,31 @@
add_in(equiv[q]-@'10000000000);
@z
+ at x [14.160] l.2915 - Avoid numeric overflow; see also section 119.
+repeat val:=10*val+next_control-"0"; next_control:=get_next;
+ at y
+repeat if val>=214748364 then err_print('! Constant too big')
+ at .Constant too big@>
+ else val:=10*val+next_control-"0";
+ next_control:=get_next;
+ at z
+ at x [14.161] l.2920 - Avoid numeric overflow; see also section 119.
+repeat val:=8*val+next_control-"0"; next_control:=get_next;
+ at y
+repeat if val>=@'2000000000 then err_print('! Constant too big')
+ at .Constant too big@>
+ else val:=8*val+next_control-"0";
+ next_control:=get_next;
+ at z
+ at x [14.162] l.2926 - Avoid numeric overflow; see also section 119.
+val:=16*val+next_control-"0"; next_control:=get_next;
+ at y
+ if val>=@"8000000 then err_print('! Constant too big')
+ at .Constant too big@>
+ else val:=16*val+next_control-"0";
+ next_control:=get_next;
+ at z
+
@x [15.165] l.2964 - Add parametric2 macros (macros that use [] to delimit arguments).
"(": incr(bal);
")": if bal=0 then err_print('! Extra )')
@@ -568,6 +593,12 @@
end
@z
+ at x [16.173] l.3095 - Reject strings as macro names.
+ if next_control<>identifier then
+ at y
+ if (next_control<>identifier) or (buffer[id_first]="""") then
+ at z
+
@x [16.173] l.3107 - Add parametric2 macros (macros that use [] to delimit arguments).
else @<If the next text is `\.{(\#)==}', call |define_macro|
and |goto continue|@>;
Modified: branches/stable/source/src/texk/web2c/tangleboot.pin
===================================================================
--- branches/stable/source/src/texk/web2c/tangleboot.pin 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/tangleboot.pin 2025-05-17 22:44:20 UTC (rev 964)
@@ -197,11 +197,11 @@
idfirst;s:=0;h:=0;
while(i<idloc)and(s<unambiglength)do begin if(buffer[i]<>95)or(
allowunderlines and not strictmode)then begin if(strictmode or
-forceuppercase)and(buffer[i]>=97)then choppedid[s]:=buffer[i]-32 else if
-(not strictmode and forcelowercase)and(buffer[i]>=65)and(buffer[i]<=90)
-then choppedid[s]:=buffer[i]+32 else choppedid[s]:=buffer[i];
-h:=(h+h+choppedid[s])mod hashsize;s:=s+1;end;i:=i+1;end;choppedid[s]:=0;
-end{:58};
+forceuppercase)and(buffer[i]>=97)and(buffer[i]<=122)then choppedid[s]:=
+buffer[i]-32 else if(not strictmode and forcelowercase)and(buffer[i]>=65
+)and(buffer[i]<=90)then choppedid[s]:=buffer[i]+32 else choppedid[s]:=
+buffer[i];h:=(h+h+choppedid[s])mod hashsize;s:=s+1;end;i:=i+1;end;
+choppedid[s]:=0;end{:58};
if p<>nameptr then{59:}begin if ilk[p]=0 then begin if t=1 then begin
writeln(stdout);write(stdout,'! This identifier has already appeared');
error;end;{60:}q:=chophash[h];
@@ -214,8 +214,8 @@
w:=q mod 3;
while(k<bytestart[q+3])and(s<unambiglength)do begin c:=bytemem[w,k];
if c<>95 or(allowunderlines and not strictmode)then begin if(strictmode
-or forceuppercase)and(c>=97)then c:=c-32 else if(not strictmode and
-forcelowercase)and(c>=65)and(c<=90)then c:=c+32;
+or forceuppercase)and(c>=97)and(c<=122)then c:=c-32 else if(not
+strictmode and forcelowercase)and(c>=65)and(c<=90)then c:=c+32;
if choppedid[s]<>c then goto 32;s:=s+1;end;k:=k+1;end;
if(k=bytestart[q+3])and(choppedid[s]<>0)then goto 32;
begin writeln(stdout);write(stdout,'! Identifier conflict with ');end;
@@ -469,22 +469,22 @@
130:begin k:=0;j:=bytestart[curval];w:=curval mod 3;
while(k<maxidlength)and(j<bytestart[curval+3])do begin k:=k+1;
outcontrib[k]:=bytemem[w,j];j:=j+1;
-if forceuppercase and(outcontrib[k]>=97)then outcontrib[k]:=outcontrib[k
-]-32 else if forcelowercase and(outcontrib[k]<=90)then outcontrib[k]:=
-outcontrib[k]+32 else if not allowunderlines and(outcontrib[k]=95)then k
-:=k-1;end;sendout(2,k);end;
-{:116}{119:}48,49,50,51,52,53,54,55,56,57:begin n:=0;
+if forceuppercase and(outcontrib[k]>=97)and(outcontrib[k]<=122)then
+outcontrib[k]:=outcontrib[k]-32 else if forcelowercase and(outcontrib[k]
+>=65)and(outcontrib[k]<=90)then outcontrib[k]:=outcontrib[k]+32 else if
+not allowunderlines and(outcontrib[k]=95)then k:=k-1;end;sendout(2,k);
+end;{:116}{119:}48,49,50,51,52,53,54,55,56,57:begin n:=0;
repeat curchar:=curchar-48;if n>=214748364 then begin writeln(stdout);
write(stdout,'! Constant too big');error;end else n:=10*n+curchar;
curchar:=getoutput;until(curchar>57)or(curchar<48);sendval(n);k:=0;
if curchar=101 then curchar:=69;if curchar=69 then goto 2 else goto 21;
end;125:sendval(poolchecksum);12:begin n:=0;curchar:=48;
-repeat curchar:=curchar-48;if n>=1073741824 then begin writeln(stdout);
+repeat curchar:=curchar-48;if n>=268435456 then begin writeln(stdout);
write(stdout,'! Constant too big');error;end else n:=8*n+curchar;
curchar:=getoutput;until(curchar>55)or(curchar<48);sendval(n);goto 21;
end;13:begin n:=0;curchar:=48;
repeat if curchar>=65 then curchar:=curchar-55 else curchar:=curchar-48;
-if n>=1073741824 then begin writeln(stdout);
+if n>=134217728 then begin writeln(stdout);
write(stdout,'! Constant too big');error;end else n:=16*n+curchar;
curchar:=getoutput;
until(curchar>70)or(curchar<48)or((curchar>57)and(curchar<65));
@@ -699,16 +699,22 @@
begin{158:}accumulator:=0;nextsign:=+1;
while true do begin nextcontrol:=getnext;
21:case nextcontrol of 48,49,50,51,52,53,54,55,56,57:begin{160:}val:=0;
-repeat val:=10*val+nextcontrol-48;nextcontrol:=getnext;
+repeat if val>=214748364 then begin writeln(stdout);
+write(stdout,'! Constant too big');error;
+end else val:=10*val+nextcontrol-48;nextcontrol:=getnext;
until(nextcontrol>57)or(nextcontrol<48){:160};
begin accumulator:=accumulator+nextsign*(val);nextsign:=+1;end;goto 21;
end;12:begin{161:}val:=0;nextcontrol:=48;
-repeat val:=8*val+nextcontrol-48;nextcontrol:=getnext;
+repeat if val>=268435456 then begin writeln(stdout);
+write(stdout,'! Constant too big');error;
+end else val:=8*val+nextcontrol-48;nextcontrol:=getnext;
until(nextcontrol>55)or(nextcontrol<48){:161};
begin accumulator:=accumulator+nextsign*(val);nextsign:=+1;end;goto 21;
end;13:begin{162:}val:=0;nextcontrol:=48;
repeat if nextcontrol>=65 then nextcontrol:=nextcontrol-7;
-val:=16*val+nextcontrol-48;nextcontrol:=getnext;
+if val>=134217728 then begin writeln(stdout);
+write(stdout,'! Constant too big');error;
+end else val:=16*val+nextcontrol-48;nextcontrol:=getnext;
until(nextcontrol>70)or(nextcontrol<48)or((nextcontrol>57)and(
nextcontrol<65)){:162};begin accumulator:=accumulator+nextsign*(val);
nextsign:=+1;end;goto 21;end;130:begin q:=idlookup(0);
@@ -807,8 +813,8 @@
while true do begin 22:while nextcontrol<=132 do begin nextcontrol:=
skipahead;if nextcontrol=135 then begin loc:=loc-2;nextcontrol:=getnext;
end;end;if nextcontrol<>133 then goto 30;nextcontrol:=getnext;
-if nextcontrol<>130 then begin begin writeln(stdout);
-write(stdout,'! Definition flushed, must start with ',
+if(nextcontrol<>130)or(buffer[idfirst]=34)then begin begin writeln(
+stdout);write(stdout,'! Definition flushed, must start with ',
'identifier of length > 1');error;end;goto 22;end;nextcontrol:=getnext;
if nextcontrol=61 then begin scannumeric(idlookup(1));goto 22;
end else if nextcontrol=30 then begin definemacro(2);goto 22;
Modified: branches/stable/source/src/texk/web2c/tests/fix-changefile-lines.py
===================================================================
--- branches/stable/source/src/texk/web2c/tests/fix-changefile-lines.py 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/tests/fix-changefile-lines.py 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# $Id: fix-changefile-lines.py 73710 2025-02-03 18:32:15Z ascherer $
+# $Id: fix-changefile-lines.py 74543 2025-03-09 09:22:22Z ascherer $
# Applied to tex.ch and mf.ch on 2024-06-03, following the request at:
# https://tug.org/pipermail/tex-k/2024-June/004064.html
"""
@@ -122,7 +122,8 @@
while True:
self._pos += 1
if self._pos >= len(self._lines):
- eprint(f"! Change file ended before @y. (l. {self._pos+1} of change file)")
+ eprint(f"! Change file ended before @y. " +
+ f"(l. {self._pos+1} of change file)")
sys.exit(1)
line = self._lines[self._pos]
if line.startswith("@y"):
@@ -131,7 +132,8 @@
]
return True
elif line.startswith("@x") or line.startswith("@z"):
- eprint(f"! Where is the matching @y?. (l. {self._pos+1} of change file)")
+ eprint(f"! Where is the matching @y?. " +
+ f"(l. {self._pos+1} of change file)")
eprint(line)
sys.exit(1)
self._pos += 1
@@ -146,7 +148,8 @@
try:
(part, section, line_number), tex_line = web_reader.next_line()
except:
- eprint(f"! Change file entry did not match. (l. {self._chunk_start+2} of change file)")
+ eprint(f"! Change file entry did not match. " +
+ f"(l. {self._chunk_start+2} of change file)")
eprint(self._match_lines[0])
sys.exit(1)
if tex_line == self._match_lines[0]:
@@ -156,7 +159,8 @@
except:
tex_line = None
if tex_line is None or tex_line != self._match_lines[i]:
- eprint(f"! Change file entry did not match. (l. {self._chunk_start+2+i} of change file)")
+ eprint(f"! Change file entry did not match. " +
+ f"(l. {self._chunk_start+2+i} of change file)")
eprint(self._match_lines[i])
sys.exit(1)
Added: branches/stable/source/src/texk/web2c/tests/invalidmu.tex
===================================================================
--- branches/stable/source/src/texk/web2c/tests/invalidmu.tex (rev 0)
+++ branches/stable/source/src/texk/web2c/tests/invalidmu.tex 2025-05-17 22:44:20 UTC (rev 964)
@@ -0,0 +1,15 @@
+% $Id: invalidmu.tex 75108 2025-05-05 17:39:26Z karl $
+% Public domain, from Tyge Thiessen and David Fuchs.
+%
+% When \mkern is followed by a normal (non-mu) dimen or skip, it gives
+% the expected "Incompatible glue units" error, but then continues with
+% up to two spurious additional errors. Fix from DRF in tex.ch at 26.449.
+% Original report: https://tug.org/pipermail/tex-k/2025-January/004150.html
+% TeX bug entry: https://tug.org/texmfbug/newbug.html#B182muerror
+
+\catcode`\$ = 3 % so we can run under initex
+\dimen0=1pt
+\skip0=1pt
+$\mkern \dimen0$
+$\mkern \skip0$
+\end
Property changes on: branches/stable/source/src/texk/web2c/tests/invalidmu.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/stable/source/src/texk/web2c/tex.ch
===================================================================
--- branches/stable/source/src/texk/web2c/tex.ch 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/tex.ch 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-% $Id: tex.ch 73679 2025-02-01 22:56:43Z karl $
+% $Id: tex.ch 75108 2025-05-05 17:39:26Z karl $
% tex.ch for C compilation with web2c, derived from various other change files.
% By Tim Morgan, UC Irvine ICS Department, and many others.
%
@@ -1587,6 +1587,22 @@
if (t>=cs_token_flag)and(t<>end_write_token) then
@z
+% Original report: https://tug.org/pipermail/tex-k/2025-January/004150.html
+% TeX bug entry: https://tug.org/texmfbug/newbug.html#B182muerror
+% Test file: tests/invalidmu.tex
+ at x [26.449] l.8878 - recover better from \mkern <non-mu-dimen-or-skip>
+ @<Coerce glue to a dimension@>;
+ if cur_val_level=mu_val then goto attach_sign;
+ if cur_val_level<>int_val then mu_error;
+ at y
+ if cur_val_level<>int_val then
+ begin
+ @<Coerce glue to a dimension@>;
+ if cur_val_level<>mu_val then mu_error;
+ goto attach_sign;
+ end;
+ at z
+
% See above change "term_input: set limit when fatal_error" for references.
@x [27.484] l.9495 - set limit when fatal_error
else fatal_error("*** (cannot \read from terminal in nonstop modes)")
Modified: branches/stable/source/src/texk/web2c/web2c/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/web2c/ChangeLog 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/web2c/ChangeLog 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,3 +1,7 @@
+2025-03-07 Karl Berry <karl at tug.org>
+
+ * TL'25 release.
+
2023-03-09 Karl Berry <karl at tug.org>
* TL'23 release.
Modified: branches/stable/source/src/texk/web2c/web2c/configure
===================================================================
--- branches/stable/source/src/texk/web2c/web2c/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/texk/web2c/web2c/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for Web2C Tools 2025.
+# Generated by GNU Autoconf 2.72 for Web2C Tools 2026/dev.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -614,8 +614,8 @@
# Identity of this package.
PACKAGE_NAME='Web2C Tools'
PACKAGE_TARNAME='web2c-tools'
-PACKAGE_VERSION='2025'
-PACKAGE_STRING='Web2C Tools 2025'
+PACKAGE_VERSION='2026/dev'
+PACKAGE_STRING='Web2C Tools 2026/dev'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1365,7 +1365,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures Web2C Tools 2025 to adapt to many kinds of systems.
+'configure' configures Web2C Tools 2026/dev to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1436,7 +1436,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Web2C Tools 2025:";;
+ short | recursive ) echo "Configuration of Web2C Tools 2026/dev:";;
esac
cat <<\_ACEOF
@@ -1560,7 +1560,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Web2C Tools configure 2025
+Web2C Tools configure 2026/dev
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2341,7 +2341,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Web2C Tools $as_me 2025, which was
+It was created by Web2C Tools $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -9233,7 +9233,7 @@
# Define the identity of the package.
PACKAGE='web2c-tools'
- VERSION='2025'
+ VERSION='2026/dev'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -16840,7 +16840,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Web2C Tools $as_me 2025, which was
+This file was extended by Web2C Tools $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16908,7 +16908,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-Web2C Tools config.status 2025
+Web2C Tools config.status 2026/dev
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: branches/stable/source/src/utils/README
===================================================================
--- branches/stable/source/src/utils/README 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/utils/README 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,14 +1,19 @@
-$Id: README 73901 2025-02-11 21:53:03Z karl $
+$Id: README 74435 2025-03-04 17:01:16Z karl $
Public domain. Originally written 2005 by Karl Berry.
Extra utilities we (optionally) compile for TeX Live.
See comments in ../texk/README.
-asymptote 2.99 - checked 11feb25
- update to TL from CTAN, to include prebuilt doc.
- see https://tug.org/texlive/build.html#asymptote
+asymptote 3.01 - checked 24feb25
+ update TL from CTAN, to include prebuilt doc, Windows binaries, etc.
+ See https://tug.org/texlive/build.html#asymptote
and tlpkg/bin/tl-update-asy
+ Special builders for asy:
+ aarch64-linux - Johannes Hielscher
+ *solaris, as well as darwinlegacy - Mojca
+ windows - from asy dist, including dlls
+
autosp 2023-10-07 - checked 07jan24
https://ctan.org/pkg/autosp
Modified: branches/stable/source/src/utils/configure
===================================================================
--- branches/stable/source/src/utils/configure 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/utils/configure 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for TeX Live utils 2025.
+# Generated by GNU Autoconf 2.72 for TeX Live utils 2026/dev.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -603,8 +603,8 @@
# Identity of this package.
PACKAGE_NAME='TeX Live utils'
PACKAGE_TARNAME='tex-live-utils'
-PACKAGE_VERSION='2025'
-PACKAGE_STRING='TeX Live utils 2025'
+PACKAGE_VERSION='2026/dev'
+PACKAGE_STRING='TeX Live utils 2026/dev'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1471,7 +1471,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures TeX Live utils 2025 to adapt to many kinds of systems.
+'configure' configures TeX Live utils 2026/dev to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1542,7 +1542,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of TeX Live utils 2025:";;
+ short | recursive ) echo "Configuration of TeX Live utils 2026/dev:";;
esac
cat <<\_ACEOF
@@ -1839,7 +1839,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-TeX Live utils configure 2025
+TeX Live utils configure 2026/dev
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -1999,7 +1999,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by TeX Live utils $as_me 2025, which was
+It was created by TeX Live utils $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -7617,7 +7617,7 @@
# Define the identity of the package.
PACKAGE='tex-live-utils'
- VERSION='2025'
+ VERSION='2026/dev'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -8614,7 +8614,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by TeX Live utils $as_me 2025, which was
+This file was extended by TeX Live utils $as_me 2026/dev, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -8673,7 +8673,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-TeX Live utils config.status 2025
+TeX Live utils config.status 2026/dev
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
Modified: branches/stable/source/src/version.ac
===================================================================
--- branches/stable/source/src/version.ac 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/src/version.ac 2025-05-17 22:44:20 UTC (rev 964)
@@ -1,4 +1,4 @@
-dnl $Id: version.ac 73591 2025-01-25 18:41:15Z karl $
+dnl $Id: version.ac 74529 2025-03-08 18:17:45Z karl $
dnl Copyright 2016-2025 Karl Berry <tex-live at tug.org>
dnl Copyright 2010-2015 Peter Breitenlohner <tex-live at tug.org>
dnl
@@ -9,4 +9,4 @@
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current TeX Live version
-m4_define([tex_live_version], [2025])
+m4_define([tex_live_version], [2026/dev])
Modified: branches/stable/source/sync-pdftex.sh
===================================================================
--- branches/stable/source/sync-pdftex.sh 2025-05-13 16:07:59 UTC (rev 963)
+++ branches/stable/source/sync-pdftex.sh 2025-05-17 22:44:20 UTC (rev 964)
@@ -151,7 +151,8 @@
After svn looks good, do make build (more needed updates may be discovered).
make versionhelp will run --version and --help on the resulting binary.
-When the build looks good, commit.
+When the build looks good, commit, as in:
+ svn commit -m"sync from tl $rev"
When the commit succeeds, do svn update afterward, due to removals.
More information about the pdftex-commits
mailing list.