diff --git a/Makefile.unix b/Makefile.unix
index 847b4e6e..d6258cf1 100644
--- a/Makefile.unix
+++ b/Makefile.unix
@@ -4,7 +4,7 @@
# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
#
# Modified for GCC under Linux by Andreas Scherer, June 8, 1996.
-# Last updated by Andreas Scherer, February 2022.
+# Last updated by Andreas Scherer, August 2022.
# The following copyright notice extends to the changes in this Makefile
# only, not to any part of the original CWEB distribution.
@@ -182,7 +182,7 @@ COMMPATCH = comm-extensions.ch comm-extensions.hch \
comm-output.ch comm-output.hch \
comm-patch.ch comm-texlive.ch comm-texlive.hch
CTANGPATCH = ctang-i18n.ch ctang-newpage.ch ctang-output.ch \
- ctang-patch.ch ctang-texlive.ch
+ ctang-patch.ch ctang-texlive.ch ctang+u.ch
CWEAVPATCH = cweav-extensions.ch prod-cweave.ch cweav-i18n.ch cweav-newpage.ch \
cweav-output.ch cweav-patch.ch cweav-texlive.ch cwtw-texlive.ch
CTWILLPATCH = cweav-twill.ch prod-twill.ch ctwill-texlive.ch ctwill-man.ch
@@ -400,7 +400,7 @@ $(CCHANGES): common.w comm-patch.ch comm-extensions.ch \
$(HCHANGES): common.h comm-extensions.hch \
comm-output.hch comm-i18n.hch # comm-texlive.hch
$(TIE) -m $@ $^
-$(TCHANGES): ctangle.w ctang-patch.ch \
+$(TCHANGES): ctangle.w ctang-patch.ch ctang+u.ch \
ctang-output.ch ctang-i18n.ch # ctang-texlive.ch
$(TIE) -c $@ $^; $(SUBVER)
$(WCHANGES): cweave.w cweav-patch.ch cweav-extensions.ch \
diff --git a/README.md b/README.md
index b679eb54..91fccec5 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[cweb system](http://www-cs-faculty.stanford.edu/~uno/cweb.html)
and donald e. knuth's [ctwill program](http://ftp.cs.stanford.edu/pub/ctwill).
it requires the contents of [the original *cweb* source
-drop](https://github.com/ascherer/cweb/releases/download/cweb-4.8/cweb-4.8.tar.gz)
+drop](https://github.com/ascherer/cweb/releases/download/cweb-4.9/cweb-4.9.tar.gz)
and [the secondary *ctwill* source
drop](http://ftp.cs.stanford.edu/pub/ctwill/ctwill.tar.gz), to which it applies
a set of change files to introduce advanced features. see the extensive
@@ -23,11 +23,11 @@ a set of change files to introduce advanced features. see the extensive
## manual compilation
-extract `ctwill.tar.gz` and add the contents of `cweb-4.8.tar.gz` (overwriting
+extract `ctwill.tar.gz` and add the contents of `cweb-4.9.tar.gz` (overwriting
outdated source files `Makefile`, `common.h`, `common.w`, and `prod.w`) and
-`cwebbin-2022.2.tar.gz` for the full set of source files.
+`cwebbin-2023.tar.gz` for the full set of source files.
replace `@@VERSION@@` in line 129 of the `Makefile.unix` with something like
-`Version 4.8 [CWEBbin 2022.2]`.
+`Version 4.9 [CWEBbin 2023]`.
`touch *.cxx`.
unix/linux users should work with [`make -f Makefile.unix`](Makefile.unix)
exclusively (targets `boot`, `cautiously`, and `all`).
@@ -47,8 +47,8 @@ clone
[cweb](https://github.com/ascherer/cweb) and
[cwebbin](https://github.com/ascherer/cwebbin), create the source drops with
```
-git archive -o cweb-4.8.tar.gz cweb-4.8
-git archive -o cwebbin-2022.2.tar.gz cwebbin-2022.2
+git archive -o cweb-4.9.tar.gz cweb-4.9
+git archive -o cwebbin-2023.tar.gz cwebbin-2023
```
respectively, put these two tarballs and the original `ctwill.tar.gz` in the
*SOURCES* directory, add the patch files
@@ -95,5 +95,5 @@ macros, and cweb include files.
updated versions of **cweb** are added to the texlive source tree with
```
cd /path/to/texlive-source/texk/web2c/cwebdir
-pax -rzf /path/to/cweb-4.8.tar.gz
+pax -rzf /path/to/cweb-4.9.tar.gz
```
diff --git a/README.txt b/README.txt
index 41650388..f28497e1 100644
--- a/README.txt
+++ b/README.txt
@@ -1,12 +1,12 @@
-*-Text-*-
%%% LEGALESE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% This file is part of CWEBbin (Version 4.8 [2022]).
+% This file is part of CWEBbin (Version 4.9 [2023]).
% (Set TAB to 8 spaces to get the spacing right.)
% The CWEB programs by Silvio Levy are based on programs by D. E. Knuth.
% They are distributed WITHOUT ANY WARRANTY, express or implied.
-% This README file was last updated June 5, 2022 by Andreas Scherer.
+% This README file was last updated May 15, 2023 by Andreas Scherer.
% The following copyright notices extend to the respective parts of the
% changed or added source code introduced in this patch only, not to the
@@ -16,7 +16,7 @@
% Copyright (C) 1991-1993 Hans-Hermann Bode
% Copyright (C) 1992 Klaus Guntermann
% Copyright (C) 1991,1993 Carsten Steger
-% Copyright (C) 1993-2000,2005,2011,2018–2022 Andreas Scherer
+% Copyright (C) 1993-2000,2005,2011,2018–2023 Andreas Scherer
% Permission is granted to make and distribute verbatim copies of this
% document provided that the copyright notice and this permission notice
@@ -55,11 +55,11 @@ CWEB 4.0 (and higher) can be retrieved from
https://github.com/ascherer/cweb
-To apply this patched version of CWEB, extract the patch archive (yielding a
-new subdirectory) and add the original distribution. Care has been taken to
-avoid collisions with any files from the original distribution and the
-Makefiles provide a target to cleanly remove the patch leaving only the files
-of the original distribution (and vice versa).
+To apply this patched version of CWEB, extract the patch archive and add the
+contents of the original distribution. Care has been taken to avoid
+collisions with any files from the original distribution and the Makefiles
+provide a target to cleanly remove the patch leaving only the files of the
+original distribution (and vice versa).
Intermediate files with extensions .tex and .cxx are reproducable from the
general sources by means of an executable ctangle, cweave, and an ANSI-C/C++
@@ -68,9 +68,12 @@ available at
CTAN: https://ctan.org/pkg/tie
-TIE should be available on all systems with a recent TeX installation.
-Alternatively, you can also try to use Julian Gilbey's CTIE processor, but
-intermediate results are different.
+To produce the CWEB source code of the CTWILL program from the original CWEAVE
+source, you need Julian Gilbey's CTIE processor, which is available at
+
+ CTAN: https://ctan.org/pkg/ctie
+
+C/TIE should be available on all systems with a recent TeX installation.
%%% TABLE OF CONTENTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -81,6 +84,7 @@ GENERAL CONTRIBUTION:
├── 0001-Support-extended-syntax-for-numeric-literals.patch for CTWILL
├── 0002-Purge-redundant-TeX-macro.patch for CTWILL
├── 0003-Adapt-to-CWEB-4.5.patch for CTWILL
+├── 0004-Add-silent-datecontentspage-macro.patch for CTWILL
├── comm-extensions.ch change file for common.w
├── comm-extensions.hch change file for common.h
├── comm-i18n.ch change file for common.w
@@ -251,10 +255,13 @@ GENERAL CONTRIBUTION:
itself. (Otherwise the source files common.w and ctangle.w won't
actually have been used.)
- 5. After all is set, you should become `superuser' and run `make -f
- Makefile.unix install'; this will install the binaries, the TeX macros
- and CWEB @include files, and some documentation in places specified in
- Makefile.unix.
+ 5. After all is set, you should become `superuser' and run
+ `make -f Makefile.unix install'; this will install the binaries, the
+ TeX macros and CWEB @include files, and some documentation in places
+ specified in Makefile.unix.
+ Please follow the instructions in README.md for 'advanced packaging'.
+ deb- and rpm-packages not only can be installed, but also cleanly
+ uninstalled from all system paths.
6. If you want a full documentation of the tangle and weave programs,
type `make -f Makefile.unix docs' or preferably `make -f Makefile.unix
@@ -392,11 +399,6 @@ I want to express my deep gratitude to Silvio Levy and Donald Knuth for the
marvelous tool they provided us with. Also I am indepted to my various pre-
and co-workers on whose initial ideas and contributions this package is based.
-
Happy CWEBbin'!
-June 5, 2022
-
-Andreas Scherer
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/comm-mini.ch b/comm-mini.ch
index 5b59ea70..3f809f9d 100644
--- a/comm-mini.ch
+++ b/comm-mini.ch
@@ -1,9 +1,9 @@
Limbo.
@x
-\def\title{Common code for CTANGLE and CWEAVE (Version 4.8 [CWEBbin 2022])}
+\def\title{Common code for CTANGLE and CWEAVE (Version 4.9 [CWEBbin 2023])}
@y
-\def\title{COMMON (Version 4.8 [CWEBbin 2022])}
+\def\title{COMMON (Version 4.9 [CWEBbin 2023])}
\def\contentspagenumber{0}
@z
diff --git a/comm-patch.ch b/comm-patch.ch
index 3a733092..7a222804 100644
--- a/comm-patch.ch
+++ b/comm-patch.ch
@@ -1,6 +1,6 @@
-*-Web-*-
This file, COMM-FOO.CH, is part of CWEBBIN (@VERSION@).
-It is a changefile for COMMON.W, Version 4.8.
+It is a changefile for COMMON.W, Version 4.9.
Technically, COMM-FOO.CH is constructed from a multitude of separate change
files by applying Klaus Guntermann's TIE processor. Any comments (like this
@@ -182,17 +182,19 @@ p21 29 October 2005 AS ANSI C++ patches to patch level [p21].
2022 05 February 2022 AS Tuneup for CWEB 4.7 [2022].
05 June 2022 AS Tuneup for CWEB 4.8 [2022].
+
+2023 15 May 2023 AS Tuneup for CWEB 4.9 [2023].
------------------------------------------------------------------------------
Material in limbo.
@x l.25
-\def\title{Common code for CTANGLE and CWEAVE (Version 4.8)}
+\def\title{Common code for CTANGLE and CWEAVE (Version 4.9)}
@y
\def\title{Common code for CTANGLE and CWEAVE (@VERSION@)}
@z
@x l.30
- \centerline{(Version 4.8)}
+ \centerline{(Version 4.9)}
@y
\centerline{(@VERSION@)}
@z
diff --git a/comm-texlive.ch b/comm-texlive.ch
index 90c3dc14..b20fe48f 100644
--- a/comm-texlive.ch
+++ b/comm-texlive.ch
@@ -13,13 +13,13 @@ Material in limbo.
\def\title{Common code for CTANGLE and CWEAVE (@VERSION@)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}} \ifacro\sanitizecommand\Kpathsea{KPATHSEA}\fi
-\def\title{Common code for CTANGLE and CWEAVE (4.8 [\TeX~Live])}
+\def\title{Common code for CTANGLE and CWEAVE (4.9 [\TeX~Live])}
@z
@x l.30 and l.191 of COMM-PATCH.CH
\centerline{(@VERSION@)}
@y
- \centerline{(Version 4.8 [\TeX~Live])}
+ \centerline{(Version 4.9 [\TeX~Live])}
@z
@x l.32
diff --git a/common.cxx b/common.cxx
index e6c1c086..111e2e63 100644
--- a/common.cxx
+++ b/common.cxx
@@ -582,8 +582,8 @@ fatal(_("! Cannot open output file "),tex_file_name);
static boolean input_ln(
FILE*fp)
{
-register int c= EOF;
-register char*k;
+int c= EOF;
+char*k;
if(feof(fp))return false;
limit= k= buffer;
while(k<=buffer_end&&(c= getc(fp))!=EOF&&c!='\n')
@@ -1370,7 +1370,7 @@ scan_args(void)
{
char*dot_pos;
char*name_pos;
-register char*s;
+char*s;
boolean found_web= false,found_change= false,found_out= false;
diff --git a/ctang+u.ch b/ctang+u.ch
new file mode 100644
index 00000000..8a2c30b6
--- /dev/null
+++ b/ctang+u.ch
@@ -0,0 +1,56 @@
+Changes for CTANGLE.W by Andreas Scherer.
+
+This set of changes extends CTANGLE's transliteration mechanism to ``poor man's
+UTF-8'' by stripping all but the last of a sequence of high-bit bytes
+representing a multi-byte character.
+
+Section 59.
+
+@x l.712
+@ @=@t\1\quad@>
+@y
+@ Nowadays, most computer files are encoded in some form of ``Unicode''. A very
+convenient special case is ``UTF-8'', a variable-length multi-byte encoding. In
+order to avoid major surgery for the transliteration feature---as tempting as
+the extended notation \.{@@l c3bc ue} might be---, \.{CTANGLE}
+accepts the \.{+u} option to activate a ``poor man's UTF-8'' mechanism. The
+first in a sequence of up to four high-bit bytes (amounting to more than
+$2^{20}$~possible character representations) determines the number of bytes
+used to represent the next character. Instead of extending the |translit| table
+to this multi-byte scenario, we simply strip all but the last byte and use this
+as the transliteration index.
+
+% Exercise 11.6 from the TeXbook:
+\def\frac#1/#2{\leavevmode\kern.1em\raise.5ex\hbox{\the\scriptfont0 #1}
+ \kern-.1em/\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
+
+\&{Example:} While in ``classic ASCII'' the German word {\it gr\"un\/} could be
+treated with transliteration \.{@@l fc ue} (from codepage ISO/IEC~8859-1) to
+get \.{gruen} as suggested above, in UTF-8 you'd be advised to use \.{@@l bc
+ue} instead, because character {\it \"u\/} (latin small letter u with
+diaeresis) is encoded as the two-byte sequence \.{c3 bc}, indicated by the
+initial three bits of byte \.{c3} (\.{1100 0011}). Note that this simple
+approach leads to the collision with character $\frac1/4$ (vulgar fraction one
+quarter) with its two-byte encoding \.{c2 bc}.
+
+@d transliterate_utf_eight flags['u']
+
+@=@t\1\quad@>
+@z
+
+@x l.717
+ if ((eight_bits)(*j)<0200) C_putc(*j);
+@^high-bit character handling@>
+ else C_printf("%s",translit[(eight_bits)(*j)-0200]);
+@y
+ if (ishigh(*j)) {
+@^high-bit character handling@>
+ if (transliterate_utf_eight) {
+ if ((eight_bits)(*j)>=0360) j+=3;
+ else if ((eight_bits)(*j)>=0340) j+=2;
+ else if ((eight_bits)(*j)>=0300) j+=1;
+ }
+ C_printf("%s",translit[(eight_bits)(*j)-0200]);
+ }
+ else C_putc(*j);
+@z
diff --git a/ctang-patch.ch b/ctang-patch.ch
index c93c71ef..d11abd4c 100644
--- a/ctang-patch.ch
+++ b/ctang-patch.ch
@@ -166,17 +166,19 @@ p21 29 October 2005 AS ANSI C++ patches for patch level [p21].
2022 05 February 2022 AS tuneup for CWEB 4.7 [2022].
05 June 2022 AS tuneup for CWEB 4.8 [2022].
+
+2023 15 May 2023 AS tuneup for CWEB 4.9 [2023].
------------------------------------------------------------------------------
Material in limbo.
@x l.30
-\def\title{CTANGLE (Version 4.8)}
+\def\title{CTANGLE (Version 4.9)}
@y
\def\title{CTANGLE (@VERSION@)}
@z
@x l.34
- \centerline{(Version 4.8)}
+ \centerline{(Version 4.9)}
@y
\centerline{(@VERSION@)}
@z
@@ -192,7 +194,7 @@ z
Section 1.
@x l.64
-@d banner "This is CTANGLE (Version 4.8)"
+@d banner "This is CTANGLE (Version 4.9)"
@y
@d banner "This is CTANGLE (@VERSION@)"
@z
diff --git a/ctang-texlive.ch b/ctang-texlive.ch
index a986fe40..a6900694 100644
--- a/ctang-texlive.ch
+++ b/ctang-texlive.ch
@@ -12,13 +12,13 @@ Material in limbo.
@x l.30 and l.169 of CTANG-PATCH.CH
\def\title{CTANGLE (@VERSION@)}
@y
-\def\title{CTANGLE (Version 4.8 [\TeX~Live])}
+\def\title{CTANGLE (Version 4.9 [\TeX~Live])}
@z
@x l.34 and l.175 of CTANG-PATCH.CH
\centerline{(@VERSION@)}
@y
- \centerline{(Version 4.8 [\TeX~Live])}
+ \centerline{(Version 4.9 [\TeX~Live])}
@z
@x l.36
@@ -38,7 +38,7 @@ Section 1.
@x l.64 and l.188 of CTANG-PATCH.CH and l.17 of CTANG-I18N.CH
@d banner _("This is CTANGLE (@VERSION@)")
@y
-@d banner "This is CTANGLE, Version 4.8"
+@d banner "This is CTANGLE, Version 4.9"
/* will be extended by the \TeX~Live |versionstring| */
@z
diff --git a/ctangle.cxx b/ctangle.cxx
index 084bd81a..b94bcec8 100644
--- a/ctangle.cxx
+++ b/ctangle.cxx
@@ -28,7 +28,7 @@
/*:4*/
#line 67 "ctangle.w"
-#define banner _("This is CTANGLE (Version 4.8 [CWEBbin 2022.2])") \
+#define banner _("This is CTANGLE (Version 4.9 [CWEBbin 2023])") \
#define _(s) gettext(s) \
diff --git a/ctwill-mini.ch b/ctwill-mini.ch
index dcb486e9..78531c03 100644
--- a/ctwill-mini.ch
+++ b/ctwill-mini.ch
@@ -252,6 +252,16 @@ Section 37.
@r @ Control codes are converted to \.{CWEAVE}'s internal
@z
+Section 42.
+
+CTWILL hickups on comment and produces unmatched '$' in mini-index.
+
+@x l.646
+skip_TeX(void) /* skip past pure \TEX/ code */
+@y
+skip_TeX(void)
+@z
+
Section 43.
@x
@@ -642,6 +652,15 @@ The raw input is converted into scraps according to the following table,
\yskip\halign{\quad#\hfil&\quad#\hfil&\quad\hfil#\hfil\cr
@z
+@x l.2137
+\.{\\hbox\{}\thinspace stuff\/\thinspace\.\} to the following scrap.
+@y
+\.{\\hbox\{}\thinspace stuff\/\thinspace\.\} to the following scrap.
+
+\smallskip
+*The \.{\\,} (thin space) is omitted in ``inner \TeX\ mode.''
+@z
+
Sections 117--125.
@x l.7 line numbers refer to 'prod.w'
@@ -714,7 +733,6 @@ Section 119.
{$\displaystyle\!\matrix{\strut\hbox{#1}\hfill\cr\hbox{#2}\hfill\cr
\strut\hbox{#3}\hfill\cr}$}
\yskip@-in@>
-@%@$dindent {CTWILL}110 =\T{\~226/}@>
\prodno=27 \midcol=2.5in
\def\theprodno{\number\prodno \global\advance\prodno by1\enspace}
\def\dagit{\dag\theprodno}
@@ -779,7 +797,6 @@ Section 121.
{$\displaystyle\!\matrix{\strut\hbox{#1}\hfill\cr\hbox{#2}\hfill\cr
\strut\hbox{#3}\hfill\cr}$}
\yskip@-any@>@-z@>@-g@>@-a@>@-x@>@-y@>@-f@>
-@%@$dindent {CTWILL}110 =\T{\~226/}@>
\prodno=61 \midcol=2.5in
\def\theprodno{\number\prodno \global\advance\prodno by1\enspace}
\def\dagit{\dag\theprodno}
@@ -1033,9 +1050,9 @@ Section 135--136.
@-cat1@>
@-cat2@>
@-cat3@>
-@$cat1 {CTWILL}136 =$(\\{pp}+\T{1})\MG\\{cat}$@>
-@$cat2 {CTWILL}136 =$(\\{pp}+\T{2})\MG\\{cat}$@>
-@$cat3 {CTWILL}136 =$(\\{pp}+\T{3})\MG\\{cat}$@>
+@$cat1 {CTWILL}135 =$(\\{pp}+\T{1})\MG\\{cat}$@>
+@$cat2 {CTWILL}135 =$(\\{pp}+\T{2})\MG\\{cat}$@>
+@$cat3 {CTWILL}135 =$(\\{pp}+\T{3})\MG\\{cat}$@>
@z
@x
@@ -1186,9 +1203,9 @@ should say, for example, `\.{@@!@@\^\\\&\{operator\}} \.{\$+\{=\}\$@@>}'
@-no_ident_found@>
@-case_found@>
@-operator_found@>
-@$no_ident_found {CTWILL}138 =\hfil\break(\&{token\_pointer}) 0@>
-@$case_found {CTWILL}138 =\hfil\break(\&{token\_pointer}) 1@>
-@$operator_found {CTWILL}138 =\hfil\break(\&{token\_pointer}) 2@>
+@$no_ident_found {CTWILL}137 =\hfil\break(\&{token\_pointer}) 0@>
+@$case_found {CTWILL}137 =\hfil\break(\&{token\_pointer}) 1@>
+@$operator_found {CTWILL}137 =\hfil\break(\&{token\_pointer}) 2@>
@z
Section 139.
@@ -1211,7 +1228,7 @@ scrap_pointer p)
make_reserved( /* make the first identifier in |p->trans| like |int| */
scrap_pointer p)
@-make_reserved@>
-@$make_reserved {CTWILL}140 \&{static} \&{void} (\,)@>
+@$make_reserved {CTWILL}139 \&{static} \&{void} (\,)@>
@z
Section 140.
@@ -1231,7 +1248,7 @@ make_underlined(
/* underline the entry for the first identifier in |p->trans| */
scrap_pointer p)
@-make_underlined@>
-@$make_underlined {CTWILL}141 \&{static} \&{void} (\,)@>
+@$make_underlined {CTWILL}140 \&{static} \&{void} (\,)@>
@z
@x
@@ -1281,7 +1298,7 @@ Section 170.
@y
@d force_lines flags['f'] /* should each statement be on its own line? */
@-force_lines@>
-@$force_lines {CTWILL}171 =\\{flags}[\.{'f'}]@>
+@$force_lines {CTWILL}170 =\\{flags}[\.{'f'}]@>
@z
Section 173.
@@ -1350,8 +1367,8 @@ Section 202.
@ @=
@-n@>
@%
+@$n {CTWILL}197 \&{short}@>
@$n {CTWILL}198 \&{short}@>
-@$n {CTWILL}199 \&{short}@>
@z
Section 204.
@@ -1370,7 +1387,7 @@ Section 208.
next_control==begin_short_comment) return;
@y
@-C_parse@>
-@$C_parse {CTWILL}209 \&{static} \&{void} (\,)@>
+@$C_parse {CTWILL}208 \&{static} \&{void} (\,)@>
if (next_control=='|' || next_control==begin_comment @| ||
next_control==begin_short_comment) return;
@z
@@ -1527,7 +1544,7 @@ Section 220.
@y
@d make_pb flags['e']
@-make_pb@>
-@$make_pb {CTWILL}221 =\\{flags}[\.{'e'}]@>
+@$make_pb {CTWILL}220 =\\{flags}[\.{'e'}]@>
@z
Section 224.
@@ -1539,9 +1556,9 @@ Section 224.
@-cur_end@>
@-cur_tok@>
@-cur_mode@>
-@$cur_end {CTWILL}225 =\\{cur\_state}.\\{end\_field}]@>
-@$cur_tok {CTWILL}225 =\\{cur\_state}.\\{tok\_field}]@>
-@$cur_mode {CTWILL}225 =\\{cur\_state}.\\{mode\_field}]@>
+@$cur_end {CTWILL}224 =\\{cur\_state}.\\{end\_field}]@>
+@$cur_tok {CTWILL}224 =\\{cur\_state}.\\{tok\_field}]@>
+@$cur_mode {CTWILL}224 =\\{cur\_state}.\\{mode\_field}]@>
@z
Section 227.
@@ -1553,7 +1570,7 @@ text_pointer p)
push_level( /* suspends the current level */
text_pointer p)
@-push_level@>
-@$push_level {CTWILL}228 \&{static} \&{void} (\,)@>
+@$push_level {CTWILL}227 \&{static} \&{void} (\,)@>
@z
Section 228.
@@ -1738,7 +1755,7 @@ Section 247.
@y
@ @d usage_sentinel (struct perm_meaning *)1
@-usage_sentinel@>
-@$usage_sentinel {CTWILL}248 =(\&{struct} \&{perm\_meaning} ${}{*}{}$) \T{1}@>
+@$usage_sentinel {CTWILL}247 =(\&{struct} \&{perm\_meaning} ${}{*}{}$) \T{1}@>
@=@+ {
@z
@@ -1751,7 +1768,7 @@ finish_C( /* finishes a definition or a \CEE/ part */
finish_C( /* finishes a definition or a \CEE/ part */
boolean visible) /* |true| if we should produce \TeX\ output */
@-finish_C@>
-@$finish_C {CTWILL}252 \&{static} \&{void} (\,)@>
+@$finish_C {CTWILL}251 \&{static} \&{void} (\,)@>
@z
Section 252.
@@ -1791,7 +1808,7 @@ sixteen_bits flag)
footnote( /* outputs section cross-references */
sixteen_bits flag)
@-footnote@>
-@$footnote {CTWILL}261 \&{static} \&{void} (\,)@>
+@$footnote {CTWILL}260 \&{static} \&{void} (\,)@>
@z
Section 261.
@@ -1841,10 +1858,9 @@ Section 271.
@-head@>
@-sort_ptr@>
@-max_sorts@>
-@$depth {CTWILL}272 =\\{cat}@>
-@$head {CTWILL}272 =\\{trans\_plus}.\\{Head}@>
-@$sort_ptr {CTWILL}272 =\\{scrap\_ptr}@>
-@$max_sorts {CTWILL}272 =\\{max_scraps}@>
+@$depth {CTWILL}271 =\\{cat}@>
+@$head {CTWILL}271 =\\{trans\_plus}.\\{Head}@>
+@$sort_ptr {CTWILL}271 =\\{scrap\_ptr}@>
@z
Section 273.
@@ -1862,7 +1878,7 @@ Section 275.
@y
@ Procedure |unbucket| goes through the buckets and adds nonempty lists
@-unbucket@>
-@$unbucket {CTWILL}276 \&{static} \&{void} (\,)@>
+@$unbucket {CTWILL}275 \&{static} \&{void} (\,)@>
@z
Section 276.
@@ -2002,18 +2018,18 @@ The current meaning of every identifier is initially `\.{\\uninitialized}'.
@z
@x
-must have fewer than 50 characters. If the \TeX\ part starts
+must have fewer than 80 characters. If the \TeX\ part starts
@y
-must have fewer than 50 characters.
+must have fewer than 80 characters.
-@d max_tex_chars 50 /* limit on the \TeX\ part of a meaning */
+@d max_tex_chars 80 /* limit on the \TeX\ part of a meaning */
@-s@>
@ If the \TeX\ part starts
@z
@x
-@d max_tex_chars 50 /* limit on the \TeX\ part of a meaning */
+@d max_tex_chars 80 /* limit on the \TeX\ part of a meaning */
@y
@z
@@ -2024,7 +2040,7 @@ static struct perm_meaning {
@y
static struct perm_meaning {
@-perm_meaning@>
-@$perm_meaning {CTWILL}293 \&{static} \&{struct}@>
+@$perm_meaning {CTWILL}292 \&{static} \&{struct}@>
@z
Section 301.
@@ -2047,7 +2063,7 @@ Section 302.
@-c@>
@-l@>
@-make_ministring@>
-@$make_ministring {CTWILL}303 \&{static} \&{void} (\,)@>
+@$make_ministring {CTWILL}302 \&{static} \&{void} (\,)@>
@z
Section 303.
@@ -2080,8 +2096,8 @@ Section 311.
@y
@ @=
@%
-@$p {CTWILL}296 \&{name\_pointer}@>
-@$q {CTWILL}296 \&{struct perm\_meaning} ${}{*}{}$@>
+@$p {CTWILL}295 \&{name\_pointer}@>
+@$q {CTWILL}295 \&{struct perm\_meaning} ${}{*}{}$@>
@z
Section 312.
@@ -2091,7 +2107,7 @@ Section 312.
@y
@=
@%
-@$p {CTWILL}219 \&{name\_pointer}@>
+@$p {CTWILL}218 \&{name\_pointer}@>
@z
Section 315.
@@ -2129,7 +2145,7 @@ Section 321.
@y
@d indent_param_decl flags['i'] /* should formal parameter declarations be indented? */
@-indent_param_decl@>
-@$indent_param_decl {CTWILL}322 =\\{flags}[\.{'i'}]@>
+@$indent_param_decl {CTWILL}321 =\\{flags}[\.{'i'}]@>
@z
Section 322.
@@ -2139,7 +2155,7 @@ Section 322.
@y
@d order_decl_stmt flags['o'] /* should declarations and statements be separated? */
@-order_decl_stmt@>
-@$order_decl_stmt {CTWILL}323 =\\{flags}[\.{'o'}]@>
+@$order_decl_stmt {CTWILL}322 =\\{flags}[\.{'o'}]@>
@z
Section 328.
diff --git a/ctwill-texlive.ch b/ctwill-texlive.ch
index 715e5984..363ba13e 100644
--- a/ctwill-texlive.ch
+++ b/ctwill-texlive.ch
@@ -12,7 +12,7 @@ Material in limbo.
@x l.21 of CWEAV-TWILL.CH
\def\title{CTWILL (@VERSION@)}
@y
-\def\title{CTWILL (Version 4.8 [\TeX~Live])}
+\def\title{CTWILL (Version 4.9 [\TeX~Live])}
@z
Section 1.
@@ -20,7 +20,7 @@ Section 1.
@x l.61 of CWEAV-TWILL.CH
@d banner _("This is CTWILL (@VERSION@)")
@y
-@d banner "This is CTWILL, Version 4.8"
+@d banner "This is CTWILL, Version 4.9"
/* will be extended by the \TeX~Live |versionstring| */
@z
diff --git a/ctwill.bux b/ctwill.bux
index 339df702..9c0c4359 100644
--- a/ctwill.bux
+++ b/ctwill.bux
@@ -2,7 +2,7 @@
@$ctwill {CTWILL}3 \&{enum} \&{cweb}@>
@$cweave {CTWILL}3 \&{enum} \&{cweb}@>
-@$program {COMMON.W}18 \&{int}@>
+@$program {COMMON.W}18 \&{cweb}@>
@$phase {COMMON.W}19 \&{int}@>
@$common_init {COMMON.W}20 \&{void} (\,)@>
@$section_text {COMMON.W}21 \&{char} [\,][\,]@>
diff --git a/ctwill.md b/ctwill.md
index 49764bc4..6deeca2b 100644
--- a/ctwill.md
+++ b/ctwill.md
@@ -90,7 +90,7 @@ The present incarnation of **ctwill** and its utilities tries hard to be a
drop-in replacement for the original package. There are, however, a few
differences worth noting:
-* This version is based on the most recent version of CWEB (4.8).
+* This version is based on the most recent version of CWEB (4.9).
* In TeX\ Live the utility programs are prefixed with **ctwill-** and
the macro files with **ct** for technical reasons.
* Options **\-\-help**, **\-\-quiet**, **\-\-verbose**, **\-\-version**, and
diff --git a/cweav-patch.ch b/cweav-patch.ch
index 5147b90b..90a3c965 100644
--- a/cweav-patch.ch
+++ b/cweav-patch.ch
@@ -1,6 +1,6 @@
-*-Web-*-
This file, CWEAV-FOO.CH, is part of CWEBBIN (@VERSION@).
-It is a changefile for CWEAVE.W, Version 4.8.
+It is a changefile for CWEAVE.W, Version 4.9.
Technically, CWEAV-FOO.CH is constructed from a multitude of separate
change files by applying Klaus Guntermann's TIE processor. Any comments
@@ -181,17 +181,19 @@ p21 29 October 2005 AS ANSI C++ patches for patch level [p21].
2022 05 February 2022 AS tuneup for CWEB 4.7 [2022].
05 June 2022 AS tuneup for CWEB 4.8 [2022].
+
+2023 15 May 2023 AS tuneup for CWEB 4.9 [2023].
------------------------------------------------------------------------------
Material in limbo.
@x l.35
-\def\title{CWEAVE (Version 4.8)}
+\def\title{CWEAVE (Version 4.9)}
@y
\def\title{CWEAVE (@VERSION@)}
@z
@x l.39
- \centerline{(Version 4.8)}
+ \centerline{(Version 4.9)}
@y
\centerline{(@VERSION@)}
@z
@@ -207,7 +209,7 @@ z
Section 1.
@x l.70
-@d banner "This is CWEAVE (Version 4.8)"
+@d banner "This is CWEAVE (Version 4.9)"
@y
@d banner "This is CWEAVE (@VERSION@)"
@z
diff --git a/cweav-texlive.ch b/cweav-texlive.ch
index 34145194..ba28464e 100644
--- a/cweav-texlive.ch
+++ b/cweav-texlive.ch
@@ -12,7 +12,7 @@ Material in limbo.
@x l.35 and l.184 of CWEAV-PATCH.CH
\def\title{CWEAVE (@VERSION@)}
@y
-\def\title{CWEAVE (Version 4.8 [\TeX~Live])}
+\def\title{CWEAVE (Version 4.9 [\TeX~Live])}
@z
Section 1.
@@ -20,6 +20,6 @@ Section 1.
@x l.70 and l.206 of CWEAV-PATCH.CH and l.17 of CWEAV-I18N.CH
@d banner _("This is CWEAVE (@VERSION@)")
@y
-@d banner "This is CWEAVE, Version 4.8"
+@d banner "This is CWEAVE, Version 4.9"
/* will be extended by the \TeX~Live |versionstring| */
@z
diff --git a/cweav-twill.ch b/cweav-twill.ch
index 0fffc396..ee18df05 100644
--- a/cweav-twill.ch
+++ b/cweav-twill.ch
@@ -229,14 +229,6 @@ part of all meanings.
}
@z
-CTWILL hickups on comment and produces unmatched '$' in mini-index.
-
-@x l.646
-skip_TeX(void) /* skip past pure \TEX/ code */
-@y
-skip_TeX(void)
-@z
-
@x l.681
\yskip\hang |xref_roman|, |xref_wildcard|, |xref_typewriter|, |TeX_string|,
@y
@@ -646,15 +638,15 @@ flush_buffer(out_ptr,false,false);
is_macro=true;
@z
-@x l.4342
+@x l.4351
@.Improper macro definition@>
else {
- app_cur_id(false);
+ app('$'); app_cur_id(false);
@y
@.Improper macro definition@>
else {
id_being_defined=id_lookup(id_first,id_loc,normal);
- app_cur_id(false);
+ app('$'); app_cur_id(false);
def_diff=(*loc!='(');
@z
@@ -910,7 +902,7 @@ things you don't like.
The meaning specified by \.{@@\$...@@>} generally has four components:
an identifier (followed by space), a program name (enclosed in braces),
a section number (followed by space), and a \TeX\ part. The \TeX\ part
-must have fewer than 50 characters. If the \TeX\ part starts
+must have fewer than 80 characters. If the \TeX\ part starts
with `\.=', the mini-index entry will contain an equals sign instead
of a colon; for example,
$$\.{@@\$buf\_size \{PROG\}10 =\\T\{200\}@@>}$$
@@ -952,7 +944,7 @@ which are quite different from the change files you set up for tangling.
(End of user manual.)
-@d max_tex_chars 50 /* limit on the \TeX\ part of a meaning */
+@d max_tex_chars 80 /* limit on the \TeX\ part of a meaning */
@q Section 25->273. @>
@* Temporary and permanent meanings.
@@ -1034,7 +1026,7 @@ new_meaning(
{ char *first=id_first;
while (xisspace(*first)) first++;
loc=first;
- while (xisalpha(*loc)||xisdigit(*loc)||*loc=='_') loc++;
+ while (xisalpha(*loc)||xisdigit(*loc)||isxalpha(*loc)) loc++;
if (*loc++!=' ')
err_print(_("! Identifier in meaning should be followed by space"));
else {@+ int n=0;
@@ -1366,7 +1358,7 @@ It advances |loc| past the title found.
@c static sixteen_bits title_lookup(void)
{
char *first=loc,*last; /* boundaries */
- register name_pointer *p;
+ name_pointer *p;
if (*loc=='"') {
while (++loc<=limit && *loc!='"') if (*loc=='\\') loc++;
} else if (*loc=='{') {
diff --git a/cweb.md b/cweb.md
index 979f09f1..4be41b4c 100644
--- a/cweb.md
+++ b/cweb.md
@@ -1,6 +1,6 @@
% CWEB(1) Web2c @VERSION@ | General Commands Manual
%
-% July 27, 2021
+% August 20, 2022
# NAME
@@ -48,7 +48,8 @@ should not notice any differences in invoking the programs nor in the
resulting output. There are, however, a few differences worth noting:
* Options **\-\-help**, **\-\-quiet**, **\-\-verbose**, **\-\-version**, and
- flags **+c**, **-i**, **-o**, and **+lX** are new in CWEBbin and TeX\ Live.
+ flags **+c**, **-i**, **-o**, **+u**, and **+lX** are new in CWEBbin and
+ TeX\ Live.
* Option **+lX** is accompanied by several wrapper files for **cwebmac.tex**
with translated captions for German (**+ld**), French (**+lf**), and
Italian (**+li**).
@@ -92,6 +93,8 @@ There is one other option applicable to **ctangle** only:
* **+k**:
keep separators in numeric literals in the output
+* **+u**:
+ transliterate UTF-8 charcters in C code
There are seven other options applicable to **cweave** only:
diff --git a/cwebbin.spec b/cwebbin.spec
index 18f5bb3b..e2dfcc07 100644
--- a/cwebbin.spec
+++ b/cwebbin.spec
@@ -13,9 +13,9 @@ License: Public Domain
URL: http://www-cs-faculty.stanford.edu/~uno/cweb.html
Packager: Andreas Scherer
-%if %{_vendor} == "debbuild"
+%if "%{_vendor}" == "debbuild"
Group: tex
-Distribution: Kubuntu 20.04 (x86_64)
+Distribution: Kubuntu 22.04 (x86_64)
Requires: texlive, pandoc, gettext
%if %{with texlive}
Requires: pax
@@ -33,8 +33,8 @@ Distribution: openSUSE 42 (x86_64)
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
-Version: 4.8
-Release: 2022.2
+Version: 4.9
+Release: 2023
# Start with CTWILL; only very few things are actually used
Source0: ftp://ftp.cs.stanford.edu/pub/ctwill/ctwill.tar.gz
@@ -63,7 +63,7 @@ The 'CWEBbin' package is an extension of the 'CWEB' package by Silvio Levy
and Donald Knuth for Literate Programming in C/C++.
%prep
-%if %{_vendor} == "debbuild"
+%if "%{_vendor}" == "debbuild"
%autosetup -c -a1 -a2
%else
%autosetup -c -T -a 0 -N
@@ -186,6 +186,9 @@ do %{__sed_i} -e "s/Web2c .*\[at\]/CWEBbin %{version}/" $m.1; done
%{__texhash}
%changelog
+* Mon May 15 2023 Andreas Scherer
+- Tuneup for CWEB 4.9
+
* Sun Jun 05 2022 Andreas Scherer
- Tuneup for CWEB 4.8
diff --git a/cwebman-extensions.ch b/cwebman-extensions.ch
index 19889218..01186e55 100644
--- a/cwebman-extensions.ch
+++ b/cwebman-extensions.ch
@@ -1,4 +1,4 @@
-CHANGES for CWEBMAN.TEX by Andreas Scherer, June 2022.
+CHANGES for CWEBMAN.TEX by Andreas Scherer, August 2022.
This set of changes describes several extensions to the standard behavior of
the CWEB system. It suggests CWEBMAN-PATCH.CH to be applied first.
@@ -36,18 +36,13 @@ more logical than indenting them.) (Has no effect on \.{CTANGLE}.)
\hfil\vskip\normallineskip
\option l This option takes the string of characters to its right as its
argument to switch between different user languages and macro packages.
-For example, if you call \.{CWEAVE} with the `\.{+ld}' (or `\.{-ld}') option,
-the German \.{CWEB} macros \.{dcwebmac.tex} will be loaded in the first line
-of output instead of the English ones. (Off by default.) (Has no effect on
-\.{CTANGLE}.)
-\hfil\vskip\normallineskip
-\option m Install communication between \.{CWEB} and the message browser of
-the {\mc SAS/C} development system. Set the external environment variable
-\.{SCMSGOPT} to any legal command line option described in the documentation
-by SAS Institute. (Off by default; works only on the {\mc AMIGA} system.)
+(Off by default.) (Has no effect on \.{CTANGLE}.)
\hfil\vskip\normallineskip
\option o Separate declarations and the first statement in a function block.
-(On by default.) (Has no effect on\break\hbox{}\qquad\.{CTANGLE}.)}
+(On by default.) (Has no effect on \.{CTANGLE}.)
+\hfil\vskip\normallineskip
+\option u Transliteration of UTF-8 multi-byte characters.
+(Off by default.) (Has no effect on \.{CWEAVE}.)}
\yskip
@z
diff --git a/cwebman-patch.ch b/cwebman-patch.ch
index e78de942..e288b7c4 100644
--- a/cwebman-patch.ch
+++ b/cwebman-patch.ch
@@ -1,6 +1,6 @@
-*-Web-*-
This file, CWEBMAN-FOO.CH, is part of CWEBBIN (@VERSION@). It is a
-changefile written by Andreas Scherer for CWEBMAN.TEX, Version 4.8, that
+changefile written by Andreas Scherer for CWEBMAN.TEX, Version 4.9, that
provides changes appropriate for extensions by Carsten Steger, Andreas
Scherer (deutsch), Giuseppe Ghibò (italiano), and Denis Roegel (français).
@@ -68,20 +68,20 @@ a22 18 Aug 2011 AS Updated for CWEB 3.64ad.
@z
------------------------------------------------------------------------------
@x l.38
-\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 4.8)}
+\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 4.9)}
@y
\def\runninghead{{\tentt CWEB} USER MANUAL (@VERSION@)}
@z
------------------------------------------------------------------------------
@x l.52
-\vskip 18pt\centerline{(Version 4.8 --- June 2022)}
+\vskip 18pt\centerline{(Version 4.9 --- May 2023)}
@y
-\vskip 18pt\centerline{(Version 4.8 --- June 2022)%
+\vskip 18pt\centerline{(Version 4.9 --- May 2023)%
\footnote*{This document describes the extended \.{CWEB} (@VERSION@).}}
@z
------------------------------------------------------------------------------
@x l.1600
- \.{ { }\\vskip 15pt \\centerline\{(Version 4.8)\}{ }\\vfill\}}\cr}$$
+ \.{ { }\\vskip 15pt \\centerline\{(Version 4.9)\}{ }\\vfill\}}\cr}$$
@y
\.{ { }\\vskip 15pt \\centerline\{(@VERSION@)\}{ }\\vfill\}}\cr}$$
@z
diff --git a/cwebman-texlive.ch b/cwebman-texlive.ch
index f8737430..12367777 100644
--- a/cwebman-texlive.ch
+++ b/cwebman-texlive.ch
@@ -1,4 +1,4 @@
-CHANGES for CWEBMAN.TEX by Andreas Scherer, February 2022.
+CHANGES for CWEBMAN.TEX by Andreas Scherer, May 2023.
This set of changes adapts CWEBMAN.TEX for TeX Live. It requires that the
change files CWEBMAN-PATCH.CH and CWEBMAN-EXTENSIONS.CH be applied first.
@@ -7,7 +7,7 @@ For a complete history of the changes made to CWEBMAN.TEX see CWEBMAN-PATCH.CH.
------------------------------------------------------------------------------
@x l.4
\input cwebmac
-\acrofalse\pdffalse\pdftexfalse\hintfalse\acrohintfalse
+\pdffalse\acrohintfalse
@y
\input cwebmac
@z
@@ -76,13 +76,13 @@ For a complete history of the changes made to CWEBMAN.TEX see CWEBMAN-PATCH.CH.
\def\runninghead{{\tentt CWEB} USER MANUAL (@VERSION@)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}}
-\def\runninghead{{\tentt CWEB} USER MANUAL (Version 4.8 [\TeX~Live])}
+\def\runninghead{{\tentt CWEB} USER MANUAL (Version 4.9 [\TeX~Live])}
@z
------------------------------------------------------------------------------
@x l.80 of CWEBMAN-PATCH.CH
\footnote*{This document describes the extended \.{CWEB} (@VERSION@).}}
@y
-\footnote*{This document describes the extended \.{CWEB} (Version 4.8 [\TeX~Live]).}}
+\footnote*{This document describes the extended \.{CWEB} (Version 4.9 [\TeX~Live]).}}
@z
------------------------------------------------------------------------------
@x l.86
@@ -125,10 +125,11 @@ specified in the environment variable \.{CWEBINPUTS}, concatenated with
\.{PATH\_SEPARATOR}s (on \UNIX/ commonly known as~`\.:'). If the environment
variable is not set, some decent default paths are used instead.}
@y
-\cwebfootnote{\acrofalse In this extended implementation, if an \.{@i}nclude
-file can not be found in the current directory, \.{CWEB} will use the
-conventions of the \Kpathsea/ library as outlined in section~\X93:File lookup
-with \Kpathsea/\X~of \pdfURL{appendix~D}{common-changes.pdf} to look for it.
+\cwebfootnote{In this extended implementation, if an \.{@i}nclude file can not
+be found in the current directory, \.{CWEB} will use the conventions of the
+\Kpathsea/ library as outlined in {\pdffalse\acrohintfalse section~\X93:File
+lookup with \Kpathsea/\X~of} \pdfURL{appendix~D}{common-changes.pdf} to look
+for it.
% FIXME
(This is true for any other input or change file lookup.)}
@z
@@ -151,19 +152,10 @@ of \pdfURL{appendix~D}{common-changes.pdf} for details.
\option i Indent parameters in function declarations. (On by default;
@z
------------------------------------------------------------------------------
-@x l.1038 and l.44 of CWEBMAN-EXTENSIONS.CH
-\option m Install communication between \.{CWEB} and the message browser of
-the {\mc SAS/C} development system. Set the external environment variable
-\.{SCMSGOPT} to any legal command line option described in the documentation
-by SAS Institute. (Off by default; works only on the {\mc AMIGA} system.)
-\hfil\vskip\normallineskip
-@y
-@z
-------------------------------------------------------------------------------
@x l.1126
Sometimes things don't work as smoothly, and you get a bunch of
@y
-\acrofalse\pdftexfalse\pdffalse
+\pdffalse\acrohintfalse
Sometimes things don't work as smoothly, and you get a bunch of
@z
------------------------------------------------------------------------------
@@ -171,13 +163,12 @@ Sometimes things don't work as smoothly, and you get a bunch of
`$\\{main}(\\{argc},\39\\{argv}{}$)'.
@y
`$\\{main}(\\{argc},\39\\{argv}{}$)'.
-\ifx\pdf+\pdftrue\fi
-\ifx\pdfoutput\undefined \pdftexfalse \else\ifnum\pdfoutput=0 \pdftexfalse
-\else \pdftextrue \pdfoutput=1\fi\fi
-\ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
+\ifx\pdf+\pdftrue\fi \ifxetex\pdftrue\fi
+\ifpdftex\ifnum\pdfoutput>0\pdftrue\fi\fi
+\ifpdf\acrohinttrue\fi \ifhint\acrohinttrue\fi
@z
------------------------------------------------------------------------------
-@x l.1176 amd l.68 of CWEBMAN-EXTENSIONS.CH.
+@x l.1176 and l.68 of CWEBMAN-EXTENSIONS.CH.
\cwebfootnote{This extended version of \.{CWEB} comes with an up-to-date
@y
\cwebfootnote{\TeX~Live comes with an up-to-date
@@ -236,7 +227,7 @@ And here's what the same excerpt looks like when typeset.
\def\runninghead{APPENDIX A --- FINAL DOCUMENT}
\subsection Final document.
-\acrofalse\pdftexfalse\pdffalse
+\pdffalse\acrohintfalse
And here's what the same excerpt looks like when typeset.
(Can you spot the typographical niceties used in the \.{CWEB} code?)
\let\K=\leftarrow
@@ -247,15 +238,14 @@ And here's what the same excerpt looks like when typeset.
\vfil\eject\titletrue
@y
\vfil\eject\titletrue
-\ifx\pdf+\pdftrue\fi
-\ifx\pdfoutput\undefined \pdftexfalse \else\ifnum\pdfoutput=0 \pdftexfalse
-\else \pdftextrue \pdfoutput=1\fi\fi
-\ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
+\ifx\pdf+\pdftrue\fi \ifxetex\pdftrue\fi
+\ifpdftex\ifnum\pdfoutput>0 \pdftrue\fi\fi
+\ifacro\acrohinttrue\fi \ifhint\acrohinttrue\fi
@z
------------------------------------------------------------------------------
@x l.1595 and l.86 of CWEBMAN-PATCH.CH
\.{ { }\\vskip 15pt \\centerline\{(@VERSION@)\}{ }\\vfill\}}\cr}$$
@y
- \.{ { }\\vskip 15pt \\centerline\{(Version 4.8)\}{ }\\vfill\}}\cr}$$
+ \.{ { }\\vskip 15pt \\centerline\{(Version 4.9)\}{ }\\vfill\}}\cr}$$
@z
------------------------------------------------------------------------------
diff --git a/cwtw-texlive.ch b/cwtw-texlive.ch
index 2a76d650..d695b0bd 100644
--- a/cwtw-texlive.ch
+++ b/cwtw-texlive.ch
@@ -3,14 +3,14 @@
% These changes apply to both CWEAVE and CTWILL when preparing their
% incantations for TeX Live. They were factored out of cweav-texlive.ch
-% and ctwill-texlive.ch to avoid redundancy amd discrepancy.
+% and ctwill-texlive.ch to avoid redundancy and discrepancy.
Material in limbo.
@x l.39 and l.190 of CWEAV-PATCH.CH
\centerline{(@VERSION@)}
@y
- \centerline{(Version 4.8 [\TeX~Live])}
+ \centerline{(Version 4.9 [\TeX~Live])}
@z
@x l.41
diff --git a/po/cweb-tl.pot b/po/cweb-tl.pot
index 34835e12..ad045d25 100644
--- a/po/cweb-tl.pot
+++ b/po/cweb-tl.pot
@@ -1,14 +1,14 @@
# International version of CWEB (CWEBbin, TeXLive).
-# Copyright (C) 2021 Andreas Scherer et al.
+# Copyright (C) 2023 Andreas Scherer et al.
# This file is distributed under the same license as the CWEB package.
-# Andreas Scherer , 2021.
+# Andreas Scherer .
#
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: CWEBbin 2021\n"
+"Project-Id-Version: CWEBbin 2023\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-12-25 14:12+0100\n"
+"POT-Creation-Date: 2023-05-15 16:11+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -30,15 +30,15 @@ msgid "%s: Need one to three file arguments.\n"
msgstr ""
#: ctang-texlive.ch:39
-msgid "This is CTANGLE, Version 4.8"
+msgid "This is CTANGLE, Version 4.9"
msgstr ""
#: ctwill-texlive.ch:39
-msgid "This is CTWILL, Version 4.8"
+msgid "This is CTWILL, Version 4.9"
msgstr ""
#: cweav-texlive.ch:39
-msgid "This is CWEAVE, Version 4.8"
+msgid "This is CWEAVE, Version 4.9"
msgstr ""
#: comm-texlive.ch:512
diff --git a/po/de/cweb-tl.po b/po/de/cweb-tl.po
index 6dac6a36..da6f725f 100644
--- a/po/de/cweb-tl.po
+++ b/po/de/cweb-tl.po
@@ -1,14 +1,14 @@
# International version of CWEB (CWEBbin, TeXLive).
-# Copyright (C) 2021 Andreas Scherer et al.
+# Copyright (C) 2023 Andreas Scherer et al.
# This file is distributed under the same license as the CWEB package.
-# Andreas Scherer , 2021.
+# Andreas Scherer .
#
msgid ""
msgstr ""
-"Project-Id-Version: CWEBbin 2021\n"
+"Project-Id-Version: CWEBbin 2023\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-12-25 14:12+0100\n"
-"PO-Revision-Date: 2021-12-25 14:13+0100\n"
+"POT-Creation-Date: 2023-05-15 16:13+0200\n"
+"PO-Revision-Date: 2023-05-15 16:13+0200\n"
"Last-Translator: Andreas Scherer \n"
"Language-Team: German\n"
"Language: de\n"
@@ -33,16 +33,16 @@ msgid "%s: Need one to three file arguments.\n"
msgstr "%s: Benötige ein bis drei Dateiargumente.\n"
#: ctang-texlive.ch:39
-msgid "This is CTANGLE, Version 4.8"
-msgstr "Dies ist CTANGLE, Version 4.8"
+msgid "This is CTANGLE, Version 4.9"
+msgstr "Dies ist CTANGLE, Version 4.9"
#: ctwill-texlive.ch:39
-msgid "This is CTWILL, Version 4.8"
-msgstr "Dies ist CTWILL, Version 4.8"
+msgid "This is CTWILL, Version 4.9"
+msgstr "Dies ist CTWILL, Version 4.9"
#: cweav-texlive.ch:39
-msgid "This is CWEAVE, Version 4.8"
-msgstr "Dies ist CWEAVE, Version 4.8"
+msgid "This is CWEAVE, Version 4.9"
+msgstr "Dies ist CWEAVE, Version 4.9"
#: comm-texlive.ch:512
#, c-format
diff --git a/po/it/cweb.po b/po/it/cweb.po
index 367c9d23..7e6c4d45 100644
--- a/po/it/cweb.po
+++ b/po/it/cweb.po
@@ -1,14 +1,14 @@
# International version of CWEB (CWEBbin, TeXLive).
-# Copyright (C) 2021 Andreas Scherer et al.
+# Copyright (C) 2023 Andreas Scherer et al.
# This file is distributed under the same license as the CWEB package.
-# Andreas Scherer , 2021.
+# Andreas Scherer .
#
msgid ""
msgstr ""
-"Project-Id-Version: CWEBbin 2021\n"
+"Project-Id-Version: CWEBbin 2023\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-02-06 15:25+0100\n"
-"PO-Revision-Date: 2021-12-25 14:14+0100\n"
+"POT-Creation-Date: 2023-05-15 16:14+0200\n"
+"PO-Revision-Date: 2023-05-15 16:14+0200\n"
"Last-Translator: Andreas Scherer \n"
"Language-Team: Italian\n"
"Language: it\n"
@@ -599,15 +599,15 @@ msgstr "Ordinamento:"
#: ctang-i18n.ch:17
msgid "This is CTANGLE (@@VERSION@@)"
-msgstr "Questo è CTANGLE (Versione 4.8 [CWEBbin 2022.2])"
+msgstr "Questo è CTANGLE (Versione 4.9 [CWEBbin 2023])"
#: cweav-i18n.ch:17
msgid "This is CWEAVE (@@VERSION@@)"
-msgstr "Questo è CWEAVE (Versione 4.8 [CWEBbin 2022.2])"
+msgstr "Questo è CWEAVE (Versione 4.9 [CWEBbin 2023])"
#: cweav-twill.ch:68
msgid "This is CTWILL (@@VERSION@@)"
-msgstr "Questo è CTWILL (Versione 4.8 [CWEBbin 2022.2])"
+msgstr "Questo è CTWILL (Versione 4.9 [CWEBbin 2023])"
#: cweav-i18n.ch:301 cweav-i18n.ch:309
msgid "buffer"
diff --git a/refsort.ch b/refsort.ch
index 79a8867b..c9472205 100644
--- a/refsort.ch
+++ b/refsort.ch
@@ -27,12 +27,34 @@ main()
int main()
@z
+@x 'register' removed in C++17.
+ register char *p,*q;
+ register int n; /* current number of items */
+ register item *x, **y;
+@y
+ char *p,*q;
+ int n; /* current number of items */
+ item *x, **y;
+@z
+
@x variable not used
{ register int k;
@y
{
@z
+@x 'register' removed in C++17
+{ register int toggle=0;
+@y
+{ int toggle=0;
+@z
+
+@x 'register' removed in C++17
+{ register int toggle=0;
+@y
+{ int toggle=0;
+@z
+
@x add 'Index.' section
for (;*p;p++) *q++=*p;
}
diff --git a/system.bux b/system.bux
index 83196611..e2ebbf7b 100644
--- a/system.bux
+++ b/system.bux
@@ -27,11 +27,15 @@
@$rename "" \zip@>
@$remove "" \zip@>
@$sprintf "" \zip@>
+@$stderr "" \zip@>
+@$stdin "" \zip@>
@$stdout "" \zip@>
@$ungetc "" \zip@>
-@$getenv "" \zip@>
+@$calloc "" \zip@>
@$exit "" \zip@>
+@$free "" \zip@>
+@$getenv "" \zip@>
@$isalpha "" \zip@>
@$isdigit "" \zip@>
@@ -45,6 +49,11 @@
@$gettext "" \zip@>
@$textdomain "" \zip@>
+@$bindtextdomain "" \zip@>
+@$setlocale "" \zip@>
+@$LC_CTYPE "" \zip@>
+@$LC_MESSAGES "" \zip@>
+
@$bool "" \zip@>
@$false "" \zip@>
@$true "" \zip@>
@@ -55,7 +64,5 @@
@$uint8_t "" \zip@>
@$uint16_t "" \zip@>
-@$bindtextdomain "" \zip@>
-@$setlocale "" \zip@>
-@$LC_CTYPE "" \zip@>
-@$LC_MESSAGES "" \zip@>
+@$asctime "" \zip@>
+@$localtime "" \zip@>
diff --git a/texinputs/dctwimac.tex b/texinputs/dctwimac.tex
index aaba94d4..4aa96294 100644
--- a/texinputs/dctwimac.tex
+++ b/texinputs/dctwimac.tex
@@ -1,7 +1,7 @@
\ifx\undefined\documentclass\input ctwimac.tex
\else\endinput\fi % LaTeX will use other macros
-\let\acrofalse=\relax
+\let\pdffalse=\relax
\input dcwebstrings.tex
\def\fin{\parfillskip 0pt plus 1fil
diff --git a/texinputs/dcwebmac.tex b/texinputs/dcwebmac.tex
index d74e5bff..c0fc9a38 100644
--- a/texinputs/dcwebmac.tex
+++ b/texinputs/dcwebmac.tex
@@ -27,6 +27,7 @@
% Version 3.64 [p20] --- Andreas Scherer, March 2002
% Version 3.64 [p21] --- Andreas Scherer, Octobre 2005
% Version 3.64 [p22] --- Andreas Scherer, March 2016
+% Version 4.9 --- Andreas Scherer, June 2022
\ifx\undefined\botofcontents\input cwebmac.tex\fi
@@ -53,28 +54,28 @@
\def\fin{\par\vfill\eject % this is done when we are ending the index
\ifpagesaved\null\vfill\eject\fi % output a null index column
\if L\lr\else\null\vfill\eject\fi % finish the current page
- \ifpdftex \makebookmarks \fi % added in Version 3.68
+ \ifpdf \ifpdftex \makebookmarks % added in Version 3.68
+ \countsections \fi\fi % and in Version 4.9
\parfillskip 0pt plus 1fil
\let\topsecno=\nullsec
\redeffin
\output={\normaloutput\page\lheader\rheader}
\setpage
- \def\note##1##2.{\quad{\eightrm##1~\ifacro{\pdfnote##2.}\else{##2}\fi.}}
+ \def\note##1##2.{\quad{\eightrm##1~\ifacrohint{\pdfnote##2.}\else{##2}\fi.}}
\def\I{\par\hangindent 2em}\let\*=*
\ifacro \let\Xpdf\X
\ifpdftex \pdfdest name {NOS} fith
- \pdfoutline goto name {NOS} count -\secno {\outsecname}
+ \pdfoutline goto name {NOS} count -\the\countD {\outsecname}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
\pdfoutline goto num \the\toksA \expandafter{\the\toksE}}
- \else\ifpdf
- \special{pdf: outline -1 << /Title (\outsecname)
+ \else \special{pdf: outline -1 << /Title (\outsecname)
/Dest [ @thispage /FitH @ypos ] >>}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
\special{pdf: outline 0 << /Title (\the\toksE)
/A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
- \fi\fi\fi
+ \fi\fi
\readsections}
\def\con{\par\vfill\eject % finish the section names
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
@@ -83,6 +84,7 @@
\titletrue % prepare to output the table of contents
\pageno=\contentspagenumber
\redefcon
+ \ifhint\HINThome\fi% Mark the Table of contents as home page
\topofcontents \startpdf
\line{\headerline}
\let\ZZ=\contentsline
diff --git a/texinputs/dcwebstrings.tex b/texinputs/dcwebstrings.tex
index 28049f3b..7f6417df 100644
--- a/texinputs/dcwebstrings.tex
+++ b/texinputs/dcwebstrings.tex
@@ -36,5 +36,6 @@
\def\redefcon{\message{Inhaltsverzeichnis:}
\def\grouptitle{INHALTSVERZEICHNIS:}
- \def\headerline{\hfil Abschnitt\hbox to3em{\hss Seite}}
+ \def\headerline{\hfil Abschnitt\ifhint\else\hbox to3em{\hss Seite}\fi}
+ % No Page in HINT
}
diff --git a/texinputs/dproofmac.tex b/texinputs/dproofmac.tex
index 4709000c..97fa6b22 100644
--- a/texinputs/dproofmac.tex
+++ b/texinputs/dproofmac.tex
@@ -1,7 +1,7 @@
\ifx\undefined\documentclass\input proofmac.tex
\else\endinput\fi % LaTeX will use other macros
-\let\acrofalse=\relax
+\let\pdffalse=\relax
\input dcwebstrings.tex
\def\fin{\par\vfill\eject % this is done when we are ending the index
diff --git a/texinputs/fcwebmac.tex b/texinputs/fcwebmac.tex
index 9a19a884..a28944c1 100644
--- a/texinputs/fcwebmac.tex
+++ b/texinputs/fcwebmac.tex
@@ -25,8 +25,9 @@
% Version 3.61 [p18] --- Andreas Scherer, July 2000
% Version 3.63 [p19] --- Andreas Scherer, January 2001
% Version 3.64 [p20] --- Andreas Scherer, March 2002
-% Version 3.64 [p21] --- Andreas Scherer, Octobre 2005
+% Version 3.64 [p21] --- Andreas Scherer, October 2005
% Version 3.64 [p22] --- Andreas Scherer, March 2016
+% Version 4.9 --- Andreas Scherer, June 2022
% french translations --- Denis Roegel, 18 September 1994
@@ -73,34 +74,34 @@
\def\fin{\par\vfill\eject % this is done when we are ending the index
\ifpagesaved\null\vfill\eject\fi % output a null index column
\if L\lr\else\null\vfill\eject\fi % finish the current page
- \ifpdftex \makebookmarks \fi % added in Version 3.68
+ \ifpdf \ifpdftex \makebookmarks % added in Version 3.68
+ \countsections \fi\fi % and in Version 4.9
\parfillskip 0pt plus 1fil
\def\grouptitle{NOMS DES SECTIONS}
\let\topsecno=\nullsec
\message{Noms des sections:}
\output={\normaloutput\page\lheader\rheader}
\setpage
- \def\note##1##2.{\quad{\eightrm##1~\ifacro{\pdfnote##2.}\else{##2}\fi.}}
+ \def\note##1##2.{\quad{\eightrm##1~\ifacrohint{\pdfnote##2.}\else{##2}\fi.}}
\def\Q{\note{Cit\'e dans la section}} % crossref for mention of a section
\def\Qs{\note{Cit\'e dans les sections}} % crossref for mentions of a section
\def\U{\note{Utilis\'e dans la section}} % crossref for use of a section
\def\Us{\note{Utilis\'e dans les sections}} % crossref for uses of a section
\def\I{\par\hangindent 2em}\let\*=*
- \ifacro \def\outsecname{Noms des sections} \let\Xpdf\X
+ \ifpdf \def\outsecname{Noms des sections} \let\Xpdf\X
% \ifpdftex \makebookmarks \pdfdest name {NOS} fitb % in versions < 3.68
\ifpdftex \pdfdest name {NOS} fith % changed in version 3.69
- \pdfoutline goto name {NOS} count -\secno {\outsecname}
+ \pdfoutline goto name {NOS} count -\the\countD {\outsecname}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
\pdfoutline goto num \the\toksA \expandafter{\the\toksE}}
- \else\ifpdf
- \special{pdf: outline -1 << /Title (\outsecname)
+ \else \special{pdf: outline -1 << /Title (\outsecname)
/Dest [ @thispage /FitH @ypos ] >>}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
\special{pdf: outline 0 << /Title (\the\toksE)
/A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
- \fi\fi\fi
+ \fi\fi
\readsections}
\def\con{\par\vfill\eject % finish the section names
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
@@ -110,8 +111,9 @@
\pageno=\contentspagenumber
\def\grouptitle{SOMMAIRE:}
\message{Sommaire:}
+ \ifhint\HINThome\fi% Mark the Table of contents as home page
\topofcontents \startpdf
- \line{\hfil Section\hbox to3em{\hss Page}}
+ \line{\hfil Section\ifhint\else\hbox to3em{\hss Page}\fi}% No Page in HINT
\let\ZZ=\contentsline
\readcontents\relax % read the contents info
\botofcontents \end} % print the contents page(s) and terminate
diff --git a/texinputs/icwebmac.tex b/texinputs/icwebmac.tex
index d3eeca26..974e7993 100644
--- a/texinputs/icwebmac.tex
+++ b/texinputs/icwebmac.tex
@@ -25,8 +25,9 @@
% Version 3.61 [p18] --- Andreas Scherer, July 2000
% Version 3.63 [p19] --- Andreas Scherer, January 2001
% Version 3.64 [p20] --- Andreas Scherer, March 2002
-% Version 3.64 [p21] --- Andreas Scherer, Octobre 2005
+% Version 3.64 [p21] --- Andreas Scherer, October 2005
% Version 3.64 [p22] --- Andreas Scherer, March 2016
+% Version 4.9 --- Andreas Scherer, June 2022
\ifx\undefined\botofcontents\input cwebmac.tex\fi
@@ -74,13 +75,15 @@
\write\cont{\catcode `\noexpand\@=12\relax} % \makeatother
\closeout\cont % the contents information has been fully gathered
\output{\ifpagesaved\normaloutput{\box\sbox}\lheader\rheader\fi
- \global\setbox\sbox=\page \global\pagesavedtrue}
+ \global\setbox\sbox=\page \global\pagesavedtrue \mark{\topmark}}
\pagesavedfalse \eject % eject the page-so-far and predecessors
\setbox\sbox\vbox{\unvbox\sbox} % take it out of its box
\vsize=\pageheight \advance\vsize by -\ht\sbox % the remaining height
\hsize=.5\pagewidth \advance\hsize by -10pt
% column width for the index (20pt between cols)
+ \ifhint\else
\parfillskip 0pt plus .6\hsize % try to avoid almost empty lines
+ \fi
\def\lr{L} % this tells whether the left or right column is next
\output{\if L\lr\global\setbox\lbox=\page \gdef\lr{R}
\else\normaloutput{\vbox to\pageheight{\box\sbox\vss
@@ -89,7 +92,7 @@
\message{Indice Analitico:}
\parskip 0pt plus .5pt
\outer\def\I##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
- \ifacro\pdfnote##2.\else##2\fi.} % index entry
+ \ifacrohint\pdfnote##2.\else##2\fi.} % index entry
\def\[##1]{$\underline{##1}$} % underlined index item
\rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar
\hyphenpenalty 10000 \parindent0pt
@@ -97,34 +100,34 @@
\def\fin{\par\vfill\eject % this is done when we are ending the index
\ifpagesaved\null\vfill\eject\fi % output a null index column
\if L\lr\else\null\vfill\eject\fi % finish the current page
- \ifpdftex \makebookmarks \fi % added in Version 3.68
+ \ifpdf \ifpdftex \makebookmarks % added in Version 3.68
+ \countsections \fi\fi % and in Version 4.9
\parfillskip 0pt plus 1fil
\def\grouptitle{NOMI DELLE SEZIONI}
\let\topsecno=\nullsec
\message{Nomi delle sezioni:}
\output={\normaloutput\page\lheader\rheader}
\setpage
- \def\note##1##2.{\quad{\eightrm##1~\ifacro{\pdfnote##2.}\else{##2}\fi.}}
+ \def\note##1##2.{\quad{\eightrm##1~\ifacrohint{\pdfnote##2.}\else{##2}\fi.}}
\def\Q{\note{Citato nella sezione}} % crossref for mention of a section
\def\Qs{\note{Citato nelle sezioni}} % crossref for mentions of a section
\def\U{\note{Usato nella sezione}} % crossref for use of a section
\def\Us{\note{Usato nelle sezioni}} % crossref for uses of a section
\def\I{\par\hangindent 2em}\let\*=*
- \ifacro \def\outsecname{Nomi delle sezioni} \let\Xpdf\X
+ \ifpdf \def\outsecname{Nomi delle sezioni} \let\Xpdf\X
% \ifpdftex \makebookmarks \pdfdest name {NOS} fitb % in versions < 3.68
\ifpdftex \pdfdest name {NOS} fith % changed in version 3.69
- \pdfoutline goto name {NOS} count -\secno {\outsecname}
+ \pdfoutline goto name {NOS} count -\the\countD {\outsecname}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
\pdfoutline goto num \the\toksA \expandafter{\the\toksE}}
- \else\ifpdf
- \special{pdf: outline -1 << /Title (\outsecname)
+ \else \special{pdf: outline -1 << /Title (\outsecname)
/Dest [ @thispage /FitH @ypos ] >>}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
\special{pdf: outline 0 << /Title (\the\toksE)
/A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
- \fi\fi\fi
+ \fi\fi
\readsections}
\def\con{\par\vfill\eject % finish the section names
% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
@@ -134,8 +137,9 @@
\pageno=\contentspagenumber
\def\grouptitle{INDICE}
\message{Indice:}
+ \ifhint\HINThome\fi% Mark the Table of contents as home page
\topofcontents \startpdf
- \line{\hfil Sezione\hbox to3em{\hss Pag.}}
+ \line{\hfil Sezione\ifhint\else\hbox to3em{\hss Pag.}\fi}% No Page in HINT
\let\ZZ=\contentsline
\readcontents\relax % read the contents info
\botofcontents \end} % print the contents page(s) and terminate
diff --git a/texinputs/pdfctwimac.tex b/texinputs/pdfctwimac.tex
index cb6804e8..6929ffb8 100644
--- a/texinputs/pdfctwimac.tex
+++ b/texinputs/pdfctwimac.tex
@@ -1,25 +1,22 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.5 --- October 2021
+% Version 4.9 --- June 2022
% 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.5+LNCS+PDF}
-
-\newif\ifpdf
-\ifx\pdf+\pdftrue\fi
+\xdef\fmtversion{\fmtversion+CTWILL4.9+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
%\ifx\pdf-\else\pdftrue\fi
\def\pdflinkcolor{0 0 1} % the RGB values for hyperlink color
-\ifx\undefined\XeTeXrevision\else\pdftrue\fi % XeTeX produces PDF output
-\newif\ifpdftex
-\ifx\pdfoutput\undefined \pdftexfalse \else\ifnum\pdfoutput=0 \pdftexfalse
-\else \pdftextrue \pdfoutput=1
+\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}}
-\fi\fi
-\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
+\fi
+\let\ifacro=\ifpdf
\let\:=\. % preserve a way to get the dot accent
% (all other accents will still work as usual)
@@ -180,7 +177,7 @@
tangles as \tentex "#2"\egroup\par}
\def\noATL#1 #2 {}
\def\noatl{\let\ATL=\noATL} % suppress output from @l
-\def\ATH{{\acrofalse\X\kern-.5em:Preprocessor definitions\X}}
+\def\ATH{{\pdffalse\X\kern-.5em:Preprocessor definitions\X}}
\let\PB=\relax % hook for program brackets |...| in TeX part or section name
\chardef\AM=`\& % ampersand character in a string
@@ -243,7 +240,7 @@
\newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD
\newtoks\toksE \newtoks\toksF \newtoks\usersanitizer
\newcount\countA \countA=0 \newcount\countB \countB=0
-\newcount\countC \countC=0
+\newcount\countC \countC=0 \newcount\countD \countD=0
\newif\iftokprocessed \newif\ifTnum \newif\ifinstr
{\def\\{\global\let\spacechar= }\\ }
@@ -282,14 +279,14 @@
\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{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox
- attr {/Border [0 0 0]} user {/Type /Action /Subtype /Link /A
- << /S /URI /URI (#2) >>}\PDFlinkcolor #1\Black \pdfendlink
- \else\ifpdf{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
- \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight
- \space depth \thedepth\space << /Border [0 0 0]
- /Type /Action /Subtype /Link /A << /S /URI /URI (#2) >> >>}\box0\relax}%
- \else #1 ({\tt#2})\fi\fi}
+\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
@@ -448,14 +445,14 @@
\gdef\rrhead{\let\i=I\uppercase{\ignorespaces#3}}
\fi
\message{*\secno} % progress report
- \ifpdftex\def\stripprefix##1>{}\def\gtitletoks{#3}%
+ \ifpdf \ifpdftex\def\stripprefix##1>{}\def\gtitletoks{#3}%
\edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
{\immediate\write\cont{\ZZ{\gtitletoks}{#1}{\secno}% write to contents file
{\noexpand\the\pageno}{\the\toksE}}} % \ZZ{title}{depth}{sec}{page}{ss}
\expandafter\xdef\csname curr#1\endcsname{\secno}
\ifnum#1>0\countB=#1 \advance\countB by-1
\advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi
- \else\ifpdf\special{pdf: outline #1 << /Title (\the\toksE) /Dest
+ \else \special{pdf: outline #1 << /Title (\the\toksE) /Dest
[ @thispage /FitH @ypos ] >>}\fi\fi
\startsection{\bf\ignorespaces#3.\quad}\ignorespaces}
\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
@@ -652,8 +649,8 @@
%\global\advance\pageno by1}
%\def\topofcontents{\centerline{\titlefont\title}\vskip.7in
%\vfill} % this material will start the table of contents page
-%\def\startpdf{\ifpdftex\pdfcatalog{/PageMode /UseOutlines}\else
- %\ifpdf{\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi}
+%\def\startpdf{\ifpdf \ifpdftex\pdfcatalog{/PageMode /UseOutlines}
+ %\else {\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi}
%\def\botofcontents{\vfill
%\centerline{\covernote}} % this material will end the table of contents page
%\def\covernote{}
@@ -679,8 +676,9 @@
\def\fin{\ifacro \message{Section names:}
\def\U##1.{} \def\Us##1.{} \let\I=\relax \let\*=*
\def\outsecname{Names of the sections}
- \ifpdftex \makebookmarks
- \pdfoutline goto num 1 count -\secno {\outsecname}
+ \ifpdftex \makebookmarks \countsections
+ \pdfdest name {NOS} fith
+ \pdfoutline goto name {NOS} count -\the\countD {\outsecname}
\def\X##1:##2\X{\firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
\pdfoutline goto num \the\toksA \expandafter{\the\toksE}}
@@ -692,6 +690,10 @@
/A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
\fi \readsections \fi}
\def\makebookmarks{\let\ZZ=\writebookmarkline \readcontents\relax}
+\def\countsections{\message{Number of named sections:}
+ {\def\I{\global\advance\countD by 1}\def\X##1\X{\relax}
+ \def\Q##1.{\relax}\def\Qs##1.{\relax}\def\U##1.{\relax}\def\Us##1.{\relax}
+ \readsections\relax}\message{\the\countD}}
\def\writebookmarkline#1#2#3#4#5{{%
\let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let
\pdfoutline goto num #3 count -\expnumber{chunk#2.#3} {#5}}}
diff --git a/twinx.ch b/twinx.ch
index 00513c0c..66e5b969 100644
--- a/twinx.ch
+++ b/twinx.ch
@@ -60,6 +60,12 @@ turns it into uppercase form.
@=
@z
+@x l.56 C++17 removed 'register' storage class.
+ if (strncmp(buf,"\\def\\title\{",11)==0) {@+register char *p,*q;
+@y
+ if (strncmp(buf,"\\def\\title\{",11)==0) {@+char *p,*q;
+@z
+
@x l.57 FIX: Fetch only the first word from the '\title'.
for (p=buf+11,q=title;*p && *p!='}';p++) *q++=*p;
@y
@@ -92,6 +98,12 @@ char *save_string(
char *s)
@z
+@x l.118 C++17 removed 'register' storage class.
+ register char *p,*q; register int l;
+@y
+ char *p,*q; int l;
+@z
+
Section 6.
@x l.145
@@ -100,6 +112,24 @@ node *new_node()
node *new_node(void)
@z
+@x l.181 C++17 removed 'register' storage class.
+register node* main_node; /* current end of main list */
+@y
+node* main_node; /* current end of main list */
+@z
+
+@x l.195 C++17 removed 'register' storage class.
+while (1) {@+register node *cur_node;
+@y
+while (1) {@+node *cur_node;
+@z
+
+@x l.213 C++17 removed 'register' storage class.
+{@+register char *p,*q;@+register int bal=1;
+@y
+{@+char *p,*q;@+int bal=1;
+@z
+
Section 11.
@x l.216 FIX: Don't count masked braces.
@@ -113,6 +143,23 @@ Section 11.
}
@z
+@x l.289 C++17 removed 'register' storage class.
+while (1) {@+register node *p,*q,*r,*s,*t;
+@y
+while (1) {@+node *p,*q,*r,*s,*t;
+@z
+
+@x l.308 C++17 removed 'register' storage class.
+do@+{@+register int d;
+@y
+do@+{@+int d;
+@z
+
+@x l.323 C++17 removed 'register' storage class.
+do@+{@+register int d;
+@y
+do@+{@+int d;
+@z
Section 17.
@x l.347
@@ -123,8 +170,21 @@ int compare(
node *p, node *q)
@z
+
+@x l.349 C++17 removed 'register' storage class.
+{@+register unsigned char *pp,*qq;
+@y
+{@+unsigned char *pp,*qq;
+@z
+
Section 19.
+@x l.378 C++17 removed 'register' storage class.
+{@+register int j;
+@y
+{@+int j;
+@z
+
@x l.379 Compiler warning.
for (j=1;collate[j];j++) ord[collate[j]]=j;
@y
@@ -141,12 +201,24 @@ void collapse(
node *p, node *q)
@z
+@x l.392 C++17 removed 'register' storage class.
+{@+register node *x;
+@y
+{@+node *x;
+@z
+
+@x l.403 C++17 removed 'register' storage class.
+{@+register node *x;
+@y
+{@+node *x;
+@z
+
Section 22.
@x l.414 Compiler warning.
{@+register char *p=x->id;
@y
-{@+register const char *p=x->id;
+{@+const char *p=x->id;
@z
@x l.434 FIX: Don't mask already masked underscore.
@@ -154,3 +226,11 @@ Section 22.
@y
if (*p=='_'&&*(p-1)!='\\') putchar('\\');
@z
+
+@x l.441 C++17 removed 'register' storage class.
+{@+register node *y=x->data.n,*z=NULL;
+ while (y) {@+register node *w;
+@y
+{@+node *y=x->data.n,*z=NULL;
+ while (y) {@+node *w;
+@z