Skip to content

Commit

Permalink
CWEB - release 4.6.1, 2022-01-15.
Browse files Browse the repository at this point in the history
This is a service release of CWEB 4.6.

Several internal array dimensions were increased in order to process
"TeX in CWEB" in Martin Ruckert's WEB2W project (i.e., the source file
https://w3-o.cs.hm.edu/users/ruckert/public_html/web2w/ctex.w).

$ ./ctangle +s ctex
Memory usage statistics:
4142 names (out of 5000)
3240 replacement texts (out of 4000)
77633 bytes (out of 100000)
246143 tokens (out of 270000)

$ ./cweave +s ctex
Memory usage statistics:
4962 names (out of 5000)
23872 cross-references (out of 30000)
97459 bytes (out of 100000)
Parsing:
4962 scraps (out of 5000)
7860 texts (out of 8000)
21108 tokens (out of 30000)
1660 levels (out of 2000)
Sorting:
52 levels (out of 5000)
  • Loading branch information
ascherer committed Jan 15, 2022
1 parent a457dcc commit a59b232
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion comm-pc.ch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 \

Expand Down
11 changes: 5 additions & 6 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion ctang-bs.ch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ctang-pc.ch
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ alternate change files with -bs suffix instead of -pc.
@d banner "This is CTANGLE (Version 4.6pc)"
@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,
Expand Down
8 changes: 4 additions & 4 deletions ctangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 \

Expand Down
2 changes: 1 addition & 1 deletion ctangle.w
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions cweav-pc.ch
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ change files that have -bs in their name instead of -pc.)
@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
14 changes: 7 additions & 7 deletions cweave.w
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...@>=
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions cwebman.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1600,8 +1600,8 @@
\point 9. Data for the table of contents is written to a file that
is read after the indexes have been \TEX/ed; there's one line of data
for every starred section. The file \.{common.toc} might look like this:
$$\lpile{\.{\\ZZ \{Introduction\}\{0\}\{1\}\{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.)
Expand Down

0 comments on commit a59b232

Please sign in to comment.