texlive[60728] Build/source/texk/web2c: [CWEB] Pre-release candidate
commits+ascherer at tug.org
commits+ascherer at tug.org
Mon Oct 11 17:21:35 CEST 2021
Revision: 60728
http://tug.org/svn/texlive?view=revision&revision=60728
Author: ascherer
Date: 2021-10-11 17:21:35 +0200 (Mon, 11 Oct 2021)
Log Message:
-----------
[CWEB] Pre-release candidate 2 for CWEB 4.6.
When the CWEB programs are called with option '-c' (the default), no
intermediate output files are created at all. After thoroughly testing
these programs, I'll prepare the final release of CWEB 4.6 in the coming
weeks (months).
Modified Paths:
--------------
trunk/Build/source/texk/web2c/ChangeLog
trunk/Build/source/texk/web2c/ctangleboot.cin
trunk/Build/source/texk/web2c/cwebboot.cin
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/ChangeLog 2021-10-11 15:21:35 UTC (rev 60728)
@@ -1,3 +1,8 @@
+2021-10-11 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: CWEB 4.6 pre-release RC2.
+
2021-09-21 Karl Berry <karl at freefriends.org>
* ac/web2c.ac (kpse_tex_progs): include hitex, disabled by default.
Modified: trunk/Build/source/texk/web2c/ctangleboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/ctangleboot.cin 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/ctangleboot.cin 2021-10-11 15:21:35 UTC (rev 60728)
@@ -270,12 +270,12 @@
extern FILE*active_file;
extern FILE*check_file;
-/*:15*//*115:*/
-#line 487 "cwebdir/ctang-w2c.ch"
+/*:15*//*116:*/
+#line 504 "cwebdir/ctang-w2c.ch"
extern char cb_banner[];
-/*:115*/
+/*:116*/
#line 69 "cwebdir/ctangle.w"
/*19:*/
@@ -536,12 +536,12 @@
#line 1114 "cwebdir/ctangle.w"
section_text[0]= ' ';
-/*:78*//*116:*/
-#line 490 "cwebdir/ctang-w2c.ch"
+/*:78*//*117:*/
+#line 507 "cwebdir/ctang-w2c.ch"
strncpy(cb_banner,banner,max_banner-1);
-/*:116*/
+/*:117*/
#line 88 "cwebdir/ctangle.w"
common_init();
@@ -748,13 +748,14 @@
writeloop:/*50:*/
#line 138 "cwebdir/ctang-w2c.ch"
+if(check_for_change){
fclose(C_file);C_file= NULL;
-/*105:*/
-#line 370 "cwebdir/ctang-w2c.ch"
+/*106:*/
+#line 387 "cwebdir/ctang-w2c.ch"
if((C_file= fopen(C_file_name,"r"))!=NULL){
-/*106:*/
-#line 377 "cwebdir/ctang-w2c.ch"
+/*107:*/
+#line 394 "cwebdir/ctang-w2c.ch"
boolean comparison= false;
@@ -762,8 +763,8 @@
fatal(_("! Cannot open output file "),check_file_name);
-if(check_for_change)/*107:*/
-#line 391 "cwebdir/ctang-w2c.ch"
+/*108:*/
+#line 408 "cwebdir/ctang-w2c.ch"
do{
char x[BUFSIZ],y[BUFSIZ];
@@ -772,18 +773,18 @@
comparison= (x_size==y_size)&&!memcmp(x,y,x_size);
}while(comparison&&!feof(C_file)&&!feof(check_file));
-/*:107*/
-#line 384 "cwebdir/ctang-w2c.ch"
+/*:108*/
+#line 401 "cwebdir/ctang-w2c.ch"
fclose(C_file);C_file= NULL;
fclose(check_file);check_file= NULL;
-/*:106*/
-#line 372 "cwebdir/ctang-w2c.ch"
+/*:107*/
+#line 389 "cwebdir/ctang-w2c.ch"
-/*108:*/
-#line 402 "cwebdir/ctang-w2c.ch"
+/*109:*/
+#line 419 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -792,18 +793,22 @@
rename(check_file_name,C_file_name);
}
-/*:108*/
-#line 373 "cwebdir/ctang-w2c.ch"
+/*:109*/
+#line 390 "cwebdir/ctang-w2c.ch"
}else
rename(check_file_name,C_file_name);
-/*:105*/
-#line 140 "cwebdir/ctang-w2c.ch"
+/*:106*/
+#line 141 "cwebdir/ctang-w2c.ch"
+}
for(an_output_file= end_output_files;an_output_file> cur_out_file;){
an_output_file--;
sprint_section_name(output_file_name,*an_output_file);
+if(check_for_change)/*105:*/
+#line 378 "cwebdir/ctang-w2c.ch"
+{
if((C_file= fopen(output_file_name,"a"))==NULL)
fatal(_("! Cannot open output file "),output_file_name);
@@ -810,6 +815,17 @@
else fclose(C_file);
if((C_file= fopen(check_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
+}
+
+/*:105*/
+#line 146 "cwebdir/ctang-w2c.ch"
+
+else{
+fclose(C_file);
+if((C_file= fopen(output_file_name,"wb"))==NULL)
+fatal(_("! Cannot open output file "),output_file_name);
+
+}
if(show_progress){printf("\n(%s)",output_file_name);update_terminal;}
cur_line= 1;
stack_ptr= stack+1;
@@ -818,16 +834,18 @@
cur_byte= cur_repl->tok_start;
cur_end= (cur_repl+1)->tok_start;
while(stack_ptr> stack)get_output();
-flush_buffer();fclose(C_file);C_file= NULL;
-/*109:*/
-#line 415 "cwebdir/ctang-w2c.ch"
+flush_buffer();
+if(check_for_change){
+fclose(C_file);C_file= NULL;
+/*110:*/
+#line 432 "cwebdir/ctang-w2c.ch"
if(0==strcmp("/dev/stdout",output_file_name))
-/*111:*/
-#line 442 "cwebdir/ctang-w2c.ch"
+/*112:*/
+#line 459 "cwebdir/ctang-w2c.ch"
{
-/*114:*/
-#line 473 "cwebdir/ctang-w2c.ch"
+/*115:*/
+#line 490 "cwebdir/ctang-w2c.ch"
char in_buf[BUFSIZ+1];
int in_size;
@@ -836,8 +854,8 @@
fatal(_("! Cannot open output file "),check_file_name);
-/*:114*/
-#line 443 "cwebdir/ctang-w2c.ch"
+/*:115*/
+#line 460 "cwebdir/ctang-w2c.ch"
do{
in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -845,8 +863,8 @@
fprintf(stdout,"%s",in_buf);
}while(!feof(check_file));
fclose(check_file);check_file= NULL;
-/*110:*/
-#line 432 "cwebdir/ctang-w2c.ch"
+/*111:*/
+#line 449 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -855,20 +873,20 @@
rename(check_file_name,output_file_name);
}
-/*:110*/
-#line 450 "cwebdir/ctang-w2c.ch"
+/*:111*/
+#line 467 "cwebdir/ctang-w2c.ch"
}
-/*:111*/
-#line 417 "cwebdir/ctang-w2c.ch"
+/*:112*/
+#line 434 "cwebdir/ctang-w2c.ch"
else if(0==strcmp("/dev/stderr",output_file_name))
-/*112:*/
-#line 455 "cwebdir/ctang-w2c.ch"
+/*113:*/
+#line 472 "cwebdir/ctang-w2c.ch"
{
-/*114:*/
-#line 473 "cwebdir/ctang-w2c.ch"
+/*115:*/
+#line 490 "cwebdir/ctang-w2c.ch"
char in_buf[BUFSIZ+1];
int in_size;
@@ -877,8 +895,8 @@
fatal(_("! Cannot open output file "),check_file_name);
-/*:114*/
-#line 456 "cwebdir/ctang-w2c.ch"
+/*:115*/
+#line 473 "cwebdir/ctang-w2c.ch"
do{
in_size= fread(in_buf,sizeof(char),BUFSIZ,check_file);
@@ -886,8 +904,8 @@
fprintf(stderr,"%s",in_buf);
}while(!feof(check_file));
fclose(check_file);check_file= NULL;
-/*110:*/
-#line 432 "cwebdir/ctang-w2c.ch"
+/*111:*/
+#line 449 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -896,21 +914,21 @@
rename(check_file_name,output_file_name);
}
-/*:110*/
-#line 463 "cwebdir/ctang-w2c.ch"
+/*:111*/
+#line 480 "cwebdir/ctang-w2c.ch"
}
-/*:112*/
-#line 419 "cwebdir/ctang-w2c.ch"
+/*:113*/
+#line 436 "cwebdir/ctang-w2c.ch"
else if(0==strcmp("/dev/null",output_file_name))
-/*113:*/
-#line 468 "cwebdir/ctang-w2c.ch"
+/*114:*/
+#line 485 "cwebdir/ctang-w2c.ch"
{
boolean comparison= true;
-/*110:*/
-#line 432 "cwebdir/ctang-w2c.ch"
+/*111:*/
+#line 449 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -919,18 +937,18 @@
rename(check_file_name,output_file_name);
}
-/*:110*/
-#line 470 "cwebdir/ctang-w2c.ch"
+/*:111*/
+#line 487 "cwebdir/ctang-w2c.ch"
}
-/*:113*/
-#line 421 "cwebdir/ctang-w2c.ch"
+/*:114*/
+#line 438 "cwebdir/ctang-w2c.ch"
else{
if((C_file= fopen(output_file_name,"r"))!=NULL){
-/*106:*/
-#line 377 "cwebdir/ctang-w2c.ch"
+/*107:*/
+#line 394 "cwebdir/ctang-w2c.ch"
boolean comparison= false;
@@ -938,8 +956,8 @@
fatal(_("! Cannot open output file "),check_file_name);
-if(check_for_change)/*107:*/
-#line 391 "cwebdir/ctang-w2c.ch"
+/*108:*/
+#line 408 "cwebdir/ctang-w2c.ch"
do{
char x[BUFSIZ],y[BUFSIZ];
@@ -948,18 +966,18 @@
comparison= (x_size==y_size)&&!memcmp(x,y,x_size);
}while(comparison&&!feof(C_file)&&!feof(check_file));
-/*:107*/
-#line 384 "cwebdir/ctang-w2c.ch"
+/*:108*/
+#line 401 "cwebdir/ctang-w2c.ch"
fclose(C_file);C_file= NULL;
fclose(check_file);check_file= NULL;
-/*:106*/
-#line 424 "cwebdir/ctang-w2c.ch"
+/*:107*/
+#line 441 "cwebdir/ctang-w2c.ch"
-/*110:*/
-#line 432 "cwebdir/ctang-w2c.ch"
+/*111:*/
+#line 449 "cwebdir/ctang-w2c.ch"
if(comparison)
remove(check_file_name);
@@ -968,17 +986,19 @@
rename(check_file_name,output_file_name);
}
-/*:110*/
-#line 425 "cwebdir/ctang-w2c.ch"
+/*:111*/
+#line 442 "cwebdir/ctang-w2c.ch"
}else
rename(check_file_name,output_file_name);
}
-/*:109*/
-#line 159 "cwebdir/ctang-w2c.ch"
+/*:110*/
+#line 164 "cwebdir/ctang-w2c.ch"
}
+}
+if(check_for_change)
strcpy(check_file_name,"");
#line 581 "cwebdir/ctangle.w"
@@ -1021,7 +1041,7 @@
if(a<024000){
cur_val= (int)a;out_char(identifier);
}
-#line 167 "cwebdir/ctang-w2c.ch"
+#line 174 "cwebdir/ctang-w2c.ch"
else if(a<050000)confusion(_("macro defs have strange char"));
#line 626 "cwebdir/ctangle.w"
else{
@@ -1165,7 +1185,7 @@
if(is_long_comment){
if(get_line())return comment_continues= true;
else{
-#line 173 "cwebdir/ctang-w2c.ch"
+#line 180 "cwebdir/ctang-w2c.ch"
err_print(_("! Input ended in mid-comment"));
#line 853 "cwebdir/ctangle.w"
@@ -1180,7 +1200,7 @@
}
if(c=='@'){
if(ccode[(eight_bits)*loc]==new_section){
-#line 179 "cwebdir/ctang-w2c.ch"
+#line 186 "cwebdir/ctang-w2c.ch"
err_print(_("! Section name ended in mid-comment"));loc--;
#line 866 "cwebdir/ctangle.w"
@@ -1288,13 +1308,13 @@
while(true){
if(loc>=limit){
if(*(limit-1)!='\\'){
-#line 185 "cwebdir/ctang-w2c.ch"
+#line 192 "cwebdir/ctang-w2c.ch"
err_print(_("! String didn't end"));loc= limit;break;
#line 1016 "cwebdir/ctangle.w"
}
if(get_line()==false){
-#line 191 "cwebdir/ctang-w2c.ch"
+#line 198 "cwebdir/ctang-w2c.ch"
err_print(_("! Input ended in middle of string"));loc= buffer;break;
#line 1020 "cwebdir/ctangle.w"
@@ -1314,7 +1334,7 @@
if(++id_loc<=section_text_end)*id_loc= (char)c;
}
if(id_loc>=section_text_end){
-#line 197 "cwebdir/ctang-w2c.ch"
+#line 204 "cwebdir/ctang-w2c.ch"
fputs(_("\n! String too long: "),stdout);
#line 1038 "cwebdir/ctangle.w"
@@ -1348,7 +1368,7 @@
switch(c= ccode[(eight_bits)*loc++]){
case ignore:continue;
-#line 203 "cwebdir/ctang-w2c.ch"
+#line 210 "cwebdir/ctang-w2c.ch"
case translit_code:err_print(_("! Use @l in limbo only"));continue;
#line 1053 "cwebdir/ctangle.w"
@@ -1355,7 +1375,7 @@
case control_text:while((c= skip_ahead())=='@');
if(*(loc-1)!='>')
-#line 209 "cwebdir/ctang-w2c.ch"
+#line 216 "cwebdir/ctang-w2c.ch"
err_print(_("! Double @ should be used in control text"));
#line 1058 "cwebdir/ctangle.w"
@@ -1371,7 +1391,7 @@
while(true){
if(loc> limit&&get_line()==false){
-#line 227 "cwebdir/ctang-w2c.ch"
+#line 234 "cwebdir/ctang-w2c.ch"
err_print(_("! Input ended in section name"));
#line 1120 "cwebdir/ctangle.w"
@@ -1387,13 +1407,13 @@
loc+= 2;break;
}
if(ccode[(eight_bits)c]==new_section){
-#line 239 "cwebdir/ctang-w2c.ch"
+#line 246 "cwebdir/ctang-w2c.ch"
err_print(_("! Section name didn't end"));break;
#line 1147 "cwebdir/ctangle.w"
}
if(ccode[(eight_bits)c]==section_name){
-#line 245 "cwebdir/ctang-w2c.ch"
+#line 252 "cwebdir/ctang-w2c.ch"
err_print(_("! Nesting of section names not allowed"));break;
#line 1151 "cwebdir/ctangle.w"
@@ -1411,7 +1431,7 @@
*k= (char)c;
}
if(k>=section_text_end){
-#line 233 "cwebdir/ctang-w2c.ch"
+#line 240 "cwebdir/ctang-w2c.ch"
fputs(_("\n! Section name too long: "),stdout);
#line 1133 "cwebdir/ctangle.w"
@@ -1459,7 +1479,7 @@
id_first= loc++;*(limit+1)= '@';*(limit+2)= '>';
while(*loc!='@'||*(loc+1)!='>')loc++;
-#line 251 "cwebdir/ctang-w2c.ch"
+#line 258 "cwebdir/ctang-w2c.ch"
if(loc>=limit)err_print(_("! Verbatim string didn't end"));
#line 1165 "cwebdir/ctangle.w"
@@ -1478,7 +1498,7 @@
while(*loc!='\''){
if(*loc=='@'){
if(*(loc+1)!='@')
-#line 215 "cwebdir/ctang-w2c.ch"
+#line 222 "cwebdir/ctang-w2c.ch"
err_print(_("! Double @ should be used in ASCII constant"));
#line 1082 "cwebdir/ctangle.w"
@@ -1486,7 +1506,7 @@
}
loc++;
if(loc> limit){
-#line 221 "cwebdir/ctang-w2c.ch"
+#line 228 "cwebdir/ctang-w2c.ch"
err_print(_("! String didn't end"));loc= limit-1;break;
#line 1088 "cwebdir/ctangle.w"
@@ -1585,7 +1605,7 @@
while(*try_loc==' '&&try_loc<limit)try_loc++;
if(*try_loc=='+'&&try_loc<limit)try_loc++;
while(*try_loc==' '&&try_loc<limit)try_loc++;
-#line 287 "cwebdir/ctang-w2c.ch"
+#line 294 "cwebdir/ctang-w2c.ch"
if(*try_loc=='=')err_print(_("! Missing `@ ' before a named section"));
#line 1284 "cwebdir/ctangle.w"
@@ -1621,7 +1641,7 @@
}
break;
-#line 275 "cwebdir/ctang-w2c.ch"
+#line 282 "cwebdir/ctang-w2c.ch"
case output_defs_code:if(t!=section_name)err_print(_("! Misplaced @h"));
#line 1256 "cwebdir/ctangle.w"
@@ -1660,7 +1680,7 @@
while(id_first<id_loc){
if(*id_first=='@'){
if(*(id_first+1)=='@')id_first++;
-#line 293 "cwebdir/ctang-w2c.ch"
+#line 300 "cwebdir/ctang-w2c.ch"
else err_print(_("! Double @ should be used in string"));
#line 1301 "cwebdir/ctangle.w"
@@ -1714,7 +1734,7 @@
case'\\':c= '\\';break;
case'\'':c= '\'';break;
case'\"':c= '\"';break;
-#line 299 "cwebdir/ctang-w2c.ch"
+#line 306 "cwebdir/ctang-w2c.ch"
default:err_print(_("! Unrecognized escape sequence"));
#line 1350 "cwebdir/ctangle.w"
@@ -1734,7 +1754,7 @@
break;
case definition:case format_code:case begin_C:if(t!=section_name)goto done;
else{
-#line 281 "cwebdir/ctang-w2c.ch"
+#line 288 "cwebdir/ctang-w2c.ch"
err_print(_("! @d, @f and @c are ignored in C text"));continue;
#line 1274 "cwebdir/ctangle.w"
@@ -1750,7 +1770,7 @@
default:app_repl(a);
}
done:next_control= (eight_bits)a;
-#line 269 "cwebdir/ctang-w2c.ch"
+#line 276 "cwebdir/ctang-w2c.ch"
if(text_ptr> text_info_end)overflow(_("text"));
#line 1216 "cwebdir/ctangle.w"
cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr;
@@ -1789,7 +1809,7 @@
while((next_control= get_next())=='\n');
if(next_control!=identifier){
-#line 305 "cwebdir/ctang-w2c.ch"
+#line 312 "cwebdir/ctang-w2c.ch"
err_print(_("! Definition flushed, must start with identifier"));
#line 1423 "cwebdir/ctangle.w"
@@ -1900,7 +1920,7 @@
loc+= 3;
if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2))
||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
-#line 323 "cwebdir/ctang-w2c.ch"
+#line 330 "cwebdir/ctang-w2c.ch"
err_print(_("! Improper hex number following @l"));
#line 1522 "cwebdir/ctangle.w"
@@ -1912,7 +1932,7 @@
beg= loc;
while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||*loc=='_'))loc++;
if(loc-beg>=translit_length)
-#line 329 "cwebdir/ctang-w2c.ch"
+#line 336 "cwebdir/ctang-w2c.ch"
err_print(_("! Replacement string in @l too long"));
#line 1532 "cwebdir/ctangle.w"
@@ -1929,13 +1949,13 @@
case control_text:if(c=='q'||c=='Q'){
while((c= (char)skip_ahead())=='@');
if(*(loc-1)!='>')
-#line 311 "cwebdir/ctang-w2c.ch"
+#line 318 "cwebdir/ctang-w2c.ch"
err_print(_("! Double @ should be used in control text"));
#line 1504 "cwebdir/ctangle.w"
break;
}
-#line 317 "cwebdir/ctang-w2c.ch"
+#line 324 "cwebdir/ctang-w2c.ch"
default:err_print(_("! Double @ should be used in limbo"));
#line 1508 "cwebdir/ctangle.w"
@@ -1949,7 +1969,7 @@
void
print_stats(void){
-#line 342 "cwebdir/ctang-w2c.ch"
+#line 349 "cwebdir/ctang-w2c.ch"
puts(_("\nMemory usage statistics:"));
printf(_("%td names (out of %ld)\n"),
(ptrdiff_t)(name_ptr-name_dir),(long)max_names);
@@ -1962,5 +1982,5 @@
(ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks);
}
-#line 355 "cwebdir/ctang-w2c.ch"
+#line 362 "cwebdir/ctang-w2c.ch"
/*:103*/
Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/cwebboot.cin 2021-10-11 15:21:35 UTC (rev 60728)
@@ -22,8 +22,8 @@
#include <stdlib.h>
#include <string.h>
-/*:3*//*89:*/
-#line 717 "cwebdir/comm-w2c.ch"
+/*:3*//*91:*/
+#line 739 "cwebdir/comm-w2c.ch"
#if HAVE_GETTEXT
#include <locale.h>
@@ -33,8 +33,8 @@
#define textdomain(a) ""
#endif
-/*:89*//*91:*/
-#line 764 "cwebdir/comm-w2c.ch"
+/*:91*//*93:*/
+#line 786 "cwebdir/comm-w2c.ch"
#include <kpathsea/kpathsea.h>
@@ -41,13 +41,13 @@
#include <w2c/config.h>
#include <lib/lib.h>
-/*:91*//*94:*/
-#line 801 "cwebdir/comm-w2c.ch"
+/*:93*//*96:*/
+#line 823 "cwebdir/comm-w2c.ch"
#define CWEB
#include "help.h"
-/*:94*/
+/*:96*/
#line 63 "cwebdir/common.w"
#define _(s) gettext(s) \
@@ -395,13 +395,13 @@
#line 601 "cwebdir/comm-w2c.ch"
/*:83*//*86:*/
-#line 646 "cwebdir/comm-w2c.ch"
+#line 629 "cwebdir/comm-w2c.ch"
const char*use_language= "";
/*:86*//*87:*/
-#line 659 "cwebdir/comm-w2c.ch"
+#line 642 "cwebdir/comm-w2c.ch"
char cb_banner[max_banner];
string texmf_locale;
@@ -476,13 +476,13 @@
static void scan_args(void);
#line 507 "cwebdir/comm-w2c.ch"
-/*:76*//*96:*/
-#line 814 "cwebdir/comm-w2c.ch"
+/*:76*//*98:*/
+#line 836 "cwebdir/comm-w2c.ch"
static void cb_usage(const_string str);
static void cb_usagehelp(const_string*message,const_string bug_email);
-/*:96*/
+/*:98*/
#line 67 "cwebdir/common.w"
@@ -509,17 +509,17 @@
/*:47*/
#line 78 "cwebdir/comm-w2c.ch"
-/*92:*/
-#line 776 "cwebdir/comm-w2c.ch"
+/*94:*/
+#line 798 "cwebdir/comm-w2c.ch"
kpse_set_program_name(argv[0],"cweb");
-/*:92*/
+/*:94*/
#line 79 "cwebdir/comm-w2c.ch"
#line 85 "cwebdir/comm-w2c.ch"
-/*90:*/
-#line 726 "cwebdir/comm-w2c.ch"
+/*92:*/
+#line 748 "cwebdir/comm-w2c.ch"
setlocale(LC_MESSAGES,setlocale(LC_CTYPE,""));
texmf_locale= kpse_var_expand("${TEXMFLOCALEDIR}");
@@ -534,7 +534,7 @@
textdomain("cweb");
-/*:90*/
+/*:92*/
#line 85 "cwebdir/comm-w2c.ch"
/*74:*/
@@ -553,6 +553,9 @@
scan_args();
if(program==ctangle){
+if(check_for_change)/*88:*/
+#line 659 "cwebdir/comm-w2c.ch"
+{
if((C_file= fopen(C_file_name,"a"))==NULL)
fatal(_("! Cannot open output file "),C_file_name);
@@ -565,11 +568,22 @@
}
if((C_file= fopen(check_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
+}
+/*:88*/
+#line 604 "cwebdir/comm-w2c.ch"
+
+else if((C_file= fopen(C_file_name,"wb"))==NULL)
+fatal(_("! Cannot open output file "),C_file_name);
+
}
else{
+if(check_for_change)/*89:*/
+#line 674 "cwebdir/comm-w2c.ch"
+{
if((tex_file= fopen(tex_file_name,"a"))==NULL)
fatal(_("! Cannot open output file "),tex_file_name);
+
else fclose(tex_file);
strcpy(check_file_name,tex_file_name);
if(check_file_name[0]!='\0'){
@@ -580,9 +594,16 @@
if((tex_file= fopen(check_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "),check_file_name);
}
+
+/*:89*/
+#line 610 "cwebdir/comm-w2c.ch"
+
+else if((tex_file= fopen(tex_file_name,"wb"))==NULL)
+fatal(_("! Cannot open output file "),tex_file_name);
+}
#line 1287 "cwebdir/common.w"
-#line 636 "cwebdir/comm-w2c.ch"
+#line 619 "cwebdir/comm-w2c.ch"
/*:84*/
#line 101 "cwebdir/common.w"
@@ -1332,8 +1353,8 @@
/*:69*/
#line 394 "cwebdir/comm-w2c.ch"
-/*88:*/
-#line 670 "cwebdir/comm-w2c.ch"
+/*90:*/
+#line 692 "cwebdir/comm-w2c.ch"
if(C_file)fclose(C_file);
if(tex_file)fclose(tex_file);
@@ -1341,7 +1362,7 @@
if(strlen(check_file_name))
remove(check_file_name);
-/*:88*/
+/*:90*/
#line 395 "cwebdir/comm-w2c.ch"
#line 402 "cwebdir/comm-w2c.ch"
@@ -1408,20 +1429,20 @@
{
if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0)
-/*95:*/
-#line 805 "cwebdir/comm-w2c.ch"
+/*97:*/
+#line 827 "cwebdir/comm-w2c.ch"
cb_usagehelp(program==ctangle?CTANGLEHELP:
program==cweave?CWEAVEHELP:CTWILLHELP,NULL);
-/*:95*/
+/*:97*/
#line 523 "cwebdir/comm-w2c.ch"
if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0)
-/*98:*/
-#line 853 "cwebdir/comm-w2c.ch"
+/*100:*/
+#line 875 "cwebdir/comm-w2c.ch"
printversionandexit(cb_banner,
program==ctwill?"Donald E. Knuth":"Silvio Levy and Donald E. Knuth",
@@ -1428,7 +1449,7 @@
NULL,"Contemporary development on https://github.com/ascherer/cweb.\n");
-/*:98*/
+/*:100*/
#line 526 "cwebdir/comm-w2c.ch"
if(strcmp("-verbose",*argv)==0||strcmp("--verbose",*argv)==0)
@@ -1594,8 +1615,8 @@
}
-/*:75*//*97:*/
-#line 818 "cwebdir/comm-w2c.ch"
+/*:75*//*99:*/
+#line 840 "cwebdir/comm-w2c.ch"
static void cb_usage(const_string str)
{
@@ -1628,8 +1649,8 @@
history= spotless;exit(wrap_up());
}
-/*:97*//*99:*/
-#line 861 "cwebdir/comm-w2c.ch"
+/*:99*//*101:*/
+#line 883 "cwebdir/comm-w2c.ch"
void cb_show_banner(void)
{
@@ -1640,4 +1661,4 @@
}
-/*:99*/
+/*:101*/
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2021-10-11 15:21:35 UTC (rev 60728)
@@ -1,3 +1,10 @@
+2021-10-11 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.ch,
+ * ctang-w2c.ch,
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch: CWEB 4.6 pre-release RC2.
+
2021-09-16 Andreas Scherer <https://ascherer.github.io>
* comm-{bs,vms,w2c,w32}.ch,
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch 2021-10-11 15:21:35 UTC (rev 60728)
@@ -601,32 +601,15 @@
@ @<Scan arguments and open output files@>=
scan_args();
if (program==ctangle) {
- if ((C_file=fopen(C_file_name,"a"))==NULL)
+ if (check_for_change) @<Open intermediate \CEE/ output file@>@;
+ else if ((C_file=fopen(C_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "), C_file_name);
@.Cannot open output file@>
- else fclose(C_file); /* Test accessability */
- strcpy(check_file_name,C_file_name);
- if(check_file_name[0]!='\0') {
- char *dot_pos=strrchr(check_file_name,'.');
- if(dot_pos==NULL) strcat(check_file_name,".ttp");
- else strcpy(dot_pos,".ttp");
- }
- if ((C_file=fopen(check_file_name,"wb"))==NULL)
- fatal(_("! Cannot open output file "), check_file_name);
- at .Cannot open output file@>
}
else {
- if ((tex_file=fopen(tex_file_name,"a"))==NULL)
+ if (check_for_change) @<Open intermediate \TEX/ output file@>@;
+ else if ((tex_file=fopen(tex_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "), tex_file_name);
- else fclose(tex_file); /* Test accessability */
- strcpy(check_file_name,tex_file_name);
- if(check_file_name[0]!='\0') {
- char *dot_pos=strrchr(check_file_name,'.');
- if(dot_pos==NULL) strcat(check_file_name,".wtp");
- else strcpy(dot_pos,".wtp");
- }
- if ((tex_file=fopen(check_file_name,"wb"))==NULL)
- fatal(_("! Cannot open output file "), check_file_name);
}
@z
@@ -664,7 +647,46 @@
#endif
char separators[]=SEPARATORS;
-@* Temporary file output. Before we leave the program we have to make
+@* Temporary file output. Most \CEE/ projects are controlled by a \.{Makefile}
+that automatically takes care of the temporal dependecies between the different
+source modules. It may be convenient that \.{CWEB} doesn't create new output
+for all existing files, when there are only changes to some of them. Thus the
+\.{make} process will only recompile those modules where necessary. You can
+activate this feature with the `\.{+c}' command-line option. The idea and basic
+implementation of this mechanism can be found in the program \.{NUWEB} by
+Preston Briggs, to whom credit is due.
+
+@<Open intermediate \CEE/ output file@>= {
+ if ((C_file=fopen(C_file_name,"a"))==NULL)
+ fatal(_("! Cannot open output file "), C_file_name);
+ at .Cannot open output file@>
+ else fclose(C_file); /* Test accessability */
+ strcpy(check_file_name,C_file_name);
+ if(check_file_name[0]!='\0') {
+ char *dot_pos=strrchr(check_file_name,'.');
+ if(dot_pos==NULL) strcat(check_file_name,".ttp");
+ else strcpy(dot_pos,".ttp");
+ }
+ if ((C_file=fopen(check_file_name,"wb"))==NULL)
+ fatal(_("! Cannot open output file "), check_file_name);
+}
+
+@ @<Open intermediate \TEX/ output file@>= {
+ if ((tex_file=fopen(tex_file_name,"a"))==NULL)
+ fatal(_("! Cannot open output file "), tex_file_name);
+ at .Cannot open output file@>
+ else fclose(tex_file); /* Test accessability */
+ strcpy(check_file_name,tex_file_name);
+ if(check_file_name[0]!='\0') {
+ char *dot_pos=strrchr(check_file_name,'.');
+ if(dot_pos==NULL) strcat(check_file_name,".wtp");
+ else strcpy(dot_pos,".wtp");
+ }
+ if ((tex_file=fopen(check_file_name,"wb"))==NULL)
+ fatal(_("! Cannot open output file "), check_file_name);
+}
+
+@ Before we leave the program we have to make
sure that the output files are correctly written.
@<Remove the temporary file...@>=
Modified: trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/cwebdir/ctang-w2c.ch 2021-10-11 15:21:35 UTC (rev 60728)
@@ -136,29 +136,36 @@
}
@y
@<Write all the named output files@>=
-fclose(C_file); C_file=NULL;
-@<Update the primary result when it has changed@>@;
+if (check_for_change) {
+ fclose(C_file); C_file=NULL;
+ @<Update the primary result when it has changed@>@;
+}
for (an_output_file=end_output_files; an_output_file>cur_out_file;) {
- an_output_file--;
- sprint_section_name(output_file_name,*an_output_file);
- if ((C_file=fopen(output_file_name,"a"))==NULL)
+ an_output_file--;
+ sprint_section_name(output_file_name,*an_output_file);
+ if (check_for_change) @<Open the intermediate output file@>@;
+ else {
+ fclose(C_file);
+ if ((C_file=fopen(output_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "),output_file_name);
@.Cannot open output file@>
- else fclose(C_file); /* Test accessability */
- if((C_file=fopen(check_file_name,"wb"))==NULL)
- fatal(_("! Cannot open output file "),check_file_name);
- if (show_progress) { printf("\n(%s)",output_file_name); update_terminal; }
- cur_line=1;
- stack_ptr=stack+1;
- cur_name=*an_output_file;
- cur_repl=(text_pointer)cur_name->equiv;
- cur_byte=cur_repl->tok_start;
- cur_end=(cur_repl+1)->tok_start;
- while (stack_ptr > stack) get_output();
- flush_buffer(); fclose(C_file); C_file=NULL;
+ }
+ if (show_progress) { printf("\n(%s)",output_file_name); update_terminal; }
+ cur_line=1;
+ stack_ptr=stack+1;
+ cur_name=*an_output_file;
+ cur_repl=(text_pointer)cur_name->equiv;
+ cur_byte=cur_repl->tok_start;
+ cur_end=(cur_repl+1)->tok_start;
+ while (stack_ptr > stack) get_output();
+ flush_buffer();
+ if (check_for_change) {
+ fclose(C_file); C_file=NULL;
@<Update the secondary results when they have changed@>@;
+ }
}
-strcpy(check_file_name,""); /* We want to get rid of the temporary file */
+if (check_for_change)
+ strcpy(check_file_name,""); /* We want to get rid of the temporary file */
@z
@x
@@ -359,15 +366,25 @@
Care has been taken to keep the original section numbering intact, so this new
material should nicely integrate with the original ``\&{104.~Index}.''
-@* Output file update. Most \CEE/ projects are controlled by a
-\.{Makefile} that automatically takes care of the temporal dependecies
-between the different source modules. It is suitable that \.{CWEB} doesn't
-create new output for all existing files, when there are only changes to
-some of them. Thus the \.{make} process will only recompile those modules
-where necessary. The idea and basic implementation of this mechanism can
-be found in the program \.{NUWEB} by Preston Briggs, to whom credit is due.
+@* Output file update. Most \CEE/ projects are controlled by a \.{Makefile}
+that automatically takes care of the temporal dependecies between the different
+source modules. It may be convenient that \.{CWEB} doesn't create new output
+for all existing files, when there are only changes to some of them. Thus the
+\.{make} process will only recompile those modules where necessary. You can
+activate this feature with the `\.{+c}' command-line option. The idea and basic
+implementation of this mechanism can be found in the program \.{NUWEB} by
+Preston Briggs, to whom credit is due.
-@<Update the primary result...@>=
+@<Open the intermediate output file@>= {
+ if ((C_file=fopen(output_file_name,"a"))==NULL)
+ fatal(_("! Cannot open output file "),output_file_name);
+ at .Cannot open output file@>
+ else fclose(C_file); /* Test accessability */
+ if((C_file=fopen(check_file_name,"wb"))==NULL)
+ fatal(_("! Cannot open output file "),check_file_name);
+}
+
+@ @<Update the primary result...@>=
if((C_file=fopen(C_file_name,"r"))!=NULL) {
@<Set up the comparison of temporary output@>@;
@<Create the primary output depending on the comparison@>@;
@@ -381,7 +398,7 @@
fatal(_("! Cannot open output file "),check_file_name);
@.Cannot open output file@>
- if (check_for_change) @<Compare the temporary output...@>@;
+ @<Compare the temporary output...@>@;
fclose(C_file); C_file=NULL;
fclose(check_file); check_file=NULL;
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2021-10-11 15:21:35 UTC (rev 60728)
@@ -1157,7 +1157,6 @@
finish_line();
out_str("\\end");
@.\\end@>
- active_file=tex_file;
}
@z
@@ -1194,8 +1193,8 @@
@y
@.\\end@>
}
-finish_line(); fclose(active_file); active_file=NULL;
-@<Update the result when it has changed@>@;
+finish_line(); fclose(active_file); active_file=tex_file=NULL;
+if (check_for_change) @<Update the result when it has changed@>@;
@z
@x
@@ -1981,15 +1980,16 @@
@<Set init...@>=
order_decl_stmt=true;
-@* Output file update. Most \CEE/ projects are controlled by a
-\.{Makefile} that automatically takes care of the temporal dependecies
-between the different source modules. It is suitable that \.{CWEB} doesn't
-create new output for all existing files, when there are only changes to
-some of them. Thus the \.{make} process will only recompile those modules
-where necessary. The idea and basic implementation of this mechanism can
-be found in the program \.{NUWEB} by Preston Briggs, to whom credit is due.
+@* Output file update. Most \CEE/ projects are controlled by a \.{Makefile}
+that automatically takes care of the temporal dependecies between the different
+source modules. It may be convenient that \.{CWEB} doesn't create new output
+for all existing files, when there are only changes to some of them. Thus the
+\.{make} process will only recompile those modules where necessary. You can
+activate this feature with the `\.{+c}' command-line option. The idea and basic
+implementation of this mechanism can be found in the program \.{NUWEB} by
+Preston Briggs, to whom credit is due.
-@<Update the result...@>=
+@<Update the result...@>= {
if((tex_file=fopen(tex_file_name,"r"))!=NULL) {
boolean comparison=false;
@@ -1997,7 +1997,7 @@
fatal(_("! Cannot open output file "),check_file_name);
@.Cannot open output file@>
- if (check_for_change) @<Compare the temporary output...@>@;
+ @<Compare the temporary output...@>@;
fclose(tex_file); tex_file=NULL;
fclose(check_file); check_file=NULL;
@@ -2007,6 +2007,7 @@
rename(check_file_name,tex_file_name); /* This was the first run */
strcpy(check_file_name,""); /* We want to get rid of the temporary file */
+}
@ We hope that this runs fast on most systems.
Modified: trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2021-10-10 23:48:31 UTC (rev 60727)
+++ trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2021-10-11 15:21:35 UTC (rev 60728)
@@ -558,7 +558,6 @@
finish_line();
out_str("\\end");
@.\\end@>
- active_file=tex_file;
}
@z
@@ -588,8 +587,8 @@
@y
@.\\end@>
}
-finish_line(); fclose(active_file); active_file=NULL;
-@<Update the result when it has changed@>@;
+finish_line(); fclose(active_file); active_file=tex_file=NULL;
+if (check_for_change) @<Update the result when it has changed@>@;
@z
@x
@@ -678,15 +677,16 @@
@<Set init...@>=
order_decl_stmt=true;
-@* Output file update. Most \CEE/ projects are controlled by a
-\.{Makefile} that automatically takes care of the temporal dependecies
-between the different source modules. It is suitable that \.{CWEB} doesn't
-create new output for all existing files, when there are only changes to
-some of them. Thus the \.{make} process will only recompile those modules
-where necessary. The idea and basic implementation of this mechanism can
-be found in the program \.{NUWEB} by Preston Briggs, to whom credit is due.
+@* Output file update. Most \CEE/ projects are controlled by a \.{Makefile}
+that automatically takes care of the temporal dependecies between the different
+source modules. It may be convenient that \.{CWEB} doesn't create new output
+for all existing files, when there are only changes to some of them. Thus the
+\.{make} process will only recompile those modules where necessary. You can
+activate this feature with the `\.{+c}' command-line option. The idea and basic
+implementation of this mechanism can be found in the program \.{NUWEB} by
+Preston Briggs, to whom credit is due.
-@<Update the result...@>=
+@<Update the result...@>= {
if((tex_file=fopen(tex_file_name,"r"))!=NULL) {
boolean comparison=false;
@@ -694,7 +694,7 @@
fatal(_("! Cannot open output file "),check_file_name);
@.Cannot open output file@>
- if (check_for_change) @<Compare the temporary output...@>@;
+ @<Compare the temporary output...@>@;
fclose(tex_file); tex_file=NULL;
fclose(check_file); check_file=NULL;
@@ -704,6 +704,7 @@
rename(check_file_name,tex_file_name); /* This was the first run */
strcpy(check_file_name,""); /* We want to get rid of the temporary file */
+}
@ We hope that this runs fast on most systems.
More information about the tex-live-commits
mailing list.