summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2023-08-16 09:45:45 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2023-08-16 09:45:45 +0000
commit6cdd8eb4bcdd93931a03d6216427dea334e2cdaf (patch)
tree2f078baccbad1628228dac9220f963cfe4fb686a /Build/source/texk/web2c/cwebdir
parent7eed4fb01eccfe483469eb7cf8acfc56a5d2f651 (diff)
[CWEB] Section 36 of COMMON is system-dependent.
git-svn-id: svn://tug.org/texlive/trunk@67943 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir')
-rw-r--r--Build/source/texk/web2c/cwebdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-w2c.ch1
-rw-r--r--Build/source/texk/web2c/cwebdir/common.c137
-rw-r--r--Build/source/texk/web2c/cwebdir/common.w1
4 files changed, 77 insertions, 68 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog
index 9a2108a91ea..dca3f684105 100644
--- a/Build/source/texk/web2c/cwebdir/ChangeLog
+++ b/Build/source/texk/web2c/cwebdir/ChangeLog
@@ -1,3 +1,9 @@
+2023-08-16 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.ch,
+ * common.c,
+ * common.w: Section 36 of COMMON is system-dependent.
+
2023-08-13 Andreas Scherer <https://ascherer.github.io>
* comm-w2c.h,
diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.ch b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
index 76721f57014..a14240a22a0 100644
--- a/Build/source/texk/web2c/cwebdir/comm-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
@@ -223,6 +223,7 @@ The remainder of the \.{@@i} line after the file name is ignored.
for (; k>=cur_file_name; k--) *(k+l+1)=*k;
strcpy(cur_file_name,temp_file_name);
cur_file_name[l]='/'; /* \UNIX/ pathname separator */
+@^system dependencies@>
if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {
cur_line=0; print_where=true;
goto restart; /* success */
diff --git a/Build/source/texk/web2c/cwebdir/common.c b/Build/source/texk/web2c/cwebdir/common.c
index 2f43a1278d7..ccedc5e914d 100644
--- a/Build/source/texk/web2c/cwebdir/common.c
+++ b/Build/source/texk/web2c/cwebdir/common.c
@@ -277,7 +277,7 @@ static char change_buffer[buf_size];
static char*change_limit;
/*:26*//*42:*/
-#line 544 "common.w"
+#line 545 "common.w"
sixteen_bits section_count;
boolean changed_section[max_sections];
@@ -286,7 +286,7 @@ boolean change_pending;
boolean print_where= false;
/*:42*//*43:*/
-#line 589 "common.w"
+#line 590 "common.w"
char byte_mem[max_bytes];
char*byte_mem_end= byte_mem+max_bytes-1;
@@ -294,25 +294,25 @@ name_info name_dir[max_names];
name_pointer name_dir_end= name_dir+max_names-1;
/*:43*//*44:*/
-#line 600 "common.w"
+#line 601 "common.w"
char*byte_ptr;
name_pointer name_ptr;
/*:44*//*46:*/
-#line 620 "common.w"
+#line 621 "common.w"
name_pointer hash[hash_size];
hash_pointer hash_end= hash+hash_size-1;
hash_pointer h;
/*:46*//*65:*/
-#line 1001 "common.w"
+#line 1002 "common.w"
int history= spotless;
/*:65*//*73:*/
-#line 1124 "common.w"
+#line 1125 "common.w"
int argc;
char**argv;
@@ -323,7 +323,7 @@ char scn_file_name[max_file_name_length];
boolean flags[128];
/*:73*//*83:*/
-#line 1265 "common.w"
+#line 1266 "common.w"
FILE*C_file;
FILE*tex_file;
@@ -383,18 +383,18 @@ static void prime_the_change_buffer(void);
static void check_change(void);
/*:33*//*55:*/
-#line 762 "common.w"
+#line 763 "common.w"
static int web_strcmp(char*,size_t,char*,size_t);
static name_pointer add_section_name(name_pointer,int,char*,char*,boolean);
static void extend_section_name(name_pointer,char*,char*,boolean);
/*:55*//*64:*/
-#line 989 "common.w"
+#line 990 "common.w"
static int section_name_cmp(char**,size_t,name_pointer);
/*:64*//*76:*/
-#line 1184 "common.w"
+#line 1185 "common.w"
static void scan_args(void);
/*:76*/
@@ -408,7 +408,7 @@ void
common_init(void)
{
/*45:*/
-#line 604 "common.w"
+#line 605 "common.w"
name_dir->byte_start= byte_ptr= byte_mem;
name_ptr= name_dir+1;
@@ -416,7 +416,7 @@ name_ptr->byte_start= byte_mem;
root= NULL;
/*:45*//*47:*/
-#line 627 "common.w"
+#line 628 "common.w"
for(h= hash;h<=hash_end;*h++= NULL);
@@ -424,7 +424,7 @@ for(h= hash;h<=hash_end;*h++= NULL);
#line 99 "common.w"
/*74:*/
-#line 1137 "common.w"
+#line 1138 "common.w"
show_banner= show_happiness= show_progress= make_xrefs= true;
@@ -432,7 +432,7 @@ show_banner= show_happiness= show_progress= make_xrefs= true;
#line 100 "common.w"
/*84:*/
-#line 1272 "common.w"
+#line 1273 "common.w"
scan_args();
if(program==ctangle){
@@ -600,7 +600,7 @@ boolean get_line(void)
restart:
if(changing&&include_depth==change_depth)
/*38:*/
-#line 469 "common.w"
+#line 470 "common.w"
{
change_line++;
if(!input_ln(change_file)){
@@ -635,7 +635,7 @@ prime_the_change_buffer();changing= !changing;print_where= true;
if(!changing||include_depth> change_depth){
/*37:*/
-#line 452 "common.w"
+#line 453 "common.w"
{
cur_line++;
while(!input_ln(cur_file)){
@@ -715,6 +715,7 @@ if(k+l+2>=cur_file_name_end)too_long();
for(;k>=cur_file_name;k--)*(k+l+1)= *k;
strcpy(cur_file_name,temp_file_name);
cur_file_name[l]= '/';
+
if((cur_file= fopen(cur_file_name,"r"))!=NULL){
cur_line= 0;print_where= true;
goto restart;
@@ -731,7 +732,7 @@ return true;
}
/*:35*//*39:*/
-#line 501 "common.w"
+#line 502 "common.w"
void
check_complete(void){
@@ -745,14 +746,14 @@ err_print("! Change file entry did not match");
}
/*:39*//*40:*/
-#line 517 "common.w"
+#line 518 "common.w"
void
reset_input(void)
{
limit= buffer;loc= buffer+1;buffer[0]= ' ';
/*41:*/
-#line 532 "common.w"
+#line 533 "common.w"
if((web_file= fopen(web_file_name,"r"))==NULL){
strcpy(web_file_name,alt_web_file_name);
@@ -766,7 +767,7 @@ if((change_file= fopen(change_file_name,"r"))==NULL)
fatal("! Cannot open change file ",change_file_name);
/*:41*/
-#line 522 "common.w"
+#line 523 "common.w"
include_depth= cur_line= change_line= 0;
change_depth= include_depth;
@@ -775,7 +776,7 @@ limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false;
}
/*:40*//*48:*/
-#line 632 "common.w"
+#line 633 "common.w"
name_pointer
id_lookup(
@@ -790,17 +791,17 @@ name_pointer p;
if(last==NULL)for(last= first;*last!='\0';last++);
l= (size_t)(last-first);
/*49:*/
-#line 655 "common.w"
+#line 656 "common.w"
h= (int)((eight_bits)*i);
while(++i<last)h= (h+h+(int)((eight_bits)*i))%hash_size;
/*:49*/
-#line 645 "common.w"
+#line 646 "common.w"
/*50:*/
-#line 663 "common.w"
+#line 664 "common.w"
p= hash[h];
while(p&&!names_match(p,first,l,t))p= p->link;
@@ -810,10 +811,10 @@ p->link= hash[h];hash[h]= p;
}
/*:50*/
-#line 646 "common.w"
+#line 647 "common.w"
if(p==name_ptr)/*51:*/
-#line 674 "common.w"
+#line 675 "common.w"
{
if(byte_ptr+l> byte_mem_end)overflow("byte memory");
if(name_ptr>=name_dir_end)overflow("name");
@@ -823,13 +824,13 @@ if(program==cweave)p->ilk= t,init_node(p);
}
/*:51*/
-#line 647 "common.w"
+#line 648 "common.w"
return p;
}
/*:48*//*52:*/
-#line 706 "common.w"
+#line 707 "common.w"
void
print_section_name(
@@ -848,7 +849,7 @@ if(q)term_write("...",3);
}
/*:52*//*53:*/
-#line 723 "common.w"
+#line 724 "common.w"
void
sprint_section_name(
@@ -868,7 +869,7 @@ s= p->byte_start;
}
/*:53*//*54:*/
-#line 741 "common.w"
+#line 742 "common.w"
void
print_prefix_name(
@@ -881,7 +882,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3);
}
/*:54*//*56:*/
-#line 767 "common.w"
+#line 768 "common.w"
static int web_strcmp(
char*j,
@@ -899,7 +900,7 @@ else return greater;
}
/*:56*//*57:*/
-#line 796 "common.w"
+#line 797 "common.w"
static name_pointer
add_section_name(
@@ -929,7 +930,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p);
}
/*:57*//*58:*/
-#line 824 "common.w"
+#line 825 "common.w"
static void
extend_section_name(
@@ -953,7 +954,7 @@ if(ispref)*(byte_ptr-1)= ' ';
}
/*:58*//*59:*/
-#line 852 "common.w"
+#line 853 "common.w"
name_pointer
section_lookup(
@@ -968,7 +969,7 @@ name_pointer par= NULL;
size_t name_len= (size_t)(last-first+1);
/*60:*/
-#line 876 "common.w"
+#line 877 "common.w"
while(p){
c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p));
@@ -995,19 +996,19 @@ p= q,q= NULL;
}
/*:60*/
-#line 866 "common.w"
+#line 867 "common.w"
/*61:*/
-#line 901 "common.w"
+#line 902 "common.w"
if(r==NULL)
return add_section_name(par,c,first,last+1,ispref);
/*:61*/
-#line 867 "common.w"
+#line 868 "common.w"
/*62:*/
-#line 909 "common.w"
+#line 910 "common.w"
switch(section_name_cmp(&first,name_len,r)){
@@ -1041,12 +1042,12 @@ err_print(">");
return r;
/*:62*/
-#line 868 "common.w"
+#line 869 "common.w"
}
/*:59*//*63:*/
-#line 957 "common.w"
+#line 958 "common.w"
static int section_name_cmp(
char**pfirst,
@@ -1080,7 +1081,7 @@ default:return c;
}
/*:63*//*66:*/
-#line 1011 "common.w"
+#line 1012 "common.w"
void
err_print(
@@ -1088,7 +1089,7 @@ const char*s)
{
*s=='!'?printf("\n%s",s):printf("%s",s);
if(web_file_open)/*67:*/
-#line 1030 "common.w"
+#line 1031 "common.w"
{char*k,*l;
if(changing&&include_depth==change_depth)
@@ -1109,20 +1110,20 @@ putchar(' ');
}
/*:67*/
-#line 1017 "common.w"
+#line 1018 "common.w"
update_terminal();mark_error();
}
/*:66*//*68:*/
-#line 1063 "common.w"
+#line 1064 "common.w"
int wrap_up(void){
if(show_progress)new_line();
if(show_stats)
print_stats();
/*69:*/
-#line 1073 "common.w"
+#line 1074 "common.w"
switch(history){
case spotless:
@@ -1136,14 +1137,14 @@ puts("(That was a fatal error, my friend.)");
}
/*:69*/
-#line 1068 "common.w"
+#line 1069 "common.w"
if(history> harmless_message)return EXIT_FAILURE;
else return EXIT_SUCCESS;
}
/*:68*//*70:*/
-#line 1091 "common.w"
+#line 1092 "common.w"
void
fatal(
const char*s,const char*t)
@@ -1154,7 +1155,7 @@ history= fatal_message;exit(wrap_up());
}
/*:70*//*71:*/
-#line 1102 "common.w"
+#line 1103 "common.w"
void
overflow(
const char*t)
@@ -1164,7 +1165,7 @@ printf("\n! Sorry, %s capacity exceeded",t);fatal("","");
/*:71*//*75:*/
-#line 1155 "common.w"
+#line 1156 "common.w"
static void
scan_args(void)
@@ -1178,13 +1179,13 @@ boolean found_web= false,found_change= false,found_out= false;
strcpy(change_file_name,"/dev/null");
while(--argc> 0){
if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/
-#line 1243 "common.w"
+#line 1244 "common.w"
for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++)
flags[(eight_bits)*dot_pos]= flag_change;
/*:80*/
-#line 1167 "common.w"
+#line 1168 "common.w"
else{
s= name_pos= *argv;dot_pos= NULL;
@@ -1193,17 +1194,17 @@ if(*s=='.')dot_pos= s++;
else if(*s=='/')dot_pos= NULL,name_pos= ++s;
else s++;
if(!found_web)/*77:*/
-#line 1193 "common.w"
+#line 1194 "common.w"
{
if(s-*argv> max_file_name_length-5)
/*82:*/
-#line 1259 "common.w"
+#line 1260 "common.w"
fatal("! Filename too long\n",*argv);
/*:82*/
-#line 1196 "common.w"
+#line 1197 "common.w"
if(dot_pos==NULL)
sprintf(web_file_name,"%s.w",*argv);
@@ -1220,21 +1221,21 @@ found_web= true;
}
/*:77*/
-#line 1175 "common.w"
+#line 1176 "common.w"
else if(!found_change)/*78:*/
-#line 1211 "common.w"
+#line 1212 "common.w"
{
if(strcmp(*argv,"-")!=0){
if(s-*argv> max_file_name_length-4)
/*82:*/
-#line 1259 "common.w"
+#line 1260 "common.w"
fatal("! Filename too long\n",*argv);
/*:82*/
-#line 1215 "common.w"
+#line 1216 "common.w"
if(dot_pos==NULL)
sprintf(change_file_name,"%s.ch",*argv);
@@ -1244,20 +1245,20 @@ found_change= true;
}
/*:78*/
-#line 1176 "common.w"
+#line 1177 "common.w"
else if(!found_out)/*79:*/
-#line 1223 "common.w"
+#line 1224 "common.w"
{
if(s-*argv> max_file_name_length-5)
/*82:*/
-#line 1259 "common.w"
+#line 1260 "common.w"
fatal("! Filename too long\n",*argv);
/*:82*/
-#line 1226 "common.w"
+#line 1227 "common.w"
if(dot_pos==NULL){
sprintf(tex_file_name,"%s.tex",*argv);
@@ -1275,10 +1276,10 @@ found_out= true;
}
/*:79*/
-#line 1177 "common.w"
+#line 1178 "common.w"
else/*81:*/
-#line 1247 "common.w"
+#line 1248 "common.w"
{
if(program==ctangle)
@@ -1292,12 +1293,12 @@ else fatal(
}
/*:81*/
-#line 1178 "common.w"
+#line 1179 "common.w"
}
}
if(!found_web)/*81:*/
-#line 1247 "common.w"
+#line 1248 "common.w"
{
if(program==ctangle)
@@ -1311,7 +1312,7 @@ else fatal(
}
/*:81*/
-#line 1181 "common.w"
+#line 1182 "common.w"
}
diff --git a/Build/source/texk/web2c/cwebdir/common.w b/Build/source/texk/web2c/cwebdir/common.w
index 83e37c14ac8..b95dfdaa6b3 100644
--- a/Build/source/texk/web2c/cwebdir/common.w
+++ b/Build/source/texk/web2c/cwebdir/common.w
@@ -441,6 +441,7 @@ The remainder of the \.{@@i} line after the file name is ignored.
for (; k>=cur_file_name; k--) *(k+l+1)=*k;
strcpy(cur_file_name,temp_file_name);
cur_file_name[l]='/'; /* \UNIX/ pathname separator */
+@^system dependencies@>
if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {
cur_line=0; print_where=true;
goto restart; /* success */