summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/cweav-bs.ch
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2021-02-07 11:02:17 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2021-02-07 11:02:17 +0000
commit3063cfbe5a32a13420a310bad225be72bcde4982 (patch)
tree01cdd5b69339785bc339eeaa5ec8e5e0dc7e29d0 /Build/source/texk/web2c/cwebdir/cweav-bs.ch
parent1842aa2477fe04aa641c9332262e21b78c4e50ed (diff)
CWEB – release 4.0, 2021-02-07.
In the course of the "2021 TeX tuneup", Don Knuth kindly transferred the responsibility for CWEB to me; see the original CWEB home page (https://www-cs-faculty.stanford.edu/~knuth/cweb.html), section "CWEB 4.0" and the updated CWEB development project (https://github.com/ascherer/cweb). This first new release draws heavily on the multi-decade work collected in my "CWEBbin" project (https://github.com/ascherer/cwebbin). I moved (almost) all stuff from the "*-patch.*" changefiles into the new CWEB sources and applied all of the "*-ansi.*" changes as well. Moreover, I made "common.h" the full interface of "common.w" in order to avoid code redundancy. And I tried to fix as many of the bugs reported by email to DEK and/or tex-k@tug.org. In total, "make; make cautiously; make fullmanual" runs flawlessly with GCC on Linux and with LLVM on MacOS. After the release of "CWEB 4.0", also "CWEBbin 2021" has also been fully revised. Thousands of lines of changefiles could be purged. What's left are the clearcut extensions for CWEB and the additional stuff for integration in "TeX Live 2021". git-svn-id: svn://tug.org/texlive/trunk@57658 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/cweav-bs.ch')
-rw-r--r--Build/source/texk/web2c/cwebdir/cweav-bs.ch132
1 files changed, 33 insertions, 99 deletions
diff --git a/Build/source/texk/web2c/cwebdir/cweav-bs.ch b/Build/source/texk/web2c/cwebdir/cweav-bs.ch
index 8c4c1fe8ff3..f34372fd035 100644
--- a/Build/source/texk/web2c/cwebdir/cweav-bs.ch
+++ b/Build/source/texk/web2c/cwebdir/cweav-bs.ch
@@ -20,16 +20,16 @@ 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 3.64)\n"
+@d banner "This is CWEAVE (Version 4.0)"
@y
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.
-@d banner "This is CWEAVE (Version 3.64pc/big)\n"
+@d banner "This is CWEAVE (Version 4.0pc/big)"
@z
-@x Section 9.
+@x Section 7.
@d chunk_marker 0
@<Common code...@>=
@@ -41,7 +41,7 @@ typedef struct name_info {
names */
char Ilk; /* used by identifiers in \.{CWEAVE} only */
} dummy;
- char *equiv_or_xref; /* info corresponding to names */
+ void *equiv_or_xref; /* info corresponding to names */
} name_info; /* contains information about an identifier or section name */
typedef name_info *name_pointer; /* pointer into array of \&{name\_info}s */
typedef name_pointer *hash_pointer;
@@ -54,9 +54,6 @@ extern char *byte_ptr; /* first unused position in |byte_mem| */
extern name_pointer hash[]; /* heads of hash lists */
extern hash_pointer hash_end; /* end of |hash| */
extern hash_pointer h; /* index into hash-head array */
-extern name_pointer id_lookup(); /* looks up a string in the identifier table */
-extern name_pointer section_lookup(); /* finds section name */
-extern void print_section_name(), sprint_section_name();
@y
@d chunk_marker 0
@@ -87,13 +84,10 @@ extern char huge* byte_ptr; /* first unused position in |byte_mem| */
extern name_pointer hash[]; /* heads of hash lists */
extern hash_pointer hash_end; /* end of |hash| */
extern hash_pointer h; /* index into hash-head array */
-extern name_pointer id_lookup(); /* looks up a string in the identifier table */
-extern name_pointer section_lookup(); /* finds section name */
-extern void print_section_name(), sprint_section_name();
@z
-@x Section 18.
+@x Section 22.
typedef struct xref_info {
sixteen_bits num; /* section number plus zero or |def_flag| */
struct xref_info *xlink; /* pointer to the previous cross-reference */
@@ -108,7 +102,7 @@ typedef xref_info huge* xref_pointer;
@z
-@x Section 19.
+@x Section 23.
xref_info xmem[max_refs]; /* contains cross-reference information */
xref_pointer xmem_end = xmem+max_refs-1;
@y
@@ -117,52 +111,24 @@ xref_pointer xmem_end;
@z
-@x Section 20.
+@x Section 24.
@d xref equiv_or_xref
@y
@d xref ptr_union.xref_member
@z
-@x Section 20.
-xref_ptr=xmem; name_dir->xref=(char*)xmem; xref_switch=0; section_xref_switch=0;
+@x Section 24.
+xref_ptr=xmem; init_node(name_dir); xref_switch=0; section_xref_switch=0;
xmem->num=0; /* sentinel value */
@y
xmem_end = xmem + max_refs - 1;
-xref_ptr=xmem; name_dir->xref=(char*)xmem; xref_switch=0; section_xref_switch=0;
+xref_ptr=xmem; init_node(name_dir); xref_switch=0; section_xref_switch=0;
xmem->num=0; /* sentinel value */
@z
-@x Section 21.
- append_xref(m); xref_ptr->xlink=q; p->xref=(char*)xref_ptr;
-@y
- append_xref(m); xref_ptr->xlink=q; p->xref=(char huge*)xref_ptr;
-@z
-
-
-@x Section 22.
- if (r==xmem) p->xref=(char*)xref_ptr;
-@y
- if (r==xmem) p->xref=(char huge*)xref_ptr;
-@z
-
-
-@x Section 23.
- q=(xref_pointer)p->xref;
- if (q->num==file_flag) return;
- append_xref(file_flag);
- xref_ptr->xlink = q;
- p->xref = (char *)xref_ptr;
-@y
- q=(xref_pointer)p->xref;
- if (q->num==file_flag) return;
- append_xref(file_flag);
- xref_ptr->xlink = q;
- p->xref = (char huge*)xref_ptr;
-@z
-
-@x Section 25. (to please Borland's C++, version 4.02)
+@x Section 30. (to please Borland's C++, version 4.02)
token tok_mem[max_toks]; /* tokens */
token_pointer tok_mem_end = tok_mem+max_toks-1; /* end of |tok_mem| */
token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
@@ -180,9 +146,10 @@ text_pointer tok_start_end; /* end of |tok_start| */
token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
@z
-@x Section 26. (goes with the previous change)
-tok_start[1]=tok_mem+1;
-max_tok_ptr=tok_mem+1; max_text_ptr=tok_start+1;
+@x Section 31. (goes with the previous change)
+tok_ptr=max_tok_ptr=tok_mem+1;@/
+tok_start[0]=tok_start[1]=tok_mem+1;@/
+text_ptr=max_text_ptr=tok_start+1;
@y
tok_start[1]=tok_mem+1;
tok_mem_end=tok_mem+max_toks-1;
@@ -191,27 +158,20 @@ max_tok_ptr=tok_mem+1; max_text_ptr=tok_start+1;
@z
-@x Section 27.
- p->ilk=t; p->xref=(char*)xmem;
+@x Section 32.
+ p->xref=(void *)xmem;
@y
- p->ilk=t; p->xref=(char huge*)xmem;
+ p->xref=(void huge*)xmem;
@z
-@x Section 27.
- p->xref=(char*)xmem;
-@y
- p->xref=(char huge*)xmem;
-@z
-
-
-@x Section 70.
+@x Section 74.
if (unindexed(lhs)) { /* retain only underlined entries */
xref_pointer q,r=NULL;
for (q=(xref_pointer)lhs->xref;q>xmem;q=q->xlink)
if (q->num<def_flag)
if (r) r->xlink=q->xlink;
- else lhs->xref=(char*)q->xlink;
+ else lhs->xref=(void *)q->xlink;
else r=q;
}
@y
@@ -220,13 +180,13 @@ max_tok_ptr=tok_mem+1; max_text_ptr=tok_start+1;
for (q=(xref_pointer)lhs->xref;q>xmem;q=q->xlink)
if (q->num<def_flag)
if (r) r->xlink=q->xlink;
- else lhs->xref=(char huge*)q->xlink;
+ else lhs->xref=(void huge*)q->xlink;
else r=q;
}
@z
-@x Section 87.
+@x Section 93.
char *k, *k_end=(p+1)->byte_start; /* pointers into |byte_mem| */
out('{');
for (k=p->byte_start; k<k_end; k++) {
@@ -237,66 +197,40 @@ max_tok_ptr=tok_mem+1; max_text_ptr=tok_start+1;
@z
-@x Section 116.
- append_xref(0); /* this number doesn't matter */
- xref_ptr->xlink=(xref_pointer)p->xref; r=xref_ptr;
- p->xref=(char*)xref_ptr;
- while (r->xlink!=q) {r->num=r->xlink->num; r=r->xlink;}
- r->num=m; /* everything from |q| on is left undisturbed */
-@y
- append_xref(0); /* this number doesn't matter */
- xref_ptr->xlink=(xref_pointer)p->xref; r=xref_ptr;
- p->xref=(char huge*)xref_ptr;
- while (r->xlink!=q) {r->num=r->xlink->num; r=r->xlink;}
- r->num=m; /* everything from |q| on is left undisturbed */
-@z
-
-
-@x Section 163.
-@ @<Change |pp| to $\max...@>=
-@y
-@ @<Change |pp| to $\max...@>=
-#ifdef __MSDOS__
-if (d<0 && pp+d>pp) pp=scrap_base; /* segmented architecture caused wrap */
-else
-#endif
-@z
-
-
-@x Section 194.
+@x Section 209.
char *p; /* index into |byte_mem| */
@y
char huge *p; /* index into |byte_mem| */
@z
-@x Section 229.
- if (cur_name->xref!=(char*)xmem) {
+@x Section 244.
+ if (cur_name->xref!=(void *)xmem) {
@y
- if (cur_name->xref!=(char huge*)xmem) {
+ if (cur_name->xref!=(void huge*)xmem) {
@z
-@x Section 232.
+@x Section 246.
char *cur_byte; /* index into |byte_mem| */
@y
char huge* cur_byte; /* index into |byte_mem| */
@z
-@x Section 241.
+@x Section 255.
switch (cur_name->ilk) {
- case normal: if (is_tiny(cur_name)) out_str("\\|");
+ case normal: case func_template: if (is_tiny(cur_name)) out_str("\\|");
else {char *j;
@y
switch (cur_name->ilk) {
- case normal: if (is_tiny(cur_name)) out_str("\\|");
+ case normal: case func_template: if (is_tiny(cur_name)) out_str("\\|");
else {char huge* j;
@z
-@x Section 241.
- case custom: case quoted: {char *j; out_str("$\\");
+@x Section 255.
+ case custom: {char *j; out_str("$\\");
@y
- case custom: case quoted: {char huge* j; out_str("$\\");
+ case custom: {char huge* j; out_str("$\\");
@z