diff --git a/source/build-aux/config.guess b/source/build-aux/config.guess index b187213930..cdfc439204 100755 --- a/source/build-aux/config.guess +++ b/source/build-aux/config.guess @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-07-20' +timestamp='2023-08-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -169,6 +172,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -904,7 +908,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; diff --git a/source/build-aux/config.sub b/source/build-aux/config.sub index 6ae2502753..defe52c0c8 100755 --- a/source/build-aux/config.sub +++ b/source/build-aux/config.sub @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-07-31' +timestamp='2023-09-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1181,7 +1181,7 @@ case $cpu-$vendor in case $cpu in 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ + | aarch64 | aarch64_be | aarch64c | arm64ec \ | abacus \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ @@ -1200,6 +1200,7 @@ case $cpu-$vendor in | d10v | d30v | dlx | dsp16xx \ | e2k | elxsi | epiphany \ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | javascript \ | h8300 | h8500 \ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ @@ -1284,11 +1285,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1488,10 +1490,16 @@ case $os in os=eabi ;; *) - os=elf + os= + obj=elf ;; esac ;; + aout* | coff* | elf* | pe*) + # These are machine code file formats, not OSes + obj=$os + os= + ;; *) # No normalization, but not necessarily accepted, that comes below. ;; @@ -1510,12 +1518,15 @@ else # system, and we'll never get to this point. kernel= +obj= case $cpu-$vendor in score-*) - os=elf + os= + obj=elf ;; spu-*) - os=elf + os= + obj=elf ;; *-acorn) os=riscix1.2 @@ -1525,28 +1536,35 @@ case $cpu-$vendor in os=gnu ;; arm*-semi) - os=aout + os= + obj=aout ;; c4x-* | tic4x-*) - os=coff + os= + obj=coff ;; c8051-*) - os=elf + os= + obj=elf ;; clipper-intergraph) os=clix ;; hexagon-*) - os=elf + os= + obj=elf ;; tic54x-*) - os=coff + os= + obj=coff ;; tic55x-*) - os=coff + os= + obj=coff ;; tic6x-*) - os=coff + os= + obj=coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1568,19 +1586,24 @@ case $cpu-$vendor in os=sunos3 ;; m68*-cisco) - os=aout + os= + obj=aout ;; mep-*) - os=elf + os= + obj=elf ;; mips*-cisco) - os=elf + os= + obj=elf ;; mips*-*) - os=elf + os= + obj=elf ;; or32-*) - os=coff + os= + obj=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 @@ -1589,7 +1612,8 @@ case $cpu-$vendor in os=sunos4.1.1 ;; pru-*) - os=elf + os= + obj=elf ;; *-be) os=beos @@ -1670,10 +1694,12 @@ case $cpu-$vendor in os=uxpv ;; *-rom68k) - os=coff + os= + obj=coff ;; *-*bug) - os=coff + os= + obj=coff ;; *-apple) os=macos @@ -1691,7 +1717,8 @@ esac fi -# Now, validate our (potentially fixed-up) OS. +# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ). + case $os in # Sometimes we do "kernel-libc", so those need to count as OSes. musl* | newlib* | relibc* | uclibc*) @@ -1702,6 +1729,9 @@ case $os in # VxWorks passes extra cpu info in the 4th filed. simlinux | simwindows | spe) ;; + # See `case $cpu-$os` validation below + ghcjs) + ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. @@ -1719,11 +1749,11 @@ case $os in | mirbsd* | netbsd* | dicos* | openedition* | ose* \ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | bosx* | nextstep* | cxux* | oabi* \ + | ptx* | ecoff* | winnt* | domain* | vsta* \ | udi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* | serenity* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | cygwin* | msys* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | mint* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ @@ -1747,60 +1777,95 @@ case $os in kernel* | msvc* ) # Restricted further below ;; + '') + if test x"$obj" = x + then + echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2 + fi + ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 + exit 1 + ;; +esac + # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \ + | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- ) ;; - uclinux-uclibc* ) + uclinux-uclibc*- ) ;; - managarm-mlibc* | managarm-kernel* ) + managarm-mlibc*- | managarm-kernel*- ) ;; - windows*-gnu* | windows*-msvc*) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + -dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - -kernel* ) + -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; - *-kernel* ) + *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; - *-msvc* ) + *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + kfreebsd*-gnu*- | kopensolaris*-gnu*-) ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; - nto-qnx*) + nto-qnx*-) ;; - os2-emx) + os2-emx-) ;; - *-eabi* | *-gnueabi*) + *-eabi*- | *-gnueabi*-) ;; - none-coff* | none-elf*) + none--*) # None (no kernel, i.e. freestanding / bare metal), - # can be paired with an output format "OS" + # can be paired with an machine code file format ;; - -*) + -*-) # Blank kernel with real OS is always fine. ;; - *-*) + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; @@ -1884,7 +1949,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/source/build-aux/texinfo.tex b/source/build-aux/texinfo.tex index d17a06200d..e8c382f596 100644 --- a/source/build-aux/texinfo.tex +++ b/source/build-aux/texinfo.tex @@ -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{2023-09-12.17} +\def\texinfoversion{2023-09-19.19} % % Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc. % @@ -5652,42 +5652,13 @@ \parfillskip=0pt plus -1fill % \advance\rightskip by \entryrightmargin - % Determine how far we can stretch into the margin. - % This allows, e.g., "Appendix H GNU Free Documentation License" to - % fit on one line in @letterpaper format. - \ifdim\entryrightmargin>1.5em - \dimen@i=1.5em - \else - \dimen@i=0em - \fi - \advance \parfillskip by 0pt minus 1\dimen@i % \dimen@ii = \hsize \advance\dimen@ii by -1\leftskip \advance\dimen@ii by -1\entryrightmargin - \advance\dimen@ii by 1\dimen@i \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line \ifdim\dimen@ > 0.8\dimen@ii % due to long index text - % Undo changes above - \advance \parfillskip by 0pt minus -1\dimen@i - \advance\dimen@ii by -1\dimen@i - % - % Try to split the text roughly evenly. \dimen@ will be the length of - % the first line. - \dimen@ = 0.7\dimen@ - \dimen@ii = \hsize - \ifnum\dimen@>\dimen@ii - % If the entry is too long (for example, if it needs more than - % two lines), use the same line length for all lines. - \dimen@ = \dimen@ii - \else - \advance \dimen@ by 1\rightskip - \fi \advance\leftskip by 0pt plus 1fill % ragged right - \parshape = 2 0pt \dimen@ 0em \dimen@ii - % Ideally we'd add a finite glue at the end of the first line only, - % instead of using \parshape with explicit line lengths, but TeX - % doesn't seem to provide a way to do such a thing. % % Indent all lines but the first one. \advance\leftskip by \entrycontskip diff --git a/source/libs/README b/source/libs/README index 9afbe1ac0c..d95c0b075c 100644 --- a/source/libs/README +++ b/source/libs/README @@ -25,8 +25,8 @@ graphite2 1.3.14 - checked 10apr20 http://sourceforge.net/projects/silgraphite/files/graphite2/ (requires C++11) -harfbuzz 8.2.0 - checked 09sep23 - https://github.com/harfbuzz/harfbuzz/releases/tag/8.2.0 +harfbuzz 8.2.1 - checked 19sep23 + https://github.com/harfbuzz/harfbuzz/releases/tag/8.2.1 icu 72.1 - checked 07jan23 https://github.com/unicode-org/icu/releases/ diff --git a/source/libs/icu/icu-src/source/config.guess b/source/libs/icu/icu-src/source/config.guess index b187213930..cdfc439204 100755 --- a/source/libs/icu/icu-src/source/config.guess +++ b/source/libs/icu/icu-src/source/config.guess @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-07-20' +timestamp='2023-08-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -169,6 +172,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -904,7 +908,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; diff --git a/source/libs/icu/icu-src/source/config.sub b/source/libs/icu/icu-src/source/config.sub index 6ae2502753..defe52c0c8 100755 --- a/source/libs/icu/icu-src/source/config.sub +++ b/source/libs/icu/icu-src/source/config.sub @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-07-31' +timestamp='2023-09-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1181,7 +1181,7 @@ case $cpu-$vendor in case $cpu in 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ + | aarch64 | aarch64_be | aarch64c | arm64ec \ | abacus \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ @@ -1200,6 +1200,7 @@ case $cpu-$vendor in | d10v | d30v | dlx | dsp16xx \ | e2k | elxsi | epiphany \ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | javascript \ | h8300 | h8500 \ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ @@ -1284,11 +1285,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1488,10 +1490,16 @@ case $os in os=eabi ;; *) - os=elf + os= + obj=elf ;; esac ;; + aout* | coff* | elf* | pe*) + # These are machine code file formats, not OSes + obj=$os + os= + ;; *) # No normalization, but not necessarily accepted, that comes below. ;; @@ -1510,12 +1518,15 @@ else # system, and we'll never get to this point. kernel= +obj= case $cpu-$vendor in score-*) - os=elf + os= + obj=elf ;; spu-*) - os=elf + os= + obj=elf ;; *-acorn) os=riscix1.2 @@ -1525,28 +1536,35 @@ case $cpu-$vendor in os=gnu ;; arm*-semi) - os=aout + os= + obj=aout ;; c4x-* | tic4x-*) - os=coff + os= + obj=coff ;; c8051-*) - os=elf + os= + obj=elf ;; clipper-intergraph) os=clix ;; hexagon-*) - os=elf + os= + obj=elf ;; tic54x-*) - os=coff + os= + obj=coff ;; tic55x-*) - os=coff + os= + obj=coff ;; tic6x-*) - os=coff + os= + obj=coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1568,19 +1586,24 @@ case $cpu-$vendor in os=sunos3 ;; m68*-cisco) - os=aout + os= + obj=aout ;; mep-*) - os=elf + os= + obj=elf ;; mips*-cisco) - os=elf + os= + obj=elf ;; mips*-*) - os=elf + os= + obj=elf ;; or32-*) - os=coff + os= + obj=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 @@ -1589,7 +1612,8 @@ case $cpu-$vendor in os=sunos4.1.1 ;; pru-*) - os=elf + os= + obj=elf ;; *-be) os=beos @@ -1670,10 +1694,12 @@ case $cpu-$vendor in os=uxpv ;; *-rom68k) - os=coff + os= + obj=coff ;; *-*bug) - os=coff + os= + obj=coff ;; *-apple) os=macos @@ -1691,7 +1717,8 @@ esac fi -# Now, validate our (potentially fixed-up) OS. +# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ). + case $os in # Sometimes we do "kernel-libc", so those need to count as OSes. musl* | newlib* | relibc* | uclibc*) @@ -1702,6 +1729,9 @@ case $os in # VxWorks passes extra cpu info in the 4th filed. simlinux | simwindows | spe) ;; + # See `case $cpu-$os` validation below + ghcjs) + ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. @@ -1719,11 +1749,11 @@ case $os in | mirbsd* | netbsd* | dicos* | openedition* | ose* \ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | bosx* | nextstep* | cxux* | oabi* \ + | ptx* | ecoff* | winnt* | domain* | vsta* \ | udi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* | serenity* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | cygwin* | msys* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | mint* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ @@ -1747,60 +1777,95 @@ case $os in kernel* | msvc* ) # Restricted further below ;; + '') + if test x"$obj" = x + then + echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2 + fi + ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 + exit 1 + ;; +esac + # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \ + | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- ) ;; - uclinux-uclibc* ) + uclinux-uclibc*- ) ;; - managarm-mlibc* | managarm-kernel* ) + managarm-mlibc*- | managarm-kernel*- ) ;; - windows*-gnu* | windows*-msvc*) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + -dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - -kernel* ) + -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; - *-kernel* ) + *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; - *-msvc* ) + *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + kfreebsd*-gnu*- | kopensolaris*-gnu*-) ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; - nto-qnx*) + nto-qnx*-) ;; - os2-emx) + os2-emx-) ;; - *-eabi* | *-gnueabi*) + *-eabi*- | *-gnueabi*-) ;; - none-coff* | none-elf*) + none--*) # None (no kernel, i.e. freestanding / bare metal), - # can be paired with an output format "OS" + # can be paired with an machine code file format ;; - -*) + -*-) # Blank kernel with real OS is always fine. ;; - *-*) + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; @@ -1884,7 +1949,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/source/texk/dviout-util/ChangeLog b/source/texk/dviout-util/ChangeLog index cc3c537025..c543007193 100644 --- a/source/texk/dviout-util/ChangeLog +++ b/source/texk/dviout-util/ChangeLog @@ -1,3 +1,8 @@ +2023-09-17 Hironobu Yamashita + + * chkdvifont.c: Check JFM with over 256 glue/kern. + * configure.ac: Version 20230917. + 2023-08-11 TANAKA Takuji * dvispc.c, chkdvifont.c, dd.h, msvcdir.h, Makefile.am: diff --git a/source/texk/dviout-util/chkdvifont.c b/source/texk/dviout-util/chkdvifont.c index 5ac8aa01a8..acf22487c1 100644 --- a/source/texk/dviout-util/chkdvifont.c +++ b/source/texk/dviout-util/chkdvifont.c @@ -932,7 +932,7 @@ void tfm_define(FILE * fp) font.c = read_n(fp,4); /* header[0] */ font.d = read_long(fp); /* header[1] */ - if (ch == 'j') { /* check for new features in pTeX p3.8.0 / JFM 2.0 */ + if (ch == 'j') { /* check for new features in Community pTeX / JFM 2.0 */ for (i = 2; i < lh; i++) /* the rest of header */ read_long(fp); for (i = 0; i < nt; i++){ /* char_type */ @@ -943,11 +943,13 @@ void tfm_define(FILE * fp) read_long(fp); for (i = 0; i < nw+nh+nd+ni; i++) /* width, height, depth, italic */ read_long(fp); - for (i = 0; i < nl; i++){ /* glue_kern */ + for (i = 0; i < nl; i++){ /* glue_kern */ x = read_byte(fp); read_n(fp,3); if (x>0 && x<128) tfmver |= 2; /* SKIP command */ if (x>128 && x<=255) tfmver |= 4; /* rearrangement */ } + if (nk>256) tfmver |= 8; /* many kern */ + if (ne>256) tfmver |= 16; /* many glue */ } fclose(fp); @@ -959,10 +961,12 @@ void tfm_define(FILE * fp) printf("\t\"%s\" is a %cfm%s file :%3ld -> %3ld\n", font.n, ch, u, bc, ec); if (ch == 'j' && tfmver > 0) { - printf("\t\tNew features in pTeX p3.8.0 / JFM 2.0:\n"); - if (tfmver & 1) printf("\t\t+ 3-byte kanji code\n"); - if (tfmver & 2) printf("\t\t+ SKIP command in glue_kern\n"); - if (tfmver & 4) printf("\t\t+ rearrangement in glue_kern\n"); + printf("\t\tNew features in Community pTeX / JFM 2.0:\n"); + if (tfmver & 1) printf("\t\t+ 3-byte kanji code\n"); /* TL18 */ + if (tfmver & 2) printf("\t\t+ SKIP command in glue_kern\n"); /* TL18 */ + if (tfmver & 4) printf("\t\t+ rearrangement in glue_kern\n"); /* TL18 */ + if (tfmver & 8) printf("\t\t+ more than 256 different kern\n"); /* TL24 */ + if (tfmver & 16) printf("\t\t+ more than 256 different glue\n"); /* TL24 */ } } if (f_vv > 0) { diff --git a/source/texk/dviout-util/configure b/source/texk/dviout-util/configure index 13481a86e9..2be39da875 100755 --- a/source/texk/dviout-util/configure +++ b/source/texk/dviout-util/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for dviout-util (TeX Live) 20220409. +# Generated by GNU Autoconf 2.71 for dviout-util (TeX Live) 20230917. # # Report bugs to . # @@ -629,8 +629,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dviout-util (TeX Live)' PACKAGE_TARNAME='dviout-util--tex-live-' -PACKAGE_VERSION='20220409' -PACKAGE_STRING='dviout-util (TeX Live) 20220409' +PACKAGE_VERSION='20230917' +PACKAGE_STRING='dviout-util (TeX Live) 20230917' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1378,7 +1378,7 @@ if test "$ac_init_help" = "long"; then # 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 dviout-util (TeX Live) 20220409 to adapt to many kinds of systems. +\`configure' configures dviout-util (TeX Live) 20230917 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1450,7 +1450,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dviout-util (TeX Live) 20220409:";; + short | recursive ) echo "Configuration of dviout-util (TeX Live) 20230917:";; esac cat <<\_ACEOF @@ -1571,7 +1571,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dviout-util (TeX Live) configure 20220409 +dviout-util (TeX Live) configure 20230917 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2095,7 +2095,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dviout-util (TeX Live) $as_me 20220409, which was +It was created by dviout-util (TeX Live) $as_me 20230917, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -8536,7 +8536,7 @@ fi # Define the identity of the package. PACKAGE='dviout-util--tex-live-' - VERSION='20220409' + VERSION='20230917' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -14855,7 +14855,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -dviout-util (TeX Live) config.lt 20220409 +dviout-util (TeX Live) config.lt 20230917 configured by $0, generated by GNU Autoconf 2.71. Copyright (C) 2011 Free Software Foundation, Inc. @@ -16483,7 +16483,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dviout-util (TeX Live) $as_me 20220409, which was +This file was extended by dviout-util (TeX Live) $as_me 20230917, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16551,7 +16551,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -dviout-util (TeX Live) config.status 20220409 +dviout-util (TeX Live) config.status 20230917 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/source/texk/dviout-util/configure.ac b/source/texk/dviout-util/configure.ac index 7d7ecbe153..c93e539d30 100644 --- a/source/texk/dviout-util/configure.ac +++ b/source/texk/dviout-util/configure.ac @@ -1,12 +1,12 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl Copyright 2018-2022 Japanese TeX Development Community +dnl Copyright 2018-2023 Japanese TeX Development Community dnl dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -AC_INIT([dviout-util (TeX Live)], [20220409], [tex-k@tug.org]) +AC_INIT([dviout-util (TeX Live)], [20230917], [tex-k@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([dvispc.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/source/texk/dviout-util/tests/skipjfmp.cfn b/source/texk/dviout-util/tests/skipjfmp.cfn index 7751a84b80..ad728a6933 100644 --- a/source/texk/dviout-util/tests/skipjfmp.cfn +++ b/source/texk/dviout-util/tests/skipjfmp.cfn @@ -1,5 +1,5 @@ "skipjfmp" is a jfm file : 0 -> 6 - New features in pTeX p3.8.0 / JFM 2.0: + New features in Community pTeX / JFM 2.0: + SKIP command in glue_kern checksum = 00000000 design size = 10485760 2^{-20} points = 10 points diff --git a/source/texk/dviout-util/tests/uparse.cfn b/source/texk/dviout-util/tests/uparse.cfn index 36f287e607..9e79e4aaf0 100644 --- a/source/texk/dviout-util/tests/uparse.cfn +++ b/source/texk/dviout-util/tests/uparse.cfn @@ -1,5 +1,5 @@ "uparse" is a jfm file : 0 -> 6 - New features in pTeX p3.8.0 / JFM 2.0: + New features in Community pTeX / JFM 2.0: + 3-byte kanji code checksum = 00000000 design size = 10485760 2^{-20} points = 10 points diff --git a/source/texk/dviout-util/tests/upphirakakuw3-h.cfn b/source/texk/dviout-util/tests/upphirakakuw3-h.cfn index 0f9f25f981..875057dcda 100644 --- a/source/texk/dviout-util/tests/upphirakakuw3-h.cfn +++ b/source/texk/dviout-util/tests/upphirakakuw3-h.cfn @@ -1,5 +1,5 @@ "upphirakakuw3-h" is a jfm file : 0 -> 130 - New features in pTeX p3.8.0 / JFM 2.0: + New features in Community pTeX / JFM 2.0: + rearrangement in glue_kern checksum = 00000000 design size = 10485760 2^{-20} points = 10 points diff --git a/source/texk/makejvf/ChangeLog b/source/texk/makejvf/ChangeLog index 5739fd61ca..ddfc0f4904 100644 --- a/source/texk/makejvf/ChangeLog +++ b/source/texk/makejvf/ChangeLog @@ -1,3 +1,13 @@ +2023-09-18 TANAKA Takuji + + * version.h, configure.ac: Bump version to 20230917. + +2023-09-17 Hironobu Yamashita + + * tfmread.c: Support more than 256 different glue/kern. + * makejvf.test: Add new tests. + * gk256[gk].tfm, gk256.vf: New tests. + 2023-09-16 TANAKA Takuji * uniblock.c: Update references Unicode blocks Blocks-15.1.0.txt diff --git a/source/texk/makejvf/Makefile.am b/source/texk/makejvf/Makefile.am index abacf53427..2da101c000 100644 --- a/source/texk/makejvf/Makefile.am +++ b/source/texk/makejvf/Makefile.am @@ -1,7 +1,7 @@ ## Makefile.am for the TeX Live subdirectory texk/makejvfk/ ## ## Copyright (C) 2010-2015 Peter Breitenlohner -## Copyright (C) 2016-2018 Japanese TeX Development Community +## Copyright (C) 2016-2023 Japanese TeX Development Community ## You may freely use, modify and/or distribute this file. ## AM_CPPFLAGS = $(PTEXENC_INCLUDES) $(KPATHSEA_INCLUDES) @@ -21,7 +21,7 @@ LDADD = $(PTEXENC_LIBS) $(KPATHSEA_LIBS) @KPATHSEA_RULE@ @PTEXENC_RULE@ -EXTRA_DIST = COPYRIGHT COPYRIGHT.jis Changes.txt README.txt +EXTRA_DIST = COPYRIGHT COPYRIGHT.ja Changes.txt README.txt dist_check_SCRIPTS = makejvf.test @@ -41,6 +41,9 @@ EXTRA_DIST += \ tests/testnewu.vf \ tests/gkhugeok.tfm \ tests/gkhugeok.vf \ + tests/gk256g.tfm \ + tests/gk256k.tfm \ + tests/gk256.vf \ tests/skipjfmp.tfm \ tests/skipjfmp.vf \ tests/skipjfmp_omit.vf diff --git a/source/texk/makejvf/Makefile.in b/source/texk/makejvf/Makefile.in index e068d6941c..39efa58616 100644 --- a/source/texk/makejvf/Makefile.in +++ b/source/texk/makejvf/Makefile.in @@ -561,10 +561,11 @@ makejvf_SOURCES = \ uniblock.c uniblock.h usrtable.c usrtable.h version.h write.c LDADD = $(PTEXENC_LIBS) $(KPATHSEA_LIBS) -EXTRA_DIST = COPYRIGHT COPYRIGHT.jis Changes.txt README.txt \ +EXTRA_DIST = COPYRIGHT COPYRIGHT.ja Changes.txt README.txt \ tests/min10.tfm tests/min10.vf tests/rml.tfm tests/rmlv.tfm \ tests/tmin10.tfm tests/tmin10.vf tests/testnewu.tfm \ tests/testnewu.vf tests/gkhugeok.tfm tests/gkhugeok.vf \ + tests/gk256g.tfm tests/gk256k.tfm tests/gk256.vf \ tests/skipjfmp.tfm tests/skipjfmp.vf tests/skipjfmp_omit.vf dist_check_SCRIPTS = makejvf.test TESTS = makejvf.test diff --git a/source/texk/makejvf/configure b/source/texk/makejvf/configure index 4a92d4ac05..f4886af02e 100755 --- a/source/texk/makejvf/configure +++ b/source/texk/makejvf/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for makejvf (TeX Live) 20230916. +# Generated by GNU Autoconf 2.71 for makejvf (TeX Live) 20230917. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -626,8 +626,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='makejvf (TeX Live)' PACKAGE_TARNAME='makejvf--tex-live-' -PACKAGE_VERSION='20230916' -PACKAGE_STRING='makejvf (TeX Live) 20230916' +PACKAGE_VERSION='20230917' +PACKAGE_STRING='makejvf (TeX Live) 20230917' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1375,7 +1375,7 @@ if test "$ac_init_help" = "long"; then # 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 makejvf (TeX Live) 20230916 to adapt to many kinds of systems. +\`configure' configures makejvf (TeX Live) 20230917 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1447,7 +1447,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of makejvf (TeX Live) 20230916:";; + short | recursive ) echo "Configuration of makejvf (TeX Live) 20230917:";; esac cat <<\_ACEOF @@ -1568,7 +1568,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -makejvf (TeX Live) configure 20230916 +makejvf (TeX Live) configure 20230917 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2092,7 +2092,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by makejvf (TeX Live) $as_me 20230916, which was +It was created by makejvf (TeX Live) $as_me 20230917, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -8533,7 +8533,7 @@ fi # Define the identity of the package. PACKAGE='makejvf--tex-live-' - VERSION='20230916' + VERSION='20230917' # Some tools Automake needs. @@ -14850,7 +14850,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -makejvf (TeX Live) config.lt 20230916 +makejvf (TeX Live) config.lt 20230917 configured by $0, generated by GNU Autoconf 2.71. Copyright (C) 2011 Free Software Foundation, Inc. @@ -16478,7 +16478,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by makejvf (TeX Live) $as_me 20230916, which was +This file was extended by makejvf (TeX Live) $as_me 20230917, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16546,7 +16546,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -makejvf (TeX Live) config.status 20230916 +makejvf (TeX Live) config.status 20230917 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/source/texk/makejvf/configure.ac b/source/texk/makejvf/configure.ac index 37b12c38a1..c7cc93db3c 100644 --- a/source/texk/makejvf/configure.ac +++ b/source/texk/makejvf/configure.ac @@ -6,7 +6,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -AC_INIT([makejvf (TeX Live)], [20230916]) +AC_INIT([makejvf (TeX Live)], [20230917]) AC_PREREQ([2.63]) AC_CONFIG_SRCDIR([main.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/source/texk/makejvf/makejvf.test b/source/texk/makejvf/makejvf.test index e2bb6ab948..66fdcb9a8e 100755 --- a/source/texk/makejvf/makejvf.test +++ b/source/texk/makejvf/makejvf.test @@ -1,6 +1,6 @@ #! /bin/sh -vx # $Id$ -# Copyright 2017-2018 Karl Berry +# Copyright 2017-2023 Karl Berry # Copyright 2010-2013 Peter Breitenlohner # You may freely use, modify and/or distribute this file. @@ -25,13 +25,21 @@ $_makejvf -e -i -u custom -t $srcdir/tests/uni10.cnf $srcdir/tests/gkhugeok urml cmp $srcdir/tests/gkhugeok.vf gkhugeok.vf && \ cmp $srcdir/tests/rml.tfm urml.tfm || exit 4 +$_makejvf -e -i -u custom -t $srcdir/tests/uni10.cnf $srcdir/tests/gk256g urml && \ + cmp $srcdir/tests/gk256.vf gk256g.vf && \ + cmp $srcdir/tests/rml.tfm urml.tfm || exit 5 + +$_makejvf -e -i -u custom -t $srcdir/tests/uni10.cnf $srcdir/tests/gk256k urml && \ + cmp $srcdir/tests/gk256.vf gk256k.vf && \ + cmp $srcdir/tests/rml.tfm urml.tfm || exit 6 + $_makejvf -e $srcdir/tests/skipjfmp rml && \ cmp $srcdir/tests/skipjfmp.vf skipjfmp.vf && \ - cmp $srcdir/tests/rml.tfm rml.tfm || exit 5 + cmp $srcdir/tests/rml.tfm rml.tfm || exit 7 $_makejvf -e -O $srcdir/tests/skipjfmp rml && \ cmp $srcdir/tests/skipjfmp_omit.vf skipjfmp.vf && \ - cmp $srcdir/tests/rml.tfm rml.tfm || exit 6 + cmp $srcdir/tests/rml.tfm rml.tfm || exit 8 TEXMFCNF=$srcdir/../kpathsea \ $_makejvf -k0 -a abc && exit 100 diff --git a/source/texk/makejvf/tests/gk256.vf b/source/texk/makejvf/tests/gk256.vf new file mode 100644 index 0000000000..37ed4cfbd7 Binary files /dev/null and b/source/texk/makejvf/tests/gk256.vf differ diff --git a/source/texk/makejvf/tests/gk256g.tfm b/source/texk/makejvf/tests/gk256g.tfm new file mode 100644 index 0000000000..fb1051b7a9 Binary files /dev/null and b/source/texk/makejvf/tests/gk256g.tfm differ diff --git a/source/texk/makejvf/tests/gk256k.tfm b/source/texk/makejvf/tests/gk256k.tfm new file mode 100644 index 0000000000..9a40b0f66e Binary files /dev/null and b/source/texk/makejvf/tests/gk256k.tfm differ diff --git a/source/texk/makejvf/tfmread.c b/source/texk/makejvf/tfmread.c index 5b4805d7e4..23f1301872 100644 --- a/source/texk/makejvf/tfmread.c +++ b/source/texk/makejvf/tfmread.c @@ -38,11 +38,11 @@ int jfmread(int kcode) if (glue_kern[(gk_ind+i)*4] > 128) break; /* ... skip loop */ if (glue_kern[(gk_ind+i)*4+1] == ctype) { if (glue_kern[(gk_ind+i)*4+2] >= 128) { - gk2_ind = glue_kern[(gk_ind+i)*4+3]; + gk2_ind = (glue_kern[(gk_ind+i)*4+2]-128)*256+glue_kern[(gk_ind+i)*4+3]; ll = kern[gk2_ind]; } else { - gk2_ind = glue_kern[(gk_ind+i)*4+3]; + gk2_ind = glue_kern[(gk_ind+i)*4+2]*256+glue_kern[(gk_ind+i)*4+3]; ll = glue[3*gk2_ind]; } break; @@ -64,11 +64,11 @@ int jfmread(int kcode) if (glue_kern[(gk_ind+i)*4] > 128) break; /* ... skip loop */ if (glue_kern[(gk_ind+i)*4+1] == 0) { if (glue_kern[(gk_ind+i)*4+2] >= 128) { - gk2_ind = glue_kern[(gk_ind+i)*4+3]; + gk2_ind = (glue_kern[(gk_ind+i)*4+2]-128)*256+glue_kern[(gk_ind+i)*4+3]; rr = kern[gk2_ind]; } else { - gk2_ind = glue_kern[(gk_ind+i)*4+3]; + gk2_ind = glue_kern[(gk_ind+i)*4+2]*256+glue_kern[(gk_ind+i)*4+3]; rr = glue[3*gk2_ind]; } break; diff --git a/source/texk/makejvf/version.h b/source/texk/makejvf/version.h index c236343513..17c9b92ae2 100644 --- a/source/texk/makejvf/version.h +++ b/source/texk/makejvf/version.h @@ -1,2 +1,2 @@ -#define VERSION "20230916" +#define VERSION "20230917" #define BUG_ADDRESS "issue@texjp.org" diff --git a/source/texk/web2c/Makefile.in b/source/texk/web2c/Makefile.in index bd0b975200..a417f4de47 100644 --- a/source/texk/web2c/Makefile.in +++ b/source/texk/web2c/Makefile.in @@ -3247,7 +3247,7 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \ eptexdir/tests/pdfprimitive-eptex.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.jis \ + uptexdir/uptftopl.ch uptexdir/COPYRIGHT uptexdir/COPYRIGHT.ja \ uptexdir/ChangeLog $(uptex_tests) $(upweb_tests) \ tests/enc-u.bbl tests/enc-eu.bbl tests/enc-su.bbl \ tests/enc-uu.bbl uptexdir/tests/uptex3.tex \ @@ -3259,6 +3259,7 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \ uptexdir/tests/testnewu.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 \ $(euptex_web_srcs) $(euptex_ch_srcs) euptexdir/euptex.defines \ euptexdir/COPYRIGHT euptexdir/COPYRIGHT.jis \ @@ -3592,40 +3593,40 @@ DISTCLEANFILES = CXXLD.sh tangle.c tangle.h tangle.p tangle-web2c \ uptests/xcmr10.tfm uptests/xcmr10.pl uptests/xsample*.typ \ uptests/x*min10.* uptests/xchcode*.* uptests/xtestnewu.* \ uptests/xuparse.* uptests/yuparse.* uptests/ygkhuge*.* \ - uptests/xskipjfmp.* uptrip.diffs $(nodist_euptex_SOURCES) \ - euptex.web euptex.ch euptex-web2c euptex.p euptex.pool \ - euptex-tangle euptrip.diffs pdfprimitive-euptex.* \ - $(nodist_hitex_SOURCES) $(nodist_hishrink_SOURCES) \ - $(nodist_histretch_SOURCES) hiformat-tangle hitex-tangle \ - hello.log rule.log $(nodist_pdftex_SOURCES) pdftex-final.ch \ - pdftex-web2c pdftex.p pdftex.pool pdftex-tangle pwprob.log \ - pwprob.tex pdfimage.fmt pdfimage.log pdfimage.pdf expanded.log \ - cnfline.log partoken-ok.log partoken-xfail.log pdftests/fn*.* \ - postV3.afm postV7.afm test-13.pdf test-13.xref test-15.pdf \ - test-15.xref $(nodist_libluatex_sources) luaimage.* \ - luajitimage.* $(nodist_xetex_SOURCES) xetex.web xetex-final.ch \ - xetex-web2c xetex.p xetex.pool xetex-tangle bug73.fmt \ - bug73.log bug73.out bug73.tex filedump.log filedump.out \ - filedump.tex xetests/fn*.* $(omegaware_programs:=.c) \ - $(omegaware_programs:=.h) $(omegaware_programs:=.p) \ - $(omegaware_programs:=-web2c) ofm2opl.web opl2ofm.web \ - ovf2ovp.web ovp2ovf.web omegaware/bad*.* \ - omegaware/tests/charwdr.* omegaware/tests/charwdv.* \ - omegaware/tests/xcheck* omegaware/tests/xlevel1.* \ - omegaware/tests/xlig*.* ofont*vf omegaware/tests/xpagenum.* \ - omegaware/tests/xofont* omegaware/tests/Cherokee.tfm \ - omegaware/tests/OCherokee.ofm omegaware/tests/OCherokee.opl \ - omegaware/tests/OCherokee.ovf omegaware/tests/xCherokee.* \ - omegaware/tests/xOCherokee.* ocftest.* omegaware/tests/xinbmp* \ - omegaware/tests/xoverbmp* omegaware/tests/xrealnum.* \ - omegaware/tests/xrepeated.* omegaware/tests/sample*.ofm \ - omegaware/tests/sample*.ovf omegaware/tests/sample1-h.opl \ - omegaware/tests/xsample*.out omegaware/tests/shortend.* \ - omegaware/tests/specialhex.ofm omegaware/tests/specialhex.opl \ - omegaware/tests/specialhex.ovf omegaware/tests/xspecialhex.* \ - omegaware/tests/yrepeat* omegaware/tests/*yarabic* \ - $(nodist_aleph_SOURCES) aleph.web aleph.ch aleph-web2c aleph.p \ - aleph.pool aleph-tangle + uptests/ygk256*.* uptests/xskipjfmp.* uptrip.diffs \ + $(nodist_euptex_SOURCES) euptex.web euptex.ch euptex-web2c \ + euptex.p euptex.pool euptex-tangle euptrip.diffs \ + pdfprimitive-euptex.* $(nodist_hitex_SOURCES) \ + $(nodist_hishrink_SOURCES) $(nodist_histretch_SOURCES) \ + hiformat-tangle hitex-tangle hello.log rule.log \ + $(nodist_pdftex_SOURCES) pdftex-final.ch pdftex-web2c pdftex.p \ + pdftex.pool pdftex-tangle pwprob.log pwprob.tex pdfimage.fmt \ + pdfimage.log pdfimage.pdf expanded.log cnfline.log \ + partoken-ok.log partoken-xfail.log pdftests/fn*.* postV3.afm \ + postV7.afm test-13.pdf test-13.xref test-15.pdf test-15.xref \ + $(nodist_libluatex_sources) luaimage.* luajitimage.* \ + $(nodist_xetex_SOURCES) xetex.web xetex-final.ch xetex-web2c \ + xetex.p xetex.pool xetex-tangle bug73.fmt bug73.log bug73.out \ + bug73.tex filedump.log filedump.out filedump.tex xetests/fn*.* \ + $(omegaware_programs:=.c) $(omegaware_programs:=.h) \ + $(omegaware_programs:=.p) $(omegaware_programs:=-web2c) \ + ofm2opl.web opl2ofm.web ovf2ovp.web ovp2ovf.web \ + omegaware/bad*.* omegaware/tests/charwdr.* \ + omegaware/tests/charwdv.* omegaware/tests/xcheck* \ + omegaware/tests/xlevel1.* omegaware/tests/xlig*.* ofont*vf \ + omegaware/tests/xpagenum.* omegaware/tests/xofont* \ + omegaware/tests/Cherokee.tfm omegaware/tests/OCherokee.ofm \ + omegaware/tests/OCherokee.opl omegaware/tests/OCherokee.ovf \ + omegaware/tests/xCherokee.* omegaware/tests/xOCherokee.* \ + ocftest.* omegaware/tests/xinbmp* omegaware/tests/xoverbmp* \ + omegaware/tests/xrealnum.* omegaware/tests/xrepeated.* \ + omegaware/tests/sample*.ofm omegaware/tests/sample*.ovf \ + omegaware/tests/sample1-h.opl omegaware/tests/xsample*.out \ + omegaware/tests/shortend.* omegaware/tests/specialhex.ofm \ + omegaware/tests/specialhex.opl omegaware/tests/specialhex.ovf \ + omegaware/tests/xspecialhex.* omegaware/tests/yrepeat* \ + omegaware/tests/*yarabic* $(nodist_aleph_SOURCES) aleph.web \ + aleph.ch aleph-web2c aleph.p aleph.pool aleph-tangle CLEANFILES = $(EXTRA_PROGRAMS) $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) TRIPTRAP_CLEAN = $(am__append_8) $(am__append_18) $(am__append_27) \ $(am__append_36) $(am__append_44) $(am__append_60) \ @@ -4407,7 +4408,11 @@ ptex_ch_srcs = \ # pTeX Tests # -ptex_tests = ptexdir/ptriptest.test ptexdir/pver.test ptexdir/wcfname.test +ptex_tests = \ + ptexdir/ptriptest.test \ + ptexdir/pver.test \ + ptexdir/wcfname.test + eptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) -I$(srcdir)/libmd5 \ $(ZLIB_INCLUDES) $(am__append_138) @@ -4452,7 +4457,12 @@ eptex_ch_srcs = \ # e-pTeX Tests # -eptex_tests = eptexdir/eptriptest.test eptexdir/pdfprimitive.test eptexdir/epver.test eptexdir/wcfname.test +eptex_tests = \ + eptexdir/eptriptest.test \ + eptexdir/pdfprimitive.test \ + eptexdir/epver.test \ + eptexdir/wcfname.test + uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) $(ZLIB_INCLUDES) uptex_ldadd = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ZLIB_LIBS) uptex_dependencies = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(ZLIB_DEPEND) $(default_dependencies) @@ -4508,15 +4518,21 @@ uptftopl_LDADD = $(uptex_ldadd) uptftopl_DEPENDENCIES = $(uptex_dependencies) # upTeX Tests -uptex_tests = uptexdir/uptriptest.test uptexdir/ptriptest.test uptexdir/upver.test uptexdir/upkcat.test uptexdir/wcfname.test uptexdir/wcfname0.test +uptex_tests = \ + uptexdir/uptriptest.test uptexdir/ptriptest.test \ + uptexdir/upver.test \ + uptexdir/upkcat.test \ + uptexdir/wcfname.test uptexdir/wcfname0.test + # uppPLtoTF/upTFtoPL upweb_tests = uptexdir/upbibtex.test uptexdir/updvitype.test \ uptexdir/uppltotf.test uptexdir/uptftopl.test \ uptexdir/upbibtex-openout-test.pl \ uptexdir/upbibtex-longline-test.pl uptexdir/upbibtex-mem.test \ - uptexdir/nissya.test uptexdir/sample.test \ + uptexdir/nissya.test uptexdir/unibib.test uptexdir/sample.test \ uptexdir/yokotate.test uptexdir/skipjfmp.test \ - uptexdir/newjfm.test uptexdir/uparse.test uptexdir/gkhuge.test + uptexdir/newjfm.test uptexdir/uparse.test uptexdir/gkhuge.test \ + uptexdir/gk256.test euptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) \ -I$(srcdir)/libmd5 $(ZLIB_INCLUDES) $(am__append_142) @@ -4566,7 +4582,13 @@ euptex_ch_srcs = \ # e-upTeX Tests # -euptex_tests = euptexdir/euptriptest.test euptexdir/eptriptest.test euptexdir/pdfprimitive.test euptexdir/eupver.test euptexdir/wcfname.test euptexdir/wcfname0.test +euptex_tests = \ + euptexdir/euptriptest.test euptexdir/eptriptest.test \ + euptexdir/pdfprimitive.test \ + euptexdir/eupver.test \ + euptexdir/upkcat.test \ + euptexdir/wcfname.test euptexdir/wcfname0.test + # At the moment, these are the only man pages handled in the # conglomerated web2c/Makefile[.am]. (All the others are in man/.) @@ -22067,17 +22089,21 @@ uptftopl.p: tangle$(EXEEXT) uptftopl.web uptexdir/uptftopl.ch $(up_tangle) uptftopl uptftopl uptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch $(tie_m) tftopl.web tftopl.ch -uptexdir/uptriptest.log uptexdir/ptriptest.log: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) -uptexdir/upver.log uptexdir/upkcat.log uptexdir/wcfname.log uptexdir/wcfname0.log: uptex$(EXEEXT) +uptexdir/uptriptest.log uptexdir/ptriptest.log: \ + uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) +uptexdir/upver.log uptexdir/upkcat.log \ + uptexdir/wcfname.log uptexdir/wcfname0.log: uptex$(EXEEXT) uptexdir/upbibtex.log: upbibtex$(EXEEXT) uptexdir/updvitype.log: updvitype$(EXEEXT) uptexdir/uppltotf.log: uppltotf$(EXEEXT) uptexdir/uptftopl.log: uptftopl$(EXEEXT) uptexdir/upbibtex-openout-test.log uptexdir/upbibtex-longline-test.log \ - uptexdir/upbibtex-mem.log uptexdir/nissya.log: upbibtex$(EXEEXT) + uptexdir/upbibtex-mem.log uptexdir/nissya.log \ + uptexdir/unibib.log: upbibtex$(EXEEXT) uptexdir/sample.log: updvitype$(EXEEXT) uptexdir/yokotate.log uptexdir/skipjfmp.log \ - uptexdir/newjfm.log uptexdir/uparse.log uptexdir/gkhuge.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT) + uptexdir/newjfm.log uptexdir/uparse.log \ + uptexdir/gkhuge.log uptexdir/gk256.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT) uptrip.diffs: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) $(triptrap_diffs) $@ .PHONY: uptrip-clean @@ -22108,9 +22134,11 @@ euptex.web: tie$(EXEEXT) $(euptex_web_srcs) # Generate euptex.ch euptex.ch: tie$(EXEEXT) euptex.web $(euptex_ch_srcs) $(tie_c) euptex.web $(euptex_ch_srcs) -euptexdir/euptriptest.log euptexdir/eptriptest.log: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) +euptexdir/euptriptest.log euptexdir/eptriptest.log: \ + euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) euptexdir/pdfprimitive.log: euptex$(EXEEXT) -euptexdir/eupver.log euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT) +euptexdir/eupver.log euptexdir/upkcat.log \ + euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT) euptrip.diffs: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) $(triptrap_diffs) $@ .PHONY: euptrip-clean diff --git a/source/texk/web2c/ctangleboot.cin b/source/texk/web2c/ctangleboot.cin index bb015ef259..58b9bdf5a1 100644 --- a/source/texk/web2c/ctangleboot.cin +++ b/source/texk/web2c/ctangleboot.cin @@ -665,7 +665,7 @@ a-= 024000; if((a+name_dir)->equiv!=(void*)text_info)push_level(a+name_dir); else if(a!=0){ #line 85 "cwebdir/ctang-w2c.ch" -fputs(_("\n! Not present: <"),stdout); +printf("%s",_("\n! Not present: <")); #line 405 "cwebdir/ctangle.w" print_section_name(a+name_dir);err_print(">"); @@ -727,7 +727,7 @@ output_defs(); if(text_info->text_link==macro&&cur_out_file==end_output_files){ #line 97 "cwebdir/ctang-w2c.ch" -fputs(_("\n! No program text was specified."),stdout);mark_harmless(); +printf("%s",_("\n! No program text was specified."));mark_harmless(); #line 519 "cwebdir/ctangle.w" } @@ -1007,7 +1007,7 @@ strcpy(check_file_name,""); if(show_happiness){ if(show_progress)new_line(); #line 111 "cwebdir/ctang-w2c.ch" -fputs(_("Done."),stdout); +printf("%s",_("Done.")); #line 537 "cwebdir/ctangle.w" } } @@ -1343,7 +1343,7 @@ if(++id_loc<=section_text_end)*id_loc= (char)c; } if(id_loc>=section_text_end){ #line 247 "cwebdir/ctang-w2c.ch" -fputs(_("\n! String too long: "),stdout); +printf("%s",_("\n! String too long: ")); #line 1022 "cwebdir/ctangle.w" term_write(section_text+1,25); @@ -1440,7 +1440,7 @@ c= (eight_bits)' ';if(*(k-1)==' ')k--; } if(k>=section_text_end){ #line 283 "cwebdir/ctang-w2c.ch" -fputs(_("\n! Section name too long: "),stdout); +printf("%s",_("\n! Section name too long: ")); #line 1117 "cwebdir/ctangle.w" term_write(section_text+1,25); diff --git a/source/texk/web2c/cwebboot.cin b/source/texk/web2c/cwebboot.cin index 069e867d7c..cddf82e87b 100644 --- a/source/texk/web2c/cwebboot.cin +++ b/source/texk/web2c/cwebboot.cin @@ -389,7 +389,7 @@ char check_file_name[max_file_name_length]; boolean flags[128]; /*:73*//*83:*/ -#line 1266 "cwebdir/common.w" +#line 1268 "cwebdir/common.w" FILE*C_file; FILE*tex_file; @@ -398,7 +398,7 @@ FILE*scn_file; #line 582 "cwebdir/comm-w2c.ch" FILE*active_file; FILE*check_file; -#line 1272 "cwebdir/common.w" +#line 1274 "cwebdir/common.w" #line 599 "cwebdir/comm-w2c.ch" /*:83*//*86:*/ @@ -612,7 +612,7 @@ fatal(_("! Cannot open output file "),check_file_name); else if((tex_file= fopen(tex_file_name,"wb"))==NULL) fatal(_("! Cannot open output file "),tex_file_name); } -#line 1284 "cwebdir/common.w" +#line 1286 "cwebdir/common.w" #line 617 "cwebdir/comm-w2c.ch" /*:84*/ @@ -1190,12 +1190,12 @@ p= (c==less?p->llink:p->rlink); }else{ if(r!=NULL){ #line 333 "cwebdir/comm-w2c.ch" -fputs(_("\n! Ambiguous prefix: matches <"),stdout); +printf("%s",_("\n! Ambiguous prefix: matches <")); #line 887 "cwebdir/common.w" print_prefix_name(p); #line 339 "cwebdir/comm-w2c.ch" -fputs(_(">\n and <"),stdout); +printf("%s",_(">\n and <")); #line 890 "cwebdir/common.w" print_prefix_name(r); err_print(">"); @@ -1229,7 +1229,7 @@ switch(section_name_cmp(&first,name_len,r)){ case prefix: if(!ispref){ #line 345 "cwebdir/comm-w2c.ch" -fputs(_("\n! New name is a prefix of <"),stdout); +printf("%s",_("\n! New name is a prefix of <")); #line 916 "cwebdir/common.w" print_section_name(r); @@ -1243,7 +1243,7 @@ extend_section_name(r,first,last+1,ispref); break; case bad_extension: #line 351 "cwebdir/comm-w2c.ch" -fputs(_("\n! New name extends <"),stdout); +printf("%s",_("\n! New name extends <")); #line 928 "cwebdir/common.w" print_section_name(r); @@ -1251,12 +1251,12 @@ err_print(">"); break; default: #line 357 "cwebdir/comm-w2c.ch" -fputs(_("\n! Section name incompatible with <"),stdout); +printf("%s",_("\n! Section name incompatible with <")); #line 934 "cwebdir/common.w" print_prefix_name(r); #line 363 "cwebdir/comm-w2c.ch" -fputs(_(">,\n which abbreviates <"),stdout); +printf("%s",_(">,\n which abbreviates <")); #line 937 "cwebdir/common.w" print_section_name(r); err_print(">"); @@ -1309,7 +1309,7 @@ void err_print( const char*s) { -*s=='!'?printf("\n%s",s):printf("%s",s); +printf(*s=='!'?"\n%s":"%s",s); if(web_file_open)/*67:*/ #line 1031 "cwebdir/common.w" @@ -1343,7 +1343,7 @@ update_terminal();mark_error(); #line 1064 "cwebdir/common.w" int wrap_up(void){ -if(show_progress)new_line(); +if(show_progress||show_happiness||history!=spotless)new_line(); if(show_stats) print_stats(); #line 401 "cwebdir/comm-w2c.ch" @@ -1394,7 +1394,7 @@ void fatal( const char*s,const char*t) { -if(*s)err_print(s); +if(*s)printf("%s",s); err_print(t); history= fatal_message;exit(wrap_up()); } @@ -1438,7 +1438,7 @@ change_file_name[max_file_name_length-2]= '\0'; #line 1167 "cwebdir/common.w" while(--argc> 0){ if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/ -#line 1244 "cwebdir/common.w" +#line 1246 "cwebdir/common.w" #line 525 "cwebdir/comm-w2c.ch" { @@ -1483,7 +1483,7 @@ if(sscanf(++dot_pos,"%u",&kpathsea_debug)!=1)/*81:*/ cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1259 "cwebdir/common.w" +#line 1261 "cwebdir/common.w" #line 576 "cwebdir/comm-w2c.ch" /*:81*/ @@ -1498,7 +1498,7 @@ default:flags[(eight_bits)*dot_pos]= flag_change;continue; break; } } -#line 1247 "cwebdir/common.w" +#line 1249 "cwebdir/common.w" #line 568 "cwebdir/comm-w2c.ch" /*:80*/ @@ -1522,7 +1522,7 @@ if(s-*argv> max_file_name_length-5) /*82:*/ #line 576 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1261 "cwebdir/common.w" +#line 1263 "cwebdir/common.w" /*:82*/ @@ -1536,8 +1536,10 @@ strcpy(web_file_name,*argv); } #line 1205 "cwebdir/common.w" sprintf(tex_file_name,"%s.tex",name_pos); +if(make_xrefs){ sprintf(idx_file_name,"%s.idx",name_pos); sprintf(scn_file_name,"%s.scn",name_pos); +} sprintf(C_file_name,"%s.c",name_pos); found_web= true; } @@ -1546,7 +1548,7 @@ found_web= true; #line 1176 "cwebdir/common.w" else if(!found_change)/*78:*/ -#line 1212 "cwebdir/common.w" +#line 1214 "cwebdir/common.w" { if(strcmp(*argv,"-")!=0){ @@ -1554,11 +1556,11 @@ if(s-*argv> max_file_name_length-4) /*82:*/ #line 576 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1261 "cwebdir/common.w" +#line 1263 "cwebdir/common.w" /*:82*/ -#line 1216 "cwebdir/common.w" +#line 1218 "cwebdir/common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1571,18 +1573,18 @@ found_change= true; #line 1177 "cwebdir/common.w" else if(!found_out)/*79:*/ -#line 1224 "cwebdir/common.w" +#line 1226 "cwebdir/common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ #line 576 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1261 "cwebdir/common.w" +#line 1263 "cwebdir/common.w" /*:82*/ -#line 1227 "cwebdir/common.w" +#line 1229 "cwebdir/common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1607,7 +1609,7 @@ else/*81:*/ cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1259 "cwebdir/common.w" +#line 1261 "cwebdir/common.w" #line 576 "cwebdir/comm-w2c.ch" /*:81*/ @@ -1620,7 +1622,7 @@ if(!found_web)/*81:*/ cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1259 "cwebdir/common.w" +#line 1261 "cwebdir/common.w" #line 576 "cwebdir/comm-w2c.ch" /*:81*/ diff --git a/source/texk/web2c/cwebdir/ChangeLog b/source/texk/web2c/cwebdir/ChangeLog index ed2250885f..6cae5fd47d 100644 --- a/source/texk/web2c/cwebdir/ChangeLog +++ b/source/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,18 @@ +2023-09-23 Andreas Scherer + + * ctwill-mini.ch, + * cweave.w: Copy structures via pointers. + +2023-09-22 Andreas Scherer + + * ctang-w2c.ch, + * ctangle.c, + * ctangle.w: Reuse code for secondary output. + +2023-09-22 Andreas Scherer + + * cwebacromac.tex: Factor out PDF/HINT macros. + 2023-09-03 TANAKA Takuji * {ctwill,cweave}.test: Make easier to test on Windows. diff --git a/source/texk/web2c/cwebdir/Makefile b/source/texk/web2c/cwebdir/Makefile index c547ef9154..ed85fc70f2 100644 --- a/source/texk/web2c/cwebdir/Makefile +++ b/source/texk/web2c/cwebdir/Makefile @@ -77,13 +77,15 @@ CTANGLE = ./ctangle SOURCES = cweave.w common.w ctangle.w ALL = common.w ctangle.w cweave.w prod.w \ Makefile README common.c common.h ctangle.c \ - cwebman.tex cwebmac.tex comm-vms.ch ctang-vms.ch \ - cweav-vms.ch comm-man.ch ctang-man.ch cweav-man.ch \ - comm-pc.ch ctang-pc.ch cweav-pc.ch comm-amiga.ch \ + cwebman.tex cwebacromac.tex cwebmac.tex \ + cweb.1 cweb.el c++lib.w iso_types.w \ + comm-man.ch ctang-man.ch cweav-man.ch \ comm-bs.ch ctang-bs.ch cweav-bs.ch makefile.bs \ + comm-pc.ch ctang-pc.ch cweav-pc.ch comm-amiga.ch \ comm-ql.ch ctang-ql.ch cweav-ql.ch readme.ql \ + comm-vms.ch ctang-vms.ch cweav-vms.ch \ comm-w32.ch ctang-w32.ch cweav-w32.ch \ - comm-os2.ch comm-mac.ch cweb.1 cweb.el c++lib.w iso_types.w + comm-os2.ch comm-mac.ch .SUFFIXES: .dvi .tex .w .pdf @@ -178,6 +180,8 @@ install: all $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT) chmod 644 $(MANDIR)/cweb.$(MANEXT) - mkdir $(MACROSDIR) + $(CP) cwebacromac.tex $(MACROSDIR) + chmod 644 $(MACROSDIR)/cwebacromac.tex $(CP) cwebmac.tex $(MACROSDIR) chmod 644 $(MACROSDIR)/cwebmac.tex - mkdir $(EMACSDIR) diff --git a/source/texk/web2c/cwebdir/README b/source/texk/web2c/cwebdir/README index e2caca4133..086f6af308 100644 --- a/source/texk/web2c/cwebdir/README +++ b/source/texk/web2c/cwebdir/README @@ -59,6 +59,7 @@ cweave-w32.ch cweave.w cweb.1 cweb.el +cwebacromac.tex cwebmac.tex cwebman.tex examples/ diff --git a/source/texk/web2c/cwebdir/comm-ql.ch b/source/texk/web2c/cwebdir/comm-ql.ch index 592c7e04a1..7d6fb05d39 100644 --- a/source/texk/web2c/cwebdir/comm-ql.ch +++ b/source/texk/web2c/cwebdir/comm-ql.ch @@ -152,8 +152,10 @@ the routine as if it would work. } sprintf(alt_web_file_name,"%s.web",*argv); sprintf(tex_file_name,"%s.tex",name_pos); /* strip off directory name */ - sprintf(idx_file_name,"%s.idx",name_pos); - sprintf(scn_file_name,"%s.scn",name_pos); + if (make_xrefs) { /* indexes will be generated */ + sprintf(idx_file_name,"%s.idx",name_pos); + sprintf(scn_file_name,"%s.scn",name_pos); + } sprintf(C_file_name,"%s.c",name_pos); found_web=true; } @@ -170,8 +172,10 @@ the routine as if it would work. } sprintf(alt_web_file_name,"%s_web",*argv); sprintf(tex_file_name,"%s_tex",name_pos); /* strip off directory name */ - sprintf(idx_file_name,"%s_idx",name_pos); - sprintf(scn_file_name,"%s_scn",name_pos); + if (make_xrefs) { /* indexes will be generated */ + sprintf(idx_file_name,"%s_idx",name_pos); + sprintf(scn_file_name,"%s_scn",name_pos); + } sprintf(C_file_name,"%s_c",name_pos); found_web=true; } diff --git a/source/texk/web2c/cwebdir/comm-w2c.ch b/source/texk/web2c/cwebdir/comm-w2c.ch index 906003989f..d37c02d23c 100644 --- a/source/texk/web2c/cwebdir/comm-w2c.ch +++ b/source/texk/web2c/cwebdir/comm-w2c.ch @@ -328,39 +328,39 @@ else if (strlen(found_filename) < max_file_name_length) { @z @x - fputs("\n! Ambiguous prefix: matches <",stdout); + printf("%s","\n! Ambiguous prefix: matches <"); @y - fputs(_("\n! Ambiguous prefix: matches <"),stdout); + printf("%s",_("\n! Ambiguous prefix: matches <")); @z @x - fputs(">\n and <",stdout); + printf("%s",">\n and <"); @y - fputs(_(">\n and <"),stdout); + printf("%s",_(">\n and <")); @z @x - fputs("\n! New name is a prefix of <",stdout); + printf("%s","\n! New name is a prefix of <"); @y - fputs(_("\n! New name is a prefix of <"),stdout); + printf("%s",_("\n! New name is a prefix of <")); @z @x - fputs("\n! New name extends <",stdout); + printf("%s","\n! New name extends <"); @y - fputs(_("\n! New name extends <"),stdout); + printf("%s",_("\n! New name extends <")); @z @x - fputs("\n! Section name incompatible with <",stdout); + printf("%s","\n! Section name incompatible with <"); @y - fputs(_("\n! Section name incompatible with <"),stdout); + printf("%s",_("\n! Section name incompatible with <")); @z @x - fputs(">,\n which abbreviates <",stdout); + printf("%s",">,\n which abbreviates <"); @y - fputs(_(">,\n which abbreviates <"),stdout); + printf("%s",_(">,\n which abbreviates <")); @z @x diff --git a/source/texk/web2c/cwebdir/comm-w2c.h b/source/texk/web2c/cwebdir/comm-w2c.h index 2a8eba1510..eb465ba7e0 100644 --- a/source/texk/web2c/cwebdir/comm-w2c.h +++ b/source/texk/web2c/cwebdir/comm-w2c.h @@ -41,7 +41,7 @@ extern int phase; /* which phase are we in? */ @ The procedure that gets everything rolling: @= -extern void common_init(void);@/ +extern void common_init(void); @ You may have noticed that almost all \.{"strings"} in the \.{CWEB} sources are placed in the context of the `|_|'~macro. This is just a shortcut for the diff --git a/source/texk/web2c/cwebdir/common.c b/source/texk/web2c/cwebdir/common.c index ccedc5e914..f5970b5c19 100644 --- a/source/texk/web2c/cwebdir/common.c +++ b/source/texk/web2c/cwebdir/common.c @@ -323,7 +323,7 @@ char scn_file_name[max_file_name_length]; boolean flags[128]; /*:73*//*83:*/ -#line 1266 "common.w" +#line 1268 "common.w" FILE*C_file; FILE*tex_file; @@ -432,7 +432,7 @@ show_banner= show_happiness= show_progress= make_xrefs= true; #line 100 "common.w" /*84:*/ -#line 1273 "common.w" +#line 1275 "common.w" scan_args(); if(program==ctangle){ @@ -979,10 +979,10 @@ par= p; p= (c==less?p->llink:p->rlink); }else{ if(r!=NULL){ -fputs("\n! Ambiguous prefix: matches <",stdout); +printf("%s","\n! Ambiguous prefix: matches <"); print_prefix_name(p); -fputs(">\n and <",stdout); +printf("%s",">\n and <"); print_prefix_name(r); err_print(">"); return name_dir; @@ -1014,7 +1014,7 @@ switch(section_name_cmp(&first,name_len,r)){ case prefix: if(!ispref){ -fputs("\n! New name is a prefix of <",stdout); +printf("%s","\n! New name is a prefix of <"); print_section_name(r); err_print(">"); @@ -1026,16 +1026,16 @@ case extension:if(!ispref||first<=last) extend_section_name(r,first,last+1,ispref); break; case bad_extension: -fputs("\n! New name extends <",stdout); +printf("%s","\n! New name extends <"); print_section_name(r); err_print(">"); break; default: -fputs("\n! Section name incompatible with <",stdout); +printf("%s","\n! Section name incompatible with <"); print_prefix_name(r); -fputs(">,\n which abbreviates <",stdout); +printf("%s",">,\n which abbreviates <"); print_section_name(r); err_print(">"); } @@ -1087,7 +1087,7 @@ void err_print( const char*s) { -*s=='!'?printf("\n%s",s):printf("%s",s); +printf(*s=='!'?"\n%s":"%s",s); if(web_file_open)/*67:*/ #line 1031 "common.w" @@ -1119,7 +1119,7 @@ update_terminal();mark_error(); #line 1064 "common.w" int wrap_up(void){ -if(show_progress)new_line(); +if(show_progress||show_happiness||history!=spotless)new_line(); if(show_stats) print_stats(); /*69:*/ @@ -1149,7 +1149,7 @@ void fatal( const char*s,const char*t) { -if(*s)err_print(s); +if(*s)printf("%s",s); err_print(t); history= fatal_message;exit(wrap_up()); } @@ -1179,7 +1179,7 @@ boolean found_web= false,found_change= false,found_out= false; strcpy(change_file_name,"/dev/null"); while(--argc> 0){ if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/ -#line 1244 "common.w" +#line 1246 "common.w" for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++) flags[(eight_bits)*dot_pos]= flag_change; @@ -1199,7 +1199,7 @@ if(!found_web)/*77:*/ { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1260 "common.w" +#line 1262 "common.w" fatal("! Filename too long\n",*argv); @@ -1214,8 +1214,10 @@ strcpy(web_file_name,*argv); } sprintf(alt_web_file_name,"%s.web",*argv); sprintf(tex_file_name,"%s.tex",name_pos); +if(make_xrefs){ sprintf(idx_file_name,"%s.idx",name_pos); sprintf(scn_file_name,"%s.scn",name_pos); +} sprintf(C_file_name,"%s.c",name_pos); found_web= true; } @@ -1224,18 +1226,18 @@ found_web= true; #line 1176 "common.w" else if(!found_change)/*78:*/ -#line 1212 "common.w" +#line 1214 "common.w" { if(strcmp(*argv,"-")!=0){ if(s-*argv> max_file_name_length-4) /*82:*/ -#line 1260 "common.w" +#line 1262 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1216 "common.w" +#line 1218 "common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1248,17 +1250,17 @@ found_change= true; #line 1177 "common.w" else if(!found_out)/*79:*/ -#line 1224 "common.w" +#line 1226 "common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1260 "common.w" +#line 1262 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1227 "common.w" +#line 1229 "common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1279,7 +1281,7 @@ found_out= true; #line 1178 "common.w" else/*81:*/ -#line 1248 "common.w" +#line 1250 "common.w" { if(program==ctangle) @@ -1298,7 +1300,7 @@ else fatal( } } if(!found_web)/*81:*/ -#line 1248 "common.w" +#line 1250 "common.w" { if(program==ctangle) diff --git a/source/texk/web2c/cwebdir/common.h b/source/texk/web2c/cwebdir/common.h index 4104965917..2cd3c7032d 100644 --- a/source/texk/web2c/cwebdir/common.h +++ b/source/texk/web2c/cwebdir/common.h @@ -41,7 +41,7 @@ extern int phase; /* which phase are we in? */ @ The procedure that gets everything rolling: @= -extern void common_init(void);@/ +extern void common_init(void); @ Interface to the standard \CEE/ library: diff --git a/source/texk/web2c/cwebdir/common.w b/source/texk/web2c/cwebdir/common.w index dbcd57e31f..4bbaaf2109 100644 --- a/source/texk/web2c/cwebdir/common.w +++ b/source/texk/web2c/cwebdir/common.w @@ -883,10 +883,10 @@ while (p) { /* compare shortest prefix of |p| with new name */ p=(c==less?p->llink:p->rlink); } else { /* new name matches |p| */ if (r!=NULL) { /* and also |r|: illegal */ - fputs("\n! Ambiguous prefix: matches <",stdout); + printf("%s","\n! Ambiguous prefix: matches <"); @.Ambiguous prefix ... @> print_prefix_name(p); - fputs(">\n and <",stdout); + printf("%s",">\n and <"); print_prefix_name(r); err_print(">"); return name_dir; /* the unsection */ @@ -912,7 +912,7 @@ switch(section_name_cmp(&first,name_len,r)) { /* compare all of |r| with new name */ case prefix: if (!ispref) { - fputs("\n! New name is a prefix of <",stdout); + printf("%s","\n! New name is a prefix of <"); @.New name is a prefix...@> print_section_name(r); err_print(">"); @@ -924,16 +924,16 @@ switch(section_name_cmp(&first,name_len,r)) { extend_section_name(r,first,last+1,ispref); break; case bad_extension: - fputs("\n! New name extends <",stdout); + printf("%s","\n! New name extends <"); @.New name extends...@> print_section_name(r); err_print(">"); break; default: /* no match: illegal */ - fputs("\n! Section name incompatible with <",stdout); + printf("%s","\n! Section name incompatible with <"); @.Section name incompatible...@> print_prefix_name(r); - fputs(">,\n which abbreviates <",stdout); + printf("%s",">,\n which abbreviates <"); print_section_name(r); err_print(">"); } @@ -1014,7 +1014,7 @@ void err_print( /* prints `\..' and location of error message */ const char *s) { - *s=='!'? printf("\n%s",s) : printf("%s",s); + printf(*s=='!' ? "\n%s" : "%s",s); if (web_file_open) @@; update_terminal(); mark_error(); } @@ -1063,7 +1063,7 @@ a status of |EXIT_SUCCESS| if and only if only harmless messages were printed. @c int wrap_up(void) { - if (show_progress) new_line(); + if (show_progress || show_happiness || history != spotless) new_line(); if (show_stats) print_stats(); /* print statistics about memory usage */ @@; @@ -1093,7 +1093,7 @@ concatenated to print the final error message. fatal( const char *s,const char *t) { - if (*s) err_print(s); + if (*s) printf("%s",s); err_print(t); history=fatal_message; exit(wrap_up()); } @@ -1203,8 +1203,10 @@ after the dot. We must check that there is enough room in } sprintf(alt_web_file_name,"%s.web",*argv); sprintf(tex_file_name,"%s.tex",name_pos); /* strip off directory name */ - sprintf(idx_file_name,"%s.idx",name_pos); - sprintf(scn_file_name,"%s.scn",name_pos); + if (make_xrefs) { /* indexes will be generated */ + sprintf(idx_file_name,"%s.idx",name_pos); + sprintf(scn_file_name,"%s.scn",name_pos); + } sprintf(C_file_name,"%s.c",name_pos); found_web=true; } diff --git a/source/texk/web2c/cwebdir/ctang-w2c.ch b/source/texk/web2c/cwebdir/ctang-w2c.ch index 3cc109ccc5..6d8d7f411b 100644 --- a/source/texk/web2c/cwebdir/ctang-w2c.ch +++ b/source/texk/web2c/cwebdir/ctang-w2c.ch @@ -80,9 +80,9 @@ @z @x - fputs("\n! Not present: <",stdout); + printf("%s","\n! Not present: <"); @y - fputs(_("\n! Not present: <"),stdout); + printf("%s",_("\n! Not present: <")); @z @x @@ -92,9 +92,9 @@ @z @x - fputs("\n! No program text was specified.",stdout); mark_harmless(); + printf("%s","\n! No program text was specified."); mark_harmless(); @y - fputs(_("\n! No program text was specified."),stdout); mark_harmless(); + printf("%s",_("\n! No program text was specified.")); mark_harmless(); @z @x @@ -106,9 +106,9 @@ @z @x - fputs("Done.",stdout); + printf("%s","Done."); @y - fputs(_("Done."),stdout); + printf("%s",_("Done.")); @z @x @@ -122,12 +122,8 @@ for (an_output_file=end_output_files; an_output_file>cur_out_file;) { @.Cannot open output file@> if (show_progress) { printf("\n(%s)",output_file_name); update_terminal(); } cur_line=1; - stack_ptr=stack+1; - cur_name=*an_output_file; - cur_repl=(text_pointer)cur_name->equiv; - cur_byte=cur_repl->tok_start; - while (stack_ptr > stack) get_output(); - flush_buffer(); + @@; + @@; } @y @= @@ -147,12 +143,8 @@ for (an_output_file=end_output_files; an_output_file>cur_out_file;) { } if (show_progress) { printf("\n(%s)",output_file_name); update_terminal(); } cur_line=1; - stack_ptr=stack+1; - cur_name=*an_output_file; - cur_repl=(text_pointer)cur_name->equiv; - cur_byte=cur_repl->tok_start; - while (stack_ptr > stack) get_output(); - flush_buffer(); + @@; + @@; if (check_for_change) { fclose(C_file); C_file=NULL; @@; @@ -242,9 +234,9 @@ quarter) with its two-byte encoding \.{c2 bc}. @z @x - fputs("\n! String too long: ",stdout); + printf("%s","\n! String too long: "); @y - fputs(_("\n! String too long: "),stdout); + printf("%s",_("\n! String too long: ")); @z @x @@ -278,9 +270,9 @@ quarter) with its two-byte encoding \.{c2 bc}. @z @x - fputs("\n! Section name too long: ",stdout); + printf("%s","\n! Section name too long: "); @y - fputs(_("\n! Section name too long: "),stdout); + printf("%s",_("\n! Section name too long: ")); @z @x diff --git a/source/texk/web2c/cwebdir/ctangle.c b/source/texk/web2c/cwebdir/ctangle.c index 2c31732e22..f01fc24f20 100644 --- a/source/texk/web2c/cwebdir/ctangle.c +++ b/source/texk/web2c/cwebdir/ctangle.c @@ -305,53 +305,53 @@ static output_state stack[stack_size+2]; static stack_pointer stack_end= stack+stack_size; static stack_pointer stack_ptr; -/*:32*//*37:*/ -#line 357 "ctangle.w" +/*:32*//*38:*/ +#line 367 "ctangle.w" static int cur_val; -/*:37*//*42:*/ -#line 449 "ctangle.w" +/*:38*//*42:*/ +#line 457 "ctangle.w" static eight_bits out_state; static boolean protect; /*:42*//*45:*/ -#line 480 "ctangle.w" +#line 488 "ctangle.w" static name_pointer output_files[max_files]; static name_pointer*cur_out_file,*end_output_files,*an_output_file; static char cur_section_name_char; static char output_file_name[longest_name+1]; -/*:45*//*52:*/ -#line 573 "ctangle.w" +/*:45*//*53:*/ +#line 584 "ctangle.w" static boolean output_defs_seen= false; -/*:52*//*57:*/ -#line 687 "ctangle.w" +/*:53*//*57:*/ +#line 694 "ctangle.w" static char translit[0200][translit_length]; /*:57*//*62:*/ -#line 763 "ctangle.w" +#line 770 "ctangle.w" static eight_bits ccode[256]; /*:62*//*66:*/ -#line 823 "ctangle.w" +#line 830 "ctangle.w" static boolean comment_continues= false; /*:66*//*68:*/ -#line 860 "ctangle.w" +#line 867 "ctangle.w" static name_pointer cur_section_name; static boolean no_where; /*:68*//*82:*/ -#line 1177 "ctangle.w" +#line 1184 "ctangle.w" static text_pointer cur_text; static eight_bits next_control; @@ -399,54 +399,48 @@ extern void print_stats(void); #line 242 "ctangle.w" static void store_two_bytes(sixteen_bits); -/*:30*//*35:*/ -#line 321 "ctangle.w" +/*:30*//*37:*/ +#line 347 "ctangle.w" static void push_level(name_pointer); static void pop_level(boolean); - -/*:35*//*39:*/ -#line 394 "ctangle.w" static void get_output(void); -/*:39*//*44:*/ -#line 470 "ctangle.w" +/*:37*//*44:*/ +#line 478 "ctangle.w" static void flush_buffer(void); /*:44*//*49:*/ -#line 541 "ctangle.w" -static void phase_two(void); - -/*:49*//*53:*/ -#line 576 "ctangle.w" +#line 547 "ctangle.w" +static void phase_two(void); static void output_defs(void); static void out_char(eight_bits); -/*:53*//*65:*/ -#line 803 "ctangle.w" +/*:49*//*65:*/ +#line 810 "ctangle.w" static eight_bits skip_ahead(void); static boolean skip_comment(boolean); /*:65*//*70:*/ -#line 910 "ctangle.w" +#line 917 "ctangle.w" static eight_bits get_next(void); /*:70*//*84:*/ -#line 1203 "ctangle.w" +#line 1210 "ctangle.w" static void scan_repl(eight_bits); /*:84*//*91:*/ -#line 1395 "ctangle.w" +#line 1402 "ctangle.w" static void scan_section(void); /*:91*//*99:*/ -#line 1472 "ctangle.w" +#line 1479 "ctangle.w" static void phase_one(void); /*:99*//*101:*/ -#line 1505 "ctangle.w" +#line 1512 "ctangle.w" static void skip_limbo(void); /*:101*/ @@ -479,12 +473,12 @@ init_node(name_dir); last_unnamed= text_info;text_info->text_link= macro; /*:27*//*46:*/ -#line 490 "ctangle.w" +#line 498 "ctangle.w" cur_out_file= end_output_files= output_files+max_files; /*:46*//*58:*/ -#line 690 "ctangle.w" +#line 697 "ctangle.w" {int i; for(i= 0;i<0200;i++) @@ -492,7 +486,7 @@ snprintf(translit[i],translit_length,"X%02X",(unsigned int)(0200+i)); } /*:58*//*63:*/ -#line 766 "ctangle.w" +#line 773 "ctangle.w" { int c; for(c= 0;c<256;c++)ccode[c]= ignore; @@ -512,7 +506,7 @@ ccode['<']= ccode['(']= section_name; ccode['\'']= ord; /*:63*//*78:*/ -#line 1098 "ctangle.w" +#line 1105 "ctangle.w" section_text[0]= ' '; /*:78*/ @@ -559,8 +553,8 @@ if(tok_ptr+2> tok_mem_end)overflow("token"); *tok_ptr++= x&0377; } -/*:29*//*34:*/ -#line 307 "ctangle.w" +/*:29*//*35:*/ +#line 315 "ctangle.w" static void push_level( @@ -575,8 +569,9 @@ cur_byte= cur_repl->tok_start;cur_section= 0; } } -/*:34*//*36:*/ -#line 329 "ctangle.w" + +/*:35*//*36:*/ +#line 334 "ctangle.w" static void pop_level( @@ -590,8 +585,8 @@ stack_ptr--; if(stack_ptr> stack)cur_state= *stack_ptr; } -/*:36*//*38:*/ -#line 364 "ctangle.w" +/*:36*//*39:*/ +#line 374 "ctangle.w" static void get_output(void) @@ -614,13 +609,13 @@ switch(a/024000){ case 0:cur_val= (int)a;out_char(identifier);break; case 1:if(a==output_defs_flag)output_defs(); else/*40:*/ -#line 399 "ctangle.w" +#line 407 "ctangle.w" { a-= 024000; if((a+name_dir)->equiv!=(void*)text_info)push_level(a+name_dir); else if(a!=0){ -fputs("\n! Not present: <",stdout); +printf("%s","\n! Not present: <"); print_section_name(a+name_dir);err_print(">"); } @@ -628,7 +623,7 @@ goto restart; } /*:40*/ -#line 385 "ctangle.w" +#line 395 "ctangle.w" break; default:cur_val= (int)a-050000; @@ -638,8 +633,8 @@ out_char(section_number); } } -/*:38*//*43:*/ -#line 457 "ctangle.w" +/*:39*//*43:*/ +#line 465 "ctangle.w" static void flush_buffer(void) @@ -654,7 +649,7 @@ cur_line++; } /*:43*//*48:*/ -#line 509 "ctangle.w" +#line 517 "ctangle.w" static void phase_two(void){ @@ -664,23 +659,24 @@ cur_line= 1; /*33:*/ #line 296 "ctangle.w" -stack_ptr= stack+1;cur_name= name_dir;cur_repl= text_info->text_link+text_info; +stack_ptr= stack+1;cur_name= name_dir; +cur_repl= text_info->text_link+text_info; cur_byte= cur_repl->tok_start;cur_section= 0; /*:33*/ -#line 515 "ctangle.w" +#line 523 "ctangle.w" -/*51:*/ -#line 569 "ctangle.w" +/*52:*/ +#line 580 "ctangle.w" if(!output_defs_seen) output_defs(); -/*:51*/ -#line 516 "ctangle.w" +/*:52*/ +#line 524 "ctangle.w" if(text_info->text_link==macro&&cur_out_file==end_output_files){ -fputs("\n! No program text was specified.",stdout);mark_harmless(); +printf("%s","\n! No program text was specified.");mark_harmless(); } else{ @@ -691,12 +687,20 @@ printf(cur_out_file==end_output_files? update_terminal(); } -if(text_info->text_link!=macro){ +if(text_info->text_link!=macro) +/*51:*/ +#line 570 "ctangle.w" + +{ while(stack_ptr> stack)get_output(); flush_buffer(); } + +/*:51*/ +#line 538 "ctangle.w" + /*50:*/ -#line 547 "ctangle.w" +#line 556 "ctangle.w" for(an_output_file= end_output_files;an_output_file> cur_out_file;){ an_output_file--; @@ -707,26 +711,41 @@ fatal("! Cannot open output file ",output_file_name); if(show_progress){printf("\n(%s)",output_file_name);update_terminal();} cur_line= 1; -stack_ptr= stack+1; -cur_name= *an_output_file; +/*34:*/ +#line 303 "ctangle.w" + +stack_ptr= stack+1;cur_name= *an_output_file; cur_repl= (text_pointer)cur_name->equiv; cur_byte= cur_repl->tok_start; + +/*:34*/ +#line 566 "ctangle.w" + +/*51:*/ +#line 570 "ctangle.w" + +{ while(stack_ptr> stack)get_output(); flush_buffer(); } +/*:51*/ +#line 567 "ctangle.w" + +} + /*:50*/ -#line 533 "ctangle.w" +#line 539 "ctangle.w" if(show_happiness){ if(show_progress)new_line(); -fputs("Done.",stdout); +printf("%s","Done."); } } } /*:48*//*54:*/ -#line 585 "ctangle.w" +#line 592 "ctangle.w" static void output_defs(void) @@ -766,7 +785,7 @@ pop_level(false); } /*:54*//*55:*/ -#line 628 "ctangle.w" +#line 635 "ctangle.w" static void out_char( @@ -779,7 +798,7 @@ case'\n':if(protect&&out_state!=verbatim)C_putc(' '); if(protect||out_state==verbatim)C_putc('\\'); flush_buffer();if(out_state!=verbatim)out_state= normal;break; /*59:*/ -#line 696 "ctangle.w" +#line 703 "ctangle.w" case identifier: if(out_state==num_or_id)C_putc(' '); @@ -791,10 +810,10 @@ else C_printf("%s",translit[(eight_bits)(*j)-0200]); out_state= num_or_id;break; /*:59*/ -#line 639 "ctangle.w" +#line 646 "ctangle.w" /*60:*/ -#line 706 "ctangle.w" +#line 713 "ctangle.w" case section_number: if(cur_val> 0)C_printf("/*%d:*/",cur_val); @@ -821,10 +840,10 @@ C_putc('"');C_putc('\n'); break; /*:60*/ -#line 640 "ctangle.w" +#line 647 "ctangle.w" /*56:*/ -#line 658 "ctangle.w" +#line 665 "ctangle.w" case plus_plus:C_putc('+');C_putc('+');out_state= normal;break; case minus_minus:C_putc('-');C_putc('-');out_state= normal;break; @@ -845,7 +864,7 @@ case minus_gt_ast:C_putc('-');C_putc('>');C_putc('*');out_state= normal; break; /*:56*/ -#line 641 "ctangle.w" +#line 648 "ctangle.w" case'=':case'>':C_putc(cur_char);C_putc(' '); out_state= normal;break; @@ -864,7 +883,7 @@ default:C_putc(cur_char);out_state= normal;break; } /*:55*//*64:*/ -#line 787 "ctangle.w" +#line 794 "ctangle.w" static eight_bits skip_ahead(void) @@ -882,7 +901,7 @@ if(c!=ignore||*(loc-1)=='>')return c; } /*:64*//*67:*/ -#line 826 "ctangle.w" +#line 833 "ctangle.w" static boolean skip_comment( boolean is_long_comment) @@ -916,7 +935,7 @@ else loc++; } /*:67*//*69:*/ -#line 867 "ctangle.w" +#line 874 "ctangle.w" static eight_bits get_next(void) @@ -930,7 +949,7 @@ if(get_line()==false)return new_section; else if(print_where&&!no_where){ print_where= false; /*85:*/ -#line 1213 "ctangle.w" +#line 1220 "ctangle.w" { eight_bits a; @@ -947,7 +966,7 @@ store_id(a); } /*:85*/ -#line 879 "ctangle.w" +#line 886 "ctangle.w" } else return(eight_bits)'\n'; @@ -960,7 +979,7 @@ else continue; } loc++; if(xisdigit(c)||c=='.')/*73:*/ -#line 951 "ctangle.w" +#line 958 "ctangle.w" { boolean hex_flag= false; id_first= loc-1; @@ -994,13 +1013,13 @@ return constant; } /*:73*/ -#line 890 "ctangle.w" +#line 897 "ctangle.w" else if(c=='\''||c=='"' ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"')) ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"'))) /*74:*/ -#line 988 "ctangle.w" +#line 995 "ctangle.w" { char delim= (char)c; id_first= section_text+1; @@ -1034,7 +1053,7 @@ c= (eight_bits)*loc++; if(++id_loc<=section_text_end)*id_loc= (char)c; } if(id_loc>=section_text_end){ -fputs("\n! String too long: ",stdout); +printf("%s","\n! String too long: "); term_write(section_text+1,25); err_print("..."); @@ -1044,11 +1063,11 @@ return string; } /*:74*/ -#line 894 "ctangle.w" +#line 901 "ctangle.w" else if(isalpha((int)c)||isxalpha(c)||ishigh(c)) /*72:*/ -#line 942 "ctangle.w" +#line 949 "ctangle.w" { id_first= --loc; do @@ -1059,10 +1078,10 @@ id_loc= loc;return identifier; } /*:72*/ -#line 896 "ctangle.w" +#line 903 "ctangle.w" else if(c=='@')/*75:*/ -#line 1033 "ctangle.w" +#line 1040 "ctangle.w" switch(c= ccode[(eight_bits)*loc++]){ case ignore:continue; @@ -1077,11 +1096,11 @@ continue; case section_name: cur_section_name_char= *(loc-1); /*77:*/ -#line 1078 "ctangle.w" +#line 1085 "ctangle.w" { char*k= section_text; /*79:*/ -#line 1100 "ctangle.w" +#line 1107 "ctangle.w" while(true){ if(loc> limit&&get_line()==false){ @@ -1091,7 +1110,7 @@ loc= buffer+1;break; } c= (eight_bits)*loc; /*80:*/ -#line 1123 "ctangle.w" +#line 1130 "ctangle.w" if(c=='@'){ c= (eight_bits)*(loc+1); @@ -1110,7 +1129,7 @@ err_print("! Nesting of section names not allowed");break; } /*:80*/ -#line 1108 "ctangle.w" +#line 1115 "ctangle.w" loc++;if(k=section_text_end){ -fputs("\n! Section name too long: ",stdout); +printf("%s","\n! Section name too long: "); term_write(section_text+1,25); printf("...");mark_harmless(); @@ -1127,7 +1146,7 @@ printf("...");mark_harmless(); if(*k==' '&&k> section_text)k--; /*:79*/ -#line 1080 "ctangle.w" +#line 1087 "ctangle.w" if(k-section_text> 3&&strncmp(k-2,"...",3)==0) cur_section_name= section_lookup(section_text+1,k-3,true); @@ -1136,7 +1155,7 @@ else cur_section_name= section_lookup(section_text+1,k,false); if(cur_section_name_char=='(') /*47:*/ -#line 494 "ctangle.w" +#line 502 "ctangle.w" { for(an_output_file= cur_out_file; @@ -1150,16 +1169,16 @@ else overflow("output files"); } /*:47*/ -#line 1088 "ctangle.w" +#line 1095 "ctangle.w" return section_name; } /*:77*/ -#line 1046 "ctangle.w" +#line 1053 "ctangle.w" case string:/*81:*/ -#line 1145 "ctangle.w" +#line 1152 "ctangle.w" id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; while(*loc!='@'||*(loc+1)!='>')loc++; @@ -1169,10 +1188,10 @@ id_loc= loc;loc+= 2; return string; /*:81*/ -#line 1047 "ctangle.w" +#line 1054 "ctangle.w" case ord:/*76:*/ -#line 1058 "ctangle.w" +#line 1065 "ctangle.w" id_first= loc; if(*loc=='\\') @@ -1194,13 +1213,13 @@ loc++; return ord; /*:76*/ -#line 1048 "ctangle.w" +#line 1055 "ctangle.w" default:return c; } /*:75*/ -#line 897 "ctangle.w" +#line 904 "ctangle.w" else if(xisspace(c)){ if(!preprocessing||loc> limit)continue; @@ -1210,7 +1229,7 @@ else return(eight_bits)' '; } else if(c=='#'&&loc==buffer+1)preprocessing= true; mistake:/*71:*/ -#line 919 "ctangle.w" +#line 926 "ctangle.w" switch(c){ case'+':if(*loc=='+')compress(plus_plus);break; @@ -1235,14 +1254,14 @@ case'!':if(*loc=='=')compress(non_eq);break; } /*:71*/ -#line 905 "ctangle.w" +#line 912 "ctangle.w" return c; } } /*:69*//*83:*/ -#line 1181 "ctangle.w" +#line 1188 "ctangle.w" static void scan_repl( @@ -1250,7 +1269,7 @@ eight_bits t) { sixteen_bits a; if(t==section_name)/*85:*/ -#line 1213 "ctangle.w" +#line 1220 "ctangle.w" { eight_bits a; @@ -1267,11 +1286,11 @@ store_id(a); } /*:85*/ -#line 1187 "ctangle.w" +#line 1194 "ctangle.w" while(true)switch(a= get_next()){ /*86:*/ -#line 1228 "ctangle.w" +#line 1235 "ctangle.w" case identifier:store_id(a); if(*buffer=='#'&&( @@ -1284,7 +1303,7 @@ break; case section_name:if(t!=section_name)goto done; else{ /*87:*/ -#line 1269 "ctangle.w" +#line 1276 "ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loctok_start= tok_ptr; } /*:83*//*90:*/ -#line 1362 "ctangle.w" +#line 1369 "ctangle.w" static void scan_section(void) @@ -1465,7 +1484,7 @@ printf("*%d",(int)section_count);update_terminal(); next_control= ignore; while(true){ /*92:*/ -#line 1403 "ctangle.w" +#line 1410 "ctangle.w" while(next_controltext_link= macro; /*:93*/ -#line 1378 "ctangle.w" +#line 1385 "ctangle.w" continue; } @@ -1504,14 +1523,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1432 "ctangle.w" +#line 1439 "ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1386 "ctangle.w" +#line 1393 "ctangle.w" break; } @@ -1519,20 +1538,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1437 "ctangle.w" +#line 1444 "ctangle.w" /*96:*/ -#line 1442 "ctangle.w" +#line 1449 "ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1438 "ctangle.w" +#line 1445 "ctangle.w" scan_repl(section_name); /*97:*/ -#line 1446 "ctangle.w" +#line 1453 "ctangle.w" if(p==name_dir||p==NULL){ last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1549,16 +1568,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1440 "ctangle.w" +#line 1447 "ctangle.w" /*:95*/ -#line 1392 "ctangle.w" +#line 1399 "ctangle.w" } /*:90*//*98:*/ -#line 1461 "ctangle.w" +#line 1468 "ctangle.w" static void phase_one(void){ @@ -1571,7 +1590,7 @@ check_complete(); } /*:98*//*100:*/ -#line 1477 "ctangle.w" +#line 1484 "ctangle.w" static void skip_limbo(void) @@ -1585,7 +1604,7 @@ char c= *loc++; switch(ccode[(eight_bits)c]){ case new_section:return; case translit_code:/*102:*/ -#line 1507 "ctangle.w" +#line 1514 "ctangle.w" while(xisspace(*loc)&&loc= -stack_ptr=stack+1; cur_name=name_dir; cur_repl=text_info->text_link+text_info; +stack_ptr=stack+1; cur_name=name_dir; +cur_repl=text_info->text_link+text_info; cur_byte=cur_repl->tok_start; cur_section=0; +@ Similar settings are used for secondary output files. + +@= +stack_ptr=stack+1; cur_name=*an_output_file; +cur_repl=(text_pointer)cur_name->equiv; +cur_byte=cur_repl->tok_start; + @ When the replacement text for name |p| is to be inserted into the output, the following subroutine is called to save the old level of output and get the new one going. @@ -318,9 +326,6 @@ name_pointer p) } } -@ @= -static void push_level(name_pointer);@/ -static void pop_level(boolean); @ When we come to the end of a replacement text, the |pop_level| subroutine does the right thing: It either moves to the continuation of this replacement @@ -339,6 +344,11 @@ boolean flag) /* |flag==false| means we are in |output_defs| */ if (stack_ptr>stack) cur_state=*stack_ptr;@^system dependencies@> } +@ @= +static void push_level(name_pointer);@/ +static void pop_level(boolean);@/ +static void get_output(void); + @ The heart of the output procedure is the function |get_output|, which produces the next token of output and sends it on to the lower-level function |out_char|. The main purpose of |get_output| is to handle the @@ -391,8 +401,6 @@ get_output(void) /* sends next token to |out_char| */ } } -@ @=@+static void get_output(void); - @ The user may have forgotten to give any \CEE/ text for a section name, or the \CEE/ text may have been associated with a different name by mistake. @@ -401,7 +409,7 @@ or the \CEE/ text may have been associated with a different name by mistake. a-=024000; if ((a+name_dir)->equiv!=(void *)text_info) push_level(a+name_dir); else if (a!=0) { - fputs("\n! Not present: <",stdout); + printf("%s","\n! Not present: <"); print_section_name(a+name_dir); err_print(">"); @.Not present:
@> } @@ -515,7 +523,7 @@ phase_two (void) { @@; @@; if (text_info->text_link==macro && cur_out_file==end_output_files) { - fputs("\n! No program text was specified.",stdout); mark_harmless(); + printf("%s","\n! No program text was specified."); mark_harmless(); @.No program text...@> } else { @@ -526,19 +534,20 @@ phase_two (void) { @.Writing the output...@> update_terminal(); } - if (text_info->text_link!=macro) { - while (stack_ptr>stack) get_output(); - flush_buffer(); - } + if (text_info->text_link!=macro) + @@; @@; if (show_happiness) { if (show_progress) new_line(); - fputs("Done.",stdout); + printf("%s","Done."); } } } -@ @=@+static void phase_two(void); +@ @= +static void phase_two(void);@/ +static void output_defs(void);@/ +static void out_char(eight_bits); @ To write the named output files, we proceed as for the unnamed section. @@ -554,12 +563,14 @@ for (an_output_file=end_output_files; an_output_file>cur_out_file;) { @.Cannot open output file@> if (show_progress) { printf("\n(%s)",output_file_name); update_terminal(); } cur_line=1; - stack_ptr=stack+1; - cur_name=*an_output_file; - cur_repl=(text_pointer)cur_name->equiv; - cur_byte=cur_repl->tok_start; - while (stack_ptr > stack) get_output(); - flush_buffer(); + @@; + @@; +} + +@ @= +{ + while (stack_ptr>stack) get_output(); + flush_buffer(); } @ If a \.{@@h} was not encountered in the input, @@ -573,10 +584,6 @@ that refer to macros, preceded by the \.{\#define} preprocessor command. @ @= static boolean output_defs_seen=false; -@ @= -static void output_defs(void);@/ -static void out_char(eight_bits); - @ @d macro_end (cur_text+1)->tok_start /* end of |macro| replacement text */ @# @d C_printf(c,a) fprintf(C_file,c,a) @@ -1018,7 +1025,7 @@ convention, but do not allow the string to be longer than |longest_name|. if (++id_loc<=section_text_end) *id_loc=(char)c; } if (id_loc>=section_text_end) { - fputs("\n! String too long: ",stdout); + printf("%s","\n! String too long: "); @.String too long@> term_write(section_text+1,25); err_print("..."); @@ -1113,7 +1120,7 @@ while (true) { *k=(char)c; } if (k>=section_text_end) { - fputs("\n! Section name too long: ",stdout); + printf("%s","\n! Section name too long: "); @.Section name too long@> term_write(section_text+1,25); printf("..."); mark_harmless(); diff --git a/source/texk/web2c/cwebdir/ctwill-mini.ch b/source/texk/web2c/cwebdir/ctwill-mini.ch index 2775c37544..396d46cbd9 100644 --- a/source/texk/web2c/cwebdir/ctwill-mini.ch +++ b/source/texk/web2c/cwebdir/ctwill-mini.ch @@ -1413,7 +1413,7 @@ Section 202. @x @ @= @y -@ @= +@r @ @= @-n@> @% @$n {CTWILL}197 \&{short}@> diff --git a/source/texk/web2c/cwebdir/ctwill-proofsort b/source/texk/web2c/cwebdir/ctwill-proofsort index dbf61958fa..71e71dd4b3 100755 --- a/source/texk/web2c/cwebdir/ctwill-proofsort +++ b/source/texk/web2c/cwebdir/ctwill-proofsort @@ -16,11 +16,10 @@ BEGIN { $progname = basename $0; # Unicode::Collate has been around a long time, # but it's not part of core Perl. - my $rc = eval { + eval { require Unicode::Collate; $collator = Unicode::Collate->new(); }; - die "$progname: the Unicode::Collate module is required\n" unless $rc; } # We expect a TeX file as the single command-line parameter. diff --git a/source/texk/web2c/cwebdir/ctwill-w2c.ch b/source/texk/web2c/cwebdir/ctwill-w2c.ch index 5ab95d2d61..40e571d0d5 100644 --- a/source/texk/web2c/cwebdir/ctwill-w2c.ch +++ b/source/texk/web2c/cwebdir/ctwill-w2c.ch @@ -305,9 +305,9 @@ part of all meanings. @z @x - fputs("\n! String too long: ",stdout); + printf("%s","\n! String too long: "); @y - fputs(_("\n! String too long: "),stdout); + printf("%s",_("\n! String too long: ")); @z @x @@ -338,9 +338,9 @@ part of all meanings. @z @x - fputs("\n! Section name too long: ",stdout); + printf("%s","\n! Section name too long: "); @y - fputs(_("\n! Section name too long: "),stdout); + printf("%s",_("\n! Section name too long: ")); @z @x @@ -445,18 +445,18 @@ if (loc>=limit) err_print(_("! Verbatim string didn't end")); @z @x - fputs("\n! Never defined: <",stdout); + printf("%s","\n! Never defined: <"); print_section_name(p); putchar('>'); mark_harmless(); @y - fputs(_("\n! Never defined: <"),stdout); + printf("%s",_("\n! Never defined: <")); print_section_name(p); putchar('>'); mark_harmless(); @z @x - fputs("\n! Never used: <",stdout); + printf("%s","\n! Never used: <"); print_section_name(p); putchar('>'); mark_harmless(); @y - fputs(_("\n! Never used: <"),stdout); + printf("%s",_("\n! Never used: <")); print_section_name(p); putchar('>'); mark_harmless(); @z @@ -912,15 +912,15 @@ to \.{\\PB}. Although \.{ctwimac} ignores \.{\\PB}, other macro packages @z @x - fputs("\n! Illegal control code in section name: <",stdout); + printf("%s","\n! Illegal control code in section name: <"); @y - fputs(_("\n! Illegal control code in section name: <"),stdout); + printf("%s",_("\n! Illegal control code in section name: <")); @z @x - fputs("\n! C text in section name didn't end: <",stdout); + printf("%s","\n! C text in section name didn't end: <"); @y - fputs(_("\n! C text in section name didn't end: <"),stdout); + printf("%s",_("\n! C text in section name didn't end: <")); @z @x @@ -936,9 +936,9 @@ to \.{\\PB}. Although \.{ctwimac} ignores \.{\\PB}, other macro packages @z @x -if (show_progress) fputs("\nWriting the output file...",stdout); +if (show_progress) printf("%s","\nWriting the output file..."); @y -if (show_progress) fputs(_("\nWriting the output file..."),stdout); +if (show_progress) printf("%s",_("\nWriting the output file...")); @z @x @@ -1112,9 +1112,9 @@ out_str("}\\FI"); finish_line(); @z @x - if (show_progress) fputs("\nWriting the index...",stdout); + if (show_progress) printf("%s","\nWriting the index..."); @y - if (show_progress) fputs(_("\nWriting the index..."),stdout); + if (show_progress) printf("%s",_("\nWriting the index...")); @z @x @@ -1146,9 +1146,9 @@ if (check_for_change) @@; @z @x - fputs("Done.",stdout); + printf("%s","Done."); @y - fputs(_("Done."),stdout); + printf("%s",_("Done.")); @z @x diff --git a/source/texk/web2c/cwebdir/cweav-w2c.ch b/source/texk/web2c/cwebdir/cweav-w2c.ch index faf1b6ad8b..4a1526462f 100644 --- a/source/texk/web2c/cwebdir/cweav-w2c.ch +++ b/source/texk/web2c/cwebdir/cweav-w2c.ch @@ -96,9 +96,9 @@ @z @x - fputs("\n! String too long: ",stdout); + printf("%s","\n! String too long: "); @y - fputs(_("\n! String too long: "),stdout); + printf("%s",_("\n! String too long: ")); @z @x @@ -114,9 +114,9 @@ @z @x - fputs("\n! Section name too long: ",stdout); + printf("%s","\n! Section name too long: "); @y - fputs(_("\n! Section name too long: "),stdout); + printf("%s",_("\n! Section name too long: ")); @z @x @@ -174,18 +174,18 @@ if (loc>=limit) err_print(_("! Verbatim string didn't end")); @z @x - fputs("\n! Never defined: <",stdout); + printf("%s","\n! Never defined: <"); print_section_name(p); putchar('>'); mark_harmless(); @y - fputs(_("\n! Never defined: <"),stdout); + printf("%s",_("\n! Never defined: <")); print_section_name(p); putchar('>'); mark_harmless(); @z @x - fputs("\n! Never used: <",stdout); + printf("%s","\n! Never used: <"); print_section_name(p); putchar('>'); mark_harmless(); @y - fputs(_("\n! Never used: <"),stdout); + printf("%s",_("\n! Never used: <")); print_section_name(p); putchar('>'); mark_harmless(); @z @@ -441,15 +441,15 @@ else if (cat1==stmt) { @z @x - fputs("\n! Illegal control code in section name: <",stdout); + printf("%s","\n! Illegal control code in section name: <"); @y - fputs(_("\n! Illegal control code in section name: <"),stdout); + printf("%s",_("\n! Illegal control code in section name: <")); @z @x - fputs("\n! C text in section name didn't end: <",stdout); + printf("%s","\n! C text in section name didn't end: <"); @y - fputs(_("\n! C text in section name didn't end: <"),stdout); + printf("%s",_("\n! C text in section name didn't end: <")); @z @x @@ -465,9 +465,9 @@ else if (cat1==stmt) { @z @x -if (show_progress) fputs("\nWriting the output file...",stdout); +if (show_progress) printf("%s","\nWriting the output file..."); @y -if (show_progress) fputs(_("\nWriting the output file..."),stdout); +if (show_progress) printf("%s",_("\nWriting the output file...")); @z @x @@ -515,9 +515,9 @@ if (show_progress) fputs(_("\nWriting the output file..."),stdout); @z @x - if (show_progress) fputs("\nWriting the index...",stdout); + if (show_progress) printf("%s","\nWriting the index..."); @y - if (show_progress) fputs(_("\nWriting the index..."),stdout); + if (show_progress) printf("%s",_("\nWriting the index...")); @z @x @@ -540,9 +540,9 @@ if (check_for_change) @@; @z @x - fputs("Done.",stdout); + printf("%s","Done."); @y - fputs(_("Done."),stdout); + printf("%s",_("Done.")); @z @x diff --git a/source/texk/web2c/cwebdir/cweave.w b/source/texk/web2c/cwebdir/cweave.w index 70654828c1..ceb46baf22 100644 --- a/source/texk/web2c/cwebdir/cweave.w +++ b/source/texk/web2c/cwebdir/cweave.w @@ -646,7 +646,7 @@ skip_TeX(void) /* skip past pure \TEX/ code */ } } -@*1 Inputting the next token. +@* Inputting the next token. As stated above, \.{CWEAVE}'s most interesting lexical scanning routine is the |get_next| function that inputs the next token of \CEE/ input. However, |get_next| is not especially complicated. @@ -911,7 +911,7 @@ convention, but do not allow the string to be longer than |longest_name|. if (++id_loc<=section_text_end) *id_loc=c; } if (id_loc>=section_text_end) { - fputs("\n! String too long: ",stdout); + printf("%s","\n! String too long: "); @.String too long@> term_write(section_text+1,25); printf("..."); mark_error(); @@ -981,7 +981,7 @@ while (true) { *k=c; } if (k>=section_text_end) { - fputs("\n! Section name too long: ",stdout); + printf("%s","\n! Section name too long: "); @.Section name too long@> term_write(section_text+1,25); printf("..."); mark_harmless(); @@ -1302,13 +1302,13 @@ name_pointer p) /* print anomalies in subtree |p| */ cur_xref=(xref_pointer)p->xref; if ((an_output=(cur_xref->num==file_flag))==true) cur_xref=cur_xref->xlink; if (cur_xref->num '); mark_harmless(); @.Never defined:
@> } while (cur_xref->num >=cite_flag) cur_xref=cur_xref->xlink; if (cur_xref==xmem && !an_output) { - fputs("\n! Never used: <",stdout); + printf("%s","\n! Never used: <"); print_section_name(p); putchar('>'); mark_harmless(); @.Never used:
@> } @@ -3204,7 +3204,7 @@ scrap_pointer j, short k, eight_bits c, short d, short n) { - scrap_pointer i, i1; /* pointers into scrap memory */ + scrap_pointer i, o; /* pointers into scrap memory */ j->cat=c; if (k>0) { j->trans=text_ptr; @@ -3212,10 +3212,8 @@ short d, short n) freeze_text(); } if (k>1) { - for (i=j+k, i1=j+1; i<=lo_ptr; i++, i1++) { - i1->cat=i->cat; i1->trans=i->trans; - i1->mathness=i->mathness; - } + for (i=j+k, o=j+1; i<=lo_ptr; i++, o++) + *o=*i;@^system dependencies@> lo_ptr=lo_ptr-k+1; } pp=(pp+d= if (lo_ptrcat=hi_ptr->cat; lo_ptr->mathness=hi_ptr->mathness; - lo_ptr->trans=(hi_ptr++)->trans; - } + while (hi_ptr<=scrap_ptr && lo_ptr!=pp+3) + *(++lo_ptr)=*(hi_ptr++);@^system dependencies@> for (i=lo_ptr+1;i<=pp+3;i++) i->cat=0; } @@ -4130,7 +4126,7 @@ while (k= if (*k++!='@@') { - fputs("\n! Illegal control code in section name: <",stdout); + printf("%s","\n! Illegal control code in section name: <"); @.Illegal control code...@> print_section_name(cur_section_name); printf("> "); mark_error(); } @@ -4145,7 +4141,7 @@ equals the delimiter that began the string being copied. j=limit+1; *j='|'; delim=0; while (true) { if (k>=k_limit) { - fputs("\n! C text in section name didn't end: <",stdout); + printf("%s","\n! C text in section name didn't end: <"); @.C text...didn't end@> print_section_name(cur_section_name); printf("> "); mark_error(); break; } @@ -4180,7 +4176,7 @@ actually output the \TEX/ material instead of merely looking at the static void phase_two(void) { phase=2; reset_input(); -if (show_progress) fputs("\nWriting the output file...",stdout); +if (show_progress) printf("%s","\nWriting the output file..."); @.Writing the output file...@> section_count=0; format_visible=true; copy_limbo(); finish_line(); flush_buffer(out_buf,false,false); @@ -4249,8 +4245,10 @@ else { out_str("\\N"); @.\\N@> {@+ char s[32];@+snprintf(s,32,"{%d}",sec_depth+1);@+out_str(s);@+} - if (show_progress) - printf("*%d",(int)section_count); update_terminal(); /* print a progress report */ + if (show_progress) { + printf("*%d",(int)section_count); + update_terminal(); /* print a progress report */ + } } out('{'); out_section(section_count); out('}'); @@ -4531,7 +4529,7 @@ if (no_xref) out_str("\\end"); @.\\end@> else { - if (show_progress) fputs("\nWriting the index...",stdout); + if (show_progress) printf("%s","\nWriting the index..."); @.Writing the index...@> if (change_exists) { @@; @@ -4569,7 +4567,7 @@ finish_line(); fclose(active_file); if (show_happiness) { if (show_progress) new_line(); - fputs("Done.",stdout); + printf("%s","Done."); } check_complete(); /* was all of the change file used? */ } diff --git a/source/texk/web2c/cwebdir/cweb.1 b/source/texk/web2c/cwebdir/cweb.1 index 4c35edb754..192c7c9597 100644 --- a/source/texk/web2c/cwebdir/cweb.1 +++ b/source/texk/web2c/cwebdir/cweb.1 @@ -1,4 +1,4 @@ -.TH CWEB 1 2021-Apr-24 +.TH CWEB 1 2023-Aug-20 . .SH NAME ctangle, cweave \- translate CWEB to C and/or TeX @@ -108,7 +108,7 @@ means treat 'typename' in templates like 'typedef'. .SH FILES The location of the files mentioned below varies from system to system. .TP -cwebmac.tex +cwebmac.tex, cwebacromac.tex TeX macros used by cweave output. .TP cwebman.tex diff --git a/source/texk/web2c/cwebdir/cwebacromac.tex b/source/texk/web2c/cwebdir/cwebacromac.tex new file mode 100644 index 0000000000..837f61ee78 --- /dev/null +++ b/source/texk/web2c/cwebdir/cwebacromac.tex @@ -0,0 +1,157 @@ +% hypertext macros for CWEB listings (in addition to cwebmac.tex) +% Version 1.0 --- August 2023 +\ifx\acrohint\undefined\else\endinput\fi % these are not standalone macros +\ifacro % The following are pdf macros +\def\thewidth{\the\wd0 \space} +\def\theheight{\the\ht\strutbox\space} +\def\thedepth{\the\dp\strutbox\space} +\ifpdftex + \ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14 + \def\pdflink#1#2{\hbox{\pdfannotlink height \theheight depth \thedepth + attr{/Border [0 0 0]} goto num #1 \Blue #1\Black\pdfendlink}} % changed 3.69 +\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}% + \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight + depth \thedepth << /Type /Annot /Subtype /Link + /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi +\def\sanitizecommand#1#2{\addtokens\usersanitizer + {\noexpand\dosanitizecommand\noexpand#1{#2}}} +\def\dosanitizecommand#1#2{\ifx\nxt#1\addF{#2}\fi} + +\catcode`\[=1 \catcode`\]=2 \catcode`\{=12 \catcode`\}=12 + \def\lbchar[{] \def\rbchar[}] +\catcode`\[=12 \catcode`\]=12 \catcode`\{=1 \catcode`\}=2 +\catcode`\~=12 \def\tildechar{~} \catcode`\~=13 +\catcode`\|=0 |catcode`|\=12 |def|bschar{\} |catcode`|\=0 \catcode`\|=12 +\def\makeoutlinetoks{\Tnumfalse\afterassignment\makeolproctok\let\nxt= } +\def\makeolnexttok{\afterassignment\makeolproctok\let\nxt= } +\def\makeolgobbletok{\afterassignment\makeolnexttok\let\nxt= } +\def\addF#1{\addtokens\toksF{#1}\tokprocessedtrue} +% now comes a routine to "sanitize" section names, for pdf outlines +\def\makeolproctok{\tokprocessedfalse + \let\next\makeolnexttok % default + \ifx\nxt\outlinedone\let\next\outlinedone + \else\ifx{\nxt \else\ifx}\nxt \Tnumfalse \instrfalse % skip braces + \else\ifx$\nxt % or a $ sign + \else\ifx^\nxt \addF^\else\ifx_\nxt \addF_% sanitize ^ and _ + \else\ifx\nxt\spacechar \addF\space + \else\if\noexpand\nxt\relax % we have a control sequence; is it one we know? + \ifx\nxt~\addF\space + \else\ifx\nxt\onespace\addF\space + \else\the\usersanitizer + \iftokprocessed\else\makeolproctokctli + \iftokprocessed\else\makeolproctokctlii + \iftokprocessed\else\makeolproctokctliii % if not recognised, skip it + \fi\fi\fi\fi\fi + \else % we don't have a control sequence, it's an ordinary char + \ifx/\nxt \addF{\string\/}% quote chars special to PDF with backslash + \else\ifx(\nxt \addF{\string\(}\else\ifx)\nxt \addF{\string\)}% + \else\ifx[\nxt \addF{\string\[}\else\ifx]\nxt \addF{\string\]}% + \else\expandafter\makeolproctokchar\meaning\nxt + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next +} +\def\makeolproctokchar#1 #2 #3{\addF{#3}} +\def\makeolproctokctli{% + \ifx\nxt\CEE\addF{C}\let\next\makeolgobbletok % \CEE/ + \else\ifx\nxt\UNIX\addF{UNIX}\let\next\makeolgobbletok % \UNIX/ + \else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/ + \else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}% + \else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/ + \else\ifx\nxt\Cee\addF{C}% + \else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...} + \else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...} + % skip \| + \else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi + \else\ifx\nxt\&\ifinstr\addF&\else\tokprocessedtrue\fi + \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77} + \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5} + \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77} + \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi % 0b10111 -> \T{\\10111} + \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi %$% \T{77\$L} + \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar + \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}% + \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}% + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +} +\def\makeolproctokctlii{% + \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}% + \else\ifx\nxt\LL\addF{<<}\else\ifx\nxt\NULL\addF{NULL}% + \else\ifx\nxt\AND\addF&\else\ifx\nxt\OR\addF|% + \else\ifx\nxt\XOR\addF^\else\ifx\nxt\CM\addF\tildechar + \else\ifx\nxt\MOD\addF{\string\%}\else\ifx\nxt\DC\addF{::}% + \else\ifx\nxt\PA\addF{.*}\else\ifx\nxt\MGA\addF{->*}% + \else\ifx\nxt\this\addF{this}\else\ifx\nxt\?\addF?% + \else\ifx\nxt\E\addF{==}\else\ifx\nxt\G\addF{>=}% + \else\ifx\nxt\I\addF{!=}\else\ifx\nxt\K\addF{=}% + \else\ifx\nxt\l\addF{l}\else\ifx\nxt\L\addF{L}% + \else\ifx\nxt\o\addF{o}\else\ifx\nxt\O\addF{O}% + \else\ifx\nxt\R\addF!% + \else\ifx\nxt\T \Tnumtrue \let\next\makeolgobbletok + \tokprocessedtrue % \T{number} + \else\ifx\nxt\AM\addF&\else\ifx\nxt\%\addF{\string\%}% + \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi +} +\def\makeolproctokctliii{% + \ifx\nxt\V\addF{||}\else\ifx\nxt\W\addF{&&}\else\ifx\nxt\Z\addF{<=}% + \else\ifx\nxt\*\addF*\else\ifx\nxt\Xand\addF{\space and\space}% + \else\ifx\nxt\Xandxeq\addF{\space and_eq\space}% + \else\ifx\nxt\Xbitand\addF{\space bitand\space}% + \else\ifx\nxt\Xbitor\addF{\space bitor\space}% + \else\ifx\nxt\Xcompl\addF{\space compl\space}% + \else\ifx\nxt\Xnot\addF{\space not\space}% + \else\ifx\nxt\Xnotxeq\addF{\space not_eq\space}% + \else\ifx\nxt\Xor\addF{\space or\space}% + \else\ifx\nxt\Xorxeq\addF{\space or_eq\space}% + \else\ifx\nxt\Xxor\addF{\space xor\space}% + \else\ifx\nxt\Xxorxeq\addF{\space xor_eq\space}% + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi +} +\def\outlinedone{\edef\outlinest{\global\noexpand\toksE={\the\toksF}}% + \outlinest\let\outlinedone=\relax} +\fi % End of pdf macros + +\ifhint +% The following uses HINT primitives to implement: +% \HINThome to mark the position of the home page +% \HINTlabel to attach a label to the top of a section +% \HINTlink to link a section number to the section label +% \HINTcontents to produce an 'outline' item +% These are the top level HINT macros that are used in this file +% No HINT primitives are used directly. +\def\HINThome{\HINTdest name {HINT.home}% + \HINToutline goto name {HINT.home} depth 1 {Table of Contents}} +\def\HINTlabel{{\let\*=\empty\HINTdest num \secstar top}} +\def\HINTlink#1#2{\HINTstartlink goto num #1 {#1}\HINTendlink}% #2 not used ??? +\def\HINTcontents#1#2#3{\HINToutline goto num #3 depth #2 {#1}} +\let\pdflink=\HINTlink +\fi % End of HINT macros + +% Common macros for \ifacro and \ifhint +\ifacrohint +\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} +\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% + \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} + \toksC={}\let\space\empty}\makenote}\maketoks}} +\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} +\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% + \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} +\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% + \ifnum\countB>`9 \countB=0 \fi + \ifnum\countB<`0 + \ifnum0=\countC\else\makenote\fi + \ifx\first.\let\next=\maketoksdone\else + \let\next=\maketoks + \addtokens\toksB{\the\toksD} + \ifx\first,\addtokens\toksB{\space}\fi + \fi + \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks + \fi + \next +} +\def\makenote{\addtokens\toksB + {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} +\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\fi % End of common macros diff --git a/source/texk/web2c/cwebdir/cwebmac.tex b/source/texk/web2c/cwebdir/cwebmac.tex index 382400a3f7..c304d3cd69 100644 --- a/source/texk/web2c/cwebdir/cwebmac.tex +++ b/source/texk/web2c/cwebdir/cwebmac.tex @@ -134,160 +134,7 @@ \newif\iftokprocessed \newif\ifTnum \newif\ifinstr {\def\\{\global\let\spacechar= }\\ } -\ifacro % The following are pdf macros -\def\thewidth{\the\wd0 \space} -\def\theheight{\the\ht\strutbox\space} -\def\thedepth{\the\dp\strutbox\space} -\ifpdftex - \ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14 - \def\pdflink#1#2{\hbox{\pdfannotlink height \theheight depth \thedepth - attr{/Border [0 0 0]} goto num #1 \Blue #1\Black\pdfendlink}} % changed 3.69 -\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}% - \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight - depth \thedepth << /Type /Annot /Subtype /Link - /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi -\def\sanitizecommand#1#2{\addtokens\usersanitizer - {\noexpand\dosanitizecommand\noexpand#1{#2}}} -\def\dosanitizecommand#1#2{\ifx\nxt#1\addF{#2}\fi} - -\catcode`\[=1 \catcode`\]=2 \catcode`\{=12 \catcode`\}=12 - \def\lbchar[{] \def\rbchar[}] -\catcode`\[=12 \catcode`\]=12 \catcode`\{=1 \catcode`\}=2 -\catcode`\~=12 \def\tildechar{~} \catcode`\~=13 -\catcode`\|=0 |catcode`|\=12 |def|bschar{\} |catcode`|\=0 \catcode`\|=12 -\def\makeoutlinetoks{\Tnumfalse\afterassignment\makeolproctok\let\nxt= } -\def\makeolnexttok{\afterassignment\makeolproctok\let\nxt= } -\def\makeolgobbletok{\afterassignment\makeolnexttok\let\nxt= } -\def\addF#1{\addtokens\toksF{#1}\tokprocessedtrue} -% now comes a routine to "sanitize" section names, for pdf outlines -\def\makeolproctok{\tokprocessedfalse - \let\next\makeolnexttok % default - \ifx\nxt\outlinedone\let\next\outlinedone - \else\ifx{\nxt \else\ifx}\nxt \Tnumfalse \instrfalse % skip braces - \else\ifx$\nxt % or a $ sign - \else\ifx^\nxt \addF^\else\ifx_\nxt \addF_% sanitize ^ and _ - \else\ifx\nxt\spacechar \addF\space - \else\if\noexpand\nxt\relax % we have a control sequence; is it one we know? - \ifx\nxt~\addF\space - \else\ifx\nxt\onespace\addF\space - \else\the\usersanitizer - \iftokprocessed\else\makeolproctokctli - \iftokprocessed\else\makeolproctokctlii - \iftokprocessed\else\makeolproctokctliii % if not recognised, skip it - \fi\fi\fi\fi\fi - \else % we don't have a control sequence, it's an ordinary char - \ifx/\nxt \addF{\string\/}% quote chars special to PDF with backslash - \else\ifx(\nxt \addF{\string\(}\else\ifx)\nxt \addF{\string\)}% - \else\ifx[\nxt \addF{\string\[}\else\ifx]\nxt \addF{\string\]}% - \else\expandafter\makeolproctokchar\meaning\nxt - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next -} -\def\makeolproctokchar#1 #2 #3{\addF{#3}} -\def\makeolproctokctli{% - \ifx\nxt\CEE\addF{C}\let\next\makeolgobbletok % \CEE/ - \else\ifx\nxt\UNIX\addF{UNIX}\let\next\makeolgobbletok % \UNIX/ - \else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/ - \else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}% - \else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/ - \else\ifx\nxt\Cee\addF{C}% - \else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...} - \else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...} - % skip \| - \else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi - \else\ifx\nxt\&\ifinstr\addF&\else\tokprocessedtrue\fi - \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77} - \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5} - \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77} - \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi % 0b10111 -> \T{\\10111} - \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi %$% \T{77\$L} - \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar - \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}% - \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi -} -\def\makeolproctokctlii{% - \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}% - \else\ifx\nxt\LL\addF{<<}\else\ifx\nxt\NULL\addF{NULL}% - \else\ifx\nxt\AND\addF&\else\ifx\nxt\OR\addF|% - \else\ifx\nxt\XOR\addF^\else\ifx\nxt\CM\addF\tildechar - \else\ifx\nxt\MOD\addF{\string\%}\else\ifx\nxt\DC\addF{::}% - \else\ifx\nxt\PA\addF{.*}\else\ifx\nxt\MGA\addF{->*}% - \else\ifx\nxt\this\addF{this}\else\ifx\nxt\?\addF?% - \else\ifx\nxt\E\addF{==}\else\ifx\nxt\G\addF{>=}% - \else\ifx\nxt\I\addF{!=}\else\ifx\nxt\K\addF{=}% - \else\ifx\nxt\l\addF{l}\else\ifx\nxt\L\addF{L}% - \else\ifx\nxt\o\addF{o}\else\ifx\nxt\O\addF{O}% - \else\ifx\nxt\R\addF!% - \else\ifx\nxt\T \Tnumtrue \let\next\makeolgobbletok - \tokprocessedtrue % \T{number} - \else\ifx\nxt\AM\addF&\else\ifx\nxt\%\addF{\string\%}% - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi\fi -} -\def\makeolproctokctliii{% - \ifx\nxt\V\addF{||}\else\ifx\nxt\W\addF{&&}\else\ifx\nxt\Z\addF{<=}% - \else\ifx\nxt\*\addF*\else\ifx\nxt\Xand\addF{\space and\space}% - \else\ifx\nxt\Xandxeq\addF{\space and_eq\space}% - \else\ifx\nxt\Xbitand\addF{\space bitand\space}% - \else\ifx\nxt\Xbitor\addF{\space bitor\space}% - \else\ifx\nxt\Xcompl\addF{\space compl\space}% - \else\ifx\nxt\Xnot\addF{\space not\space}% - \else\ifx\nxt\Xnotxeq\addF{\space not_eq\space}% - \else\ifx\nxt\Xor\addF{\space or\space}% - \else\ifx\nxt\Xorxeq\addF{\space or_eq\space}% - \else\ifx\nxt\Xxor\addF{\space xor\space}% - \else\ifx\nxt\Xxorxeq\addF{\space xor_eq\space}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi -} -\def\outlinedone{\edef\outlinest{\global\noexpand\toksE={\the\toksF}}% - \outlinest\let\outlinedone=\relax} -\fi % End of pdf macros - -\ifhint -% The following uses HINT primitives to implement: -% \HINThome to mark the position of the home page -% \HINTlabel to attach a label to the top of a section -% \HINTlink to link a section number to the section label -% \HINTcontents to produce an 'outline' item -% These are the top level HINT macros that are used in this file -% No HINT primitives are used directly. -\def\HINThome{\HINTdest name {HINT.home}% - \HINToutline goto name {HINT.home} depth 1 {Table of Contents}} -\def\HINTlabel{{\let\*=\empty\HINTdest num \secstar top}} -\def\HINTlink#1#2{\HINTstartlink goto num #1 {#1}\HINTendlink}% #2 not used ??? -\def\HINTcontents#1#2#3{\HINToutline goto num #3 depth #2 {#1}} -\let\pdflink=\HINTlink -\fi % End of HINT macros - -% Common macros for \ifacro and \ifhint -\ifacrohint -\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} -\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% - \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} - \toksC={}\let\space\empty}\makenote}\maketoks}} -\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} -\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% - \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} -\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% - \ifnum\countB>`9 \countB=0 \fi - \ifnum\countB<`0 - \ifnum0=\countC\else\makenote\fi - \ifx\first.\let\next=\maketoksdone\else - \let\next=\maketoks - \addtokens\toksB{\the\toksD} - \ifx\first,\addtokens\toksB{\space}\fi - \fi - \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks - \fi - \next -} -\def\makenote{\addtokens\toksB - {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} -\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\fi % End of common macros +\ifacrohint \input cwebacromac \fi % load hypertext macros \def\pdfURL#1#2{\ifpdf \ifpdftex\pdfannotlink height \theheight depth \thedepth attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A diff --git a/source/texk/web2c/cwebdir/cwebman-w2c.ch b/source/texk/web2c/cwebdir/cwebman-w2c.ch index 929fd58d38..b9352a3da9 100644 --- a/source/texk/web2c/cwebdir/cwebman-w2c.ch +++ b/source/texk/web2c/cwebdir/cwebman-w2c.ch @@ -241,10 +241,10 @@ As an example of a real program written in \.{CWEB}, \Appendix A @z @x -Appendix B is the file that sets \TEX/ up to accept +Appendix B displays the files that set \TEX/ up to accept the output of \.{CWEAVE}, and Appendix~C discusses how to use some of those @y -\Appendix B is the file that sets \TEX/ up to accept +\Appendix B displays the files that set \TEX/ up to accept the output of \.{CWEAVE}, and \Appendix C discusses how to use some of those @z @@ -327,10 +327,16 @@ And here's what the same excerpt looks like when typeset. @x if you have a duplex printer. Appendices D, E, and F of the complete +version of this manual are printed using a commented-out option that +substitutes `$\gets$' for `$=$' in the program listings. Looking at those @y if you have a duplex printer. Appendices \pdfURL{D}{common.pdf}, \pdfURL{E}{ctangle.pdf}, and \pdfURL{F}{cweave.pdf}\cwebfootnote{And \pdfURL{Appendix~G}{ctwill.pdf}.} of the complete +version of this manual are printed using a commented-out option that +substitutes `$\gets$' for `$=$' in the program listings.\cwebfootnote{They +also make use of the alternative format for \CEE/ comments.} +Looking at those @z @x diff --git a/source/texk/web2c/cwebdir/cwebman.tex b/source/texk/web2c/cwebdir/cwebman.tex index 108bd32f88..3804c56cb4 100644 --- a/source/texk/web2c/cwebdir/cwebman.tex +++ b/source/texk/web2c/cwebdir/cwebman.tex @@ -1187,7 +1187,7 @@ examines the listings in this appendix carefully will get a good feeling for the basic ideas of \.{CWEB}. -Appendix B is the file that sets \TEX/ up to accept +Appendix B displays the files that set \TEX/ up to accept the output of \.{CWEAVE}, and Appendix~C discusses how to use some of those macros to vary the output formats. @@ -1524,20 +1524,28 @@ \vskip6pt \begingroup \def\tt{\eighttt} \baselineskip9pt -\def\printmacs{\begingroup +\def\printmacs#1{\begingroup \def\do##1{\catcode`##1=12 } \dospecials \parskip 0pt \parindent 0pt \catcode`\ =13 \catcode`\^^M=13 - \tt \verbatimdefs \input cwebmac \endgroup} -\printmacs + \tt \verbatimdefs \input cweb#1mac \endgroup} +\printmacs{\empty} + +\vskip6pt \baselineskip12pt +\noindent And here comes the file that extends \.{cwebmac.tex} in order to +support the ``hypertext'' features needed by the enhanced \TEX/ engines when +processing the output of \.{CWEAVE}. + +\vskip6pt \baselineskip9pt +\printmacs{acro} \endgroup \vfill\eject \def\runninghead{APPENDIX C --- NOTES ON FORMATTING} \section Appendix C: How to use \.{CWEB} macros. -The macros in \.{cwebmac} make it possible to produce a variety of formats -without editing the output of \.{CWEAVE}, and the purpose of this appendix -is to explain some of the possibilities. +The macros in \.{cwebmac} and \.{cwebacromac} make it possible to produce a +variety of formats without editing the output of \.{CWEAVE}, and the purpose +of this appendix is to explain some of the possibilities. \def\point#1.{\yskip\indent#1.\quad\ignorespaces} @@ -1615,8 +1623,8 @@ \point 9. Data for the table of contents is written to a file that is read after the indexes have been \TEX/ed; there's one line of data for every starred section. The file \.{common.toc} might look like this: -$$\lpile{\.{\\ZZ \{Introduction\}\{0\}\{1\}\{29\}\{\}}\cr - \.{\\ZZ \{The character set\}\{1\}\{21\}\{35\}\{\}}\cr}$$ +$$\lpile{\.{\\ZZ \{Introduction\}\{1\}\{1\}\{30\}\{\}}\cr + \.{\\ZZ \{The character set\}\{1\}\{21\}\{36\}\{\}}\cr}$$ and so on. The \.{\\topofcontents} macro could redefine \.{\\ZZ} so that the information appears in any desired format. (See also point~19 below.) @@ -1752,7 +1760,7 @@ can be opened up to list every section name; Acrobat users can therefore navigate easily to any desired section. -The macros of \.{cwebmac.tex} are careful to ``sanitize'' all the names +The macros of \.{cwebacromac.tex} are careful to ``sanitize'' all the names that appear as bookmarks, by removing special characters and formatting codes that are inappropriate for the limited typographic capabilities of {\mc PDF} outlines. For example, one section of \.{CWEAVE} diff --git a/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex b/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex index 811af25149..9a64c366a4 100644 --- a/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex +++ b/source/texk/web2c/cwebdir/texinputs/pdfctproofmac.tex @@ -1,10 +1,10 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 4.9 --- June 2023 +% Version 4.10 --- August 2023 % modified for proofs in CTWILL % modified for PDF output with 'tex "\let\pdf+', 'pdftex', 'xetex', and 'hitex' % This file is not copyrighted and can be used freely. \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CTWILL4.9+PROOFS+PDF} +\xdef\fmtversion{\fmtversion+CTWILL4.10+PROOFS+PDF} \input iftex.sty % TeX engine tests \ifx\pdf+\pdftrue\fi % for plain TeX in combination with dvipdfm % Uncomment the following line if you want PDF goodies to be the default @@ -13,7 +13,7 @@ \ifxetex\pdftrue\fi % XeTeX produces PDF output \ifpdftex % pdfTeX produces PDF output if \pdfoutput>0 \def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too - \def\PDFlinkcolor{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}} + \def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}} \fi \let\ifacro=\ifpdf \newif\ifacrohint \ifacro\acrohinttrue\fi \ifhint\acrohinttrue\fi @@ -135,160 +135,7 @@ \newif\iftokprocessed \newif\ifTnum \newif\ifinstr {\def\\{\global\let\spacechar= }\\ } -\ifacro % The following are pdf macros -\def\thewidth{\the\wd0 \space} -\def\theheight{\the\ht\strutbox\space} -\def\thedepth{\the\dp\strutbox\space} -\ifpdftex - \ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14 - \def\pdflink#1#2{\hbox{\pdfannotlink height \theheight depth \thedepth - attr{/Border [0 0 0]} goto num #1 \PDFlinkcolor #1\Black\pdfendlink}} -\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}% - \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight - depth \thedepth << /Type /Annot /Subtype /Link - /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi -\def\sanitizecommand#1#2{\addtokens\usersanitizer - {\noexpand\dosanitizecommand\noexpand#1{#2}}} -\def\dosanitizecommand#1#2{\ifx\nxt#1\addF{#2}\fi} - -\catcode`\[=1 \catcode`\]=2 \catcode`\{=12 \catcode`\}=12 - \def\lbchar[{] \def\rbchar[}] -\catcode`\[=12 \catcode`\]=12 \catcode`\{=1 \catcode`\}=2 -\catcode`\~=12 \def\tildechar{~} \catcode`\~=13 -\catcode`\|=0 |catcode`|\=12 |def|bschar{\} |catcode`|\=0 \catcode`\|=12 -\def\makeoutlinetoks{\Tnumfalse\afterassignment\makeolproctok\let\nxt= } -\def\makeolnexttok{\afterassignment\makeolproctok\let\nxt= } -\def\makeolgobbletok{\afterassignment\makeolnexttok\let\nxt= } -\def\addF#1{\addtokens\toksF{#1}\tokprocessedtrue} -% now comes a routine to "sanitize" section names, for pdf outlines -\def\makeolproctok{\tokprocessedfalse - \let\next\makeolnexttok % default - \ifx\nxt\outlinedone\let\next\outlinedone - \else\ifx{\nxt \else\ifx}\nxt \Tnumfalse \instrfalse % skip braces - \else\ifx$\nxt % or a $ sign - \else\ifx^\nxt \addF^\else\ifx_\nxt \addF_% sanitize ^ and _ - \else\ifx\nxt\spacechar \addF\space - \else\if\noexpand\nxt\relax % we have a control sequence; is it one we know? - \ifx\nxt~\addF\space - \else\ifx\nxt\onespace\addF\space - \else\the\usersanitizer - \iftokprocessed\else\makeolproctokctli - \iftokprocessed\else\makeolproctokctlii - \iftokprocessed\else\makeolproctokctliii % if not recognised, skip it - \fi\fi\fi\fi\fi - \else % we don't have a control sequence, it's an ordinary char - \ifx/\nxt \addF{\string\/}% quote chars special to PDF with backslash - \else\ifx(\nxt \addF{\string\(}\else\ifx)\nxt \addF{\string\)}% - \else\ifx[\nxt \addF{\string\[}\else\ifx]\nxt \addF{\string\]}% - \else\expandafter\makeolproctokchar\meaning\nxt - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next -} -\def\makeolproctokchar#1 #2 #3{\addF{#3}} -\def\makeolproctokctli{% - \ifx\nxt\CEE\addF{C}\let\next\makeolgobbletok % \CEE/ - \else\ifx\nxt\UNIX\addF{UNIX}\let\next\makeolgobbletok % \UNIX/ - \else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/ - \else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}% - \else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/ - \else\ifx\nxt\Cee\addF{C}% - \else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...} - \else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...} - % skip \| - \else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi - \else\ifx\nxt\&\ifinstr\addF&\else\tokprocessedtrue\fi - \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77} - \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5} - \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77} - \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi % 0b10111 -> \T{\\10111} - \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi %$% \T{77\$L} - \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar - \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}% - \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi -} -\def\makeolproctokctlii{% - \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}% - \else\ifx\nxt\LL\addF{<<}\else\ifx\nxt\NULL\addF{NULL}% - \else\ifx\nxt\AND\addF&\else\ifx\nxt\OR\addF|% - \else\ifx\nxt\XOR\addF^\else\ifx\nxt\CM\addF\tildechar - \else\ifx\nxt\MOD\addF{\string\%}\else\ifx\nxt\DC\addF{::}% - \else\ifx\nxt\PA\addF{.*}\else\ifx\nxt\MGA\addF{->*}% - \else\ifx\nxt\this\addF{this}\else\ifx\nxt\?\addF?% - \else\ifx\nxt\E\addF{==}\else\ifx\nxt\G\addF{>=}% - \else\ifx\nxt\I\addF{!=}\else\ifx\nxt\K\addF{=}% - \else\ifx\nxt\l\addF{l}\else\ifx\nxt\L\addF{L}% - \else\ifx\nxt\o\addF{o}\else\ifx\nxt\O\addF{O}% - \else\ifx\nxt\R\addF!% - \else\ifx\nxt\T \Tnumtrue \let\next\makeolgobbletok - \tokprocessedtrue % \T{number} - \else\ifx\nxt\AM\addF&\else\ifx\nxt\%\addF{\string\%}% - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi\fi -} -\def\makeolproctokctliii{% - \ifx\nxt\V\addF{||}\else\ifx\nxt\W\addF{&&}\else\ifx\nxt\Z\addF{<=}% - \else\ifx\nxt\*\addF*\else\ifx\nxt\Xand\addF{\space and\space}% - \else\ifx\nxt\Xandxeq\addF{\space and_eq\space}% - \else\ifx\nxt\Xbitand\addF{\space bitand\space}% - \else\ifx\nxt\Xbitor\addF{\space bitor\space}% - \else\ifx\nxt\Xcompl\addF{\space compl\space}% - \else\ifx\nxt\Xnot\addF{\space not\space}% - \else\ifx\nxt\Xnotxeq\addF{\space not_eq\space}% - \else\ifx\nxt\Xor\addF{\space or\space}% - \else\ifx\nxt\Xorxeq\addF{\space or_eq\space}% - \else\ifx\nxt\Xxor\addF{\space xor\space}% - \else\ifx\nxt\Xxorxeq\addF{\space xor_eq\space}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi -} -\def\outlinedone{\edef\outlinest{\global\noexpand\toksE={\the\toksF}}% - \outlinest\let\outlinedone=\relax} -\fi % End of pdf macros - -\ifhint -% The following uses HINT primitives to implement: -% \HINThome to mark the position of the home page -% \HINTlabel to attach a label to the top of a section -% \HINTlink to link a section number to the section label -% \HINTcontents to produce an 'outline' item -% These are the top level HINT macros that are used in this file -% No HINT primitives are used directly. -\def\HINThome{\HINTdest name {HINT.home}% - \HINToutline goto name {HINT.home} depth 1 {Table of Contents}} -\def\HINTlabel{{\let\*=\empty\HINTdest num \secstar top}} -\def\HINTlink#1#2{\HINTstartlink goto num #1 {#1}\HINTendlink}% #2 not used ??? -\def\HINTcontents#1#2#3{\HINToutline goto num #3 depth #2 {#1}} -\let\pdflink=\HINTlink -\fi % End of HINT macros - -% Common macros for \ifpdf and \ifhint -\ifacrohint -\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} -\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% - \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} - \toksC={}\let\space\empty}\makenote}\maketoks}} -\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} -\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% - \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} -\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% - \ifnum\countB>`9 \countB=0 \fi - \ifnum\countB<`0 - \ifnum0=\countC\else\makenote\fi - \ifx\first.\let\next=\maketoksdone\else - \let\next=\maketoks - \addtokens\toksB{\the\toksD} - \ifx\first,\addtokens\toksB{\space}\fi - \fi - \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks - \fi - \next -} -\def\makenote{\addtokens\toksB - {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} -\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\fi % End of common macros +\ifacrohint \input cwebacromac \fi % load hypertext macros \def\pdfURL#1#2{\ifpdf \ifpdftex\pdfannotlink height \theheight depth \thedepth attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A diff --git a/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex b/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex index f76d22ae8d..c982784fd2 100644 --- a/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex +++ b/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex @@ -1,11 +1,11 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 4.9 --- June 2023 +% Version 4.10 --- August 2023 % modified for pages produced by CTWILL % further modified for page size of the MMIXware book % modified for PDF output with 'tex "\let\pdf+', 'pdftex', and 'xetex' % This file is not copyrighted and can be used freely. \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CTWILL4.9+LNCS+PDF} +\xdef\fmtversion{\fmtversion+CTWILL4.10+LNCS+PDF} \input iftex.sty % TeX engine tests \ifx\pdf+\pdftrue\fi % for plain TeX in combination with dvipdfm % Uncomment the following line if you want PDF goodies to be the default @@ -14,13 +14,14 @@ \ifxetex\pdftrue\fi % XeTeX produces PDF output \ifpdftex % pdfTeX produces PDF output if \pdfoutput>0 \def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too - \def\PDFlinkcolor{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}} + \def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}} \fi \let\ifacro=\ifpdf \ifhint\message{These macros are not suitable for HiTeX.} \message{Please use 'ctwill +P [+lpdf]' instead.} \end \fi +\newif\ifacrohint \ifacro\acrohinttrue\fi \ifhint\acrohinttrue\fi \let\:=\. % preserve a way to get the dot accent % (all other accents will still work as usual) @@ -250,150 +251,7 @@ \newif\iftokprocessed \newif\ifTnum \newif\ifinstr {\def\\{\global\let\spacechar= }\\ } -\ifacro % The following are pdf macros -\def\thewidth{\the\wd0 \space} -\def\theheight{\the\ht\strutbox\space} -\def\thedepth{\the\dp\strutbox\space} -\ifpdftex - \ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14 - \def\pdflink#1#2{\hbox{\pdfannotlink height \theheight depth \thedepth - attr{/Border [0 0 0]} goto num #1 \PDFlinkcolor #1\Black\pdfendlink}} -\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}% - \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight - depth \thedepth << /Type /Annot /Subtype /Link - /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi -\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} -\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% - \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} - \toksC={}\let\space\empty}\makenote}\maketoks}} -\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} -\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% - \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} -\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% - \ifnum\countB>`9 \countB=0 \fi - \ifnum\countB<`0 - \ifnum0=\countC\else\makenote\fi - \ifx\first.\let\next=\maketoksdone\else - \let\next=\maketoks - \addtokens\toksB{\the\toksD} - \ifx\first,\addtokens\toksB{\space}\fi - \fi - \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks - \fi - \next -} -\def\makenote{\addtokens\toksB - {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} -\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\def\pdfURL#1#2{\ifpdf \ifpdftex\pdfannotlink height \theheight depth \thedepth - attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A - << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69 - \else {\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}% - \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight - depth \thedepth << /Border [0 0 0] /Type /Annot /Subtype /Link /A - << /S /URI /URI (#2) >> >>}\box0\relax}\fi - \else #1 ({\tt#2})\fi} -{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL -{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL -\def\sanitizecommand#1#2{\addtokens\usersanitizer - {\noexpand\dosanitizecommand\noexpand#1{#2}}} -\def\dosanitizecommand#1#2{\ifx\nxt#1\addF{#2}\fi} - -\catcode`\[=1 \catcode`\]=2 \catcode`\{=12 \catcode`\}=12 - \def\lbchar[{] \def\rbchar[}] -\catcode`\[=12 \catcode`\]=12 \catcode`\{=1 \catcode`\}=2 -\catcode`\~=12 \def\tildechar{~} \catcode`\~=13 -\catcode`\|=0 |catcode`|\=12 |def|bschar{\} |catcode`|\=0 \catcode`\|=12 -\def\makeoutlinetoks{\Tnumfalse\afterassignment\makeolproctok\let\nxt= } -\def\makeolnexttok{\afterassignment\makeolproctok\let\nxt= } -\def\makeolgobbletok{\afterassignment\makeolnexttok\let\nxt= } -\def\addF#1{\addtokens\toksF{#1}\tokprocessedtrue} -% now comes a routine to "sanitize" section names, for pdf outlines -\def\makeolproctok{\tokprocessedfalse - \let\next\makeolnexttok % default - \ifx\nxt\outlinedone\let\next\outlinedone - \else\ifx{\nxt \else\ifx}\nxt \Tnumfalse \instrfalse % skip braces - \else\ifx$\nxt % or a $ sign - \else\ifx^\nxt \addF^\else\ifx_\nxt \addF_% sanitize ^ and _ - \else\ifx\nxt\spacechar \addF\space - \else\if\noexpand\nxt\relax % we have a control sequence; is it one we know? - \ifx\nxt~\addF\space - \else\ifx\nxt\onespace\addF\space - \else\the\usersanitizer - \iftokprocessed\else\makeolproctokctli - \iftokprocessed\else\makeolproctokctlii - \iftokprocessed\else\makeolproctokctliii % if not recognised, skip it - \fi\fi\fi\fi\fi - \else % we don't have a control sequence, it's an ordinary char - \ifx/\nxt \addF{\string\/}% quote chars special to PDF with backslash - \else\ifx(\nxt \addF{\string\(}\else\ifx)\nxt \addF{\string\)}% - \else\ifx[\nxt \addF{\string\[}\else\ifx]\nxt \addF{\string\]}% - \else\expandafter\makeolproctokchar\meaning\nxt - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next -} -\def\makeolproctokchar#1 #2 #3{\addF{#3}} -\def\makeolproctokctli{% - \ifx\nxt\CEE\addF{C}\let\next\makeolgobbletok % \CEE/ - \else\ifx\nxt\UNIX\addF{UNIX}\let\next\makeolgobbletok % \UNIX/ - \else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/ - \else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}% - \else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/ - \else\ifx\nxt\Cee\addF{C}% - \else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...} - \else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...} - % skip \| - \else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi - \else\ifx\nxt\&\ifinstr\addF&\else\tokprocessedtrue\fi - \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77} - \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5} - \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77} - \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi % 0b10111 -> \T{\\10111} - \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi %$% \T{77\$L} - \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar - \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}% - \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi -} -\def\makeolproctokctlii{% - \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}% - \else\ifx\nxt\LL\addF{<<}\else\ifx\nxt\NULL\addF{NULL}% - \else\ifx\nxt\AND\addF&\else\ifx\nxt\OR\addF|% - \else\ifx\nxt\XOR\addF^\else\ifx\nxt\CM\addF\tildechar - \else\ifx\nxt\MOD\addF{\string\%}\else\ifx\nxt\DC\addF{::}% - \else\ifx\nxt\PA\addF{.*}\else\ifx\nxt\MGA\addF{->*}% - \else\ifx\nxt\this\addF{this}\else\ifx\nxt\?\addF?% - \else\ifx\nxt\E\addF{==}\else\ifx\nxt\G\addF{>=}% - \else\ifx\nxt\I\addF{!=}\else\ifx\nxt\K\addF{=}% - \else\ifx\nxt\l\addF{l}\else\ifx\nxt\L\addF{L}% - \else\ifx\nxt\o\addF{o}\else\ifx\nxt\O\addF{O}% - \else\ifx\nxt\R\addF!% - \else\ifx\nxt\T \Tnumtrue \let\next\makeolgobbletok - \tokprocessedtrue % \T{number} - \else\ifx\nxt\AM\addF&\else\ifx\nxt\%\addF{\string\%}% - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi\fi -} -\def\makeolproctokctliii{% - \ifx\nxt\V\addF{||}\else\ifx\nxt\W\addF{&&}\else\ifx\nxt\Z\addF{<=}% - \else\ifx\nxt\*\addF*\else\ifx\nxt\Xand\addF{\space and\space}% - \else\ifx\nxt\Xandxeq\addF{\space and_eq\space}% - \else\ifx\nxt\Xbitand\addF{\space bitand\space}% - \else\ifx\nxt\Xbitor\addF{\space bitor\space}% - \else\ifx\nxt\Xcompl\addF{\space compl\space}% - \else\ifx\nxt\Xnot\addF{\space not\space}% - \else\ifx\nxt\Xnotxeq\addF{\space not_eq\space}% - \else\ifx\nxt\Xor\addF{\space or\space}% - \else\ifx\nxt\Xorxeq\addF{\space or_eq\space}% - \else\ifx\nxt\Xxor\addF{\space xor\space}% - \else\ifx\nxt\Xxorxeq\addF{\space xor_eq\space}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi -} -\def\outlinedone{\edef\outlinest{\global\noexpand\toksE={\the\toksF}}% - \outlinest\let\outlinedone=\relax} -\fi % End of pdf macros +\ifacrohint \input cwebacromac \fi % load hypertext macros \def\lapstar{\rlap{*}} \def\stsec{\tenpoint\rightskip=0pt % get out of C mode (cf. \B) diff --git a/source/texk/web2c/eptexdir/am/eptex.am b/source/texk/web2c/eptexdir/am/eptex.am index 546fbf73c6..fce0a5e31a 100644 --- a/source/texk/web2c/eptexdir/am/eptex.am +++ b/source/texk/web2c/eptexdir/am/eptex.am @@ -92,7 +92,11 @@ EXTRA_DIST += \ # e-pTeX Tests # -eptex_tests = eptexdir/eptriptest.test eptexdir/pdfprimitive.test eptexdir/epver.test eptexdir/wcfname.test +eptex_tests = \ + eptexdir/eptriptest.test \ + eptexdir/pdfprimitive.test \ + eptexdir/epver.test \ + eptexdir/wcfname.test eptexdir/eptriptest.log: eptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) eptexdir/pdfprimitive.log: eptex$(EXEEXT) eptexdir/epver.log eptexdir/wcfname.log: eptex$(EXEEXT) diff --git a/source/texk/web2c/euptexdir/am/euptex.am b/source/texk/web2c/euptexdir/am/euptex.am index 5d86f39237..baa1bcf66d 100644 --- a/source/texk/web2c/euptexdir/am/euptex.am +++ b/source/texk/web2c/euptexdir/am/euptex.am @@ -93,10 +93,17 @@ EXTRA_DIST += \ # e-upTeX Tests # -euptex_tests = euptexdir/euptriptest.test euptexdir/eptriptest.test euptexdir/pdfprimitive.test euptexdir/eupver.test euptexdir/wcfname.test euptexdir/wcfname0.test -euptexdir/euptriptest.log euptexdir/eptriptest.log: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) +euptex_tests = \ + euptexdir/euptriptest.test euptexdir/eptriptest.test \ + euptexdir/pdfprimitive.test \ + euptexdir/eupver.test \ + euptexdir/upkcat.test \ + euptexdir/wcfname.test euptexdir/wcfname0.test +euptexdir/euptriptest.log euptexdir/eptriptest.log: \ + euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) euptexdir/pdfprimitive.log: euptex$(EXEEXT) -euptexdir/eupver.log euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT) +euptexdir/eupver.log euptexdir/upkcat.log \ + euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT) EXTRA_DIST += $(euptex_tests) diff --git a/source/texk/web2c/euptexdir/upkcat.test b/source/texk/web2c/euptexdir/upkcat.test new file mode 100755 index 0000000000..602c1e5b42 --- /dev/null +++ b/source/texk/web2c/euptexdir/upkcat.test @@ -0,0 +1,19 @@ +#! /bin/sh -vx +# $Id$ +# Copyright 2022 TANAKA Takuji +# You may freely use, modify and/or distribute this file. + +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_euptex=$BinDir/euptex$ExeExt + +LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE + +TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF +TEXINPUTS="$srcdir/uptexdir/tests;."; export TEXINPUTS + +$_euptex -ini -etex -interaction batchmode -jobname upkcat-log kcat.tex || exit 1 +grep '::' upkcat-log.log > upkcat-log_ed.log \ + && diff upkcat-log_ed.log $srcdir/uptexdir/tests/upkcat.txt || exit 2 + +exit 0 diff --git a/source/texk/web2c/man/ChangeLog b/source/texk/web2c/man/ChangeLog index 715d9e3dc0..d28619d6d2 100644 --- a/source/texk/web2c/man/ChangeLog +++ b/source/texk/web2c/man/ChangeLog @@ -1,3 +1,8 @@ +2023-09-22 Andreas Scherer + + * cweb.man, + * ctwill.man: Regenerate with Pandoc 3.1.7. + 2023-08-24 vaitkus * aleph.man, diff --git a/source/texk/web2c/man/ctwill.man b/source/texk/web2c/man/ctwill.man index b635fd0e5c..70d83f6821 100644 --- a/source/texk/web2c/man/ctwill.man +++ b/source/texk/web2c/man/ctwill.man @@ -1,27 +1,10 @@ .\" Automatically generated by Pandoc .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} .TH "CTWILL" "1" "August 19, 2023" "Web2c @VERSION@" "General Commands Manual" -.hy .SH NAME -.PP ctwill, ctwill-proofsort, ctwill-refsort, ctwill-twinx - translate CWEB to TeX with mini-indexes .SH SYNOPSIS -.PP \f[B]ctwill\f[R] [\f[I]options\f[R]] \f[I]webfile\f[R][.w] [{\f[I]changefile\f[R][.ch]|-} [\f[I]outfile\f[R][.tex]]] .PD 0 @@ -38,7 +21,6 @@ mini-indexes \f[B]ctwill-twinx\f[R] \f[I]outfile\f[R].tex [\f[I]outfile\f[R].tex \&...] > index.tex .SH DESCRIPTION -.PP The \f[B]ctwill\f[R] program converts a CWEB source document into a TeX\ file that may be formatted and printed in the usual way. It takes appropriate care of typographic details like page layout and @@ -52,7 +34,6 @@ and to produce a well-formatted document describing the program in as much detail as the writer may desire. The user of CWEB ought to be familiar with TeX as well as C/C++. .SH USAGE -.PP The command line should have one, two, or three names on it. The first is taken as the CWEB input file (and \f[B].w\f[R] is added if there is no extension). @@ -137,7 +118,6 @@ A complete example with all bells and whistles is described in \f[B]Mini-Indexes for Literate Programs\f[R], pages 225\[en]245 of Knuth\[cq]s \f[B]Digital Typography\f[R] (\f[I]CSLI\f[R], 1999). .SH DIFFERENCES TO ORIGINAL CTWILL -.PP The present incarnation of \f[B]ctwill\f[R] and its utilities tries hard to be a drop-in replacement for the original package. There are, however, a few differences worth noting: @@ -168,7 +148,6 @@ permit several, colon-separated, paths; see ENVIRONMENT below. If properly configured, the main program \f[B]ctwill\f[R] is localized with the \[lq]GNU gettext utilities\[rq]. .SH OPTIONS -.PP Options on the command line may be either turned off with `\f[B]-\f[R]' (if they are on by default) or turned on with `\f[B]+\f[R]' (if they are off by default). @@ -217,7 +196,6 @@ output .IP \[bu] 2 \f[B]--version\f[R]: output version information and exit .SH ENVIRONMENT -.PP The environment variable CWEBINPUTS is used to search for the input files, or the system default if CWEBINPUTS is not set. See tex(1) for the details of the searching. @@ -233,7 +211,6 @@ search for translation catalogs. These variables are preconfigured in TeX\ Live\[cq]s \f[B]texmf.cnf\f[R]. .SH FILES -.PP The location of the files mentioned below varies from system to system. Use the \f[B]kpsewhich\f[R] utility to find their locations. .IP \[bu] 2 @@ -280,7 +257,6 @@ Weaving a Program: by Wayne Sewell. .PP cweb(1), tex(1), cc(1) .SH AUTHORS -.PP Don Knuth wrote \f[B]ctwill\f[R] based on \f[B]cweave\f[R] by Silvio Levy and Knuth. .PD 0 diff --git a/source/texk/web2c/man/cweb.man b/source/texk/web2c/man/cweb.man index b1d051551f..d67fe17136 100644 --- a/source/texk/web2c/man/cweb.man +++ b/source/texk/web2c/man/cweb.man @@ -1,26 +1,9 @@ .\" Automatically generated by Pandoc .\" -.\" Define V font for inline verbatim, using C font in formats -.\" that render this, and otherwise B font. -.ie "\f[CB]x\f[]"x" \{\ -. ftr V B -. ftr VI BI -. ftr VB B -. ftr VBI BI -.\} -.el \{\ -. ftr V CR -. ftr VI CI -. ftr VB CB -. ftr VBI CBI -.\} .TH "CWEB" "1" "August 20, 2022" "Web2c @VERSION@" "General Commands Manual" -.hy .SH NAME -.PP ctangle, cweave - translate CWEB to C/C++ and/or TeX .SH SYNOPSIS -.PP \f[B]ctangle\f[R] [\f[I]options\f[R]] \f[I]webfile\f[R][.w] [{\f[I]changefile\f[R][.ch]|-} [\f[I]outfile\f[R][.c]]] .PD 0 @@ -29,7 +12,6 @@ ctangle, cweave - translate CWEB to C/C++ and/or TeX \f[B]cweave\f[R] [\f[I]options\f[R]] \f[I]webfile\f[R][.w] [{\f[I]changefile\f[R][.ch]|-} [\f[I]outfile\f[R][.tex]]] .SH DESCRIPTION -.PP The \f[B]ctangle\f[R] program converts a CWEB source document into a C/C++\ program that may be compiled in the usual way. The output file includes \f[B]#line\f[R] specifications so that @@ -48,7 +30,6 @@ and to produce a well-formatted document describing the program in as much detail as the writer may desire. The user of CWEB ought to be familiar with TeX as well as C/C++. .SH USAGE -.PP The command line should have one, two, or three names on it. The first is taken as the CWEB input file (and \f[B].w\f[R] is added if there is no extension). @@ -62,7 +43,6 @@ the current directory) with the extension \f[B].tex\f[R]. If you just want to change the output file name, but don\[cq]t have a change file to apply, you can use `\f[B]-\f[R]' as the second argument. .SH DIFFERENCES TO ORIGINAL CWEB -.PP CWEBbin tries hard to be a drop-in replacement for CWEB, so in general you should not notice any differences in invoking the programs nor in the resulting output. @@ -85,7 +65,6 @@ permit several, colon-separated, paths; see ENVIRONMENT below. If properly configured, the main programs \f[B]ctangle\f[R] and \f[B]cweave\f[R] are localized with the \[lq]GNU gettext utilities\[rq]. .SH OPTIONS -.PP Options on the command line may be either turned off with `\f[B]-\f[R]' (if they are on by default) or turned on with `\f[B]+\f[R]' (if they are off by default). @@ -142,7 +121,6 @@ output \f[B]+t\f[R]: treat \f[B]typename\f[R] in a template like \f[B]typedef\f[R] .SH ENVIRONMENT -.PP The environment variable CWEBINPUTS is used to search for the input files, or the system default if CWEBINPUTS is not set. See tex(1) for the details of the searching. @@ -158,7 +136,6 @@ translation catalogs. These variables are preconfigured in TeX\ Live\[cq]s \f[B]texmf.cnf\f[R]. .SH FILES -.PP The location of the files mentioned below varies from system to system. Use the \f[B]kpsewhich\f[R] utility to find their locations. .IP \[bu] 2 @@ -180,7 +157,6 @@ Weaving a Program: by Wayne Sewell. .PP cweb(1), tex(1), cc(1) .SH AUTHORS -.PP Don Knuth wrote WEB for TeX and Pascal. .PD 0 .P diff --git a/source/texk/web2c/ptexdir/ChangeLog b/source/texk/web2c/ptexdir/ChangeLog index 8ac9123da9..890d153de6 100644 --- a/source/texk/web2c/ptexdir/ChangeLog +++ b/source/texk/web2c/ptexdir/ChangeLog @@ -1,3 +1,8 @@ +2023-09-17 Hironobu Yamashita + + * ptex-base.ch: Support more than 256 different glue/kern. + * ptex_version.h: Version p4.1.1. + 2023-09-03 TANAKA Takuji * {ptriptest,pver}.test: diff --git a/source/texk/web2c/ptexdir/am/ptex.am b/source/texk/web2c/ptexdir/am/ptex.am index 1985be9308..663b9c17cf 100644 --- a/source/texk/web2c/ptexdir/am/ptex.am +++ b/source/texk/web2c/ptexdir/am/ptex.am @@ -102,7 +102,10 @@ EXTRA_DIST += \ # pTeX Tests # -ptex_tests = ptexdir/ptriptest.test ptexdir/pver.test ptexdir/wcfname.test +ptex_tests = \ + ptexdir/ptriptest.test \ + ptexdir/pver.test \ + ptexdir/wcfname.test ptexdir/ptriptest.log: ptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) ptexdir/pver.log ptexdir/wcfname.log: ptex$(EXEEXT) @@ -125,8 +128,10 @@ endif PWEB EXTRA_DIST += ptexdir/tests/nissya.bst ptexdir/tests/sample.bib DISTCLEANFILES += ptests/nissya_bib.* ## ptexdir/pbibtex.test -EXTRA_DIST += 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 \ +EXTRA_DIST += 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 tests/enc-amb1.bib tests/enc-amb2.bib \ tests/enc.aux 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 diff --git a/source/texk/web2c/ptexdir/ptex-base.ch b/source/texk/web2c/ptexdir/ptex-base.ch index 4a57d3eb17..3ed7b821e7 100644 --- a/source/texk/web2c/ptexdir/ptex-base.ch +++ b/source/texk/web2c/ptexdir/ptex-base.ch @@ -73,6 +73,7 @@ % More details in TUGboat 41(2):329--334, 2020. % (2022-10-24) HY pTeX p4.1.0 Add new syntax \font [in jis/ucs]. % New primitives: \tojis, \ptextracingfonts and \ptexfontname. +% (2023-09-17) HY pTeX p4.1.1 Support more than 256 different glue/kern. @x % Here is TeX material that gets inserted after \input webmac @@ -87,8 +88,8 @@ @y @d pTeX_version=4 @d pTeX_minor_version=1 -@d pTeX_revision==".0" -@d pTeX_version_string=='-p4.1.0' {current \pTeX\ version} +@d pTeX_revision==".1" +@d pTeX_version_string=='-p4.1.1' {current \pTeX\ version} @# @d pTeX_banner=='This is pTeX, Version 3.141592653',pTeX_version_string @d pTeX_banner_k==pTeX_banner @@ -3359,9 +3360,11 @@ for k:=char_base[f]+bc to width_base[f]-1 do end else begin if b<>bchar then check_existence(b); if c<128 then begin - if jfm_flag<>dir_default then begin if d>=ne then abort; end + if jfm_flag<>dir_default then + begin if 256*c+d>=ne then abort; end {check glue} else check_existence(d); {check ligature} - end else if 256*(c-128)+d>=nk then abort; {check kern} + end + else if 256*(c-128)+d>=nk then abort; {check kern} if a<128 then if k-lig_kern_base[f]+a+1>=nl then abort; end; end; @@ -4451,7 +4454,7 @@ if (math_type(subscr(q))=empty)and(math_type(supscr(q))=empty)and@| loop@+ begin if next_char(cur_i)=cur_c then if skip_byte(cur_i)<=stop_flag then if op_byte(cur_i)null then begin while((type(gp)<>rr)and(link(gp)<>null)) do begin gp:=link(gp); end; @@ -8070,7 +8073,7 @@ if inhibit_glue_flag<>true then end; loop@+begin if next_char(main_j)=cur_l then if skip_byte(main_j)<=stop_flag then begin if op_byte(main_j)null then begin while((type(gp)<>cur_r)and(link(gp)<>null)) do gp:=link(gp); gq:=glue_ptr(gp); diff --git a/source/texk/web2c/ptexdir/ptex_version.h b/source/texk/web2c/ptexdir/ptex_version.h index 7e26abb0f5..13e0f1467b 100644 --- a/source/texk/web2c/ptexdir/ptex_version.h +++ b/source/texk/web2c/ptexdir/ptex_version.h @@ -1 +1 @@ -#define PTEX_VERSION "p4.1.0" +#define PTEX_VERSION "p4.1.1" diff --git a/source/texk/web2c/uptexdir/ChangeLog b/source/texk/web2c/uptexdir/ChangeLog index 42bd7490c7..ee6bbf40c0 100644 --- a/source/texk/web2c/uptexdir/ChangeLog +++ b/source/texk/web2c/uptexdir/ChangeLog @@ -1,4 +1,15 @@ -2022-09-16 TANAKA Takuji +2023-09-21 Hironobu Yamashita + + * uptex-m.ch: Clean up changes on 2023-09-03. + * unibib.test: New test for upbibtex. + +2023-09-17 Hironobu Yamashita + + * uppltotf.ch, uptftopl.ch: Version p230917. + - Support more than 256 different glue/kern. + * gk256.test, tests/gk256[gk].{tex,tfm}: New tests. + +2023-09-16 TANAKA Takuji * uptex-m.ch, upbibtex.ch, uptex_version.h: upTeX version u1.30. diff --git a/source/texk/web2c/uptexdir/am/uptex.am b/source/texk/web2c/uptexdir/am/uptex.am index c4226b35ff..672f067734 100644 --- a/source/texk/web2c/uptexdir/am/uptex.am +++ b/source/texk/web2c/uptexdir/am/uptex.am @@ -1,7 +1,7 @@ ## $Id$ ## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX. ## -## Copyright 2016-2022 Karl Berry +## Copyright 2016-2023 Karl Berry ## Copyright 2011-2015 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. @@ -161,13 +161,19 @@ bin_links += uptftopl$(EXEEXT):ptftopl ## EXTRA_DIST += \ uptexdir/COPYRIGHT \ - uptexdir/COPYRIGHT.jis \ + uptexdir/COPYRIGHT.ja \ uptexdir/ChangeLog # upTeX Tests -uptex_tests = uptexdir/uptriptest.test uptexdir/ptriptest.test uptexdir/upver.test uptexdir/upkcat.test uptexdir/wcfname.test uptexdir/wcfname0.test -uptexdir/uptriptest.log uptexdir/ptriptest.log: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) -uptexdir/upver.log uptexdir/upkcat.log uptexdir/wcfname.log uptexdir/wcfname0.log: uptex$(EXEEXT) +uptex_tests = \ + uptexdir/uptriptest.test uptexdir/ptriptest.test \ + uptexdir/upver.test \ + uptexdir/upkcat.test \ + uptexdir/wcfname.test uptexdir/wcfname0.test +uptexdir/uptriptest.log uptexdir/ptriptest.log: \ + uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT) +uptexdir/upver.log uptexdir/upkcat.log \ + uptexdir/wcfname.log uptexdir/wcfname0.log: uptex$(EXEEXT) upweb_tests = \ uptexdir/upbibtex.test \ uptexdir/updvitype.test \ @@ -176,23 +182,27 @@ upweb_tests = \ ## upBibTeX upweb_tests += \ uptexdir/upbibtex-openout-test.pl uptexdir/upbibtex-longline-test.pl \ - uptexdir/upbibtex-mem.test uptexdir/nissya.test + uptexdir/upbibtex-mem.test uptexdir/nissya.test \ + uptexdir/unibib.test ## upDviType upweb_tests += \ uptexdir/sample.test # uppPLtoTF/upTFtoPL upweb_tests += \ uptexdir/yokotate.test uptexdir/skipjfmp.test \ - uptexdir/newjfm.test uptexdir/uparse.test uptexdir/gkhuge.test + uptexdir/newjfm.test uptexdir/uparse.test \ + uptexdir/gkhuge.test uptexdir/gk256.test uptexdir/upbibtex.log: upbibtex$(EXEEXT) uptexdir/updvitype.log: updvitype$(EXEEXT) uptexdir/uppltotf.log: uppltotf$(EXEEXT) uptexdir/uptftopl.log: uptftopl$(EXEEXT) uptexdir/upbibtex-openout-test.log uptexdir/upbibtex-longline-test.log \ - uptexdir/upbibtex-mem.log uptexdir/nissya.log: upbibtex$(EXEEXT) + uptexdir/upbibtex-mem.log uptexdir/nissya.log \ + uptexdir/unibib.log: upbibtex$(EXEEXT) uptexdir/sample.log: updvitype$(EXEEXT) uptexdir/yokotate.log uptexdir/skipjfmp.log \ - uptexdir/newjfm.log uptexdir/uparse.log uptexdir/gkhuge.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT) + uptexdir/newjfm.log uptexdir/uparse.log \ + uptexdir/gkhuge.log uptexdir/gk256.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT) EXTRA_DIST += $(uptex_tests) $(upweb_tests) DISTCLEANFILES += $(upweb_programs:=.c) $(upweb_programs:=.h) \ @@ -241,6 +251,9 @@ DISTCLEANFILES += uptests/xuparse.* uptests/yuparse.* ## uptexdir/gkhuge.test EXTRA_DIST += uptexdir/tests/gkhugeok.tfm uptexdir/tests/gkhugeng.tfm uptexdir/tests/gkhugeng.err DISTCLEANFILES += uptests/ygkhuge*.* +## uptexdir/gk256.test +EXTRA_DIST += uptexdir/tests/gk256g.tfm uptexdir/tests/gk256k.tfm +DISTCLEANFILES += uptests/ygk256*.* ## uptexdir/skipjfmp.test DISTCLEANFILES += uptests/xskipjfmp.* ## uptexdir/uptriptest diff --git a/source/texk/web2c/uptexdir/gk256.test b/source/texk/web2c/uptexdir/gk256.test new file mode 100755 index 0000000000..96fae296ca --- /dev/null +++ b/source/texk/web2c/uptexdir/gk256.test @@ -0,0 +1,30 @@ +#! /bin/sh -vx +# $Id$ +# Copyright 2023 Karl Berry +# You may freely use, modify and/or distribute this file. + +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_uppltotf=$BinDir/uppltotf$ExeExt +_uptftopl=$BinDir/uptftopl$ExeExt + +test -d uptests || mkdir -p uptests + +TEXMFCNF=$srcdir/../kpathsea +export TEXMFCNF + +# Test inputs +testdir=$srcdir/uptexdir/tests + +# Testing upPLtoTF/upTFtoPL for huge GLUEKERN table +# with over 256 different glue/kern. +for font in gk256g gk256k; do + + # This test is constructed as a cycle, since JPL source + # of gkhugeok.tfm is so large. + $_uptftopl -verbose $testdir/$font.tfm uptests/y$font.pl && \ + $_uppltotf -verbose uptests/y$font.pl uptests/y$font.tfm && \ + cmp $testdir/$font.tfm uptests/y$font.tfm && echo || exit 1 + +done + diff --git a/source/texk/web2c/uptexdir/tests/gk256.tex b/source/texk/web2c/uptexdir/tests/gk256.tex new file mode 100644 index 0000000000..b8a8628f0b --- /dev/null +++ b/source/texk/web2c/uptexdir/tests/gk256.tex @@ -0,0 +1,66 @@ +%#!uptex + +%% まずは kern が 256 を超える時: +% * (u)pPLtoTF はエラー発生しないが正常に格納できず→修正 +% * (u)pTFtoPL は元々読み出し OK +% * (u)pTeX は元々読み出し OK +% ※オリジナルの TeX は max_kerns=5000 まで許容 + +\prebreakpenalty`…=0 +\prebreakpenalty`・=0 +\prebreakpenalty`。=0 + +\tracingonline1 +\showboxdepth10000 +\showboxbreadth10000 +\ptextracingfonts2 + +\font\x=upjisr-h\x +\setbox0=\hbox{あ……あ}\showbox0 +\box0 + +\font\y=gk-over256-kern\y +\setbox2=\hbox{あ……あ}\showbox2 +\box2 + +\newfam\mx +\newfam\my +\textfont\mx=\x \scriptfont\mx=\x \scriptscriptfont\mx=\x +\textfont\my=\y \scriptfont\my=\y \scriptscriptfont\my=\y + +\jfam\mx +\setbox4=\hbox{$あ……あ$}\showbox4 +\box4 + +\jfam\my +\setbox6=\hbox{$あ……あ$}\showbox6 +\box6 + +%% 次に glue が 256 を超える時: +% * (u)pPLtoTF は 256 を超えるとエラー→修正 +% * (u)pTFtoPL は読み出せず→修正 +% * (u)pTeX も正常に読み出せず→修正 +% →新しい (u)pTeX では max_kerns*3 = 15000 まで許容してみた + +\font\z=upjisg-h\z +\setbox0=\hbox{あ・・あ。あ}\showbox0 +\box0 + +\font\w=gk-over256-glue\w +\setbox2=\hbox{あ・・あ。あ}\showbox2 +\box2 + +\newfam\mz +\newfam\mw +\textfont\mz=\z \scriptfont\mz=\z \scriptscriptfont\mz=\z +\textfont\mw=\w \scriptfont\mw=\w \scriptscriptfont\mw=\w + +\jfam\mz +\setbox4=\hbox{$あ・・あ。あ$}\showbox4 +\box4 + +\jfam\mw +\setbox6=\hbox{$あ・・あ。あ$}\showbox6 +\box6 + +\bye diff --git a/source/texk/web2c/uptexdir/tests/gk256g.tfm b/source/texk/web2c/uptexdir/tests/gk256g.tfm new file mode 100644 index 0000000000..fb1051b7a9 Binary files /dev/null and b/source/texk/web2c/uptexdir/tests/gk256g.tfm differ diff --git a/source/texk/web2c/uptexdir/tests/gk256k.tfm b/source/texk/web2c/uptexdir/tests/gk256k.tfm new file mode 100644 index 0000000000..9a40b0f66e Binary files /dev/null and b/source/texk/web2c/uptexdir/tests/gk256k.tfm differ diff --git a/source/texk/web2c/uptexdir/tests/jplain.bst b/source/texk/web2c/uptexdir/tests/jplain.bst new file mode 100644 index 0000000000..652179eb96 --- /dev/null +++ b/source/texk/web2c/uptexdir/tests/jplain.bst @@ -0,0 +1,1385 @@ + % version 0.30 for JBibTeX versions 0.30 or later, LaTeX version 2.09. + % Copyright (C) 1990, all rights reserved. + % + % This file is derived from btxbst.doc of BibTeX 0.99c + % + % Copying of this file is authorized only if either + % (1) you make absolutely no changes to your copy, including name, or + % (2) if you do make changes, you name it something other than + % jbtxbst.doc, jplain.bst, junsrt.bst, jalpha.bst, jabbrv.bst, + % tipsj.bst, jipsj.bst, tieice.bst, jname.bst, jorsj.bst + % + % This restriction helps ensure that all standard styles are identical. + % The file jbtxbst.doc has the documentation for this style. + % + % Please notify Shouichi MATSUI(matsui@denken.or.jp) of any bugs in + % these standard styles or in this documentation file. + % 松井 正一 (財) 電力中央研究所 情報システム部 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + yomi + } + {is.kanji.entry} + + { label } + + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + +} +STRINGS { s t } + + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + + { ", " * write$ } + + { output.state after.block = + { + + add.period$ write$ + + newline$ + "\newblock " write$ + } + + { output.state before.all = + 'write$ + + { add.period$ " " * write$ } + + if$ + } + + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {output.bibitem} +{ newline$ + + "\bibitem{" write$ + + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} +FUNCTION {fin.entry} +{ + + add.period$ + + write$ + newline$ +} +FUNCTION {new.block} +{ output.state before.all = + + 'skip$ + { after.block 'output.state := } + + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { duplicate$ is.kanji.str$ + 'skip$ + { "{\em " swap$ * "}" * } + if$ + } + if$ +} + +INTEGERS { nameptr namesleft numnames } +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + + { s nameptr "{ff}{ll}" format.name$ is.kanji.str$ + {s nameptr "{ff}{ll}" format.name$ 't :=} + {s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=} + if$ + + nameptr #1 > + { namesleft #1 > + + {", " * t * } + + + { t "others" = + + { s is.kanji.str$ + + {"ほか" * } + + + {", et~al." * } + + if$ + } + { s is.kanji.str$ + + {", " * t * } + + + + { numnames #2 = + {" and " * t * } + {", and " * t * } + if$ + } + + + if$ + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} +FUNCTION {format.authors} +{ author empty$ + { "" } + + { author format.names } + + if$ +} +FUNCTION {format.editors} +{ editor empty$ + { "" } + + { editor format.names + + editor num.names$ #1 > + { editor is.kanji.str$ + + {"(編)" * } {", editors" * } if$ + + } + { editor is.kanji.str$ + + {"(編)" *} {", editor" * } if$ + + } + if$ + } + if$ +} + +FUNCTION {format.title} + +{ title empty$ + + { "" } + + + { title "t" change.case$ } + + + if$ +} +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} +FUNCTION {format.date} + +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$ + month + } + if$ + } + { month empty$ + 'year + { month " " * year * } + if$ + } + if$ +} + +FUNCTION {format.btitle} + +{ title emphasize +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { volume is.kanji.str$ + { volume } + { is.kanji.entry + {"第" volume * "巻" *} + {"Vol." volume tie.or.space.connect} + if$ + } + if$ + series empty$ + 'skip$ + { series is.kanji.str$ + { volume empty$ + {series swap$ * } + + {series ", " * swap$ * } + + if$ + } + { " of " * series emphasize * } + if$ + } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { number is.kanji.str$ + { number } + {"No." number tie.or.space.connect} + if$ + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { series is.kanji.str$ + + { series ", " * swap$ * } + + { " in " * series * } + if$ + } + if$ + } + if$ + } + { "" } + if$ +} +FUNCTION {format.edition} +{ edition empty$ + { "" } + { edition is.kanji.str$ + { edition } + { is.kanji.entry + {"第" edition * "版" *} + { output.state mid.sentence = + { edition "l" change.case$ " edition" * } + { edition "t" change.case$ " edition" * } + if$ + } + if$ + } + if$ + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + + { "pp." pages n.dashify tie.or.space.connect } + { "p." pages tie.or.space.connect } + + if$ + } + if$ +} + + +FUNCTION {format.vol.num.pages} +{ volume empty$ + {""} + + + { volume is.kanji.str$ + {volume ", " * } + {"Vol." volume tie.or.space.connect ", " * } + if$ + } + + + if$ + number empty$ + 'skip$ + + { number is.kanji.str$ + {number *} + {"No." number tie.or.space.connect *} + if$ + + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { number empty$ + + { format.pages * } + { ", " * format.pages * } + + if$ + } + if$ + } + if$ +} + + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { chapter is.kanji.str$ + { "" } + { is.kanji.entry + {"章"} + {"chapter"} + if$ + } + if$ + } + { type "l" change.case$ } + if$ + chapter is.kanji.str$ not is.kanji.entry and + {"第" chapter * swap$ *} + { chapter is.kanji.str$ + {chapter *} + {chapter tie.or.space.connect} + if$ + } + if$ + pages empty$ + 'skip$ + + { ", " * format.pages * } + + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { booktitle is.kanji.str$ + { " " booktitle emphasize * } + + { "In " booktitle emphasize * } + + if$ + } + { booktitle is.kanji.str$ + + { " " format.editors * ", " * booktitle * } + + + { "In " format.editors * ", " * booktitle emphasize * } + + if$ + } + if$ + } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + + key empty$ not and + + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} +FUNCTION {format.tr.number} +{ type empty$ + { "Technical Report" } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { title is.kanji.str$ + { " " journal * } + + { "In {\em " journal * "\/}" * } + + if$ + } + if$ + } + { title is.kanji.str$ + { " " key * } + + { "In " key * } + + if$ + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.crossref.editor} +{ editor is.kanji.str$ + + {editor #1 "{ff}" format.name$ duplicate$ + + empty$ + {pop$ editor #1 "{ll}" format.name$} + 'skip$ + if$ + } + + {editor #1 "{vv~}{ll}" format.name$} + + if$ + editor num.names$ duplicate$ + #2 > + { editor is.kanji.str$ + + {pop$ "ほか" *} {pop$ ", et~al." * } if$ + + } + { #2 < + 'skip$ + + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + + { editor is.kanji.str$ + + {"ほか" *} {", et~al." * } if$ + + } + { editor is.kanji.str$ + { + + ", " * + + editor #2 "{ff}" format.name$ duplicate$ + empty$ + {pop$ editor #2 "{ll}" format.name$} + 'skip$ + if$ + * + } + {" and " * editor #2 "{vv~}{ll}" format.name$ * } + if$ + } + if$ + } + if$ + } + if$ +} +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + title is.kanji.str$ + + {" "} {"In "} if$ + + } + { volume is.kanji.str$ + { volume } + { is.kanji.entry + {"第" volume * "巻" *} + {"Vol." volume tie.or.space.connect " of " * } + if$ + } + if$ + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + + { series is.kanji.str$ + + { series ", " * swap$ * } + + { "{\em " * series * "\/}" * } + if$ + } + + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { booktitle is.kanji.str$ + { booktitle } + + {"In {\em " booktitle * "\/}" * } + + if$ + } + if$ + } + + { "In " key * } + + if$ + } + { title is.kanji.str$ + {" " format.crossref.editor * } + + {"In " format.crossref.editor * } + + if$ + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { journal emphasize "journal" output.check + + format.vol.num.pages output + format.date "year" output.check + +} + { format.article.crossref output.nonnull + format.pages output + } + if$ + + new.block + note output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + + new.sentence + + publisher "publisher" output.check + address output + } + { new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + + format.date "year" output.check + + new.block + note output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + new.block + format.title "title" output.check + howpublished address new.block.checkb + howpublished output + address output + format.date output + + new.block + note output + fin.entry +} +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + + format.chapter.pages "chapter and pages" output.check + + new.block + format.number.series output + + new.sentence + + publisher "publisher" output.check + address output + } + + { format.chapter.pages "chapter and pages" output.check + + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + + + new.block + note output + fin.entry +} +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + + + format.chapter.pages output + + + + new.sentence + + publisher "publisher" output.check + address output + format.edition output + + format.date "year" output.check + + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + + new.block + note output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + + + format.pages output + + + + address empty$ + { organization publisher new.sentence.checkb + + organization output + + publisher output + + format.date "year" output.check + + } + { address output.nonnull + + format.date "year" output.check + + + new.sentence + + organization output + + publisher output + + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + + new.block + note output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull + address output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + format.btitle "title" output.check + author empty$ + { organization empty$ + { address new.block.checka + address output + } + 'skip$ + if$ + } + { organization address new.block.checkb + organization output + address output + } + if$ + format.edition output + format.date output + + new.block + note output + fin.entry +} +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + "Master's thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + + new.block + note output + fin.entry +} +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished output + format.date output + + new.block + note output + fin.entry + empty.misc.check +} +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle "title" output.check + new.block + "PhD thesis" format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + + new.block + note output + fin.entry +} +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + address empty$ + { editor empty$ + { publisher new.sentence.checka } + { organization publisher new.sentence.checkb + organization output + } + if$ + publisher output + format.date "year" output.check + + } + { address output.nonnull + format.date "year" output.check + + + new.sentence + + editor empty$ + 'skip$ + { organization output } + if$ + publisher output + } + if$ + new.block + note output + fin.entry +} +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" output.check + address output + format.date "year" output.check + + new.block + note output + fin.entry +} +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + note "note" output.check + format.date output + fin.entry +} +FUNCTION {default.type} { misc } + +MACRO {jan} {"January"} +MACRO {feb} {"February"} +MACRO {mar} {"March"} +MACRO {apr} {"April"} +MACRO {may} {"May"} +MACRO {jun} {"June"} +MACRO {jul} {"July"} +MACRO {aug} {"August"} +MACRO {sep} {"September"} +MACRO {oct} {"October"} +MACRO {nov} {"November"} +MACRO {dec} {"December"} + + +MACRO {acmcs} {"ACM Computing Surveys"} +MACRO {acta} {"Acta Informatica"} +MACRO {cacm} {"Communications of the ACM"} +MACRO {ibmjrd} {"IBM Journal of Research and Development"} +MACRO {ibmsj} {"IBM Systems Journal"} +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} +MACRO {ieeetc} {"IEEE Transactions on Computers"} +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} +MACRO {ipl} {"Information Processing Letters"} +MACRO {jacm} {"Journal of the ACM"} +MACRO {jcss} {"Journal of Computer and System Sciences"} +MACRO {scp} {"Science of Computer Programming"} +MACRO {sicomp} {"SIAM Journal on Computing"} +MACRO {tocs} {"ACM Transactions on Computer Systems"} +MACRO {tods} {"ACM Transactions on Database Systems"} +MACRO {tog} {"ACM Transactions on Graphics"} +MACRO {toms} {"ACM Transactions on Mathematical Software"} +MACRO {toois} {"ACM Transactions on Office Information Systems"} +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} +MACRO {tcs} {"Theoretical Computer Science"} +MACRO {tieice} {"電子情報通信学会論文誌"} +MACRO {tipsj} {"情報処理学会論文誌"} +MACRO {jipsj} {"Journal of Informatin Processing Society of Japan"} +MACRO {jorsj} {"Journal of the Operations Research Society of Japan"} + +READ +FUNCTION {set.is.kanji.entry} +{ + author field.or.null is.kanji.str$ + title field.or.null is.kanji.str$ or + editor field.or.null is.kanji.str$ or + journal field.or.null is.kanji.str$ or + booktitle field.or.null is.kanji.str$ or + series field.or.null is.kanji.str$ or + 'is.kanji.entry := +} +ITERATE {set.is.kanji.entry} + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + + + +FUNCTION {sort.format.names} +{ 's := + yomi empty$ + 'skip$ + { yomi 's := } + if$ + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { ", " * } + 'skip$ + if$ + + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := + + nameptr numnames = t "others" = and + { s is.kanji.str$ + + {"ほか" * } + + {"et~al." *} + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.organization.sort} +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.organization.sort} +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} + +{ type$ "book" = + + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ + + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {presort} +SORT + + +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} + +FUNCTION {begin.bib} + +{ preamble$ empty$ + + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} diff --git a/source/texk/web2c/uptexdir/tests/unibib.bbl b/source/texk/web2c/uptexdir/tests/unibib.bbl index 718ab2c44b..e61fc1c347 100644 --- a/source/texk/web2c/uptexdir/tests/unibib.bbl +++ b/source/texk/web2c/uptexdir/tests/unibib.bbl @@ -7,9 +7,9 @@ Tomas Björk. \bibitem{boswell} Dustin Boswell and Trevor Foucher. -\newblock リーダブルコード - ―より良いコードを書くためのシンプルで実践的 - なテクニック (Theory in practice). +\newblock + リーダブルコード ―より良いコードを書くためのシンプルで実践的 なテクニック (Theory + in practice). \newblock オライリージャパン, 2012. \bibitem{dostoevskii} diff --git a/source/texk/web2c/uptexdir/unibib.test b/source/texk/web2c/uptexdir/unibib.test new file mode 100755 index 0000000000..fdd7400d32 --- /dev/null +++ b/source/texk/web2c/uptexdir/unibib.test @@ -0,0 +1,28 @@ +#! /bin/sh -vx +# $Id$ +# Copyright 2023 Karl Berry +# You may freely use, modify and/or distribute this file. + +BinDir=${BinDir:-.} +ExeExt=${ExeExt:-} +_upbibtex=$BinDir/upbibtex$ExeExt + +test -d uptests || mkdir -p uptests + +# Test inputs +testdir=$srcdir/uptexdir/tests + +rc=0 + +TEXMFCNF=$srcdir/../kpathsea +BSTINPUTS=$testdir +BIBINPUTS=$testdir +export TEXMFCNF BSTINPUTS BIBINPUTS + +cp $testdir/unibib.aux uptests/xunibib.aux + +$_upbibtex uptests/xunibib || rc=1 +diff $testdir/unibib.bbl uptests/xunibib.bbl || rc=2 + +exit $rc + diff --git a/source/texk/web2c/uptexdir/uppltotf.ch b/source/texk/web2c/uptexdir/uppltotf.ch index 06960c591f..4c6b7fb9df 100644 --- a/source/texk/web2c/uptexdir/uppltotf.ch +++ b/source/texk/web2c/uptexdir/uppltotf.ch @@ -1,5 +1,6 @@ % This is a change file for PLtoTF % +% (2023-09-17) HY Support more than 256 different glue/kern % (2022-12-03) TTK Merge pPLtoTF source/binary into upPLtoTF % (2018-01-27) HY pPLtoTF p2.0 - new JFM spec by texjporg % (07/18/2006) ST PLtoTF p1.8 (3.5, Web2c 7.2) @@ -17,7 +18,7 @@ @d banner=='This is PLtoTF, Version 3.6' {printed when the program starts} @y @d my_name=='uppltotf' -@d banner=='This is upPLtoTF, Version 3.6-p221203' +@d banner=='This is upPLtoTF, Version 3.6-p230917' {printed when the program starts} @z @@ -113,12 +114,17 @@ dir_code: read_direction; @z @x [110] l.1915 - pTeX: there are no charlists in kanji format files. +@; +@; for c:=0 to 255 do @; @y -if file_format=tfm_format then +if file_format=tfm_format then begin + @; + @; for c:=0 to 255 do @; + end; @z @x [120] l.2037 - pTeX: when checking glue_kern prog check glues as well @@ -140,23 +146,12 @@ if file_format=tfm_format then if lig_gen>=128 then if(c<128)or(c=256) then if(lig_exam<128)or(lig_exam=bchar) then seven_unsafe:=true; end - else check_existence(lig_exam)('GLUE character generated by'); + else if lig_exam<>bchar then + check_existence(lig_exam)('GLUE character examined by'); +@.GLUE character examined...@> end @z -@x [126] l.2178 - pTeX: Fix up output of bytes. -@= -if nl>0 then for lig_ptr:=0 to nl-1 do - if lig_kern[lig_ptr].b2= -@z - @x [128] l.2207 - pTeX: Decide the |file_format|. @= @y @@ -376,7 +371,7 @@ file_format:undefined..vfm_format; {the format of the input file} kanji_type:array[0..max_kanji] of -1..256; {the type of every kanji char } kanji_type_index:0..max_kanji; { index into above } nt:integer; {number of entries in character type table} -glue:array[0..768] of fix_word; {the distinct glue amounts} +glue:array[0..15000] of fix_word; {the distinct glue amounts, equals 3 * |max_kerns|} ng:integer; {number of 3-word entries in glue table} @ @= @@ -416,7 +411,8 @@ load11("E")("X")("T")("R")("A")("S")("H")("R")("I")("N")("K") There routines a bit similar reading ligature/kern programs. @= -begin while level=1 do +begin lk_step_ended:=false; +while level=1 do begin while cur_char=" " do get_next; if cur_char="(" then @ else if cur_char=")" then skip_to_end_of_item @@ -442,60 +438,68 @@ else begin case cur_code of end; end -@ When a character is about to be tagged, we use the following -so that an error message is given in case of multiple tags. - -@= -begin c:=get_byte; -case char_tag[c] of - no_tag: do_nothing; - lig_tag: err_print('This character already appeared in a GLUEKERN LABEL'); - @.This character already...@> - list_tag: err_print('Impossible: a list tag in a kanji format file?'); - ext_tag: err_print('Impossible: an extensible tag in a kanji format file?'); +@ When a character is about to be tagged, we call the following +procedure so that an error message is given in case of multiple tags. + +@= +procedure check_tag_gluekern(c:byte); {print error if |c| already tagged} +begin case char_tag[c] of +no_tag: do_nothing; +lig_tag: err_print('This character already appeared in a GLUEKERN LABEL'); +@.This character already...@> +list_tag: err_print('Impossible: a list tag in a kanji format file?'); +ext_tag: err_print('Impossible: an extensible tag in a kanji format file?'); end; -if nl>max_lig_steps then - err_print('GLUEKERN with more than ',max_lig_steps,' commands cannot have further labels') -@.GLUEKERN with more than...@> -else begin char_tag[c]:=lig_tag; char_remainder[c]:=nl; - lk_step_ended:=false; +end; + +@ @= +begin while cur_char=" " do get_next; +if cur_char="B" then + begin bchar_label:=nl; skip_to_paren; {\.{LABEL BOUNDARYCHAR}} + end +else begin backup; c:=get_byte; + check_tag_gluekern(c); char_tag[c]:=lig_tag; char_remainder[c]:=nl; end; +if min_nl<=nl then min_nl:=nl+1; +lk_step_ended:=false; end @ @= -begin lig_kern[nl].b0:=0; lig_kern[nl].b1:=get_byte;@/ -lig_kern[nl].b2:=kern_flag; kern[nk]:=get_fix; krn_ptr:=0; +begin lig_kern[nl].b0:=0; lig_kern[nl].b1:=get_byte; +kern[nk]:=get_fix; krn_ptr:=0; while kern[krn_ptr]<>kern[nk] do incr(krn_ptr); if krn_ptr=nk then begin if nk - krn_ptr:=max_kerns-1; + decr(krn_ptr); end; end; -lig_kern[nl].b3:=krn_ptr; -if nl=max_lig_steps then - err_print('GLUEKERN table should never exceed ',max_lig_steps,' LIG/KRN commands') +lig_kern[nl].b2:=kern_flag+(krn_ptr div 256); +lig_kern[nl].b3:=krn_ptr mod 256; +if nl>=max_lig_steps-1 then + err_print('GLUEKERN table should never exceed ',max_lig_steps,' GLUE/KRN commands') @.GLUEKERN table should never...@> else incr(nl); lk_step_ended:=true; end @ @= -begin lig_kern[nl].b0:=0; lig_kern[nl].b1:=get_byte; lig_kern[nl].b2:=0;@/ +begin lig_kern[nl].b0:=0; lig_kern[nl].b1:=get_byte; glue[3*ng+0]:=get_fix; glue[3*ng+1]:=get_fix; glue[3*ng+2]:=get_fix; krn_ptr:=0; while (glue[3*krn_ptr+0]<>glue[3*ng+0])or (glue[3*krn_ptr+1]<>glue[3*ng+1])or (glue[3*krn_ptr+2]<>glue[3*ng+2]) do incr(krn_ptr); if krn_ptr=ng then - begin if ng<256 then incr(ng) - else begin err_print('At most 256 different glues are allowed'); - krn_ptr:=255; + begin if ng=max_lig_steps-1 then err_print('GLUEKERN table should never exceed ',max_lig_steps,' GLUE/KRN commands') @.GLUEKERN table should never...@> else incr(nl); diff --git a/source/texk/web2c/uptexdir/uptex-m.ch b/source/texk/web2c/uptexdir/uptex-m.ch index cc6886ecc1..f8698ab9af 100644 --- a/source/texk/web2c/uptexdir/uptex-m.ch +++ b/source/texk/web2c/uptexdir/uptex-m.ch @@ -1,5 +1,5 @@ % $Id$ -% This is a change file for upTeX u1.29 +% This is a change file for upTeX u1.30 % By Takuji Tanaka. % % (02/26/2007) TTK upTeX u0.01 @@ -859,8 +859,7 @@ if cur_cmd=char_given then else begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); @; end; end; if cur_cmd=kchar_given then - begin cur_chr:=cur_chr mod max_cjk_val; - cur_cmd:=kcat_code(kcatcodekey(cur_chr)); @; end; + begin cur_cmd:=kcat_code(kcatcodekey(cur_chr)); @; end; if cur_cmd=char_num then begin scan_char_num; cur_chr:=cur_val; if check_echar_range(cur_chr) then goto main_loop_lookahead+1 diff --git a/source/texk/web2c/uptexdir/uptftopl.ch b/source/texk/web2c/uptexdir/uptftopl.ch index 5046263cc9..af21ffe429 100644 --- a/source/texk/web2c/uptexdir/uptftopl.ch +++ b/source/texk/web2c/uptexdir/uptftopl.ch @@ -1,5 +1,6 @@ % This is a change file for TFtoPL % +% (2023-09-17) HY Support more than 256 different glue/kern % (2022-12-03) TTK Merge pTFtoPL source/binary into upTFtoPL % (2018-01-27) HY pTFtoPL p2.0 - new JFM spec by texjporg % (07/18/2006) ST TFtoPL p1.7 (3.1, Web2c 7.2) @@ -16,7 +17,7 @@ @d banner=='This is TFtoPL, Version 3.3' {printed when the program starts} @y @d my_name=='uptftopl' -@d banner=='This is upTFtoPL, Version 3.3-p221203' +@d banner=='This is upTFtoPL, Version 3.3-p230917' {printed when the program starts} @z @@ -258,6 +259,12 @@ if file_format<>tfm_format then out_ln;@/ @z +@x [68] l.1075 - pTeX: no need to check for loop + @; +@y + if file_format=tfm_format then begin @; end; +@z + @x [69] l.1090 - pTeX: we print Glue/kern instead of Ligature/kern print('Ligature/kern starting index for character '); print_octal(c); print_ln(' is too large;'); print_ln('so I removed it.'); reset_tag(c); @@ -411,22 +418,21 @@ We need to include some routines for handling kanji character. @!kanji_type:array[0..max_kanji] of -1..255; {kanji type index} @ @= -begin if nonexistent(tfm[k+1]) then - correct_bad_char('Glue step for')(k+1) +begin if nonexistent(tfm[k+1]) then if tfm[k+1]<>boundary_char then + correct_bad_char('Glue step for')(k+1); @.Glue step for nonexistent...@> -else - begin left; out('GLUE'); out_char(tfm[k+1]); - if 3*tfm[k+3]>=ng then - begin bad('Glue index too large.'); +left; out('GLUE'); out_char(tfm[k+1]); +r:=3*(256*tfm[k+2]+tfm[k+3]); +if r>=ng then + begin bad('Glue index too large.'); @.Glue index too large@> - out(' R 0.0 R 0.0 R 0.0'); - end - else begin out_fix(glue(3*tfm[k+3])); - out_fix(glue(3*tfm[k+3]+1)); - out_fix(glue(3*tfm[k+3]+2)); - end; - right; + out(' R 0.0 R 0.0 R 0.0'); + end +else begin out_fix(glue(r)); + out_fix(glue(r+1)); + out_fix(glue(r+2)); end; +right; end @ list the |char_type| table in a similar way to the type table.