summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-02-07 03:03:44 +0000
committerNorbert Preining <norbert@preining.info>2022-02-07 03:03:44 +0000
commitf689c91581665257602a841d03f73078c3495e14 (patch)
tree09c55c606b43f4f53c4c8f9e09625813e19fb2b0 /web
parent350b3e35109171f0edd6fe9d697b91d5e76561f9 (diff)
CTAN sync 202202070303
Diffstat (limited to 'web')
-rw-r--r--web/c_cpp/cweb/Makefile7
-rw-r--r--web/c_cpp/cweb/comm-mac.ch4
-rw-r--r--web/c_cpp/cweb/comm-man.ch2
-rw-r--r--web/c_cpp/cweb/comm-pc.ch2
-rw-r--r--web/c_cpp/cweb/comm-ql.ch8
-rw-r--r--web/c_cpp/cweb/common.c6
-rw-r--r--web/c_cpp/cweb/common.h13
-rw-r--r--web/c_cpp/cweb/common.w6
-rw-r--r--web/c_cpp/cweb/ctang-bs.ch6
-rw-r--r--web/c_cpp/cweb/ctang-man.ch2
-rw-r--r--web/c_cpp/cweb/ctang-pc.ch6
-rw-r--r--web/c_cpp/cweb/ctang-ql.ch8
-rw-r--r--web/c_cpp/cweb/ctang-vms.ch4
-rw-r--r--web/c_cpp/cweb/ctang-w32.ch8
-rw-r--r--web/c_cpp/cweb/ctangle.c10
-rw-r--r--web/c_cpp/cweb/ctangle.w12
-rw-r--r--web/c_cpp/cweb/cweav-bs.ch4
-rw-r--r--web/c_cpp/cweb/cweav-man.ch2
-rw-r--r--web/c_cpp/cweb/cweav-pc.ch8
-rw-r--r--web/c_cpp/cweb/cweav-ql.ch8
-rw-r--r--web/c_cpp/cweb/cweav-vms.ch4
-rw-r--r--web/c_cpp/cweb/cweav-w32.ch4
-rw-r--r--web/c_cpp/cweb/cweave.w22
-rw-r--r--web/c_cpp/cweb/cwebmac.tex124
-rw-r--r--web/c_cpp/cweb/cwebman.pdfbin344141 -> 346104 bytes
-rw-r--r--web/c_cpp/cweb/cwebman.tex21
-rw-r--r--web/c_cpp/cweb/prod.w2
-rw-r--r--web/pwebmac/README.md16
-rw-r--r--web/pwebmac/index.md79
-rwxr-xr-xweb/pwebmac/makeall136
-rw-r--r--web/pwebmac/pwebmac.tex117
31 files changed, 379 insertions, 272 deletions
diff --git a/web/c_cpp/cweb/Makefile b/web/c_cpp/cweb/Makefile
index 86db9f3bfc..92e59b857b 100644
--- a/web/c_cpp/cweb/Makefile
+++ b/web/c_cpp/cweb/Makefile
@@ -1,6 +1,6 @@
# This file is part of CWEB.
# It is distributed WITHOUT ANY WARRANTY, express or implied.
-# Version 4.6 --- December 2021
+# Version 4.7 --- February 2022
# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
@@ -64,9 +64,11 @@ CP= /bin/cp
# uncomment the second line if you use pdftex to bypass .dvi files
# uncomment the third line if you use xetex to bypass .dvi files
+# uncomment the forth line if you use hitex for HINT output
PDFTEX = dvipdfm
#PDFTEX = pdftex
#PDFTEX = xetex
+#PDFTEX = hitex
########## You shouldn't have to change anything after this point #######
@@ -108,6 +110,7 @@ ALL = common.w ctangle.w cweave.w prod.w \
dvipdfm ) tex "\let\pdf+ \input $*"; dvipdfm $* ;; \
pdftex ) pdftex $* ;; \
xetex ) xetex $* ;; \
+ hitex ) hitex $* ;; \
esac
all: ctangle cweave
@@ -163,7 +166,7 @@ fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
# be sure to leave ctangle.c and common.c for bootstrapping
clean:
$(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
- *.log *.dvi *.toc *.idx *.scn *.pdf core cweave ctangle
+ *.log *.dvi *.toc *.idx *.scn *.pdf *.hnt core cweave ctangle
install: all
- mkdir $(DESTDIR)
diff --git a/web/c_cpp/cweb/comm-mac.ch b/web/c_cpp/cweb/comm-mac.ch
index 4d1382accd..6d795ff4e8 100644
--- a/web/c_cpp/cweb/comm-mac.ch
+++ b/web/c_cpp/cweb/comm-mac.ch
@@ -4,9 +4,9 @@ No changes to CTANGLE or CWEAVE are needed.
(Contributed 13 Oct 2000 by AndPio@aol.com; slightly edited by Don Knuth)
@x in limbo, change the title page document to specify Mac version
- \centerline{(Version 4.6)}
+ \centerline{(Version 4.7)}
@y
- \centerline{(Version 4.6 for MacOS)}
+ \centerline{(Version 4.7 for MacOS)}
@z
@x section 23: Make input_ln accept \n, \r, \n\r, or \r\n as line endings
diff --git a/web/c_cpp/cweb/comm-man.ch b/web/c_cpp/cweb/comm-man.ch
index c922c03631..f2cdcf52e4 100644
--- a/web/c_cpp/cweb/comm-man.ch
+++ b/web/c_cpp/cweb/comm-man.ch
@@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one.
}
@y
\def\botofcontents{\vfill\titlefalse}
-\def\contentspagenumber{28}
+\def\contentspagenumber{29}
\def\title{APPENDIX D: COMMON}
\let\K=\leftarrow
@z
diff --git a/web/c_cpp/cweb/comm-pc.ch b/web/c_cpp/cweb/comm-pc.ch
index 5a29188ed7..883da1303c 100644
--- a/web/c_cpp/cweb/comm-pc.ch
+++ b/web/c_cpp/cweb/comm-pc.ch
@@ -8,7 +8,7 @@ Note: The change to section 16 is not necessary if using a compiler
that allows >64K arrays.
@x section 16
-@d max_bytes 90000 /* the number of bytes in identifiers,
+@d max_bytes 100000 /* the number of bytes in identifiers,
@y
@d max_bytes (unsigned)60000 /* the number of bytes in identifiers,
@z
diff --git a/web/c_cpp/cweb/comm-ql.ch b/web/c_cpp/cweb/comm-ql.ch
index 191fb51f1d..aa451c7455 100644
--- a/web/c_cpp/cweb/comm-ql.ch
+++ b/web/c_cpp/cweb/comm-ql.ch
@@ -10,24 +10,24 @@ ex <dev_>cc;'-v -h -c -=500000 -DCWEBINPUTS=flp2_ common_c'
@x
\def\v{\char'174} % vertical (|) in typewriter font
-\def\title{Common code for CTANGLE and CWEAVE (Version 4.6)}
+\def\title{Common code for CTANGLE and CWEAVE (Version 4.7)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
- \centerline{(Version 4.6)}
+ \centerline{(Version 4.7)}
\vfill}
\def\botofcontents{\vfill
\noindent
@y
\def\v{\char'174} % vertical (|) in typewriter font
-\def\title{Common code for CTANGLE and CWEAVE (QL Version 4.6)}
+\def\title{Common code for CTANGLE and CWEAVE (QL Version 4.7)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
- \centerline{(Version 4.6)}
+ \centerline{(Version 4.7)}
\vfill}
\def\botofcontents{\vfill
\noindent
diff --git a/web/c_cpp/cweb/common.c b/web/c_cpp/cweb/common.c
index 9e77c55f31..00575a0ebf 100644
--- a/web/c_cpp/cweb/common.c
+++ b/web/c_cpp/cweb/common.c
@@ -82,13 +82,13 @@
#define new_line putchar('\n')
#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \
-#define buf_size 100
+#define buf_size 200
#define longest_name 10000 \
#define long_buf_size (buf_size+longest_name)
-#define max_bytes 90000 \
+#define max_bytes 100000 \
-#define max_names 4000 \
+#define max_names 5000 \
#define max_sections 2000 \
diff --git a/web/c_cpp/cweb/common.h b/web/c_cpp/cweb/common.h
index 2a584ff442..4d2caba05d 100644
--- a/web/c_cpp/cweb/common.h
+++ b/web/c_cpp/cweb/common.h
@@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
-% Version 4.6 --- December 2021 (works also with later versions)
+% Version 4.7 --- February 2022 (works also with later versions)
% Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
@@ -226,17 +226,16 @@ extern FILE *active_file; /* currently active file for \.{CWEAVE} output */
extern void common_init(void);@/
extern void print_stats(void);
-@ The following parameters were sufficient in the original \.{WEB} to
-handle \TEX/, so they should be sufficient for most applications of
-\.{CWEB}.
+@ The following parameters are sufficient to handle \TEX/ (converted to
+\.{CWEB}), so they should be sufficient for most applications of \.{CWEB}.
-@d buf_size 100 /* maximum length of input line, plus one */
+@d buf_size 200 /* maximum length of input line, plus one */
@d longest_name 10000 /* file names, section names, and section texts
shouldn't be longer than this */
@d long_buf_size (buf_size+longest_name) /* for \.{CWEAVE} */
-@d max_bytes 90000 /* the number of bytes in identifiers,
+@d max_bytes 100000 /* the number of bytes in identifiers,
index entries, and section names; must be less than $2^{24}$ */
-@d max_names 4000 /* number of identifiers, strings, section names;
+@d max_names 5000 /* number of identifiers, strings, section names;
must be less than 10240 */
@d max_sections 2000 /* greater than the total number of sections */
diff --git a/web/c_cpp/cweb/common.w b/web/c_cpp/cweb/common.w
index 36f35f3cbc..941b7206cc 100644
--- a/web/c_cpp/cweb/common.w
+++ b/web/c_cpp/cweb/common.w
@@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
-% Version 4.6 --- December 2021
+% Version 4.7 --- February 2022
% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
@@ -22,12 +22,12 @@
\def\v{\char'174} % vertical (|) in typewriter font
-\def\title{Common code for CTANGLE and CWEAVE (Version 4.6)}
+\def\title{Common code for CTANGLE and CWEAVE (Version 4.7)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
- \centerline{(Version 4.6)}
+ \centerline{(Version 4.7)}
\vfill}
\def\botofcontents{\vfill
\noindent
diff --git a/web/c_cpp/cweb/ctang-bs.ch b/web/c_cpp/cweb/ctang-bs.ch
index ceaefa93e5..ecdb4be591 100644
--- a/web/c_cpp/cweb/ctang-bs.ch
+++ b/web/c_cpp/cweb/ctang-bs.ch
@@ -17,12 +17,12 @@ by using "huge" pointers.
The ``banner line'' defined here should be changed whenever \.{CTANGLE}
is modified.
-@d banner "This is CTANGLE (Version 4.6)"
+@d banner "This is CTANGLE (Version 4.7)"
@y
The ``banner line'' defined here should be changed whenever \.{CTANGLE}
is modified.
-@d banner "This is CTANGLE (Version 4.6pc/big)"
+@d banner "This is CTANGLE (Version 4.7pc/big)"
@z
@@ -98,7 +98,7 @@ typedef text *text_pointer;
@x Section 20.
-@ @d max_texts 2500 /* number of replacement texts, must be less than 10240 */
+@ @d max_texts 4000 /* number of replacement texts, must be less than 10240 */
@d max_toks 270000 /* number of bytes in compressed \CEE/ code */
@y
@ (This is a modified version of \.{CTANGLE}, and in fact one of the parameters
diff --git a/web/c_cpp/cweb/ctang-man.ch b/web/c_cpp/cweb/ctang-man.ch
index f90d5361ae..69bc686b72 100644
--- a/web/c_cpp/cweb/ctang-man.ch
+++ b/web/c_cpp/cweb/ctang-man.ch
@@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one.
}
@y
\def\botofcontents{\vfill\titlefalse}
-\def\contentspagenumber{64}
+\def\contentspagenumber{65}
\def\title{APPENDIX E: CTANGLE}
\let\K=\leftarrow
@z
diff --git a/web/c_cpp/cweb/ctang-pc.ch b/web/c_cpp/cweb/ctang-pc.ch
index 2fb9b90440..459356a59e 100644
--- a/web/c_cpp/cweb/ctang-pc.ch
+++ b/web/c_cpp/cweb/ctang-pc.ch
@@ -9,12 +9,12 @@ that allows >64K arrays. If you need lots of bytes and toks, try the
alternate change files with -bs suffix instead of -pc.
@x section 1
-@d banner "This is CTANGLE (Version 4.6)"
+@d banner "This is CTANGLE (Version 4.7)"
@y
-@d banner "This is CTANGLE (Version 4.6pc)"
+@d banner "This is CTANGLE (Version 4.7pc)"
@z
@x section 17
-@d max_bytes 90000 /* the number of bytes in identifiers,
+@d max_bytes 100000 /* the number of bytes in identifiers,
index entries, and section names; must be less than $2^{24}$ */
@y (note that CWEAVE itself needs only about 42K toks)
@d max_bytes (unsigned)60000 /* the number of bytes in identifiers,
diff --git a/web/c_cpp/cweb/ctang-ql.ch b/web/c_cpp/cweb/ctang-ql.ch
index 2f4ff604b1..727b20ea9c 100644
--- a/web/c_cpp/cweb/ctang-ql.ch
+++ b/web/c_cpp/cweb/ctang-ql.ch
@@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c -=500000 ctangle_c"
@x
-\def\title{CTANGLE (Version 4.6)}
+\def\title{CTANGLE (Version 4.7)}
@y
-\def\title{CTANGLE (QL Version 4.6)}
+\def\title{CTANGLE (QL Version 4.7)}
@z
@x section 1
-@d banner "This is CTANGLE (Version 4.6)"
+@d banner "This is CTANGLE (Version 4.7)"
@y
-@d banner "This is CTANGLE (QL Version 4.6)"
+@d banner "This is CTANGLE (QL Version 4.7)"
@z
@x
diff --git a/web/c_cpp/cweb/ctang-vms.ch b/web/c_cpp/cweb/ctang-vms.ch
index 9f5dd2a677..e494b86f4f 100644
--- a/web/c_cpp/cweb/ctang-vms.ch
+++ b/web/c_cpp/cweb/ctang-vms.ch
@@ -10,9 +10,9 @@ created:
(these changes not necessary for initial bootstrapping)
@x section 1 (01-FEB-1992 ST)
-@d banner "This is CTANGLE (Version 4.6)"
+@d banner "This is CTANGLE (Version 4.7)"
@y
-@d banner "This is CTANGLE (VAX/VMS Version 4.6)"
+@d banner "This is CTANGLE (VAX/VMS Version 4.7)"
@z
@x section 4 (01-FEB-1992 ST)
diff --git a/web/c_cpp/cweb/ctang-w32.ch b/web/c_cpp/cweb/ctang-w32.ch
index d299f00683..d54b84b9f9 100644
--- a/web/c_cpp/cweb/ctang-w32.ch
+++ b/web/c_cpp/cweb/ctang-w32.ch
@@ -4,9 +4,9 @@ This is the change file for CWEB's CTANGLE under Win32
Changes necessary for compiling with Borland C/C++
@x section 1
-@d banner "This is CTANGLE (Version 4.6)"
+@d banner "This is CTANGLE (Version 4.7)"
@y
-@d banner "This is CTANGLE (Version 4.6win32)"
+@d banner "This is CTANGLE (Version 4.7win32)"
@z
@x
@@ -14,13 +14,13 @@ boolean names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
-eight_bits t) /* not used by \.{TANGLE} */
+eight_bits t) /* not used by \.{CTANGLE} */
@y
boolean __cdecl names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
-eight_bits t) /* not used by \.{TANGLE} */
+eight_bits t) /* not used by \.{CTANGLE} */
@z
@x
diff --git a/web/c_cpp/cweb/ctangle.c b/web/c_cpp/cweb/ctangle.c
index 0c6f8afe2a..d7bc2ecbf8 100644
--- a/web/c_cpp/cweb/ctangle.c
+++ b/web/c_cpp/cweb/ctangle.c
@@ -15,7 +15,7 @@
/*:4*/
#line 67 "ctangle.w"
-#define banner "This is CTANGLE (Version 4.6)" \
+#define banner "This is CTANGLE (Version 4.7)" \
#define ctangle false
#define cweave true \
@@ -84,17 +84,17 @@
#define new_line putchar('\n')
#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \
-#define buf_size 100
+#define buf_size 200
#define longest_name 10000 \
#define long_buf_size (buf_size+longest_name)
-#define max_bytes 90000 \
+#define max_bytes 100000 \
-#define max_names 4000 \
+#define max_names 5000 \
#define max_sections 2000 \
-#define max_texts 2500
+#define max_texts 4000
#define max_toks 270000
#define equiv equiv_or_xref \
diff --git a/web/c_cpp/cweb/ctangle.w b/web/c_cpp/cweb/ctangle.w
index 1a9e8065af..1ee2aaf195 100644
--- a/web/c_cpp/cweb/ctangle.w
+++ b/web/c_cpp/cweb/ctangle.w
@@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
-% Version 4.6 --- December 2021
+% Version 4.7 --- February 2022
% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
@@ -27,11 +27,11 @@
\mathchardef\RA="3221 % right arrow
\mathchardef\BA="3224 % double arrow
-\def\title{CTANGLE (Version 4.6)}
+\def\title{CTANGLE (Version 4.7)}
\def\topofcontents{\null\vfill
\centerline{\titlefont The {\ttitlefont CTANGLE} processor}
\vskip 15pt
- \centerline{(Version 4.6)}
+ \centerline{(Version 4.7)}
\vfill}
\def\botofcontents{\vfill
\noindent
@@ -61,7 +61,7 @@ Joachim Schrod, Lee Wittenberg, and others who have contributed improvements.
The ``banner line'' defined here should be changed whenever \.{CTANGLE}
is modified.
-@d banner "This is CTANGLE (Version 4.6)"
+@d banner "This is CTANGLE (Version 4.7)"
@c
@<Include files@>@/
@@ -126,7 +126,7 @@ typedef struct {
} text;
typedef text *text_pointer;
-@ @d max_texts 2500 /* number of replacement texts, must be less than 10240 */
+@ @d max_texts 4000 /* number of replacement texts, must be less than 10240 */
@d max_toks 270000 /* number of bytes in compressed \CEE/ code */
@<Private...@>=
static text text_info[max_texts];
@@ -157,7 +157,7 @@ boolean names_match(
name_pointer p, /* points to the proposed match */
const char *first, /* position of first character of string */
size_t l, /* length of identifier */
-eight_bits t) /* not used by \.{TANGLE} */
+eight_bits t) /* not used by \.{CTANGLE} */
{@+(void)t;@/
return length(p)==l && strncmp(first,p->byte_start,l)==0;
}
diff --git a/web/c_cpp/cweb/cweav-bs.ch b/web/c_cpp/cweb/cweav-bs.ch
index 5aa05c8b8c..c0fc3981ae 100644
--- a/web/c_cpp/cweb/cweav-bs.ch
+++ b/web/c_cpp/cweb/cweav-bs.ch
@@ -20,12 +20,12 @@ This file contributed by Barry Schwartz, trashman@crud.mn.org, 28 Jun 94.
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.
-@d banner "This is CWEAVE (Version 4.6)"
+@d banner "This is CWEAVE (Version 4.7)"
@y
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.
-@d banner "This is CWEAVE (Version 4.6pc/big)"
+@d banner "This is CWEAVE (Version 4.7pc/big)"
@z
diff --git a/web/c_cpp/cweb/cweav-man.ch b/web/c_cpp/cweb/cweav-man.ch
index 366cda6f11..6cfcc8fe2d 100644
--- a/web/c_cpp/cweb/cweav-man.ch
+++ b/web/c_cpp/cweb/cweav-man.ch
@@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one.
}
@y
\def\botofcontents{\vfill\titlefalse}
-\def\contentspagenumber{108}
+\def\contentspagenumber{109}
\def\title{APPENDIX F: CWEAVE}
\let\K=\leftarrow
@z
diff --git a/web/c_cpp/cweb/cweav-pc.ch b/web/c_cpp/cweb/cweav-pc.ch
index 23b37416a8..101b4d8a7a 100644
--- a/web/c_cpp/cweb/cweav-pc.ch
+++ b/web/c_cpp/cweb/cweav-pc.ch
@@ -11,18 +11,18 @@ that allows >64K arrays. (If you need lots more bytes, try the alternate
change files that have -bs in their name instead of -pc.)
@x section 1
-@d banner "This is CWEAVE (Version 4.6)"
+@d banner "This is CWEAVE (Version 4.7)"
@y
-@d banner "This is CWEAVE (Version 4.6pc)"
+@d banner "This is CWEAVE (Version 4.7pc)"
@z
@x section 17
-@d max_bytes 90000 /* the number of bytes in identifiers,
+@d max_bytes 100000 /* the number of bytes in identifiers,
@y
@d max_bytes (unsigned)60000 /* the number of bytes in identifiers,
@z
@x
-@d max_refs 20000 /* number of cross-references; must be less than 65536 */
+@d max_refs 30000 /* number of cross-references; must be less than 65536 */
@y
@d max_refs 10000 /* number of cross-references; must be less than 65536 */
@z
diff --git a/web/c_cpp/cweb/cweav-ql.ch b/web/c_cpp/cweb/cweav-ql.ch
index 4525b8006d..041cba0a83 100644
--- a/web/c_cpp/cweb/cweav-ql.ch
+++ b/web/c_cpp/cweb/cweav-ql.ch
@@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c =500000 cweave_c"
@x
-\def\title{CWEAVE (Version 4.6)}
+\def\title{CWEAVE (Version 4.7)}
@y
-\def\title{CWEAVE (QL Version 4.6)}
+\def\title{CWEAVE (QL Version 4.7)}
@z
@x section 1
-@d banner "This is CWEAVE (Version 4.6)"
+@d banner "This is CWEAVE (Version 4.7)"
@y
-@d banner "This is CWEAVE (QL Version 4.6)"
+@d banner "This is CWEAVE (QL Version 4.7)"
@z
@x
diff --git a/web/c_cpp/cweb/cweav-vms.ch b/web/c_cpp/cweb/cweav-vms.ch
index f6d786da4a..5078c16541 100644
--- a/web/c_cpp/cweb/cweav-vms.ch
+++ b/web/c_cpp/cweb/cweav-vms.ch
@@ -13,9 +13,9 @@ modified:
(also modified by Don Knuth to keep version numbers uptodate)
@x section 1 (01-FEB-1992 ST)
-@d banner "This is CWEAVE (Version 4.6)"
+@d banner "This is CWEAVE (Version 4.7)"
@y
-@d banner "This is CWEAVE (VAX/VMS Version 4.6)"
+@d banner "This is CWEAVE (VAX/VMS Version 4.7)"
@z
@x section 4 (01-FEB-1992 ST)
diff --git a/web/c_cpp/cweb/cweav-w32.ch b/web/c_cpp/cweb/cweav-w32.ch
index 1fc91f1a88..84e6a321a5 100644
--- a/web/c_cpp/cweb/cweav-w32.ch
+++ b/web/c_cpp/cweb/cweav-w32.ch
@@ -2,9 +2,9 @@ This is the change file for CWEB's CWEAVE under Win32
(Contributed by Fabrice Popineau, February 2002)
@x section 1
-@d banner "This is CWEAVE (Version 4.6)"
+@d banner "This is CWEAVE (Version 4.7)"
@y
-@d banner "This is CWEAVE (Version 4.6win32)"
+@d banner "This is CWEAVE (Version 4.7win32)"
@z
@x
diff --git a/web/c_cpp/cweb/cweave.w b/web/c_cpp/cweb/cweave.w
index bcc8efcfb7..5db1c371b5 100644
--- a/web/c_cpp/cweb/cweave.w
+++ b/web/c_cpp/cweb/cweave.w
@@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
-% Version 4.6 --- December 2021
+% Version 4.7 --- February 2022
% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
@@ -32,11 +32,11 @@
\def\skipxTeX{\\{skip\_\TEX/}}
\def\copyxTeX{\\{copy\_\TEX/}}
-\def\title{CWEAVE (Version 4.6)}
+\def\title{CWEAVE (Version 4.7)}
\def\topofcontents{\null\vfill
\centerline{\titlefont The {\ttitlefont CWEAVE} processor}
\vskip 15pt
- \centerline{(Version 4.6)}
+ \centerline{(Version 4.7)}
\vfill}
\def\botofcontents{\vfill
\noindent
@@ -67,7 +67,7 @@ Crusius, and others who have contributed improvements.
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.
-@d banner "This is CWEAVE (Version 4.6)"
+@d banner "This is CWEAVE (Version 4.7)"
@c
@<Include files@>@/
@@ -111,13 +111,13 @@ possible changes from this \.{COMMON} interface consistently.
@i common.h
-@ The following parameters were sufficient in the original \.{WEAVE} to
-handle \TEX/, so they should be sufficient for most applications of \.{CWEAVE}.
+@ The following parameters are sufficient to handle \TEX/ (converted to
+\.{CWEB}), so they should be sufficient for most applications of \.{CWEAVE}.
@d line_length 80 /* lines of \TEX/ output have at most this many characters;
should be less than 256 */
-@d max_refs 20000 /* number of cross-references; must be less than 65536 */
-@d max_scraps 2000 /* number of tokens in \CEE/ texts being parsed */
+@d max_refs 30000 /* number of cross-references; must be less than 65536 */
+@d max_scraps 5000 /* number of tokens in \CEE/ texts being parsed */
@* Data structures exclusive to {\tt CWEAVE}.
As explained in \.{common.w}, the field of a |name_info| structure
@@ -335,9 +335,9 @@ that is unoccupied by replacement text is called |tok_ptr|, and the first
unused location of |tok_start| is called |text_ptr|.
Thus, we usually have |*text_ptr==tok_ptr|.
-@d max_toks 20000 /* number of symbols in \CEE/ texts being parsed;
+@d max_toks 30000 /* number of symbols in \CEE/ texts being parsed;
must be less than 65536 */
-@d max_texts 4000 /* number of phrases in \CEE/ texts being parsed;
+@d max_texts 8000 /* number of phrases in \CEE/ texts being parsed;
must be less than 10240 */
@<Private...@>=
@@ -3765,7 +3765,7 @@ typedef struct {
} output_state;
typedef output_state *stack_pointer;
-@ @d stack_size 400 /* number of simultaneous output levels */
+@ @d stack_size 2000 /* number of simultaneous output levels */
@d cur_end cur_state.end_field /* current ending location in |tok_mem| */
@d cur_tok cur_state.tok_field /* location of next output token in |tok_mem| */
@d cur_mode cur_state.mode_field /* current mode of interpretation */
diff --git a/web/c_cpp/cweb/cwebmac.tex b/web/c_cpp/cweb/cwebmac.tex
index 586e7bb30f..9384d06886 100644
--- a/web/c_cpp/cweb/cwebmac.tex
+++ b/web/c_cpp/cweb/cwebmac.tex
@@ -1,8 +1,8 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.6 --- December 2021
+% Version 4.7--- January 2022
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CWEB4.6}
-\chardef\cwebversion=4 \chardef\cwebrevision=6
+\xdef\fmtversion{\fmtversion+CWEB4.7}
+\chardef\cwebversion=4 \chardef\cwebrevision=7
\newif\ifpdf
\ifx\pdf+\pdftrue\fi
% Uncomment the following line if you want PDF goodies to be the default
@@ -16,7 +16,10 @@
\def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too
\def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}}
\fi\fi
+\newif\ifHINT
+\ifx\HINTversion\undefined \HINTfalse \else \HINTtrue \fi
\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\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)
@@ -127,7 +130,7 @@
\def\?{\mathrel?}
\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi}
\def\note#1#2.{\Y\noindent{\hangindent2em%
- \baselineskip10pt\eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}}
+ \baselineskip10pt\eightrm#1~\ifacroHINT{\pdfnote#2.}\else#2\fi.\par}}
\newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD
\newtoks\toksE \newtoks\toksF \newtoks\usersanitizer
@@ -148,39 +151,6 @@
\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{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox
- attr {/Border [0 0 0]} user { /Type /Action /Subtype /Link /A
- << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
- \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}
-{\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}
@@ -235,7 +205,7 @@
\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\$\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{--}%
@@ -281,9 +251,64 @@
\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
+
+\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) >>}\Blue #1\Black \pdfendlink % changed in 3.69
+ \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}
+{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
+{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
+
\def\lapstar{\rlap{*}}
\def\stsec{\rightskip=0pt % get out of C mode (cf. \B)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
+ \ifHINT\HINTlabel\fi% Start page before section
\noindent{\let\*=\lapstar\bf\secstar.\quad}%
\ifacro \smash{\raise\baselineskip\hbox to0pt{\let\*=\empty
\ifpdftex \pdfdest num \secstar fith%
@@ -311,7 +336,7 @@
\let\G=\ge % greater than or equal sign
% \H is long Hungarian umlaut accent
\let\I=\ne % unequal sign
-\def\J{\.{@\&}} % TANGLE's join operation
+\def\J{\.{@\&}} % CTANGLE's join operation
\let\K== % assignment operator
%\let\K=\leftarrow % "honest" alternative to standard assignment operator
% \L is Polish letter suppressed-L
@@ -345,19 +370,19 @@
\let\R=\lnot % logical not
% \S is section sign
\def\T#1{\leavevmode % octal, hex or decimal constant
- \hbox{$\def\?{\kern.2em}%
+ \hbox{$\def\?{\kern.2em}%$%
\let\ \, % C++ digit separator becomes a little white space
% \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67
\def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
- \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}
+ \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
\def\U{\note{This code is used in section}} % xref for use of a section
\def\Us{\note{This code is used in sections}} % xref for uses of a section
\let\V=\lor % logical or
\let\W=\land % logical and
\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name
\XX$\langle\,${\let\I=\ne#2\eightrm\kern.5em
- \ifacro{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
+ \ifacroHINT{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
\def\Y{\par\yskip}
\let\Z=\le
\let\ZZ=\let % now you can \write the control sequence \ZZ
@@ -451,7 +476,9 @@
\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
@@ -460,7 +487,7 @@
\message{Index:}
\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
@@ -475,7 +502,7 @@
\message{Section names:}
\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{Cited in section}} % crossref for mention of a section
\def\Qs{\note{Cited in sections}} % crossref for mentions of a section
\def\U{\note{Used in section}} % crossref for use of a section
@@ -512,15 +539,20 @@
\pageno=\contentspagenumber
\def\grouptitle{TABLE OF CONTENTS}
\message{Table of contents:}
+ \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
\def\contentsline#1#2#3#4#5{\ifnum#2=0 \smallbreak\fi
\line{\consetup{#2}#1
\rm\leaders\hbox to .5em{.\hfil}\hfil
- \ \ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}}
+ \ \ifHINT
+ \HINTlink{#3}{\romannumeral#3}% No page numbers in HINT
+ \HINTcontents{#1}{#2}{#3}%
+ \else\ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi
+ \hbox to3em{\hss#4}\fi}}
\def\consetup#1{\ifcase#1 \bf % depth -1 (@**)
\or % depth 0 (@*)
\or \hskip2em % depth 1 (@*1)
diff --git a/web/c_cpp/cweb/cwebman.pdf b/web/c_cpp/cweb/cwebman.pdf
index 83f0707c13..134c823818 100644
--- a/web/c_cpp/cweb/cwebman.pdf
+++ b/web/c_cpp/cweb/cwebman.pdf
Binary files differ
diff --git a/web/c_cpp/cweb/cwebman.tex b/web/c_cpp/cweb/cwebman.tex
index 476b526a60..c36b26c9ff 100644
--- a/web/c_cpp/cweb/cwebman.tex
+++ b/web/c_cpp/cweb/cwebman.tex
@@ -2,7 +2,7 @@
\def\tangref{3} % where the main explanation of CTANGLing is given
\input cwebmac
-\acrofalse\pdffalse\pdftexfalse
+\acrofalse\pdffalse\pdftexfalse\HINTfalse\acroHINTfalse
\def\page{\box255 } \normalbottom
\parskip 0pt plus 1pt
\def\RA{\char'31 } % right arrow
@@ -35,7 +35,7 @@
\def\lheader{\mainfont\the\pageno\hfill\sc\runninghead\hfill}
\def\rheader{\hfill\sc\runninghead\hfill\mainfont\the\pageno}
-\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 4.6)}
+\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 4.7)}
% This verbatim mode assumes that ! marks are !! in the text being copied.
\def\verbatim{\begingroup
@@ -49,7 +49,7 @@
\null\vfill
\centerline{\titlefont The {\ttitlefont CWEB} System of
Structured Documentation}
-\vskip 18pt\centerline{(Version 4.6 --- December 2021)}
+\vskip 18pt\centerline{(Version 4.7 --- February 2022)}
\vskip 24pt
\centerline{\authorfont Donald E. Knuth and Silvio Levy}
\vfill
@@ -889,8 +889,8 @@ the change file can have any number of lines that do not begin with
matching purposes.
\more This dual-input feature is useful when working with a master \.{CWEB}
-file that has been received from elsewhere (e.g., \.{tangle.w} or
-\.{weave.w} or \.{tex.web}), when changes are desirable to customize the
+file that has been received from elsewhere (e.g., \.{ctangle.w} or
+\.{cweave.w} or \.{ctex.w}), when changes are desirable to customize the
program for your local computer system. You will be able to debug your
system-dependent changes without clobbering the master web file; and once
your changes are working, you will be able to incorporate them readily
@@ -1166,6 +1166,11 @@ saying `\.{pdftex}~\.{cob}'.
And a third way to create PDF output from \.{CWEB} input is to say
`\.{xetex}~\.{cob}'.
+Similar output for ``smart'' devices can be created with Martin Ruckert's
+Hi\TeX\ and its dynamic \.{HINT} format; just say `\.{hitex}~\.{cob}'.
+\.{HINT} files can be viewed with the \.{hintview} program, which is available
+for {\mc GNU}/Linux, {\mc MS}~Windows, and Android.
+
A more elaborate system called \.{CTWILL}, which extends the usual cross
references of \.{CWEAVE} by preparing links from the uses of identifiers
to their definitions, is also available---provided that you are willing
@@ -1592,7 +1597,7 @@ $$\lpile{\.{\\def\\topofcontents\{\\null\\vfill}\cr
\.{ { }\\titlefalse \% include headline on the contents page}\cr
\.{ { }\\def\\rheader\{\\mainfont The \{\\tt CWEAVE\}{ }processor\\hfil\}}\cr
\.{ { }\\centerline\{\\titlefont The \{\\ttitlefont CWEAVE\}{ }processor\}}\cr
- \.{ { }\\vskip 15pt \\centerline\{(Version 4.6)\}{ }\\vfill\}}\cr}$$
+ \.{ { }\\vskip 15pt \\centerline\{(Version 4.7)\}{ }\\vfill\}}\cr}$$
Redefining \.{\\rheader}, which is the headline for right-hand pages,
suffices in this case to put the desired information at the top of the
contents page.
@@ -1600,8 +1605,8 @@ contents page.
\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\}\{28\}\{\}}\cr
- \.{\\ZZ \{The character set\}\{2\}\{5\}\{29\}\{\}}\cr}$$
+$$\lpile{\.{\\ZZ \{Introduction\}\{0\}\{1\}\{29\}\{\}}\cr
+ \.{\\ZZ \{The character set\}\{1\}\{21\}\{35\}\{\}}\cr}$$
and so on. The \.{\\topofcontents} macro could
redefine \.{\\ZZ} so that the information appears in any desired format.
(See also point~19 below.)
diff --git a/web/c_cpp/cweb/prod.w b/web/c_cpp/cweb/prod.w
index cba9473fd0..ff33c57a46 100644
--- a/web/c_cpp/cweb/prod.w
+++ b/web/c_cpp/cweb/prod.w
@@ -2,7 +2,7 @@
% This program by Silvio Levy and Donald E. Knuth
% is based on a program by Knuth.
% It is distributed WITHOUT ANY WARRANTY, express or implied.
-% Version 4.6 --- December 2021
+% Version 4.7 --- February 2022
%
@ Here is a table of all the productions. Each production that
combines two or more consecutive scraps implicitly inserts a {\tt \$}
diff --git a/web/pwebmac/README.md b/web/pwebmac/README.md
index a876aaf212..1fec3c29a5 100644
--- a/web/pwebmac/README.md
+++ b/web/pwebmac/README.md
@@ -12,22 +12,26 @@ output; all these macros can only be used with a specific “TeX engine” each.
The present `pwebmac` package integrates these three WEB macro files similar
to `cwebmac.tex` in Silvio Levy's and Don Knuth's
[CWEB](https://ctan.org/pkg/cweb) system, so `pwebmac.tex` can be used with
-“plain TeX,” “pdfTeX,” and “XeTeX” alike.
+“plain TeX,” “pdfTeX,” and “XeTeX” alike. And it adds full support for Martin
+Ruckert's “[HiTeX](https://ctan.org/pkg/hitex)” engine and its `HINT` output
+format.
-Its initial application is the production of PDF files for all major WEB
-programs for “TeX and friends” as distributed in
+Its initial application is the production of PDF and HINT files for all major
+WEB programs for “TeX and friends” as distributed in
[TeX Live](https://www.tug.org/texlive). For this purpose, the shell script
`makeall` was whipped together; it provides various commandline options and
works around several “quirks” in the WEB sources. The resulting collection
-of PDF documents can be browsed in the `knuth-pdf` package.
+of PDF documents can be browsed in the `knuth-pdf` package amd the collection
+of HINT documents are available in the `knuth-hint` package.
WEB programmers who want to use `pwebmac.tex` instead of the default
`webmac.tex` in their programs have to change the first line in the TeX file
created by `weave`. From there, all depends on the “TeX engine” you use:
“plain TeX” by default creates DVI output, “plain TeX” with the invocation
`tex "\let\pdf+\input…"`, `pdftex`, and `xetex` create PDF output with
-clickable links and bookmarks (depending on your PDF viewer).
+clickable links and bookmarks (depending on your PDF viewer), and `hitex`
+creates HINT output that can be viewed with the `hintview` program.
The `pwebmac` package is free software and may be used without constraints.
-This is version “4.6.4” of the `pwebmac` package — 2021-11-06, Andreas Scherer.
+This is version “4.7” of the `pwebmac` package — 2022-02-05, Andreas Scherer.
diff --git a/web/pwebmac/index.md b/web/pwebmac/index.md
index 0c9accb73e..59f6663e26 100644
--- a/web/pwebmac/index.md
+++ b/web/pwebmac/index.md
@@ -1,5 +1,5 @@
---
-title: C/WEB programs in “\TeX\ Live 2021”
+title: C/WEB programs in \TeX\ Live 2022
colorlinks: true
filecolor: blue
urlcolor: blue
@@ -9,14 +9,14 @@ urlcolor: blue
## Introduction
-Welcome to “All Things `WEB`” in “\TeX\ Live.”
+Welcome to “All Things `WEB`” in \TeX\ Live.
Here you find the documented source code of all major `WEB` and `CWEB` programs
-in readable format. The “named” entries represent the unmodified base sources
-as written by their respective authors, the attached “`chg`” links point to
-“only the changed sections (or modules)” as applied for release in the
-“\TeX\ Live” distribution, so you may want to study these pairs in parallel.
-Care has been taken to keep the section numbers for the main parts intact.
+in readable format. The `NAMED` entries represent the unmodified base sources
+as written by their respective authors, the attached `chg` links point to
+only the changed sections (or modules) as applied for release in the
+\TeX\ Live distribution, so you may want to study these pairs in parallel.
+Care has been taken to keep the section numbering intact.
Although not all the programs presented here are written or maintained by
Donald Knuth, it is more convenient for everything to be collected in one place
@@ -24,67 +24,68 @@ for reading and searching. And they all stem from the system that Knuth
created.
Note that all `WEB` programs are mogrified from Pascal code to C code before
-compilation, so further modifications and amendments will occur “for the real
-thing,” i.e., the production of the executable `WEB` programs. (The `CWEB`
+compilation, so further modifications and amendments will occur for the real
+thing, i.e., the production of the executable `WEB` programs. (The `CWEB`
programs do not require these extra modifications, they get linked directly to
the external runtime environment.)
If you believe to have found anything that remains technically, historically,
typographically, or politically incorrect in any of these files, please feel
free to [report bugs in \TeX\ and friends](https://tug.org/texmfbug/) or
-[contact the maintainer of this library](mailto:andreas_github@freenet.de)
+[contact the maintainer of this collection](mailto:andreas_github@freenet.de)
directly.
## Canonical Knuthian WEB programs
* `etc/` \[
- [`VFtoVP`](etc/vftovp.pdf)\ ~[`chg`](etc/vftovp-changes.pdf)~ \|
- [`VPtoVF`](etc/vptovf.pdf)\ ~[`chg`](etc/vptovf-changes.pdf)~ \]
+ [`VFtoVP`](etc/vftovp.pdf)+[`chg`](etc/vftovp-changes.pdf) \|
+ [`VPtoVF`](etc/vptovf.pdf)+[`chg`](etc/vptovf-changes.pdf) \]
* `mf/` \[
- [`Metafont`](mf/mf.pdf)\ ~[`chg`](mf/mf-changes.pdf)~ \|
+ [`Metafont`](mf/mf.pdf)+[`chg`](mf/mf-changes.pdf) \|
[`TRAPMAN`](mf/trapman.pdf) \]
* `mfware/` \[
- [`GFtype`](mfware/gftype.pdf)\ ~[`chg`](mfware/gftype-changes.pdf)~ \|
- [`GFtoPK`](mfware/gftopk.pdf)\ ~[`chg`](mfware/gftopk-changes.pdf)~ \|
- [`GFtoDVI`](mfware/gftodvi.pdf)\ ~[`chg`](mfware/gftodvi-changes.pdf)~ \|
- [`MFT`](mfware/mft.pdf)\ ~[`chg`](mfware/mft-changes.pdf)~ \]
+ [`GFtype`](mfware/gftype.pdf)+[`chg`](mfware/gftype-changes.pdf) \|
+ [`GFtoPK`](mfware/gftopk.pdf)+[`chg`](mfware/gftopk-changes.pdf) \|
+ [`GFtoDVI`](mfware/gftodvi.pdf)+[`chg`](mfware/gftodvi-changes.pdf) \|
+ [`MFT`](mfware/mft.pdf)+[`chg`](mfware/mft-changes.pdf) \]
* `tex/` \[
[`GLUE`](tex/glue.pdf) \|
- [`TeX`](tex/tex.pdf)\ ~[`chg`](tex/tex-changes.pdf)~ \|
+ [`TeX`](tex/tex.pdf)+[`chg`](tex/tex-changes.pdf) \|
[`TRIPMAN`](tex/tripman.pdf) \]
* `texware/` \[
- [`POOLtype`](texware/pooltype.pdf)\ ~[`chg`](texware/pooltype-changes.pdf)~ \|
- [`TFtoPL`](texware/tftopl.pdf)\ ~[`chg`](texware/tftopl-changes.pdf)~ \|
- [`PLtoTF`](texware/pltotf.pdf)\ ~[`chg`](texware/pltotf-changes.pdf)~ \|
- [`DVItype`](texware/dvitype.pdf)\ ~[`chg`](texware/dvitype-changes.pdf)~ \]
+ [`POOLtype`](texware/pooltype.pdf)+[`chg`](texware/pooltype-changes.pdf) \|
+ [`TFtoPL`](texware/tftopl.pdf)+[`chg`](texware/tftopl-changes.pdf) \|
+ [`PLtoTF`](texware/pltotf.pdf)+[`chg`](texware/pltotf-changes.pdf) \|
+ [`DVItype`](texware/dvitype.pdf)+[`chg`](texware/dvitype-changes.pdf) \]
* `web/` \[
[`WEBMAN`](web/webman.pdf) \|
- [`WEAVE`](web/weave.pdf)\ ~[`chg`](web/weave-changes.pdf)~ \|
- [`TANGLE`](web/tangle.pdf)\ ~[`chg`](web/tangle-changes.pdf)~ \]
+ [`WEAVE`](web/weave.pdf)+[`chg`](web/weave-changes.pdf) \|
+ [`TANGLE`](web/tangle.pdf)+[`chg`](web/tangle-changes.pdf) \|
+ [`TWILL`](web/twill.pdf) \]
## Complementary WEB programs by other authors
* `other/` \[
- [`DVIcopy`](other/dvicopy.pdf)\ ~[`chg`](other/dvicopy-changes.pdf)~ \|
- [`PatGen`](other/patgen.pdf)\ ~[`chg`](other/patgen-changes.pdf)~ \|
- [`PKtoGF`](other/pktogf.pdf)\ ~[`chg`](other/pktogf-changes.pdf)~ \|
- [`PKtype`](other/pktype.pdf)\ ~[`chg`](other/pktype-changes.pdf)~ \]
-* `bibtex/` \[ [`BibTeX`](bibtex/bibtex.pdf)\ ~[`chg`](bibtex/bibtex-changes.pdf)~ \]
-* `pdftex/` \[ [`pdfTeX`](pdftex/pdftex.pdf)\ ~[`chg`](pdftex/pdftex-changes.pdf)~ \]
-* `xetex/` \[ [`XeTeX`](xetex/xetex.pdf)\ ~[`chg`](xetex/xetex-changes.pdf)~ \]
+ [`DVIcopy`](other/dvicopy.pdf)+[`chg`](other/dvicopy-changes.pdf) \|
+ [`PatGen`](other/patgen.pdf)+[`chg`](other/patgen-changes.pdf) \|
+ [`PKtoGF`](other/pktogf.pdf)+[`chg`](other/pktogf-changes.pdf) \|
+ [`PKtype`](other/pktype.pdf)+[`chg`](other/pktype-changes.pdf) \]
+* `bibtex/` \[ [`BibTeX`](bibtex/bibtex.pdf)+[`chg`](bibtex/bibtex-changes.pdf) \]
+* `pdftex/` \[ [`pdfTeX`](pdftex/pdftex.pdf)+[`chg`](pdftex/pdftex-changes.pdf) \]
+* `xetex/` \[ [`XeTeX`](xetex/xetex.pdf)+[`chg`](xetex/xetex-changes.pdf) \]
## CWEB programs by Knuth _et\ al._
* `cweb/` \[
[`CWEBMAN`](cweb/cwebman.pdf) \|
- [`COMMON`](cweb/common.pdf)\ ~[`chg`](cweb/common-changes.pdf)~ \|
- [`CTANGLE`](cweb/ctangle.pdf)\ ~[`chg`](cweb/ctangle-changes.pdf)~ \|
- [`CWEAVE`](cweb/cweave.pdf)\ ~[`chg`](cweb/cweave-changes.pdf)~ \|\
+ [`COMMON`](cweb/common.pdf)+[`chg`](cweb/common-changes.pdf) \|
+ [`CTANGLE`](cweb/ctangle.pdf)+[`chg`](cweb/ctangle-changes.pdf) \|
+ [`CWEAVE`](cweb/cweave.pdf)+[`chg`](cweb/cweave-changes.pdf) \|\
[`CTWILL`](cweb/ctwill.pdf) \|
- [`REFSORT`](cweb/refsort.pdf)\ ~[`chg`](cweb/refsort-changes.pdf)~ \|
- [`TWINX`](cweb/twinx.pdf)\ ~[`chg`](cweb/twinx-changes.pdf)~ \]
-* `ctie/` \[ [`CTIE`](ctie/ctie.pdf)\ ~[`chg`](ctie/ctie-changes.pdf)~ \]
-* `tie/` \[ [`TIE`](tie/tie.pdf)\ ~[`chg`](tie/tie-changes.pdf)~ \]
+ [`REFSORT`](cweb/refsort.pdf)+[`chg`](cweb/refsort-changes.pdf) \|
+ [`TWINX`](cweb/twinx.pdf)+[`chg`](cweb/twinx-changes.pdf) \]
+* `ctie/` \[ [`CTIE`](ctie/ctie.pdf)+[`chg`](ctie/ctie-changes.pdf) \]
+* `tie/` \[ [`TIE`](tie/tie.pdf)+[`chg`](tie/tie-changes.pdf) \]
## Errata for “Computers & Typesetting” by Donald E.\ Knuth
@@ -106,4 +107,4 @@ directly.
## Happy C/WEB Programming!
-2021-03-17 Andreas Scherer
+2022-02-02 Andreas Scherer
diff --git a/web/pwebmac/makeall b/web/pwebmac/makeall
index 879ec912d4..2a058c5c6f 100755
--- a/web/pwebmac/makeall
+++ b/web/pwebmac/makeall
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
PROG=$(basename $0)
@@ -8,8 +8,8 @@ usage ()
Usage: $PROG [options]
Test driver for 'pwebmac.tex' in combination with various TeX engines.
-Produce TeX output in DVI or PDF from a set of C/WEB programs included
-in the 'TeX Live' source tree.
+Produce TeX output in DVI, PDF or HINT format from a set of C/WEB programs
+included in the 'TeX Live' source tree.
Options are (--long options only with GNU getopt):
-c, --changes Apply change file to C/WEB source
@@ -18,7 +18,7 @@ Options are (--long options only with GNU getopt):
-n, --new Use 'pwebmac' instead of 'webmac'
-o, --outdir ARG Create tarballs in path ARG
-p, --pdftocfront Place TOC page at the front (PDF only)
- -t, --tex ARG Use TeX variant ARG={tex,pdftex,xetex}
+ -t, --tex ARG Use TeX variant ARG={tex,{hi,pdf,xe}tex}
Public domain. Originally written by Andreas Scherer, 2020.
HELP
@@ -32,7 +32,7 @@ FILESELECT=false # user-defined '--files' selection
NEW=false # '\input pwebmac' instead of '\input webmac' for PDF et al.
OUTDIR=. # path where the resulting tarballs are placed
PDFTOCFRONT=false # push table-of-contents to front of PDF output
-TEX=tex # or 'pdftex' or 'xetex'
+TEX=tex # or 'pdftex' or 'xetex' or 'hitex'
# Initial list of C/WEB sources to process, overridable with option '-f':
KNUTHWHERE=$(locate /bibtex.web)
@@ -41,7 +41,7 @@ then echo "$PROG: Can't locate the TeX Live source tree!" >&2; exit 1
fi
KNUTHWARE=$(dirname $KNUTHWHERE)
-FILES="$KNUTHWARE/*.web pdftex.web xetex.web"
+FILES="$KNUTHWARE/*.web pdftex.web xetex.web twill"
WEBINPUTS=$KNUTHWARE//:
FILES="$FILES common ctangle cweave ctwill refsort twinx ctie tie"
@@ -87,6 +87,15 @@ CWEAVE="cweave -f +lX"
CTWILL="ctwill -f +lpdf"
PAX="pax -wvzf"
SED_I="sed -i" # non-GNU-sed requires an extra '' argument for '-i' option.
+PDF=pdf
+
+# HINT format
+if [ hitex = $TEX ]
+then
+ $TEX -ini -jobname=hitex tex.ini
+ TEX="hitex --compress"
+ PDF=hnt
+fi
# WEB and CWEB programs we want to get formatted
for f in $FILES
@@ -101,6 +110,11 @@ do
$CTWILL $f # prime the pump
$CTWILL $f # get decent answers
+ elif [ twill = $f ]
+ then
+ tie -m $f.web weave.web weave.ch weav-$f.ch
+ weave $f
+
elif [ glue = $f ]
then
weave $f # no 'glue.ch' at this time
@@ -121,6 +135,9 @@ do
WEBINPUTS=$KNUTHWARE/../../Work//:$WEBINPUTS: \
weave $f $f-final ;;
+ # TWILL is a change in and of itself
+ twill ) ;;
+
# all other WEB codes have singular changefiles
* ) weave $f $f ;;
esac
@@ -157,7 +174,7 @@ do
$SED_I -e "s/\(\\\\def\\\\title\)/\\\\datecontentspage\n\1/" $f.tex ;;
mf | tex | pdftex | xetex )
- $SED_I -e "s/\(\\\\def\\\\botofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\1/" $f.tex
+ $SED_I -e "s/\(\\\\def\\\\topofcontents\)/\\\\datethis\n\\\\emergencystretch=.1\\\\hsize\n\1/" $f.tex
# amend '\N' redefinition for PDF outlines in
# Metafont and TeX (also pdfTeX and XeTeX)
@@ -214,7 +231,7 @@ FI
# FIX: pdfTeX uses '\pdfTeX' in section names; these should
# appear correctly in the bookmarks, too.
pdftex )
- if $NEW && [ tex != $TEX ]
+ if $NEW && [ tex != "$TEX" ] && [[ ! $TEX =~ hitex ]]
then
$SED_I -e "s/\(\\\\def\\\\pdfTeX{pdf\\\\TeX}\)/\1 \\\\sanitizecommand\\\\pdfTeX{pdfTeX}\\\\sanitizecommand\\\\eTeX{e-TeX}/" \
$f.tex
@@ -245,62 +262,72 @@ FI
# only XeTeX can process XETEX.WEB
if [ xetex = $f ]
then $f $f
- elif [ refsort = $f ]
- then $TEX -interaction nonstopmode $f
- else $TEX $f
- fi
-
- if [ ctwill = $f ]
+ elif [ ctwill = $f ]
then
+ if [[ $TEX =~ hitex ]]
+ then
+ CTWILLTEX=pdftex
+ else
+ CTWILLTEX="$TEX"
+ fi
+ $CTWILLTEX $f
# sort mini-indexes
ctwill-refsort < $f.ref > $f.sref
- $TEX $f
+ $CTWILLTEX $f
+ elif [ refsort = $f ]
+ then $TEX -interaction nonstopmode $f
+ else $TEX $f
fi
done
-if $PDFTOCFRONT && ! $FILESELECT
+if ( $PDFTOCFRONT || [[ $TEX =~ hitex ]] ) && ! $FILESELECT
then
# create tarballs w/o changes for publication
if $CHANGES
then
- for f in *.pdf
+ for f in *.$PDF
do
case $f in
- *-changes.pdf ) rm -f $f; continue ;;
+ *-changes.$PDF ) rm -f $f; continue ;;
esac
- mv $f $(basename $f .pdf)-changes.pdf
+ mv $f $(basename $f .$PDF)-changes.$PDF
done
+ if [[ $TEX =~ hitex ]]
+ then
+ rm -f xetex-changes.pdf
+ mv xetex.pdf xetex-changes.pdf
+ fi
$PAX "$OUTDIR/etc-changes.tar.gz" -s ,^,etc/, \
- vftovp-changes.pdf vptovf-changes.pdf
+ vftovp-changes.$PDF vptovf-changes.$PDF
$PAX "$OUTDIR/mf-changes.tar.gz" -s ,^,mf/, \
- mf-changes.pdf
+ mf-changes.$PDF
$PAX "$OUTDIR/mfware-changes.tar.gz" -s ,^,mfware/, \
- gftodvi-changes.pdf gftopk-changes.pdf \
- gftype-changes.pdf mft-changes.pdf
+ gftodvi-changes.$PDF gftopk-changes.$PDF \
+ gftype-changes.$PDF mft-changes.$PDF
$PAX "$OUTDIR/tex-changes.tar.gz" -s ,^,tex/, \
- tex-changes.pdf
+ tex-changes.$PDF
$PAX "$OUTDIR/texware-changes.tar.gz" -s ,^,texware/, \
- dvitype-changes.pdf pltotf-changes.pdf \
- pooltype-changes.pdf tftopl-changes.pdf
+ dvitype-changes.$PDF pltotf-changes.$PDF \
+ pooltype-changes.$PDF tftopl-changes.$PDF
$PAX "$OUTDIR/web-changes.tar.gz" -s ,^,web/, \
- tangle-changes.pdf weave-changes.pdf
+ tangle-changes.$PDF weave-changes.$PDF
$PAX "$OUTDIR/bibtex-changes.tar.gz" -s ,^,bibtex/, \
- bibtex-changes.pdf
+ bibtex-changes.$PDF
$PAX "$OUTDIR/other-changes.tar.gz" -s ,^,other/, \
- dvicopy-changes.pdf patgen-changes.pdf \
- pktogf-changes.pdf pktype-changes.pdf
+ dvicopy-changes.$PDF patgen-changes.$PDF \
+ pktogf-changes.$PDF pktype-changes.$PDF
$PAX "$OUTDIR/pdftex-changes.tar.gz" -s ,^,pdftex/, \
- pdftex-changes.pdf
+ pdftex-changes.$PDF
$PAX "$OUTDIR/xetex-changes.tar.gz" -s ,^,xetex/, \
xetex-changes.pdf
$PAX "$OUTDIR/ctie-changes.tar.gz" -s ,^,ctie/, \
- ctie-changes.pdf
+ ctie-changes.$PDF
$PAX "$OUTDIR/tie-changes.tar.gz" -s ,^,tie/, \
- tie-changes.pdf
+ tie-changes.$PDF
$PAX "$OUTDIR/cweb-changes.tar.gz" -s ,^,cweb/, \
- common-changes.pdf ctangle-changes.pdf \
- cweave-changes.pdf refsort-changes.pdf \
- twinx-changes.pdf
+ common-changes.$PDF ctangle-changes.$PDF \
+ cweave-changes.$PDF refsort-changes.$PDF \
+ twinx-changes.$PDF
else
# Finally, build the remaining documents
# * TeX and Metafont test routines
@@ -336,45 +363,48 @@ then
eleven twelve
do
$TEX errata.$f
- mv errata.pdf errata.$f.pdf
+ mv errata.$PDF errata.$f.$PDF
done
$TEX errata
$PAX "$OUTDIR/errata.tar.gz" -s ,^,errata/, \
- errorlog.pdf errata.*.pdf errata.pdf
- $PAX "$OUTDIR/etc.tar.gz" -s ,^,etc/, vftovp.pdf vptovf.pdf
- $PAX "$OUTDIR/mf.tar.gz" -s ,^,mf/, mf.pdf trapman.pdf
+ errorlog.$PDF errata.*.$PDF errata.$PDF
+ $PAX "$OUTDIR/etc.tar.gz" -s ,^,etc/, vftovp.$PDF vptovf.$PDF
+ $PAX "$OUTDIR/mf.tar.gz" -s ,^,mf/, mf.$PDF trapman.$PDF
$PAX "$OUTDIR/mfware.tar.gz" -s ,^,mfware/, \
- gftodvi.pdf gftopk.pdf gftype.pdf mft.pdf
+ gftodvi.$PDF gftopk.$PDF gftype.$PDF mft.$PDF
$PAX "$OUTDIR/tex.tar.gz" -s ,^,tex/, \
- glue.pdf tex.pdf tripman.pdf
+ glue.$PDF tex.$PDF tripman.$PDF
$PAX "$OUTDIR/texware.tar.gz" -s ,^,texware/, \
- dvitype.pdf pltotf.pdf pooltype.pdf tftopl.pdf
+ dvitype.$PDF pltotf.$PDF pooltype.$PDF tftopl.$PDF
$PAX "$OUTDIR/web.tar.gz" -s ,^,web/, \
- webman.pdf tangle.pdf weave.pdf
- $PAX "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, bibtex.pdf
+ webman.$PDF tangle.$PDF weave.$PDF twill.$PDF
+ $PAX "$OUTDIR/bibtex.tar.gz" -s ,^,bibtex/, bibtex.$PDF
$PAX "$OUTDIR/other.tar.gz" -s ,^,other/, \
- dvicopy.pdf patgen.pdf pktogf.pdf pktype.pdf
- $PAX "$OUTDIR/pdftex.tar.gz" -s ,^,pdftex/, pdftex.pdf
+ dvicopy.$PDF patgen.$PDF pktogf.$PDF pktype.$PDF
+ $PAX "$OUTDIR/pdftex.tar.gz" -s ,^,pdftex/, pdftex.$PDF
$PAX "$OUTDIR/xetex.tar.gz" -s ,^,xetex/, xetex.pdf
- $PAX "$OUTDIR/ctie.tar.gz" -s ,^,ctie/, ctie.pdf
- $PAX "$OUTDIR/tie.tar.gz" -s ,^,tie/, tie.pdf
+ $PAX "$OUTDIR/ctie.tar.gz" -s ,^,ctie/, ctie.$PDF
+ $PAX "$OUTDIR/tie.tar.gz" -s ,^,tie/, tie.$PDF
$PAX "$OUTDIR/cweb.tar.gz" -s ,^,cweb/, \
- cwebman.pdf common.pdf ctangle.pdf cweave.pdf \
- ctwill.pdf refsort.pdf twinx.pdf
+ cwebman.$PDF common.$PDF ctangle.$PDF cweave.$PDF \
+ ctwill.pdf refsort.$PDF twinx.$PDF
fi
# Notes to self:
# (1) Create a user-friendly central entrypoint with
# (a) pandoc index.md -o index.pdf
# (b) pandoc index.md -o index.tex;
- # pandoc index.tex -s -o index.html;
+ # pandoc index.tex -s -o index.html \
+ # --metadata title="C/WEB programs in TeX Live 2022";
# rm index.tex
# (2) Prepare a super-tarball from all the contents of these
- # individual tarballs (27/31) with either of
+ # individual tarballs (42/53 and 34/54) with either of
# (a) pax -wzf knuth-pdf.tar.gz knuth-pdf
+ # (a') pax -wzf knuth-hint.tar.gz knuth-hint
# (b) zip -r knuth-pdf.zip knuth-pdf
+ # (b') zip -r knuth-hint.zip knuth-hint
fi
exit 0
diff --git a/web/pwebmac/pwebmac.tex b/web/pwebmac/pwebmac.tex
index 3dac11f4bc..3f4bd335e6 100644
--- a/web/pwebmac/pwebmac.tex
+++ b/web/pwebmac/pwebmac.tex
@@ -1,10 +1,11 @@
% standard macros for WEB listings (in addition to PLAIN.TEX)
% pdfTeX adjustments provided by Han The Thanh <thanh@pdftex.org>.
% XeTeX adjustments provided by Khaled Hosny <khaledhosny@eglug.org>.
+% HiTeX adjustments provided by Martin Ruckert <ruckert@cs.hm.edu>.
% macro integration \`a la CWEB by Andreas Scherer <andreas_tex@freenet.de>.
% This file is not copyrighted and can be used freely.
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+WEBMAC4.6}
+\xdef\fmtversion{\fmtversion+WEBMAC4.7}
\newif\ifpdf
\ifx\pdf+\pdftrue\fi
% Uncomment the following line if you want PDF goodies to be the default
@@ -17,7 +18,10 @@
\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\ifHINT
+\ifx\HINTversion\undefined \HINTfalse \else \HINTtrue \fi
\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
+\newif\ifacroHINT \ifacro\acroHINTtrue\fi \ifHINT\acroHINTtrue\fi
\parskip 0pt % no stretch between paragraphs
\parindent 1em % for paragraphs and for the first line of Pascal text
@@ -81,7 +85,7 @@
\let\yskip=\smallskip
\def\to{\mathrel{.\,.}} % double dot, used only in math mode
\def\note#1#2.{\Y\noindent{\hangindent2em\baselineskip10pt%
- \eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}}
+ \eightrm#1~\ifacroHINT{\pdfnote#2.}\else#2\fi.\par}}
\newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD
\newtoks\toksE \newtoks\toksF \newtoks\usersanitizer
@@ -102,43 +106,9 @@
\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{\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}
-{\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}
-\sanitizecommand\to{..} % a trivial example
\catcode`\[=1 \catcode`\]=2 \catcode`\{=12 \catcode`\}=12
\def\lbchar[{] \def\rbchar[}]
@@ -187,7 +157,7 @@
\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\tokprocessedtrue\else\addF$\fi % \T{77\$L} %$%
+ \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\#}%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
@@ -205,9 +175,65 @@
\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 \modstar 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}
+\ifHINT\else\sanitizecommand\to{..}\fi % a trivial example; requires \addtokens
+\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
+
+\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}
+{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
+{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
+
\def\lapstar{\rlap{*}}
\def\stsec{\rightskip=0pt % get out of Pascal mode (cf. \P)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
+ \ifHINT\HINTlabel\fi% Start page before section
\noindent{\let\*=\lapstar\bf\modstar.\quad}%
\ifacro \smash{\raise\baselineskip\hbox to0pt{\let\*=\empty
\ifpdftex \pdfdest num \modstar fith%
@@ -265,7 +291,7 @@
\let\W=\land % logical and
\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name
\XX$\langle\,$#2{\eightrm\kern.5em
- \ifacro{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
+ \ifacroHINT{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
\def\Y{\par\yskip}
\let\Z=\let % now you can \send the control sequence \Z
\def\){\hbox{\.{@\$}}} % sign for string pool check sum
@@ -345,7 +371,9 @@
\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
@@ -354,7 +382,7 @@
\message{Index:}
\parskip 0pt plus .5pt
\outer\def\:##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
- \ifacro\pdfnote##2.\else##2\fi.} % index entry
+ \ifacroHINT\pdfnote##2.\else##2\fi.} % index entry
\let\ttentry=\. \def\.##1{\ttentry{##1\kern.2em}} % give \tt a little room
\def\[##1]{$\underline{##1}$} % underlined index item
\rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar
@@ -369,7 +397,7 @@
\message{Section names:}
\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.}}
\linepenalty=10 % try to conserve lines
\def\U{\note{Used in section}} % crossref for use of a section
\def\Us{\note{Used in sections}} % crossref for uses of a section
@@ -404,15 +432,20 @@
\pageno=\contentspagenumber
\def\grouptitle{TABLE OF CONTENTS}
\message{Table of contents:}
+ \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\Z=\contentsline
\readcontents\relax % read the contents info
\botofcontents \end} % print the contents page(s) and terminate
\def\contentsline#1#2#3#4{%
\line{\ignorespaces#1
\rm\leaders\hbox to .5em{.\hfil}\hfil
- \ \ifacro\pdflink{#2}{\romannumeral#2}\else#2\fi\hbox to3em{\hss#3}}}
+ \ \ifHINT
+ \HINTlink{#2}{\romannumeral#2}% No page numbers in HINT
+ \HINTcontents{#1}{#2}{#3}%
+ \else\ifacro\pdflink{#2}{\romannumeral#2}\else#2\fi
+ \hbox to3em{\hss#3}\fi}}
\def\today{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi