summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/comm-w2c.ch
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2021-05-03 13:03:46 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2021-05-03 13:03:46 +0000
commit60712e2174bfaa66828692206c37af9b20d9fc9a (patch)
tree3e9284ecd37b56a42a67118bb5aa94482e07112b /Build/source/texk/web2c/cwebdir/comm-w2c.ch
parentd3de05fb9dda5d710a51f3ad2097d67d8452a166 (diff)
[CWEB] New release 4.3.1.
This release is almost the same as CWEB 4.3 of 2021-04-16, but * it fixes the indexing bug in CWEAVE/CTWILL that got retracted * it extracts and collects all additions made in CTWILL, so that the section numbers of CWEAVE are retained up to ยง272 and new material is described in the (first) appendix, including the CTWILL user manual * it provides fully revised and (hopefully) corrected mini-indexes for CTWILL, if it is processed by itself (to be published in package 'knuth-pdf' on CTAN) git-svn-id: svn://tug.org/texlive/trunk@59061 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/comm-w2c.ch')
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-w2c.ch118
1 files changed, 60 insertions, 58 deletions
diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.ch b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
index 286a39723e1..737fbfb4485 100644
--- a/Build/source/texk/web2c/cwebdir/comm-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
@@ -17,16 +17,16 @@
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @>
@x
-\def\title{Common code for CTANGLE and CWEAVE (Version 4.2)}
+\def\title{Common code for CTANGLE and CWEAVE (Version 4.3)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}} \ifacro\sanitizecommand\Kpathsea{KPATHSEA}\fi
-\def\title{Common code for CTANGLE and CWEAVE (4.2 [\TeX~Live])}
+\def\title{Common code for CTANGLE and CWEAVE (4.3 [\TeX~Live])}
@z
@x
- \centerline{(Version 4.2)}
+ \centerline{(Version 4.3)}
@y
- \centerline{(Version 4.2 [\TeX~Live])}
+ \centerline{(Version 4.3 [\TeX~Live])}
@z
@x
@@ -146,11 +146,11 @@ if ((web_file=fopen(web_file_name,"r"))==NULL) {
fatal("! Cannot open input file ", web_file_name);
}
@y
-if ((found_filename=kpse_find_cweb(web_file_name))==NULL || @|
- (web_file=fopen(found_filename,"r"))==NULL) {
+if ((found_filename=kpse_find_cweb(web_file_name))==NULL @|
+ || (web_file=fopen(found_filename,"r"))==NULL)
fatal(_("! Cannot open input file "), web_file_name);
-} else if (strlen(found_filename) < max_file_name_length) {
- /* Copy name for |#line| directives. */
+else if (strlen(found_filename) < max_file_name_length) {
+ /* Copy name for \#\&{line} directives. */
if (strcmp(web_file_name, found_filename))
strcpy(web_file_name, found_filename +
((strncmp(found_filename,"./",2)==0) ? 2 : 0));
@@ -162,11 +162,11 @@ if ((found_filename=kpse_find_cweb(web_file_name))==NULL || @|
if ((change_file=fopen(change_file_name,"r"))==NULL)
fatal("! Cannot open change file ", change_file_name);
@y
-if ((found_filename=kpse_find_cweb(change_file_name))==NULL || @|
- (change_file=fopen(found_filename,"r"))==NULL) {
+if ((found_filename=kpse_find_cweb(change_file_name))==NULL @|
+ || (change_file=fopen(found_filename,"r"))==NULL)
fatal(_("! Cannot open change file "), change_file_name);
-} else if (strlen(found_filename) < max_file_name_length) {
- /* Copy name for |#line| directives. */
+else if (strlen(found_filename) < max_file_name_length) {
+ /* Copy name for \#\&{line} directives. */
if (strcmp(change_file_name, found_filename))
strcpy(change_file_name, found_filename +
((strncmp(found_filename,"./",2)==0) ? 2 : 0));
@@ -217,7 +217,7 @@ The remainder of the \.{@@i} line after the file name is ignored.
@x
char temp_file_name[max_file_name_length];
char *cur_file_name_end=cur_file_name+max_file_name_length-1;
- char *k=cur_file_name, *kk;
+ char *kk, *k=cur_file_name;
int l; /* length of file name */
@y
char *cur_file_name_end=cur_file_name+max_file_name_length-1;
@@ -227,9 +227,9 @@ The remainder of the \.{@@i} line after the file name is ignored.
@x
if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {
@y
- if ((found_filename=kpse_find_cweb(cur_file_name))!=NULL && @|
- (cur_file=fopen(found_filename,"r"))!=NULL) {
- /* Copy name for |#line| directives. */
+ if ((found_filename=kpse_find_cweb(cur_file_name))!=NULL @|
+ && (cur_file=fopen(found_filename,"r"))!=NULL) {
+ /* Copy name for \#\&{line} directives. */
if (strlen(found_filename) < max_file_name_length) {
if (strcmp(cur_file_name, found_filename))
strcpy(cur_file_name, found_filename +
@@ -239,8 +239,8 @@ The remainder of the \.{@@i} line after the file name is ignored.
@z
@x
- kk=getenv("CWEBINPUTS");
- if (kk!=NULL) {
+ if ((kk=getenv("CWEBINPUTS"))!=NULL) {
+@.CWEBINPUTS@>
if ((l=strlen(kk))>max_file_name_length-2) too_long();
strcpy(temp_file_name,kk);
}
@@ -255,7 +255,7 @@ The remainder of the \.{@@i} line after the file name is ignored.
if (l>0) {
if (k+l+2>=cur_file_name_end) too_long();
@.Include file name ...@>
- for (; k>= cur_file_name; k--) *(k+l+1)=*k;
+ for (; k>=cur_file_name; k--) *(k+l+1)=*k;
strcpy(cur_file_name,temp_file_name);
cur_file_name[l]='/'; /* \UNIX/ pathname separator */
if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {
@@ -364,7 +364,7 @@ else if (include_depth==0) printf(_(". (l. %d)\n"), cur_line);
Some implementations may wish to pass the |history| value to the
operating system so that it can be used to govern whether or not other
programs are started. Here, for instance, we pass the operating system
-a status of 0 if and only if only harmless messages were printed.
+a status of |EXIT_SUCCESS| if and only if only harmless messages were printed.
@^system dependencies@>
@y
On multi-tasking systems like the {\mc AMIGA} it is very convenient to
@@ -394,20 +394,22 @@ can be made sensitive to these conditions.
else return EXIT_SUCCESS;
@y
switch(history) {
+ case spotless: return RETURN_OK;
case harmless_message: return RETURN_WARN;
case error_message: return RETURN_ERROR;
- case fatal_message: return RETURN_FAIL;
- default: return RETURN_OK;
+ case fatal_message: default: return RETURN_FAIL;
}
@z
@x
-case spotless: if (show_happiness) puts("(No errors were found.)"); break;
+case spotless:
+ if (show_happiness) puts("(No errors were found.)"); break;
case harmless_message:
puts("(Did you see the warning message above?)"); break;
case error_message:
puts("(Pardon me, but I think I spotted something wrong.)"); break;
-case fatal_message: puts("(That was a fatal error, my friend.)");
+case fatal_message: default:
+ puts("(That was a fatal error, my friend.)");
@y
case spotless:
if (show_happiness) puts(_("(No errors were found.)")); break;
@@ -415,7 +417,7 @@ case harmless_message:
puts(_("(Did you see the warning message above?)")); break;
case error_message:
puts(_("(Pardon me, but I think I spotted something wrong.)")); break;
-case fatal_message:
+case fatal_message: default:
puts(_("(That was a fatal error, my friend.)"));
@z
@@ -426,6 +428,14 @@ case fatal_message:
@z
@x
+or flags to be turned on (beginning with |"+"|).
+@y
+or flags to be turned on (beginning with |"+"|).
+\TeX~Live's \.{CWEB} executables accept several ``long options'' as well;
+see section |@<Handle flag arg...@>| for details.
+@z
+
+@x
char scn_file_name[max_file_name_length]; /* name of |scn_file| */
@y
char scn_file_name[max_file_name_length]; /* name of |scn_file| */
@@ -433,10 +443,9 @@ char check_file_name[max_file_name_length]; /* name of |check_file| */
@z
@x
-show_banner=show_happiness=show_progress=make_xrefs=true;@/
+show_banner=show_happiness=show_progress=make_xrefs=true;
@y
-make_xrefs=true;@/
-temporary_output=true; /* Check temporary output for changes */
+make_xrefs=check_for_change=true;
@z
@x
@@ -459,32 +468,28 @@ systems the contents of the compile-time variable |DEV_NULL| (\TeX~Live) or
@x
strcpy(change_file_name,"/dev/null");
@y
-@#
+ strcpy(change_file_name,"/dev/null");
#if defined DEV_NULL
strncpy(change_file_name,DEV_NULL,max_file_name_length-2);
change_file_name[max_file_name_length-2]='\0';
#elif defined _DEV_NULL
strncpy(change_file_name,_DEV_NULL,max_file_name_length-2);
change_file_name[max_file_name_length-2]='\0';
-#else
- strcpy(change_file_name,"/dev/null");
#endif
@^system dependencies@>
@z
@x
- while (*s) {
+ while (*s)
if (*s=='.') dot_pos=s++;
else if (*s=='/') dot_pos=NULL,name_pos=++s;
else s++;
- }
@y
- while (*s) {
+ while (*s)
if (*s=='.') dot_pos=s++;
else if (*s==DIR_SEPARATOR || *s==DEVICE_SEPARATOR || *s=='/')
dot_pos=NULL,name_pos=++s;
else s++;
- }
@^system dependencies@>
@z
@@ -503,11 +508,9 @@ otherwise we add |".w"|.
@z
@x
-@<Handle flag...@>=
-{
- for(dot_pos=*argv+1;*dot_pos>'\0';dot_pos++)
+for(dot_pos=*argv+1;*dot_pos>'\0';dot_pos++)
+ flags[(eight_bits)*dot_pos]=flag_change;
@y
-@<Handle flag...@>=
{
if (strcmp("-help",*argv)==0 || strcmp("--help",*argv)==0)
@.--help@>
@@ -517,26 +520,25 @@ otherwise we add |".w"|.
@<Display version information and |exit|@>@;
if (strcmp("-verbose",*argv)==0 || strcmp("--verbose",*argv)==0)
@.--verbose@>
- { show_banner=show_progress=show_happiness=1; continue; }
+ strcpy(*argv,"-v");
if (strcmp("-quiet",*argv)==0 || strcmp("--quiet",*argv)==0)
@.--quiet@>
- { show_banner=show_progress=show_happiness=0; continue; }
- for(dot_pos=*argv+1;*dot_pos>'\0';dot_pos++)
- if (*dot_pos=='v') {
- show_banner=show_progress=show_happiness=true;
- } else
- if (*dot_pos=='q') {
- show_banner=show_progress=show_happiness=false;
- } else
- if (*dot_pos=='d') {
+ strcpy(*argv,"-q");
+ for(dot_pos=*argv+1;*dot_pos>'\0';dot_pos++) {
+ switch (*dot_pos) {
+ case 'v': show_banner=show_progress=show_happiness=true; continue;
+ case 'q': show_banner=show_progress=show_happiness=false; continue;
+ case 'd':
if (sscanf(++dot_pos,"%u",&kpathsea_debug)!=1) @<Print usage error...@>@;
while (isdigit(*dot_pos)) dot_pos++; /* skip numeric part */
dot_pos--; /* reset to final digit */
- } else
- if(*dot_pos=='l') {
- use_language=++dot_pos;
- break;
- } else
+ continue;
+ case 'l': use_language=++dot_pos; break; /* from |switch| */
+ default: flags[(eight_bits)*dot_pos]=flag_change; continue;
+ }
+ break; /* from |for| loop */
+ }
+}
@z
@x
@@ -625,9 +627,9 @@ else {
@x
@** Index.
@y
-@** Extensions to \.{CWEB}. The following sections introduce new or improved
-features that have been created by numerous contributors over the course of a
-quarter century.
+@** Extensions to {\tentex CWEB}. The following sections introduce new or
+improved features that have been created by numerous contributors over the
+course of a quarter century.
Care has been taken to keep the original section numbering intact, so this new
material should nicely integrate with the original ``\&{85.~Index}.''
@@ -829,6 +831,7 @@ static void cb_usagehelp (const_string *message, const_string bug_email)
textdomain("web2c-help");
@.web2c-help.mo@>
while (*message) {
+ /* empty string \.{""} has special meaning for |gettext| */
printf("%s\n", strcmp("", *message) ? _(*message) : *message);
++message;
}
@@ -854,7 +857,6 @@ printversionandexit(cb_banner,
@c
void cb_show_banner (void)
{
- assert(cb_banner[0]!='\0');
textdomain("cweb-tl");
@.cweb-tl.mo@>
printf("%s%s\n", _(cb_banner), versionstring);