diff --git a/texk/web2c/ChangeLog b/texk/web2c/ChangeLog index f39e410d2e..5d97112af7 100644 --- a/texk/web2c/ChangeLog +++ b/texk/web2c/ChangeLog @@ -1,3 +1,8 @@ +2023-06-26 Andreas Scherer + + * ctangleboot.cin, + * cwebboot.cin: Purge 'init_p'. + 2023-06-21 Andreas Scherer * ctangleboot.cin, diff --git a/texk/web2c/ctangleboot.cin b/texk/web2c/ctangleboot.cin index 07af68ec45..5da90fedc0 100644 --- a/texk/web2c/ctangleboot.cin +++ b/texk/web2c/ctangleboot.cin @@ -76,7 +76,8 @@ #define llink link #define rlink dummy.Rlink #define root name_dir->rlink \ - \ + +#define ilk dummy.Ilk \ #define spotless 0 #define harmless_message 1 @@ -228,7 +229,7 @@ extern boolean change_pending; extern boolean print_where; /*:10*//*11:*/ -#line 170 "cwebdir/comm-w2c.h" +#line 171 "cwebdir/comm-w2c.h" typedef struct name_info{ char*byte_start; @@ -299,7 +300,7 @@ typedef text*text_pointer; #line 66 "cwebdir/ctang-w2c.ch" /*:19*//*31:*/ -#line 271 "cwebdir/ctangle.w" +#line 267 "cwebdir/ctangle.w" typedef struct{ eight_bits*byte_field; @@ -323,30 +324,30 @@ static eight_bits*tok_mem_end= tok_mem+max_toks-1; static eight_bits*tok_ptr; /*:20*//*26:*/ -#line 200 "cwebdir/ctangle.w" +#line 196 "cwebdir/ctangle.w" static text_pointer last_unnamed; /*:26*//*32:*/ -#line 289 "cwebdir/ctangle.w" +#line 285 "cwebdir/ctangle.w" static output_state stack[stack_size+2]; static stack_pointer stack_end= stack+stack_size; static stack_pointer stack_ptr; /*:32*//*37:*/ -#line 361 "cwebdir/ctangle.w" +#line 357 "cwebdir/ctangle.w" static int cur_val; /*:37*//*42:*/ -#line 453 "cwebdir/ctangle.w" +#line 449 "cwebdir/ctangle.w" static eight_bits out_state; static boolean protect; /*:42*//*45:*/ -#line 484 "cwebdir/ctangle.w" +#line 480 "cwebdir/ctangle.w" static name_pointer output_files[max_files]; static name_pointer*cur_out_file,*end_output_files,*an_output_file; @@ -354,33 +355,33 @@ static char cur_section_name_char; static char output_file_name[longest_name+1]; /*:45*//*52:*/ -#line 583 "cwebdir/ctangle.w" +#line 579 "cwebdir/ctangle.w" static boolean output_defs_seen= false; /*:52*//*57:*/ -#line 697 "cwebdir/ctangle.w" +#line 693 "cwebdir/ctangle.w" static char translit[0200][translit_length]; /*:57*//*62:*/ -#line 773 "cwebdir/ctangle.w" +#line 769 "cwebdir/ctangle.w" static eight_bits ccode[256]; /*:62*//*66:*/ -#line 833 "cwebdir/ctangle.w" +#line 829 "cwebdir/ctangle.w" static boolean comment_continues= false; /*:66*//*68:*/ -#line 870 "cwebdir/ctangle.w" +#line 866 "cwebdir/ctangle.w" static name_pointer cur_section_name; static boolean no_where; /*:68*//*82:*/ -#line 1187 "cwebdir/ctangle.w" +#line 1183 "cwebdir/ctangle.w" static text_pointer cur_text; static eight_bits next_control; @@ -404,7 +405,7 @@ extern void check_complete(void); extern void reset_input(void); /*:9*//*12:*/ -#line 193 "cwebdir/comm-w2c.h" +#line 194 "cwebdir/comm-w2c.h" extern name_pointer id_lookup(const char*,const char*,eight_bits); @@ -416,7 +417,6 @@ extern void sprint_section_name(char*,name_pointer); extern boolean names_match(name_pointer,const char*,size_t,eight_bits); extern void init_node(name_pointer); -extern void init_p(name_pointer,eight_bits); /*:12*//*14:*/ #line 219 "cwebdir/comm-w2c.h" @@ -427,57 +427,57 @@ extern void fatal(const char*,const char*); extern void overflow(const char*); /*:14*//*30:*/ -#line 246 "cwebdir/ctangle.w" +#line 242 "cwebdir/ctangle.w" static void store_two_bytes(sixteen_bits); /*:30*//*35:*/ -#line 325 "cwebdir/ctangle.w" +#line 321 "cwebdir/ctangle.w" static void push_level(name_pointer); static void pop_level(boolean); /*:35*//*39:*/ -#line 398 "cwebdir/ctangle.w" +#line 394 "cwebdir/ctangle.w" static void get_output(void); /*:39*//*44:*/ -#line 474 "cwebdir/ctangle.w" +#line 470 "cwebdir/ctangle.w" static void flush_buffer(void); /*:44*//*49:*/ -#line 551 "cwebdir/ctangle.w" +#line 547 "cwebdir/ctangle.w" static void phase_two(void); /*:49*//*53:*/ -#line 586 "cwebdir/ctangle.w" +#line 582 "cwebdir/ctangle.w" static void output_defs(void); static void out_char(eight_bits); /*:53*//*65:*/ -#line 813 "cwebdir/ctangle.w" +#line 809 "cwebdir/ctangle.w" static eight_bits skip_ahead(void); static boolean skip_comment(boolean); /*:65*//*70:*/ -#line 920 "cwebdir/ctangle.w" +#line 916 "cwebdir/ctangle.w" static eight_bits get_next(void); /*:70*//*84:*/ -#line 1213 "cwebdir/ctangle.w" +#line 1209 "cwebdir/ctangle.w" static void scan_repl(eight_bits); /*:84*//*91:*/ -#line 1405 "cwebdir/ctangle.w" +#line 1401 "cwebdir/ctangle.w" static void scan_section(void); /*:91*//*99:*/ -#line 1482 "cwebdir/ctangle.w" +#line 1478 "cwebdir/ctangle.w" static void phase_one(void); /*:99*//*101:*/ -#line 1515 "cwebdir/ctangle.w" +#line 1511 "cwebdir/ctangle.w" static void skip_limbo(void); /*:101*/ @@ -506,16 +506,16 @@ text_ptr= text_info+1;text_ptr->tok_start= tok_mem; init_node(name_dir); /*:23*//*27:*/ -#line 203 "cwebdir/ctangle.w" +#line 199 "cwebdir/ctangle.w" last_unnamed= text_info;text_info->text_link= macro; /*:27*//*46:*/ -#line 494 "cwebdir/ctangle.w" +#line 490 "cwebdir/ctangle.w" cur_out_file= end_output_files= output_files+max_files; /*:46*//*58:*/ -#line 700 "cwebdir/ctangle.w" +#line 696 "cwebdir/ctangle.w" { int i; @@ -524,7 +524,7 @@ for(i= 0;i<0200;i++)sprintf(translit[i],"X%02X",(unsigned int)(0200+i)); #line 178 "cwebdir/ctang-w2c.ch" /*:58*//*63:*/ -#line 776 "cwebdir/ctangle.w" +#line 772 "cwebdir/ctangle.w" { int c; for(c= 0;c<256;c++)ccode[c]= ignore; @@ -544,7 +544,7 @@ ccode['<']= ccode['(']= section_name; ccode['\'']= ord; /*:63*//*78:*/ -#line 1108 "cwebdir/ctangle.w" +#line 1104 "cwebdir/ctangle.w" section_text[0]= ' '; /*:78*//*117:*/ @@ -577,7 +577,7 @@ return length(p)==l&&strncmp(first,p->byte_start,l)==0; } /*:24*//*25:*/ -#line 170 "cwebdir/ctangle.w" +#line 168 "cwebdir/ctangle.w" void init_node( @@ -585,11 +585,9 @@ name_pointer node) { node->equiv= (void*)text_info; } -void -init_p(name_pointer p,eight_bits t){(void)p;(void)t;} /*:25*//*29:*/ -#line 236 "cwebdir/ctangle.w" +#line 232 "cwebdir/ctangle.w" static void store_two_bytes( @@ -597,13 +595,13 @@ sixteen_bits x) { #line 73 "cwebdir/ctang-w2c.ch" if(tok_ptr+2> tok_mem_end)overflow(_("token")); -#line 242 "cwebdir/ctangle.w" +#line 238 "cwebdir/ctangle.w" *tok_ptr++= x>>8; *tok_ptr++= x&0377; } /*:29*//*34:*/ -#line 311 "cwebdir/ctangle.w" +#line 307 "cwebdir/ctangle.w" static void push_level( @@ -611,7 +609,7 @@ name_pointer p) { #line 79 "cwebdir/ctang-w2c.ch" if(stack_ptr==stack_end)overflow(_("stack")); -#line 317 "cwebdir/ctangle.w" +#line 313 "cwebdir/ctangle.w" *stack_ptr= cur_state; stack_ptr++; if(p!=NULL){ @@ -621,7 +619,7 @@ cur_byte= cur_repl->tok_start;cur_section= 0; } /*:34*//*36:*/ -#line 333 "cwebdir/ctangle.w" +#line 329 "cwebdir/ctangle.w" static void pop_level( @@ -636,7 +634,7 @@ if(stack_ptr> stack)cur_state= *stack_ptr; } /*:36*//*38:*/ -#line 368 "cwebdir/ctangle.w" +#line 364 "cwebdir/ctangle.w" static void get_output(void) @@ -659,7 +657,7 @@ switch(a/024000){ case 0:cur_val= (int)a;out_char(identifier);break; case 1:if(a==output_defs_flag)output_defs(); else/*40:*/ -#line 403 "cwebdir/ctangle.w" +#line 399 "cwebdir/ctangle.w" { a-= 024000; @@ -667,7 +665,7 @@ if((a+name_dir)->equiv!=(void*)text_info)push_level(a+name_dir); else if(a!=0){ #line 85 "cwebdir/ctang-w2c.ch" fputs(_("\n! Not present: <"),stdout); -#line 409 "cwebdir/ctangle.w" +#line 405 "cwebdir/ctangle.w" print_section_name(a+name_dir);err_print(">"); } @@ -675,7 +673,7 @@ goto restart; } /*:40*/ -#line 389 "cwebdir/ctangle.w" +#line 385 "cwebdir/ctangle.w" break; default:cur_val= (int)a-050000; @@ -686,7 +684,7 @@ out_char(section_number); } /*:38*//*43:*/ -#line 461 "cwebdir/ctangle.w" +#line 457 "cwebdir/ctangle.w" static void flush_buffer(void) @@ -701,7 +699,7 @@ cur_line++; } /*:43*//*48:*/ -#line 513 "cwebdir/ctangle.w" +#line 509 "cwebdir/ctangle.w" static void phase_two(void){ @@ -709,27 +707,27 @@ phase= 2; web_file_open= false; cur_line= 1; /*33:*/ -#line 300 "cwebdir/ctangle.w" +#line 296 "cwebdir/ctangle.w" stack_ptr= stack+1;cur_name= name_dir;cur_repl= text_info->text_link+text_info; cur_byte= cur_repl->tok_start;cur_section= 0; /*:33*/ -#line 519 "cwebdir/ctangle.w" +#line 515 "cwebdir/ctangle.w" /*51:*/ -#line 579 "cwebdir/ctangle.w" +#line 575 "cwebdir/ctangle.w" if(!output_defs_seen) output_defs(); /*:51*/ -#line 520 "cwebdir/ctangle.w" +#line 516 "cwebdir/ctangle.w" if(text_info->text_link==macro&&cur_out_file==end_output_files){ #line 97 "cwebdir/ctang-w2c.ch" fputs(_("\n! No program text was specified."),stdout);mark_harmless; -#line 523 "cwebdir/ctangle.w" +#line 519 "cwebdir/ctangle.w" } else{ @@ -737,7 +735,7 @@ if(cur_out_file==end_output_files){ if(show_progress){ #line 103 "cwebdir/ctang-w2c.ch" printf(_("\nWriting the output file (%s):"),C_file_name); -#line 529 "cwebdir/ctangle.w" +#line 525 "cwebdir/ctangle.w" update_terminal; } } @@ -745,7 +743,7 @@ else{ if(show_progress){ #line 109 "cwebdir/ctang-w2c.ch" fputs(_("\nWriting the output files:"),stdout); -#line 535 "cwebdir/ctangle.w" +#line 531 "cwebdir/ctangle.w" printf(" (%s)",C_file_name); update_terminal; @@ -1008,22 +1006,22 @@ rename(check_file_name,output_file_name); } if(check_for_change) strcpy(check_file_name,""); -#line 574 "cwebdir/ctangle.w" +#line 570 "cwebdir/ctangle.w" /*:50*/ -#line 543 "cwebdir/ctangle.w" +#line 539 "cwebdir/ctangle.w" if(show_happiness){ if(show_progress)new_line; #line 115 "cwebdir/ctang-w2c.ch" fputs(_("Done."),stdout); -#line 547 "cwebdir/ctangle.w" +#line 543 "cwebdir/ctangle.w" } } } /*:48*//*54:*/ -#line 595 "cwebdir/ctangle.w" +#line 591 "cwebdir/ctangle.w" static void output_defs(void) @@ -1050,7 +1048,7 @@ cur_val= (int)a;out_char(identifier); } #line 172 "cwebdir/ctang-w2c.ch" else if(a<050000)confusion(_("macro defs have strange char")); -#line 620 "cwebdir/ctangle.w" +#line 616 "cwebdir/ctangle.w" else{ cur_val= (int)a-050000;cur_section= (sixteen_bits)cur_val; out_char(section_number); @@ -1065,7 +1063,7 @@ pop_level(false); } /*:54*//*55:*/ -#line 638 "cwebdir/ctangle.w" +#line 634 "cwebdir/ctangle.w" static void out_char( @@ -1080,7 +1078,7 @@ flush_buffer();if(out_state!=verbatim)out_state= normal;break; /*59:*/ #line 204 "cwebdir/ctang-w2c.ch" -#line 707 "cwebdir/ctangle.w" +#line 703 "cwebdir/ctangle.w" case identifier: if(out_state==num_or_id)C_putc(' '); for(j= (cur_val+name_dir)->byte_start,k= (cur_val+name_dir+1)->byte_start; @@ -1096,14 +1094,14 @@ else if((eight_bits)(*j)>=0300)j+= 1; C_printf("%s",translit[(eight_bits)(*j)-0200]); } else C_putc(*j); -#line 714 "cwebdir/ctangle.w" +#line 710 "cwebdir/ctangle.w" out_state= num_or_id;break; /*:59*/ -#line 649 "cwebdir/ctangle.w" +#line 645 "cwebdir/ctangle.w" /*60:*/ -#line 716 "cwebdir/ctangle.w" +#line 712 "cwebdir/ctangle.w" case section_number: if(cur_val> 0)C_printf("/*%d:*/",cur_val); @@ -1130,10 +1128,10 @@ C_putc('"');C_putc('\n'); break; /*:60*/ -#line 650 "cwebdir/ctangle.w" +#line 646 "cwebdir/ctangle.w" /*56:*/ -#line 668 "cwebdir/ctangle.w" +#line 664 "cwebdir/ctangle.w" case plus_plus:C_putc('+');C_putc('+');out_state= normal;break; case minus_minus:C_putc('-');C_putc('-');out_state= normal;break; @@ -1154,7 +1152,7 @@ case minus_gt_ast:C_putc('-');C_putc('>');C_putc('*');out_state= normal; break; /*:56*/ -#line 651 "cwebdir/ctangle.w" +#line 647 "cwebdir/ctangle.w" case'=':case'>':C_putc(cur_char);C_putc(' '); out_state= normal;break; @@ -1173,7 +1171,7 @@ default:C_putc(cur_char);out_state= normal;break; } /*:55*//*64:*/ -#line 797 "cwebdir/ctangle.w" +#line 793 "cwebdir/ctangle.w" static eight_bits skip_ahead(void) @@ -1191,7 +1189,7 @@ if(c!=ignore||*(loc-1)=='>')return c; } /*:64*//*67:*/ -#line 836 "cwebdir/ctangle.w" +#line 832 "cwebdir/ctangle.w" static boolean skip_comment( boolean is_long_comment) @@ -1204,7 +1202,7 @@ if(get_line())return comment_continues= true; else{ #line 227 "cwebdir/ctang-w2c.ch" err_print(_("! Input ended in mid-comment")); -#line 847 "cwebdir/ctangle.w" +#line 843 "cwebdir/ctangle.w" return comment_continues= false; } @@ -1219,7 +1217,7 @@ if(c=='@'){ if(ccode[(eight_bits)*loc]==new_section){ #line 233 "cwebdir/ctang-w2c.ch" err_print(_("! Section name ended in mid-comment"));loc--; -#line 860 "cwebdir/ctangle.w" +#line 856 "cwebdir/ctangle.w" return comment_continues= false; } @@ -1229,7 +1227,7 @@ else loc++; } /*:67*//*69:*/ -#line 877 "cwebdir/ctangle.w" +#line 873 "cwebdir/ctangle.w" static eight_bits get_next(void) @@ -1243,7 +1241,7 @@ if(get_line()==false)return new_section; else if(print_where&&!no_where){ print_where= false; /*85:*/ -#line 1223 "cwebdir/ctangle.w" +#line 1219 "cwebdir/ctangle.w" { eight_bits a; @@ -1260,7 +1258,7 @@ store_id(a); } /*:85*/ -#line 889 "cwebdir/ctangle.w" +#line 885 "cwebdir/ctangle.w" } else return(eight_bits)'\n'; @@ -1273,7 +1271,7 @@ else continue; } loc++; if(xisdigit(c)||c=='.')/*73:*/ -#line 961 "cwebdir/ctangle.w" +#line 957 "cwebdir/ctangle.w" { boolean hex_flag= false; id_first= loc-1; @@ -1307,13 +1305,13 @@ return constant; } /*:73*/ -#line 900 "cwebdir/ctangle.w" +#line 896 "cwebdir/ctangle.w" else if(c=='\''||c=='"' ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"')) ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"'))) /*74:*/ -#line 998 "cwebdir/ctangle.w" +#line 994 "cwebdir/ctangle.w" { char delim= (char)c; id_first= section_text+1; @@ -1327,13 +1325,13 @@ if(loc>=limit){ if(*(limit-1)!='\\'){ #line 239 "cwebdir/ctang-w2c.ch" err_print(_("! String didn't end"));loc= limit;break; -#line 1010 "cwebdir/ctangle.w" +#line 1006 "cwebdir/ctangle.w" } if(get_line()==false){ #line 245 "cwebdir/ctang-w2c.ch" err_print(_("! Input ended in middle of string"));loc= buffer;break; -#line 1014 "cwebdir/ctangle.w" +#line 1010 "cwebdir/ctangle.w" } else if(++id_loc<=section_text_end)*id_loc= '\n'; @@ -1353,7 +1351,7 @@ if(++id_loc<=section_text_end)*id_loc= (char)c; if(id_loc>=section_text_end){ #line 251 "cwebdir/ctang-w2c.ch" fputs(_("\n! String too long: "),stdout); -#line 1032 "cwebdir/ctangle.w" +#line 1028 "cwebdir/ctangle.w" term_write(section_text+1,25); err_print("..."); @@ -1363,11 +1361,11 @@ return string; } /*:74*/ -#line 904 "cwebdir/ctangle.w" +#line 900 "cwebdir/ctangle.w" else if(isalpha((int)c)||isxalpha(c)||ishigh(c)) /*72:*/ -#line 952 "cwebdir/ctangle.w" +#line 948 "cwebdir/ctangle.w" { id_first= --loc; do @@ -1378,45 +1376,45 @@ id_loc= loc;return identifier; } /*:72*/ -#line 906 "cwebdir/ctangle.w" +#line 902 "cwebdir/ctangle.w" else if(c=='@')/*75:*/ -#line 1043 "cwebdir/ctangle.w" +#line 1039 "cwebdir/ctangle.w" switch(c= ccode[(eight_bits)*loc++]){ case ignore:continue; #line 257 "cwebdir/ctang-w2c.ch" case translit_code:err_print(_("! Use @l in limbo only"));continue; -#line 1047 "cwebdir/ctangle.w" +#line 1043 "cwebdir/ctangle.w" case control_text:while((c= skip_ahead())=='@'); if(*(loc-1)!='>') #line 263 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in control text")); -#line 1052 "cwebdir/ctangle.w" +#line 1048 "cwebdir/ctangle.w" continue; case section_name: cur_section_name_char= *(loc-1); /*77:*/ -#line 1088 "cwebdir/ctangle.w" +#line 1084 "cwebdir/ctangle.w" { char*k= section_text; /*79:*/ -#line 1110 "cwebdir/ctangle.w" +#line 1106 "cwebdir/ctangle.w" while(true){ if(loc> limit&&get_line()==false){ #line 281 "cwebdir/ctang-w2c.ch" err_print(_("! Input ended in section name")); -#line 1114 "cwebdir/ctangle.w" +#line 1110 "cwebdir/ctangle.w" loc= buffer+1;break; } c= (eight_bits)*loc; /*80:*/ -#line 1133 "cwebdir/ctangle.w" +#line 1129 "cwebdir/ctangle.w" if(c=='@'){ c= (eight_bits)*(loc+1); @@ -1426,20 +1424,20 @@ loc+= 2;break; if(ccode[(eight_bits)c]==new_section){ #line 293 "cwebdir/ctang-w2c.ch" err_print(_("! Section name didn't end"));break; -#line 1141 "cwebdir/ctangle.w" +#line 1137 "cwebdir/ctangle.w" } if(ccode[(eight_bits)c]==section_name){ #line 299 "cwebdir/ctang-w2c.ch" err_print(_("! Nesting of section names not allowed"));break; -#line 1145 "cwebdir/ctangle.w" +#line 1141 "cwebdir/ctangle.w" } *(++k)= '@';loc++; } /*:80*/ -#line 1118 "cwebdir/ctangle.w" +#line 1114 "cwebdir/ctangle.w" loc++;if(k=section_text_end){ #line 287 "cwebdir/ctang-w2c.ch" fputs(_("\n! Section name too long: "),stdout); -#line 1127 "cwebdir/ctangle.w" +#line 1123 "cwebdir/ctangle.w" term_write(section_text+1,25); printf("...");mark_harmless; @@ -1458,7 +1456,7 @@ printf("...");mark_harmless; if(*k==' '&&k> section_text)k--; /*:79*/ -#line 1090 "cwebdir/ctangle.w" +#line 1086 "cwebdir/ctangle.w" if(k-section_text> 3&&strncmp(k-2,"...",3)==0) cur_section_name= section_lookup(section_text+1,k-3,true); @@ -1467,7 +1465,7 @@ else cur_section_name= section_lookup(section_text+1,k,false); if(cur_section_name_char=='(') /*47:*/ -#line 498 "cwebdir/ctangle.w" +#line 494 "cwebdir/ctangle.w" { for(an_output_file= cur_out_file; @@ -1478,36 +1476,36 @@ if(cur_out_file> output_files) *--cur_out_file= cur_section_name; #line 91 "cwebdir/ctang-w2c.ch" else overflow(_("output files")); -#line 507 "cwebdir/ctangle.w" +#line 503 "cwebdir/ctangle.w" } } /*:47*/ -#line 1098 "cwebdir/ctangle.w" +#line 1094 "cwebdir/ctangle.w" return section_name; } /*:77*/ -#line 1056 "cwebdir/ctangle.w" +#line 1052 "cwebdir/ctangle.w" case string:/*81:*/ -#line 1155 "cwebdir/ctangle.w" +#line 1151 "cwebdir/ctangle.w" id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; while(*loc!='@'||*(loc+1)!='>')loc++; #line 305 "cwebdir/ctang-w2c.ch" if(loc>=limit)err_print(_("! Verbatim string didn't end")); -#line 1159 "cwebdir/ctangle.w" +#line 1155 "cwebdir/ctangle.w" id_loc= loc;loc+= 2; return string; /*:81*/ -#line 1057 "cwebdir/ctangle.w" +#line 1053 "cwebdir/ctangle.w" case ord:/*76:*/ -#line 1068 "cwebdir/ctangle.w" +#line 1064 "cwebdir/ctangle.w" id_first= loc; if(*loc=='\\') @@ -1517,7 +1515,7 @@ if(*loc=='@'){ if(*(loc+1)!='@') #line 269 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in ASCII constant")); -#line 1076 "cwebdir/ctangle.w" +#line 1072 "cwebdir/ctangle.w" else loc++; } @@ -1525,7 +1523,7 @@ loc++; if(loc> limit){ #line 275 "cwebdir/ctang-w2c.ch" err_print(_("! String didn't end"));loc= limit-1;break; -#line 1082 "cwebdir/ctangle.w" +#line 1078 "cwebdir/ctangle.w" } } @@ -1533,13 +1531,13 @@ loc++; return ord; /*:76*/ -#line 1058 "cwebdir/ctangle.w" +#line 1054 "cwebdir/ctangle.w" default:return c; } /*:75*/ -#line 907 "cwebdir/ctangle.w" +#line 903 "cwebdir/ctangle.w" else if(xisspace(c)){ if(!preprocessing||loc> limit)continue; @@ -1549,7 +1547,7 @@ else return(eight_bits)' '; } else if(c=='#'&&loc==buffer+1)preprocessing= true; mistake:/*71:*/ -#line 929 "cwebdir/ctangle.w" +#line 925 "cwebdir/ctangle.w" switch(c){ case'+':if(*loc=='+')compress(plus_plus);break; @@ -1574,14 +1572,14 @@ case'!':if(*loc=='=')compress(non_eq);break; } /*:71*/ -#line 915 "cwebdir/ctangle.w" +#line 911 "cwebdir/ctangle.w" return c; } } /*:69*//*83:*/ -#line 1191 "cwebdir/ctangle.w" +#line 1187 "cwebdir/ctangle.w" static void scan_repl( @@ -1589,7 +1587,7 @@ eight_bits t) { sixteen_bits a; if(t==section_name)/*85:*/ -#line 1223 "cwebdir/ctangle.w" +#line 1219 "cwebdir/ctangle.w" { eight_bits a; @@ -1606,11 +1604,11 @@ store_id(a); } /*:85*/ -#line 1197 "cwebdir/ctangle.w" +#line 1193 "cwebdir/ctangle.w" while(true)switch(a= get_next()){ /*86:*/ -#line 1238 "cwebdir/ctangle.w" +#line 1234 "cwebdir/ctangle.w" case identifier:store_id(a); if(*buffer=='#'&&( @@ -1623,7 +1621,7 @@ break; case section_name:if(t!=section_name)goto done; else{ /*87:*/ -#line 1279 "cwebdir/ctangle.w" +#line 1275 "cwebdir/ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loc text_info_end)overflow(_("text")); -#line 1210 "cwebdir/ctangle.w" +#line 1206 "cwebdir/ctangle.w" cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } /*:83*//*90:*/ -#line 1372 "cwebdir/ctangle.w" +#line 1368 "cwebdir/ctangle.w" static void scan_section(void) @@ -1816,7 +1814,7 @@ printf("*%d",(int)section_count);update_terminal; next_control= ignore; while(true){ /*92:*/ -#line 1413 "cwebdir/ctangle.w" +#line 1409 "cwebdir/ctangle.w" while(next_controltext_link= macro; /*:93*/ -#line 1388 "cwebdir/ctangle.w" +#line 1384 "cwebdir/ctangle.w" continue; } @@ -1857,14 +1855,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1442 "cwebdir/ctangle.w" +#line 1438 "cwebdir/ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1396 "cwebdir/ctangle.w" +#line 1392 "cwebdir/ctangle.w" break; } @@ -1872,20 +1870,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1447 "cwebdir/ctangle.w" +#line 1443 "cwebdir/ctangle.w" /*96:*/ -#line 1452 "cwebdir/ctangle.w" +#line 1448 "cwebdir/ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1448 "cwebdir/ctangle.w" +#line 1444 "cwebdir/ctangle.w" scan_repl(section_name); /*97:*/ -#line 1456 "cwebdir/ctangle.w" +#line 1452 "cwebdir/ctangle.w" if(p==name_dir||p==NULL){ last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1902,16 +1900,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1450 "cwebdir/ctangle.w" +#line 1446 "cwebdir/ctangle.w" /*:95*/ -#line 1402 "cwebdir/ctangle.w" +#line 1398 "cwebdir/ctangle.w" } /*:90*//*98:*/ -#line 1471 "cwebdir/ctangle.w" +#line 1467 "cwebdir/ctangle.w" static void phase_one(void){ @@ -1924,7 +1922,7 @@ check_complete(); } /*:98*//*100:*/ -#line 1487 "cwebdir/ctangle.w" +#line 1483 "cwebdir/ctangle.w" static void skip_limbo(void) @@ -1938,7 +1936,7 @@ char c= *loc++; switch(ccode[(eight_bits)c]){ case new_section:return; case translit_code:/*102:*/ -#line 1517 "cwebdir/ctangle.w" +#line 1513 "cwebdir/ctangle.w" while(xisspace(*loc)&&loc limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2)) ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1))) #line 379 "cwebdir/ctang-w2c.ch" err_print(_("! Improper hex number following @l")); -#line 1523 "cwebdir/ctangle.w" +#line 1519 "cwebdir/ctangle.w" else{ unsigned int i; @@ -1958,7 +1956,7 @@ while(loc=translit_length) #line 385 "cwebdir/ctang-w2c.ch" err_print(_("! Replacement string in @l too long")); -#line 1533 "cwebdir/ctangle.w" +#line 1529 "cwebdir/ctangle.w" else{ strncpy(translit[i-0200],beg,(size_t)(loc-beg)); @@ -1967,7 +1965,7 @@ translit[i-0200][loc-beg]= '\0'; } /*:102*/ -#line 1499 "cwebdir/ctangle.w" +#line 1495 "cwebdir/ctangle.w" break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1975,13 +1973,13 @@ while((c= (char)skip_ahead())=='@'); if(*(loc-1)!='>') #line 365 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in control text")); -#line 1505 "cwebdir/ctangle.w" +#line 1501 "cwebdir/ctangle.w" break; #line 372 "cwebdir/ctang-w2c.ch" }/* otherwise fall through */ default:err_print(_("! Double @ should be used in limbo")); -#line 1509 "cwebdir/ctangle.w" +#line 1505 "cwebdir/ctangle.w" } } @@ -1989,7 +1987,7 @@ default:err_print(_("! Double @ should be used in limbo")); } /*:100*//*103:*/ -#line 1543 "cwebdir/ctangle.w" +#line 1539 "cwebdir/ctangle.w" void print_stats(void){ @@ -2002,7 +2000,7 @@ printf(_("%td replacement texts (out of %ld)\n"), printf(_("%td bytes (out of %ld)\n"), (ptrdiff_t)(byte_ptr-byte_mem),(long)max_bytes); printf(_("%td tokens (out of %ld)\n"), -#line 1554 "cwebdir/ctangle.w" +#line 1550 "cwebdir/ctangle.w" (ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks); } diff --git a/texk/web2c/cwebboot.cin b/texk/web2c/cwebboot.cin index 30e0e2f86c..b2a91e38f4 100644 --- a/texk/web2c/cwebboot.cin +++ b/texk/web2c/cwebboot.cin @@ -26,20 +26,20 @@ #line 78 "cwebdir/comm-w2c.h" /*:4*//*91:*/ -#line 733 "cwebdir/comm-w2c.ch" +#line 739 "cwebdir/comm-w2c.ch" #if HAVE_GETTEXT #include #else -#line 737 "cwebdir/comm-w2c.ch" +#line 743 "cwebdir/comm-w2c.ch" #define setlocale(a,b) "" #define bindtextdomain(a,b) "" #define textdomain(a) "" #endif -#line 741 "cwebdir/comm-w2c.ch" +#line 747 "cwebdir/comm-w2c.ch" /*:91*//*93:*/ -#line 780 "cwebdir/comm-w2c.ch" +#line 786 "cwebdir/comm-w2c.ch" #include @@ -47,7 +47,7 @@ #include /*:93*//*96:*/ -#line 817 "cwebdir/comm-w2c.ch" +#line 823 "cwebdir/comm-w2c.ch" #define CWEB #include "help.h" @@ -100,7 +100,8 @@ #define llink link #define rlink dummy.Rlink #define root name_dir->rlink \ - \ + +#define ilk dummy.Ilk \ #define spotless 0 #define harmless_message 1 @@ -230,7 +231,7 @@ extern boolean change_pending; extern boolean print_where; /*:9*//*10:*/ -#line 170 "cwebdir/comm-w2c.h" +#line 171 "cwebdir/comm-w2c.h" typedef struct name_info{ char*byte_start; @@ -369,52 +370,52 @@ hash_pointer hash_end= hash+hash_size-1; hash_pointer h; /*:46*//*65:*/ -#line 1003 "cwebdir/common.w" +#line 1004 "cwebdir/common.w" int history= spotless; /*:65*//*73:*/ -#line 1126 "cwebdir/common.w" +#line 1127 "cwebdir/common.w" int argc; char**argv; char C_file_name[max_file_name_length]; char tex_file_name[max_file_name_length]; char idx_file_name[max_file_name_length]; -#line 448 "cwebdir/comm-w2c.ch" +#line 454 "cwebdir/comm-w2c.ch" char scn_file_name[max_file_name_length]; char check_file_name[max_file_name_length]; -#line 1133 "cwebdir/common.w" +#line 1134 "cwebdir/common.w" boolean flags[128]; /*:73*//*83:*/ -#line 1267 "cwebdir/common.w" +#line 1268 "cwebdir/common.w" FILE*C_file; FILE*tex_file; FILE*idx_file; FILE*scn_file; -#line 578 "cwebdir/comm-w2c.ch" +#line 584 "cwebdir/comm-w2c.ch" FILE*active_file; FILE*check_file; -#line 1273 "cwebdir/common.w" +#line 1274 "cwebdir/common.w" -#line 595 "cwebdir/comm-w2c.ch" +#line 601 "cwebdir/comm-w2c.ch" /*:83*//*86:*/ -#line 623 "cwebdir/comm-w2c.ch" +#line 629 "cwebdir/comm-w2c.ch" const char*use_language= ""; /*:86*//*87:*/ -#line 636 "cwebdir/comm-w2c.ch" +#line 642 "cwebdir/comm-w2c.ch" char cb_banner[max_banner]; string texmf_locale; #ifndef SEPARATORS #define SEPARATORS "://" #endif -#line 642 "cwebdir/comm-w2c.ch" +#line 648 "cwebdir/comm-w2c.ch" char separators[]= SEPARATORS; /*:87*/ @@ -436,7 +437,7 @@ extern void check_complete(void); extern void reset_input(void); /*:8*//*11:*/ -#line 193 "cwebdir/comm-w2c.h" +#line 194 "cwebdir/comm-w2c.h" extern name_pointer id_lookup(const char*,const char*,eight_bits); @@ -448,7 +449,6 @@ extern void sprint_section_name(char*,name_pointer); extern boolean names_match(name_pointer,const char*,size_t,eight_bits); extern void init_node(name_pointer); -extern void init_p(name_pointer,eight_bits); /*:11*//*13:*/ #line 219 "cwebdir/comm-w2c.h" @@ -471,23 +471,23 @@ static void prime_the_change_buffer(void); static void check_change(void); /*:33*//*55:*/ -#line 764 "cwebdir/common.w" +#line 765 "cwebdir/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 991 "cwebdir/common.w" +#line 992 "cwebdir/common.w" static int section_name_cmp(char**,size_t,name_pointer); /*:64*//*76:*/ -#line 1186 "cwebdir/common.w" +#line 1187 "cwebdir/common.w" static void scan_args(void); -#line 508 "cwebdir/comm-w2c.ch" +#line 514 "cwebdir/comm-w2c.ch" /*:76*//*98:*/ -#line 830 "cwebdir/comm-w2c.ch" +#line 836 "cwebdir/comm-w2c.ch" static void cb_usage(const_string str); static void cb_usagehelp(const_string*message); @@ -520,7 +520,7 @@ for(h= hash;h<=hash_end;*h++= NULL); #line 78 "cwebdir/comm-w2c.ch" /*94:*/ -#line 792 "cwebdir/comm-w2c.ch" +#line 798 "cwebdir/comm-w2c.ch" kpse_set_program_name(argv[0],"cweb"); @@ -529,7 +529,7 @@ kpse_set_program_name(argv[0],"cweb"); #line 85 "cwebdir/comm-w2c.ch" /*92:*/ -#line 742 "cwebdir/comm-w2c.ch" +#line 748 "cwebdir/comm-w2c.ch" setlocale(LC_MESSAGES,setlocale(LC_CTYPE,"")); texmf_locale= kpse_var_expand("${TEXMFLOCALEDIR}"); @@ -548,23 +548,23 @@ textdomain("cweb"); #line 85 "cwebdir/comm-w2c.ch" /*74:*/ -#line 1139 "cwebdir/common.w" +#line 1140 "cwebdir/common.w" -#line 455 "cwebdir/comm-w2c.ch" +#line 461 "cwebdir/comm-w2c.ch" make_xrefs= true; -#line 1141 "cwebdir/common.w" +#line 1142 "cwebdir/common.w" /*:74*/ #line 86 "cwebdir/comm-w2c.ch" #line 101 "cwebdir/common.w" /*84:*/ -#line 595 "cwebdir/comm-w2c.ch" +#line 601 "cwebdir/comm-w2c.ch" scan_args(); if(program==ctangle){ if(check_for_change)/*88:*/ -#line 653 "cwebdir/comm-w2c.ch" +#line 659 "cwebdir/comm-w2c.ch" { if((C_file= fopen(C_file_name,"a"))==NULL) fatal(_("! Cannot open output file "),C_file_name); @@ -581,7 +581,7 @@ fatal(_("! Cannot open output file "),check_file_name); } /*:88*/ -#line 598 "cwebdir/comm-w2c.ch" +#line 604 "cwebdir/comm-w2c.ch" else if((C_file= fopen(C_file_name,"wb"))==NULL) fatal(_("! Cannot open output file "),C_file_name); @@ -589,7 +589,7 @@ fatal(_("! Cannot open output file "),C_file_name); } else{ if(check_for_change)/*89:*/ -#line 668 "cwebdir/comm-w2c.ch" +#line 674 "cwebdir/comm-w2c.ch" { if((tex_file= fopen(tex_file_name,"a"))==NULL) fatal(_("! Cannot open output file "),tex_file_name); @@ -606,14 +606,14 @@ fatal(_("! Cannot open output file "),check_file_name); } /*:89*/ -#line 604 "cwebdir/comm-w2c.ch" +#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 1285 "cwebdir/common.w" +#line 1286 "cwebdir/common.w" -#line 613 "cwebdir/comm-w2c.ch" +#line 619 "cwebdir/comm-w2c.ch" /*:84*/ #line 101 "cwebdir/common.w" @@ -1013,15 +1013,19 @@ p->link= hash[h];hash[h]= p; #line 647 "cwebdir/common.w" if(p==name_ptr)/*51:*/ -#line 676 "cwebdir/common.w" +#line 675 "cwebdir/common.w" { #line 300 "cwebdir/comm-w2c.ch" if(byte_ptr+l> byte_mem_end)overflow(_("byte memory")); if(name_ptr>=name_dir_end)overflow(_("name")); -#line 679 "cwebdir/common.w" +#line 678 "cwebdir/common.w" strncpy(byte_ptr,first,l); (++name_ptr)->byte_start= byte_ptr+= l; -init_p(p,t); +#line 307 "cwebdir/comm-w2c.ch" +if(program!=ctangle){ +#line 681 "cwebdir/common.w" +p->ilk= t;init_node(p); +} } /*:51*/ @@ -1031,7 +1035,7 @@ return p; } /*:48*//*52:*/ -#line 708 "cwebdir/common.w" +#line 709 "cwebdir/common.w" void print_section_name( @@ -1050,7 +1054,7 @@ if(q)term_write("...",3); } /*:52*//*53:*/ -#line 725 "cwebdir/common.w" +#line 726 "cwebdir/common.w" void sprint_section_name( @@ -1070,7 +1074,7 @@ s= p->byte_start; } /*:53*//*54:*/ -#line 743 "cwebdir/common.w" +#line 744 "cwebdir/common.w" void print_prefix_name( @@ -1083,7 +1087,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); } /*:54*//*56:*/ -#line 769 "cwebdir/common.w" +#line 770 "cwebdir/common.w" static int web_strcmp( char*j, @@ -1101,7 +1105,7 @@ else return greater; } /*:56*//*57:*/ -#line 798 "cwebdir/common.w" +#line 799 "cwebdir/common.w" static name_pointer add_section_name( @@ -1114,10 +1118,10 @@ boolean ispref) name_pointer p= name_ptr; char*s= first_chunk(p); size_t name_len= (size_t)(last-first+(int)ispref); -#line 308 "cwebdir/comm-w2c.ch" +#line 314 "cwebdir/comm-w2c.ch" if(s+name_len> byte_mem_end)overflow(_("byte memory")); if(name_ptr+1>=name_dir_end)overflow(_("name")); -#line 812 "cwebdir/common.w" +#line 813 "cwebdir/common.w" (++name_ptr)->byte_start= byte_ptr= s+name_len; if(ispref){ *(byte_ptr-1)= ' '; @@ -1133,7 +1137,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); } /*:57*//*58:*/ -#line 826 "cwebdir/common.w" +#line 827 "cwebdir/common.w" static void extend_section_name( @@ -1145,23 +1149,23 @@ boolean ispref) char*s; name_pointer q= p+1; size_t name_len= (size_t)(last-first+(int)ispref); -#line 315 "cwebdir/comm-w2c.ch" +#line 321 "cwebdir/comm-w2c.ch" if(name_ptr>=name_dir_end)overflow(_("name")); -#line 838 "cwebdir/common.w" +#line 839 "cwebdir/common.w" while(q->link!=name_dir)q= q->link; q->link= name_ptr; s= name_ptr->byte_start; name_ptr->link= name_dir; -#line 321 "cwebdir/comm-w2c.ch" +#line 327 "cwebdir/comm-w2c.ch" if(s+name_len> byte_mem_end)overflow(_("byte memory")); -#line 843 "cwebdir/common.w" +#line 844 "cwebdir/common.w" (++name_ptr)->byte_start= byte_ptr= s+name_len; strncpy(s,first,name_len); if(ispref)*(byte_ptr-1)= ' '; } /*:58*//*59:*/ -#line 854 "cwebdir/common.w" +#line 855 "cwebdir/common.w" name_pointer section_lookup( @@ -1176,7 +1180,7 @@ name_pointer par= NULL; size_t name_len= (size_t)(last-first+1); /*60:*/ -#line 878 "cwebdir/common.w" +#line 879 "cwebdir/common.w" while(p){ c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p)); @@ -1186,14 +1190,14 @@ par= p; p= (c==less?p->llink:p->rlink); }else{ if(r!=NULL){ -#line 327 "cwebdir/comm-w2c.ch" +#line 333 "cwebdir/comm-w2c.ch" fputs(_("\n! Ambiguous prefix: matches <"),stdout); -#line 888 "cwebdir/common.w" +#line 889 "cwebdir/common.w" print_prefix_name(p); -#line 333 "cwebdir/comm-w2c.ch" +#line 339 "cwebdir/comm-w2c.ch" fputs(_(">\n and <"),stdout); -#line 891 "cwebdir/common.w" +#line 892 "cwebdir/common.w" print_prefix_name(r); err_print(">"); return name_dir; @@ -1207,27 +1211,27 @@ p= q,q= NULL; } /*:60*/ -#line 868 "cwebdir/common.w" +#line 869 "cwebdir/common.w" /*61:*/ -#line 903 "cwebdir/common.w" +#line 904 "cwebdir/common.w" if(r==NULL) return add_section_name(par,c,first,last+1,ispref); /*:61*/ -#line 869 "cwebdir/common.w" +#line 870 "cwebdir/common.w" /*62:*/ -#line 911 "cwebdir/common.w" +#line 912 "cwebdir/common.w" switch(section_name_cmp(&first,name_len,r)){ case prefix: if(!ispref){ -#line 339 "cwebdir/comm-w2c.ch" +#line 345 "cwebdir/comm-w2c.ch" fputs(_("\n! New name is a prefix of <"),stdout); -#line 917 "cwebdir/common.w" +#line 918 "cwebdir/common.w" print_section_name(r); err_print(">"); @@ -1239,34 +1243,34 @@ case extension:if(!ispref||first<=last) extend_section_name(r,first,last+1,ispref); break; case bad_extension: -#line 345 "cwebdir/comm-w2c.ch" +#line 351 "cwebdir/comm-w2c.ch" fputs(_("\n! New name extends <"),stdout); -#line 929 "cwebdir/common.w" +#line 930 "cwebdir/common.w" print_section_name(r); err_print(">"); break; default: -#line 351 "cwebdir/comm-w2c.ch" +#line 357 "cwebdir/comm-w2c.ch" fputs(_("\n! Section name incompatible with <"),stdout); -#line 935 "cwebdir/common.w" +#line 936 "cwebdir/common.w" print_prefix_name(r); -#line 357 "cwebdir/comm-w2c.ch" +#line 363 "cwebdir/comm-w2c.ch" fputs(_(">,\n which abbreviates <"),stdout); -#line 938 "cwebdir/common.w" +#line 939 "cwebdir/common.w" print_section_name(r); err_print(">"); } return r; /*:62*/ -#line 870 "cwebdir/common.w" +#line 871 "cwebdir/common.w" } /*:59*//*63:*/ -#line 959 "cwebdir/common.w" +#line 960 "cwebdir/common.w" static int section_name_cmp( char**pfirst, @@ -1300,7 +1304,7 @@ default:return c; } /*:63*//*66:*/ -#line 1013 "cwebdir/common.w" +#line 1014 "cwebdir/common.w" void err_print( @@ -1308,15 +1312,15 @@ const char*s) { *s=='!'?printf("\n%s",s):printf("%s",s); if(web_file_open)/*67:*/ -#line 1032 "cwebdir/common.w" +#line 1033 "cwebdir/common.w" {char*k,*l; if(changing&&include_depth==change_depth) -#line 365 "cwebdir/comm-w2c.ch" +#line 371 "cwebdir/comm-w2c.ch" printf(_(". (l. %d of change file)\n"),change_line); else if(include_depth==0)printf(_(". (l. %d)\n"),cur_line); else printf(_(". (l. %d of include file %s)\n"),cur_line,cur_file_name); -#line 1038 "cwebdir/common.w" +#line 1039 "cwebdir/common.w" l= (loc>=limit?limit:loc); if(l> buffer){ for(k= buffer;k 0){ if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/ -#line 1245 "cwebdir/common.w" +#line 1246 "cwebdir/common.w" -#line 521 "cwebdir/comm-w2c.ch" +#line 527 "cwebdir/comm-w2c.ch" { if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0) /*97:*/ -#line 821 "cwebdir/comm-w2c.ch" +#line 827 "cwebdir/comm-w2c.ch" cb_usagehelp(program==ctangle?CTANGLEHELP: program==cweave?CWEAVEHELP:CTWILLHELP); /*:97*/ -#line 524 "cwebdir/comm-w2c.ch" +#line 530 "cwebdir/comm-w2c.ch" if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0) /*100:*/ -#line 867 "cwebdir/comm-w2c.ch" +#line 873 "cwebdir/comm-w2c.ch" printversionandexit(cb_banner, program==ctwill?"Donald E. Knuth":"Silvio Levy and Donald E. Knuth", @@ -1462,7 +1466,7 @@ NULL,"Contemporary development on https://github.com/ascherer/cweb.\n"); /*:100*/ -#line 527 "cwebdir/comm-w2c.ch" +#line 533 "cwebdir/comm-w2c.ch" if(strcmp("-verbose",*argv)==0||strcmp("--verbose",*argv)==0) @@ -1476,15 +1480,15 @@ 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)/*81:*/ -#line 564 "cwebdir/comm-w2c.ch" +#line 570 "cwebdir/comm-w2c.ch" cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1260 "cwebdir/common.w" +#line 1261 "cwebdir/common.w" -#line 572 "cwebdir/comm-w2c.ch" +#line 578 "cwebdir/comm-w2c.ch" /*:81*/ -#line 539 "cwebdir/comm-w2c.ch" +#line 545 "cwebdir/comm-w2c.ch" while(isdigit(*dot_pos))dot_pos++; dot_pos--; @@ -1495,35 +1499,35 @@ default:flags[(eight_bits)*dot_pos]= flag_change;continue; break; } } -#line 1248 "cwebdir/common.w" +#line 1249 "cwebdir/common.w" -#line 564 "cwebdir/comm-w2c.ch" +#line 570 "cwebdir/comm-w2c.ch" /*:80*/ -#line 1169 "cwebdir/common.w" +#line 1170 "cwebdir/common.w" else{ s= name_pos= *argv;dot_pos= NULL; -#line 495 "cwebdir/comm-w2c.ch" +#line 501 "cwebdir/comm-w2c.ch" while(*s) if(*s=='.')dot_pos= s++; else if(*s==DIR_SEPARATOR||*s==DEVICE_SEPARATOR||*s=='/') dot_pos= NULL,name_pos= ++s; else s++; -#line 1176 "cwebdir/common.w" +#line 1177 "cwebdir/common.w" if(!found_web)/*77:*/ -#line 1195 "cwebdir/common.w" +#line 1196 "cwebdir/common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 572 "cwebdir/comm-w2c.ch" +#line 578 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1262 "cwebdir/common.w" +#line 1263 "cwebdir/common.w" /*:82*/ -#line 1198 "cwebdir/common.w" +#line 1199 "cwebdir/common.w" if(dot_pos==NULL) sprintf(web_file_name,"%s.w",*argv); @@ -1531,7 +1535,7 @@ else{ strcpy(web_file_name,*argv); *dot_pos= '\0'; } -#line 1206 "cwebdir/common.w" +#line 1207 "cwebdir/common.w" sprintf(tex_file_name,"%s.tex",name_pos); sprintf(idx_file_name,"%s.idx",name_pos); sprintf(scn_file_name,"%s.scn",name_pos); @@ -1540,22 +1544,22 @@ found_web= true; } /*:77*/ -#line 1177 "cwebdir/common.w" +#line 1178 "cwebdir/common.w" else if(!found_change)/*78:*/ -#line 1213 "cwebdir/common.w" +#line 1214 "cwebdir/common.w" { if(strcmp(*argv,"-")!=0){ if(s-*argv> max_file_name_length-4) /*82:*/ -#line 572 "cwebdir/comm-w2c.ch" +#line 578 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1262 "cwebdir/common.w" +#line 1263 "cwebdir/common.w" /*:82*/ -#line 1217 "cwebdir/common.w" +#line 1218 "cwebdir/common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1565,21 +1569,21 @@ found_change= true; } /*:78*/ -#line 1178 "cwebdir/common.w" +#line 1179 "cwebdir/common.w" else if(!found_out)/*79:*/ -#line 1225 "cwebdir/common.w" +#line 1226 "cwebdir/common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 572 "cwebdir/comm-w2c.ch" +#line 578 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1262 "cwebdir/common.w" +#line 1263 "cwebdir/common.w" /*:82*/ -#line 1228 "cwebdir/common.w" +#line 1229 "cwebdir/common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1597,36 +1601,36 @@ found_out= true; } /*:79*/ -#line 1179 "cwebdir/common.w" +#line 1180 "cwebdir/common.w" else/*81:*/ -#line 564 "cwebdir/comm-w2c.ch" +#line 570 "cwebdir/comm-w2c.ch" cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1260 "cwebdir/common.w" +#line 1261 "cwebdir/common.w" -#line 572 "cwebdir/comm-w2c.ch" +#line 578 "cwebdir/comm-w2c.ch" /*:81*/ -#line 1180 "cwebdir/common.w" +#line 1181 "cwebdir/common.w" } } if(!found_web)/*81:*/ -#line 564 "cwebdir/comm-w2c.ch" +#line 570 "cwebdir/comm-w2c.ch" cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1260 "cwebdir/common.w" +#line 1261 "cwebdir/common.w" -#line 572 "cwebdir/comm-w2c.ch" +#line 578 "cwebdir/comm-w2c.ch" /*:81*/ -#line 1183 "cwebdir/common.w" +#line 1184 "cwebdir/common.w" } /*:75*//*99:*/ -#line 834 "cwebdir/comm-w2c.ch" +#line 840 "cwebdir/comm-w2c.ch" static void cb_usage(const_string str) { @@ -1658,7 +1662,7 @@ history= spotless;exit(wrap_up()); } /*:99*//*101:*/ -#line 875 "cwebdir/comm-w2c.ch" +#line 881 "cwebdir/comm-w2c.ch" void cb_show_banner(void) { diff --git a/texk/web2c/cwebdir/ChangeLog b/texk/web2c/cwebdir/ChangeLog index 57caa0f438..67bd41dfa7 100644 --- a/texk/web2c/cwebdir/ChangeLog +++ b/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,21 @@ +2023-07-26 Andreas Scherer + + * comm-bs.ch, + * comm-w2c.ch, + * comm-w2c.h, + * comm-w32.ch, + * common.bux, + * common.c, + * common.h, + * common.w, + * ctang-w32.ch, + * ctangle.c, + * ctangle.w, + * ctwill-mini.ch, + * ctwill-w2c.ch, + * cweav-w32.ch, + * cweave.w: Purge 'init_p'. + 2023-07-21 Andreas Scherer * comm-{mac,mini,vms,w2c}.ch, diff --git a/texk/web2c/cwebdir/comm-bs.ch b/texk/web2c/cwebdir/comm-bs.ch index b5e1d21b9b..5d62e60019 100644 --- a/texk/web2c/cwebdir/comm-bs.ch +++ b/texk/web2c/cwebdir/comm-bs.ch @@ -16,7 +16,7 @@ by using "huge" pointers. @x Section 9. - for section names */ +@d ilk dummy.Ilk /* used by \.{CWEAVE} only */ @= typedef struct name_info { @@ -34,7 +34,7 @@ typedef name_pointer *hash_pointer; extern char byte_mem[]; /* characters of names */ extern char *byte_mem_end; /* end of |byte_mem| */ @y - for section names */ +@d ilk dummy.Ilk /* used by \.{CWEAVE} only */ @f huge extern diff --git a/texk/web2c/cwebdir/comm-w2c.ch b/texk/web2c/cwebdir/comm-w2c.ch index 9ef6a192f1..55f6c1ebe8 100644 --- a/texk/web2c/cwebdir/comm-w2c.ch +++ b/texk/web2c/cwebdir/comm-w2c.ch @@ -301,6 +301,12 @@ else if (strlen(found_filename) < max_file_name_length) { if (name_ptr>=name_dir_end) overflow(_("name")); @z +@x + if (program==cweave) { +@y + if (program!=ctangle) { +@z + @x if (s+name_len>byte_mem_end) overflow("byte memory"); if (name_ptr+1>=name_dir_end) overflow("name"); diff --git a/texk/web2c/cwebdir/comm-w2c.h b/texk/web2c/cwebdir/comm-w2c.h index 615f76325a..ed5e7e5054 100644 --- a/texk/web2c/cwebdir/comm-w2c.h +++ b/texk/web2c/cwebdir/comm-w2c.h @@ -166,6 +166,7 @@ extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */ @d rlink dummy.Rlink /* right link in binary search tree for section names */ @d root name_dir->rlink /* the root of the binary search tree for section names */ +@d ilk dummy.Ilk /* used by \.{CWEAVE} only */ @= typedef struct name_info { @@ -199,9 +200,8 @@ extern void print_section_name(name_pointer);@/ extern void sprint_section_name(char *,name_pointer); @# extern boolean names_match(name_pointer,const char *,size_t,eight_bits);@/ -/* three routines defined in \.{ctangle.w} and \.{cweave.w} */ +/* two routines defined in \.{ctangle.w} and \.{cweave.w} */ extern void init_node(name_pointer);@/ -extern void init_p(name_pointer,eight_bits);@/ @ Code related to error handling: @d spotless 0 /* |history| value for normal jobs */ diff --git a/texk/web2c/cwebdir/comm-w32.ch b/texk/web2c/cwebdir/comm-w32.ch index 38c209981a..163fcde428 100644 --- a/texk/web2c/cwebdir/comm-w32.ch +++ b/texk/web2c/cwebdir/comm-w32.ch @@ -40,12 +40,6 @@ extern boolean names_match(name_pointer,const char *,size_t,eight_bits);@/ extern boolean __cdecl names_match(name_pointer,const char *,size_t,eight_bits);@/ @z -@x -extern void init_p(name_pointer,eight_bits);@/ -@y -extern void __cdecl init_p(name_pointer,eight_bits);@/ -@z - @x section 75 An omitted change file argument means that |"/dev/null"| should be used, @y diff --git a/texk/web2c/cwebdir/common.bux b/texk/web2c/cwebdir/common.bux index 96c3fdfe0b..d5ee633299 100644 --- a/texk/web2c/cwebdir/common.bux +++ b/texk/web2c/cwebdir/common.bux @@ -17,7 +17,6 @@ @$xref {CWEAVE.W}24 \\{equiv\_or\_xref}@> -@$init_p {CWEAVE.W}32 \&{void} (\,)@> @$init_node {CWEAVE.W}32 \&{void} (\,)@> @$names_match {CWEAVE.W}32 \&{boolean} (\,)@> diff --git a/texk/web2c/cwebdir/common.c b/texk/web2c/cwebdir/common.c index 15e0e45ee3..d25adeadfc 100644 --- a/texk/web2c/cwebdir/common.c +++ b/texk/web2c/cwebdir/common.c @@ -61,7 +61,8 @@ #define llink link #define rlink dummy.Rlink #define root name_dir->rlink \ - \ + +#define ilk dummy.Ilk \ #define spotless 0 #define harmless_message 1 @@ -174,7 +175,7 @@ extern boolean change_pending; extern boolean print_where; /*:9*//*10:*/ -#line 148 "common.h" +#line 149 "common.h" typedef struct name_info{ char*byte_start; @@ -306,12 +307,12 @@ hash_pointer hash_end= hash+hash_size-1; hash_pointer h; /*:46*//*65:*/ -#line 1003 "common.w" +#line 1004 "common.w" int history= spotless; /*:65*//*73:*/ -#line 1126 "common.w" +#line 1127 "common.w" int argc; char**argv; @@ -322,7 +323,7 @@ char scn_file_name[max_file_name_length]; boolean flags[128]; /*:73*//*83:*/ -#line 1267 "common.w" +#line 1268 "common.w" FILE*C_file; FILE*tex_file; @@ -347,7 +348,7 @@ extern void check_complete(void); extern void reset_input(void); /*:8*//*11:*/ -#line 171 "common.h" +#line 172 "common.h" extern name_pointer id_lookup(const char*,const char*,eight_bits); @@ -359,7 +360,6 @@ extern void sprint_section_name(char*,name_pointer); extern boolean names_match(name_pointer,const char*,size_t,eight_bits); extern void init_node(name_pointer); -extern void init_p(name_pointer,eight_bits); /*:11*//*13:*/ #line 197 "common.h" @@ -382,18 +382,18 @@ static void prime_the_change_buffer(void); static void check_change(void); /*:33*//*55:*/ -#line 764 "common.w" +#line 765 "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 991 "common.w" +#line 992 "common.w" static int section_name_cmp(char**,size_t,name_pointer); /*:64*//*76:*/ -#line 1186 "common.w" +#line 1187 "common.w" static void scan_args(void); /*:76*/ @@ -423,7 +423,7 @@ for(h= hash;h<=hash_end;*h++= NULL); #line 99 "common.w" /*74:*/ -#line 1139 "common.w" +#line 1140 "common.w" show_banner= show_happiness= show_progress= make_xrefs= true; @@ -431,7 +431,7 @@ show_banner= show_happiness= show_progress= make_xrefs= true; #line 100 "common.w" /*84:*/ -#line 1274 "common.w" +#line 1275 "common.w" scan_args(); if(program==ctangle){ @@ -813,13 +813,15 @@ p->link= hash[h];hash[h]= p; #line 647 "common.w" if(p==name_ptr)/*51:*/ -#line 676 "common.w" +#line 675 "common.w" { if(byte_ptr+l> byte_mem_end)overflow("byte memory"); if(name_ptr>=name_dir_end)overflow("name"); strncpy(byte_ptr,first,l); (++name_ptr)->byte_start= byte_ptr+= l; -init_p(p,t); +if(program==cweave){ +p->ilk= t;init_node(p); +} } /*:51*/ @@ -829,7 +831,7 @@ return p; } /*:48*//*52:*/ -#line 708 "common.w" +#line 709 "common.w" void print_section_name( @@ -848,7 +850,7 @@ if(q)term_write("...",3); } /*:52*//*53:*/ -#line 725 "common.w" +#line 726 "common.w" void sprint_section_name( @@ -868,7 +870,7 @@ s= p->byte_start; } /*:53*//*54:*/ -#line 743 "common.w" +#line 744 "common.w" void print_prefix_name( @@ -881,7 +883,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); } /*:54*//*56:*/ -#line 769 "common.w" +#line 770 "common.w" static int web_strcmp( char*j, @@ -899,7 +901,7 @@ else return greater; } /*:56*//*57:*/ -#line 798 "common.w" +#line 799 "common.w" static name_pointer add_section_name( @@ -929,7 +931,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); } /*:57*//*58:*/ -#line 826 "common.w" +#line 827 "common.w" static void extend_section_name( @@ -953,7 +955,7 @@ if(ispref)*(byte_ptr-1)= ' '; } /*:58*//*59:*/ -#line 854 "common.w" +#line 855 "common.w" name_pointer section_lookup( @@ -968,7 +970,7 @@ name_pointer par= NULL; size_t name_len= (size_t)(last-first+1); /*60:*/ -#line 878 "common.w" +#line 879 "common.w" while(p){ c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p)); @@ -995,19 +997,19 @@ p= q,q= NULL; } /*:60*/ -#line 868 "common.w" +#line 869 "common.w" /*61:*/ -#line 903 "common.w" +#line 904 "common.w" if(r==NULL) return add_section_name(par,c,first,last+1,ispref); /*:61*/ -#line 869 "common.w" +#line 870 "common.w" /*62:*/ -#line 911 "common.w" +#line 912 "common.w" switch(section_name_cmp(&first,name_len,r)){ @@ -1041,12 +1043,12 @@ err_print(">"); return r; /*:62*/ -#line 870 "common.w" +#line 871 "common.w" } /*:59*//*63:*/ -#line 959 "common.w" +#line 960 "common.w" static int section_name_cmp( char**pfirst, @@ -1080,7 +1082,7 @@ default:return c; } /*:63*//*66:*/ -#line 1013 "common.w" +#line 1014 "common.w" void err_print( @@ -1088,7 +1090,7 @@ const char*s) { *s=='!'?printf("\n%s",s):printf("%s",s); if(web_file_open)/*67:*/ -#line 1032 "common.w" +#line 1033 "common.w" {char*k,*l; if(changing&&include_depth==change_depth) @@ -1109,20 +1111,20 @@ putchar(' '); } /*:67*/ -#line 1019 "common.w" +#line 1020 "common.w" update_terminal;mark_error; } /*:66*//*68:*/ -#line 1065 "common.w" +#line 1066 "common.w" int wrap_up(void){ if(show_progress)new_line; if(show_stats) print_stats(); /*69:*/ -#line 1075 "common.w" +#line 1076 "common.w" switch(history){ case spotless: @@ -1136,14 +1138,14 @@ puts("(That was a fatal error, my friend.)"); } /*:69*/ -#line 1070 "common.w" +#line 1071 "common.w" if(history> harmless_message)return EXIT_FAILURE; else return EXIT_SUCCESS; } /*:68*//*70:*/ -#line 1093 "common.w" +#line 1094 "common.w" void fatal( const char*s,const char*t) @@ -1154,7 +1156,7 @@ history= fatal_message;exit(wrap_up()); } /*:70*//*71:*/ -#line 1104 "common.w" +#line 1105 "common.w" void overflow( const char*t) @@ -1164,7 +1166,7 @@ printf("\n! Sorry, %s capacity exceeded",t);fatal("",""); /*:71*//*75:*/ -#line 1157 "common.w" +#line 1158 "common.w" static void scan_args(void) @@ -1178,13 +1180,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 1245 "common.w" +#line 1246 "common.w" for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++) flags[(eight_bits)*dot_pos]= flag_change; /*:80*/ -#line 1169 "common.w" +#line 1170 "common.w" else{ s= name_pos= *argv;dot_pos= NULL; @@ -1193,17 +1195,17 @@ if(*s=='.')dot_pos= s++; else if(*s=='/')dot_pos= NULL,name_pos= ++s; else s++; if(!found_web)/*77:*/ -#line 1195 "common.w" +#line 1196 "common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1261 "common.w" +#line 1262 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1198 "common.w" +#line 1199 "common.w" if(dot_pos==NULL) sprintf(web_file_name,"%s.w",*argv); @@ -1220,21 +1222,21 @@ found_web= true; } /*:77*/ -#line 1177 "common.w" +#line 1178 "common.w" else if(!found_change)/*78:*/ -#line 1213 "common.w" +#line 1214 "common.w" { if(strcmp(*argv,"-")!=0){ if(s-*argv> max_file_name_length-4) /*82:*/ -#line 1261 "common.w" +#line 1262 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1217 "common.w" +#line 1218 "common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1244,20 +1246,20 @@ found_change= true; } /*:78*/ -#line 1178 "common.w" +#line 1179 "common.w" else if(!found_out)/*79:*/ -#line 1225 "common.w" +#line 1226 "common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1261 "common.w" +#line 1262 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1228 "common.w" +#line 1229 "common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1275,10 +1277,10 @@ found_out= true; } /*:79*/ -#line 1179 "common.w" +#line 1180 "common.w" else/*81:*/ -#line 1249 "common.w" +#line 1250 "common.w" { if(program==ctangle) @@ -1292,12 +1294,12 @@ else fatal( } /*:81*/ -#line 1180 "common.w" +#line 1181 "common.w" } } if(!found_web)/*81:*/ -#line 1249 "common.w" +#line 1250 "common.w" { if(program==ctangle) @@ -1311,7 +1313,7 @@ else fatal( } /*:81*/ -#line 1183 "common.w" +#line 1184 "common.w" } diff --git a/texk/web2c/cwebdir/common.h b/texk/web2c/cwebdir/common.h index f8c8af34d4..0c1f829111 100644 --- a/texk/web2c/cwebdir/common.h +++ b/texk/web2c/cwebdir/common.h @@ -144,6 +144,7 @@ extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */ @d rlink dummy.Rlink /* right link in binary search tree for section names */ @d root name_dir->rlink /* the root of the binary search tree for section names */ +@d ilk dummy.Ilk /* used by \.{CWEAVE} only */ @= typedef struct name_info { @@ -177,9 +178,8 @@ extern void print_section_name(name_pointer);@/ extern void sprint_section_name(char *,name_pointer); @# extern boolean names_match(name_pointer,const char *,size_t,eight_bits);@/ -/* three routines defined in \.{ctangle.w} and \.{cweave.w} */ +/* two routines defined in \.{ctangle.w} and \.{cweave.w} */ extern void init_node(name_pointer);@/ -extern void init_p(name_pointer,eight_bits);@/ @ Code related to error handling: @d spotless 0 /* |history| value for normal jobs */ diff --git a/texk/web2c/cwebdir/common.w b/texk/web2c/cwebdir/common.w index f5bbf46216..56111d907a 100644 --- a/texk/web2c/cwebdir/common.w +++ b/texk/web2c/cwebdir/common.w @@ -670,15 +670,16 @@ if (p==NULL) { } @ The information associated with a new identifier must be initialized -in a slightly different way in \.{CWEAVE} than in \.{CTANGLE}; hence the -|init_p| procedure. +in a slightly different way in \.{CWEAVE} than in \.{CTANGLE}. @= { if (byte_ptr+l>byte_mem_end) overflow("byte memory"); if (name_ptr>=name_dir_end) overflow("name"); strncpy(byte_ptr,first,l); (++name_ptr)->byte_start=byte_ptr+=l; - init_p(p,t); + if (program==cweave) { + p->ilk=t; init_node(p); + } } @ If |p| is a |name_pointer| variable, as we have seen, diff --git a/texk/web2c/cwebdir/ctang-w32.ch b/texk/web2c/cwebdir/ctang-w32.ch index 76311d0b65..401040c3d1 100644 --- a/texk/web2c/cwebdir/ctang-w32.ch +++ b/texk/web2c/cwebdir/ctang-w32.ch @@ -30,8 +30,6 @@ name_pointer node) { node->equiv=(void *)text_info; } -void -init_p(name_pointer p,eight_bits t) {@+(void)p;@+(void)t;@+} @y void init_node( @@ -39,6 +37,4 @@ name_pointer node) { node->equiv=(void *)text_info; } -void __cdecl -init_p(name_pointer p,eight_bits t) {@+(void)p;@+(void)t;@+} @z diff --git a/texk/web2c/cwebdir/ctangle.c b/texk/web2c/cwebdir/ctangle.c index c4b8d8197c..d873628a53 100644 --- a/texk/web2c/cwebdir/ctangle.c +++ b/texk/web2c/cwebdir/ctangle.c @@ -63,7 +63,8 @@ #define llink link #define rlink dummy.Rlink #define root name_dir->rlink \ - \ + +#define ilk dummy.Ilk \ #define spotless 0 #define harmless_message 1 @@ -207,7 +208,7 @@ extern boolean change_pending; extern boolean print_where; /*:10*//*11:*/ -#line 148 "common.h" +#line 149 "common.h" typedef struct name_info{ char*byte_start; @@ -269,7 +270,7 @@ sixteen_bits text_link; typedef text*text_pointer; /*:19*//*31:*/ -#line 271 "ctangle.w" +#line 267 "ctangle.w" typedef struct{ eight_bits*byte_field; @@ -293,30 +294,30 @@ static eight_bits*tok_mem_end= tok_mem+max_toks-1; static eight_bits*tok_ptr; /*:20*//*26:*/ -#line 200 "ctangle.w" +#line 196 "ctangle.w" static text_pointer last_unnamed; /*:26*//*32:*/ -#line 289 "ctangle.w" +#line 285 "ctangle.w" static output_state stack[stack_size+2]; static stack_pointer stack_end= stack+stack_size; static stack_pointer stack_ptr; /*:32*//*37:*/ -#line 361 "ctangle.w" +#line 357 "ctangle.w" static int cur_val; /*:37*//*42:*/ -#line 453 "ctangle.w" +#line 449 "ctangle.w" static eight_bits out_state; static boolean protect; /*:42*//*45:*/ -#line 484 "ctangle.w" +#line 480 "ctangle.w" static name_pointer output_files[max_files]; static name_pointer*cur_out_file,*end_output_files,*an_output_file; @@ -324,33 +325,33 @@ static char cur_section_name_char; static char output_file_name[longest_name+1]; /*:45*//*52:*/ -#line 583 "ctangle.w" +#line 579 "ctangle.w" static boolean output_defs_seen= false; /*:52*//*57:*/ -#line 697 "ctangle.w" +#line 693 "ctangle.w" static char translit[0200][translit_length]; /*:57*//*62:*/ -#line 773 "ctangle.w" +#line 769 "ctangle.w" static eight_bits ccode[256]; /*:62*//*66:*/ -#line 833 "ctangle.w" +#line 829 "ctangle.w" static boolean comment_continues= false; /*:66*//*68:*/ -#line 870 "ctangle.w" +#line 866 "ctangle.w" static name_pointer cur_section_name; static boolean no_where; /*:68*//*82:*/ -#line 1187 "ctangle.w" +#line 1183 "ctangle.w" static text_pointer cur_text; static eight_bits next_control; @@ -372,7 +373,7 @@ extern void check_complete(void); extern void reset_input(void); /*:9*//*12:*/ -#line 171 "common.h" +#line 172 "common.h" extern name_pointer id_lookup(const char*,const char*,eight_bits); @@ -384,7 +385,6 @@ extern void sprint_section_name(char*,name_pointer); extern boolean names_match(name_pointer,const char*,size_t,eight_bits); extern void init_node(name_pointer); -extern void init_p(name_pointer,eight_bits); /*:12*//*14:*/ #line 197 "common.h" @@ -395,57 +395,57 @@ extern void fatal(const char*,const char*); extern void overflow(const char*); /*:14*//*30:*/ -#line 246 "ctangle.w" +#line 242 "ctangle.w" static void store_two_bytes(sixteen_bits); /*:30*//*35:*/ -#line 325 "ctangle.w" +#line 321 "ctangle.w" static void push_level(name_pointer); static void pop_level(boolean); /*:35*//*39:*/ -#line 398 "ctangle.w" +#line 394 "ctangle.w" static void get_output(void); /*:39*//*44:*/ -#line 474 "ctangle.w" +#line 470 "ctangle.w" static void flush_buffer(void); /*:44*//*49:*/ -#line 551 "ctangle.w" +#line 547 "ctangle.w" static void phase_two(void); /*:49*//*53:*/ -#line 586 "ctangle.w" +#line 582 "ctangle.w" static void output_defs(void); static void out_char(eight_bits); /*:53*//*65:*/ -#line 813 "ctangle.w" +#line 809 "ctangle.w" static eight_bits skip_ahead(void); static boolean skip_comment(boolean); /*:65*//*70:*/ -#line 920 "ctangle.w" +#line 916 "ctangle.w" static eight_bits get_next(void); /*:70*//*84:*/ -#line 1213 "ctangle.w" +#line 1209 "ctangle.w" static void scan_repl(eight_bits); /*:84*//*91:*/ -#line 1405 "ctangle.w" +#line 1401 "ctangle.w" static void scan_section(void); /*:91*//*99:*/ -#line 1482 "ctangle.w" +#line 1478 "ctangle.w" static void phase_one(void); /*:99*//*101:*/ -#line 1515 "ctangle.w" +#line 1511 "ctangle.w" static void skip_limbo(void); /*:101*/ @@ -474,16 +474,16 @@ text_ptr= text_info+1;text_ptr->tok_start= tok_mem; init_node(name_dir); /*:23*//*27:*/ -#line 203 "ctangle.w" +#line 199 "ctangle.w" last_unnamed= text_info;text_info->text_link= macro; /*:27*//*46:*/ -#line 494 "ctangle.w" +#line 490 "ctangle.w" cur_out_file= end_output_files= output_files+max_files; /*:46*//*58:*/ -#line 700 "ctangle.w" +#line 696 "ctangle.w" { int i; @@ -491,7 +491,7 @@ for(i= 0;i<0200;i++)sprintf(translit[i],"X%02X",(unsigned int)(0200+i)); } /*:58*//*63:*/ -#line 776 "ctangle.w" +#line 772 "ctangle.w" { int c; for(c= 0;c<256;c++)ccode[c]= ignore; @@ -511,7 +511,7 @@ ccode['<']= ccode['(']= section_name; ccode['\'']= ord; /*:63*//*78:*/ -#line 1108 "ctangle.w" +#line 1104 "ctangle.w" section_text[0]= ' '; /*:78*/ @@ -537,7 +537,7 @@ return length(p)==l&&strncmp(first,p->byte_start,l)==0; } /*:24*//*25:*/ -#line 170 "ctangle.w" +#line 168 "ctangle.w" void init_node( @@ -545,11 +545,9 @@ name_pointer node) { node->equiv= (void*)text_info; } -void -init_p(name_pointer p,eight_bits t){(void)p;(void)t;} /*:25*//*29:*/ -#line 236 "ctangle.w" +#line 232 "ctangle.w" static void store_two_bytes( @@ -561,7 +559,7 @@ if(tok_ptr+2> tok_mem_end)overflow("token"); } /*:29*//*34:*/ -#line 311 "ctangle.w" +#line 307 "ctangle.w" static void push_level( @@ -577,7 +575,7 @@ cur_byte= cur_repl->tok_start;cur_section= 0; } /*:34*//*36:*/ -#line 333 "ctangle.w" +#line 329 "ctangle.w" static void pop_level( @@ -592,7 +590,7 @@ if(stack_ptr> stack)cur_state= *stack_ptr; } /*:36*//*38:*/ -#line 368 "ctangle.w" +#line 364 "ctangle.w" static void get_output(void) @@ -615,7 +613,7 @@ switch(a/024000){ case 0:cur_val= (int)a;out_char(identifier);break; case 1:if(a==output_defs_flag)output_defs(); else/*40:*/ -#line 403 "ctangle.w" +#line 399 "ctangle.w" { a-= 024000; @@ -629,7 +627,7 @@ goto restart; } /*:40*/ -#line 389 "ctangle.w" +#line 385 "ctangle.w" break; default:cur_val= (int)a-050000; @@ -640,7 +638,7 @@ out_char(section_number); } /*:38*//*43:*/ -#line 461 "ctangle.w" +#line 457 "ctangle.w" static void flush_buffer(void) @@ -655,7 +653,7 @@ cur_line++; } /*:43*//*48:*/ -#line 513 "ctangle.w" +#line 509 "ctangle.w" static void phase_two(void){ @@ -663,22 +661,22 @@ phase= 2; web_file_open= false; cur_line= 1; /*33:*/ -#line 300 "ctangle.w" +#line 296 "ctangle.w" stack_ptr= stack+1;cur_name= name_dir;cur_repl= text_info->text_link+text_info; cur_byte= cur_repl->tok_start;cur_section= 0; /*:33*/ -#line 519 "ctangle.w" +#line 515 "ctangle.w" /*51:*/ -#line 579 "ctangle.w" +#line 575 "ctangle.w" if(!output_defs_seen) output_defs(); /*:51*/ -#line 520 "ctangle.w" +#line 516 "ctangle.w" if(text_info->text_link==macro&&cur_out_file==end_output_files){ fputs("\n! No program text was specified.",stdout);mark_harmless; @@ -703,7 +701,7 @@ if(text_info->text_link==macro)goto writeloop; while(stack_ptr> stack)get_output(); flush_buffer(); writeloop:/*50:*/ -#line 557 "ctangle.w" +#line 553 "ctangle.w" for(an_output_file= end_output_files;an_output_file> cur_out_file;){ an_output_file--; @@ -723,7 +721,7 @@ flush_buffer(); } /*:50*/ -#line 543 "ctangle.w" +#line 539 "ctangle.w" if(show_happiness){ if(show_progress)new_line; @@ -733,7 +731,7 @@ fputs("Done.",stdout); } /*:48*//*54:*/ -#line 595 "ctangle.w" +#line 591 "ctangle.w" static void output_defs(void) @@ -773,7 +771,7 @@ pop_level(false); } /*:54*//*55:*/ -#line 638 "ctangle.w" +#line 634 "ctangle.w" static void out_char( @@ -786,7 +784,7 @@ case'\n':if(protect&&out_state!=verbatim)C_putc(' '); if(protect||out_state==verbatim)C_putc('\\'); flush_buffer();if(out_state!=verbatim)out_state= normal;break; /*59:*/ -#line 706 "ctangle.w" +#line 702 "ctangle.w" case identifier: if(out_state==num_or_id)C_putc(' '); @@ -798,10 +796,10 @@ else C_printf("%s",translit[(eight_bits)(*j)-0200]); out_state= num_or_id;break; /*:59*/ -#line 649 "ctangle.w" +#line 645 "ctangle.w" /*60:*/ -#line 716 "ctangle.w" +#line 712 "ctangle.w" case section_number: if(cur_val> 0)C_printf("/*%d:*/",cur_val); @@ -828,10 +826,10 @@ C_putc('"');C_putc('\n'); break; /*:60*/ -#line 650 "ctangle.w" +#line 646 "ctangle.w" /*56:*/ -#line 668 "ctangle.w" +#line 664 "ctangle.w" case plus_plus:C_putc('+');C_putc('+');out_state= normal;break; case minus_minus:C_putc('-');C_putc('-');out_state= normal;break; @@ -852,7 +850,7 @@ case minus_gt_ast:C_putc('-');C_putc('>');C_putc('*');out_state= normal; break; /*:56*/ -#line 651 "ctangle.w" +#line 647 "ctangle.w" case'=':case'>':C_putc(cur_char);C_putc(' '); out_state= normal;break; @@ -871,7 +869,7 @@ default:C_putc(cur_char);out_state= normal;break; } /*:55*//*64:*/ -#line 797 "ctangle.w" +#line 793 "ctangle.w" static eight_bits skip_ahead(void) @@ -889,7 +887,7 @@ if(c!=ignore||*(loc-1)=='>')return c; } /*:64*//*67:*/ -#line 836 "ctangle.w" +#line 832 "ctangle.w" static boolean skip_comment( boolean is_long_comment) @@ -923,7 +921,7 @@ else loc++; } /*:67*//*69:*/ -#line 877 "ctangle.w" +#line 873 "ctangle.w" static eight_bits get_next(void) @@ -937,7 +935,7 @@ if(get_line()==false)return new_section; else if(print_where&&!no_where){ print_where= false; /*85:*/ -#line 1223 "ctangle.w" +#line 1219 "ctangle.w" { eight_bits a; @@ -954,7 +952,7 @@ store_id(a); } /*:85*/ -#line 889 "ctangle.w" +#line 885 "ctangle.w" } else return(eight_bits)'\n'; @@ -967,7 +965,7 @@ else continue; } loc++; if(xisdigit(c)||c=='.')/*73:*/ -#line 961 "ctangle.w" +#line 957 "ctangle.w" { boolean hex_flag= false; id_first= loc-1; @@ -1001,13 +999,13 @@ return constant; } /*:73*/ -#line 900 "ctangle.w" +#line 896 "ctangle.w" else if(c=='\''||c=='"' ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"')) ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"'))) /*74:*/ -#line 998 "ctangle.w" +#line 994 "ctangle.w" { char delim= (char)c; id_first= section_text+1; @@ -1051,11 +1049,11 @@ return string; } /*:74*/ -#line 904 "ctangle.w" +#line 900 "ctangle.w" else if(isalpha((int)c)||isxalpha(c)||ishigh(c)) /*72:*/ -#line 952 "ctangle.w" +#line 948 "ctangle.w" { id_first= --loc; do @@ -1066,10 +1064,10 @@ id_loc= loc;return identifier; } /*:72*/ -#line 906 "ctangle.w" +#line 902 "ctangle.w" else if(c=='@')/*75:*/ -#line 1043 "ctangle.w" +#line 1039 "ctangle.w" switch(c= ccode[(eight_bits)*loc++]){ case ignore:continue; @@ -1084,11 +1082,11 @@ continue; case section_name: cur_section_name_char= *(loc-1); /*77:*/ -#line 1088 "ctangle.w" +#line 1084 "ctangle.w" { char*k= section_text; /*79:*/ -#line 1110 "ctangle.w" +#line 1106 "ctangle.w" while(true){ if(loc> limit&&get_line()==false){ @@ -1098,7 +1096,7 @@ loc= buffer+1;break; } c= (eight_bits)*loc; /*80:*/ -#line 1133 "ctangle.w" +#line 1129 "ctangle.w" if(c=='@'){ c= (eight_bits)*(loc+1); @@ -1117,7 +1115,7 @@ err_print("! Nesting of section names not allowed");break; } /*:80*/ -#line 1118 "ctangle.w" +#line 1114 "ctangle.w" loc++;if(k section_text)k--; /*:79*/ -#line 1090 "ctangle.w" +#line 1086 "ctangle.w" if(k-section_text> 3&&strncmp(k-2,"...",3)==0) cur_section_name= section_lookup(section_text+1,k-3,true); @@ -1143,7 +1141,7 @@ else cur_section_name= section_lookup(section_text+1,k,false); if(cur_section_name_char=='(') /*47:*/ -#line 498 "ctangle.w" +#line 494 "ctangle.w" { for(an_output_file= cur_out_file; @@ -1157,16 +1155,16 @@ else overflow("output files"); } /*:47*/ -#line 1098 "ctangle.w" +#line 1094 "ctangle.w" return section_name; } /*:77*/ -#line 1056 "ctangle.w" +#line 1052 "ctangle.w" case string:/*81:*/ -#line 1155 "ctangle.w" +#line 1151 "ctangle.w" id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; while(*loc!='@'||*(loc+1)!='>')loc++; @@ -1176,10 +1174,10 @@ id_loc= loc;loc+= 2; return string; /*:81*/ -#line 1057 "ctangle.w" +#line 1053 "ctangle.w" case ord:/*76:*/ -#line 1068 "ctangle.w" +#line 1064 "ctangle.w" id_first= loc; if(*loc=='\\') @@ -1201,13 +1199,13 @@ loc++; return ord; /*:76*/ -#line 1058 "ctangle.w" +#line 1054 "ctangle.w" default:return c; } /*:75*/ -#line 907 "ctangle.w" +#line 903 "ctangle.w" else if(xisspace(c)){ if(!preprocessing||loc> limit)continue; @@ -1217,7 +1215,7 @@ else return(eight_bits)' '; } else if(c=='#'&&loc==buffer+1)preprocessing= true; mistake:/*71:*/ -#line 929 "ctangle.w" +#line 925 "ctangle.w" switch(c){ case'+':if(*loc=='+')compress(plus_plus);break; @@ -1242,14 +1240,14 @@ case'!':if(*loc=='=')compress(non_eq);break; } /*:71*/ -#line 915 "ctangle.w" +#line 911 "ctangle.w" return c; } } /*:69*//*83:*/ -#line 1191 "ctangle.w" +#line 1187 "ctangle.w" static void scan_repl( @@ -1257,7 +1255,7 @@ eight_bits t) { sixteen_bits a; if(t==section_name)/*85:*/ -#line 1223 "ctangle.w" +#line 1219 "ctangle.w" { eight_bits a; @@ -1274,11 +1272,11 @@ store_id(a); } /*:85*/ -#line 1197 "ctangle.w" +#line 1193 "ctangle.w" while(true)switch(a= get_next()){ /*86:*/ -#line 1238 "ctangle.w" +#line 1234 "ctangle.w" case identifier:store_id(a); if(*buffer=='#'&&( @@ -1291,7 +1289,7 @@ break; case section_name:if(t!=section_name)goto done; else{ /*87:*/ -#line 1279 "ctangle.w" +#line 1275 "ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loctok_start= tok_ptr; } /*:83*//*90:*/ -#line 1372 "ctangle.w" +#line 1368 "ctangle.w" static void scan_section(void) @@ -1472,7 +1470,7 @@ printf("*%d",(int)section_count);update_terminal; next_control= ignore; while(true){ /*92:*/ -#line 1413 "ctangle.w" +#line 1409 "ctangle.w" while(next_controltext_link= macro; /*:93*/ -#line 1388 "ctangle.w" +#line 1384 "ctangle.w" continue; } @@ -1511,14 +1509,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1442 "ctangle.w" +#line 1438 "ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1396 "ctangle.w" +#line 1392 "ctangle.w" break; } @@ -1526,20 +1524,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1447 "ctangle.w" +#line 1443 "ctangle.w" /*96:*/ -#line 1452 "ctangle.w" +#line 1448 "ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1448 "ctangle.w" +#line 1444 "ctangle.w" scan_repl(section_name); /*97:*/ -#line 1456 "ctangle.w" +#line 1452 "ctangle.w" if(p==name_dir||p==NULL){ last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1556,16 +1554,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1450 "ctangle.w" +#line 1446 "ctangle.w" /*:95*/ -#line 1402 "ctangle.w" +#line 1398 "ctangle.w" } /*:90*//*98:*/ -#line 1471 "ctangle.w" +#line 1467 "ctangle.w" static void phase_one(void){ @@ -1578,7 +1576,7 @@ check_complete(); } /*:98*//*100:*/ -#line 1487 "ctangle.w" +#line 1483 "ctangle.w" static void skip_limbo(void) @@ -1592,7 +1590,7 @@ char c= *loc++; switch(ccode[(eight_bits)c]){ case new_section:return; case translit_code:/*102:*/ -#line 1517 "ctangle.w" +#line 1513 "ctangle.w" while(xisspace(*loc)&&locbyte_start,l)==0; } -@ The common lookup routine |id_lookup| refers to separate routines |init_node| -and |init_p| when the data structure grows. Actually |init_p| is called only by -\.{CWEAVE}, but we need to declare a dummy version so that -the loader won't complain of its absence. +@ The common lookup routine |id_lookup| refers to a separate routine +|init_node| when the data structure grows. @c void @@ -174,8 +172,6 @@ name_pointer node) { node->equiv=(void *)text_info; } -void -init_p(name_pointer p,eight_bits t) {@+(void)p;@+(void)t;@+} @* Tokens. Replacement texts, which represent \CEE/ code in a compressed format, diff --git a/texk/web2c/cwebdir/ctwill-mini.ch b/texk/web2c/cwebdir/ctwill-mini.ch index 0813d6d4c1..8c91645b1d 100644 --- a/texk/web2c/cwebdir/ctwill-mini.ch +++ b/texk/web2c/cwebdir/ctwill-mini.ch @@ -117,12 +117,6 @@ Section 7. Section 8. -@x -@f line x /* make |line| an unreserved word */ -@y -@s line x @q/* make |line| an unreserved word */@> -@z - @x @d cur_line line[include_depth] /* number of current line in current file */ @y diff --git a/texk/web2c/cwebdir/ctwill-w2c.ch b/texk/web2c/cwebdir/ctwill-w2c.ch index d51cf4a88d..874f1decae 100644 --- a/texk/web2c/cwebdir/ctwill-w2c.ch +++ b/texk/web2c/cwebdir/ctwill-w2c.ch @@ -157,22 +157,24 @@ turned on during the first phase---NOT! @z @x -@ Here are the three procedures needed to complete |id_lookup|: +@ Here are the two procedures needed to complete |id_lookup|: @y -@ Here are the three procedures needed to complete |id_lookup|: +@ Here are the two procedures needed to complete |id_lookup|: @s perm_meaning int @z @x - p->ilk=t; init_node(p); + p->xref=(void *)xmem; @y - struct perm_meaning *q=get_meaning(p); - p->ilk=t; init_node(p); - q->stamp=0; - q->link=NULL; - q->perm.id=p; - q->perm.prog_no=q->perm.sec_no=0; - strcpy(q->perm.tex_part,"\\uninitialized"); + p->xref=(void *)xmem; + if (p!=name_dir) { + struct perm_meaning *q=get_meaning(p); + q->stamp=0; + q->link=NULL; + q->perm.id=p; + q->perm.prog_no=q->perm.sec_no=0; + strcpy(q->perm.tex_part,"\\uninitialized"); + } @z @x diff --git a/texk/web2c/cwebdir/cweav-w32.ch b/texk/web2c/cwebdir/cweav-w32.ch index 0392dd3a92..279534899a 100644 --- a/texk/web2c/cwebdir/cweav-w32.ch +++ b/texk/web2c/cwebdir/cweav-w32.ch @@ -20,15 +20,3 @@ const char *first, /* position of first character of string */ size_t l, /* length of identifier */ eight_bits t) /* desired |ilk| */ @z - -@x -void -init_p( -name_pointer p, -eight_bits t) -@y -void __cdecl -init_p( -name_pointer p, -eight_bits t) -@z diff --git a/texk/web2c/cwebdir/cweave.w b/texk/web2c/cwebdir/cweave.w index dbdfa3c029..20a2308b53 100644 --- a/texk/web2c/cwebdir/cweave.w +++ b/texk/web2c/cwebdir/cweave.w @@ -147,7 +147,6 @@ identifiers are \CEE/ or \CPLUSPLUS/ reserved words whose |ilk| explains how they are to be treated when \CEE/ code is being formatted. -@d ilk dummy.Ilk @d normal 0 /* ordinary identifiers have |normal| ilk */ @d roman 1 /* normal index entries have |roman| ilk */ @d wildcard 2 /* user-formatted index entries have |wildcard| ilk */ @@ -355,7 +354,7 @@ 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; -@ Here are the three procedures needed to complete |id_lookup|: +@ Here are the two procedures needed to complete |id_lookup|: @c boolean names_match( name_pointer p, /* points to the proposed match */ @@ -368,14 +367,6 @@ eight_bits t) /* desired |ilk| */ return !strncmp(first,p->byte_start,l); } -void -init_p( -name_pointer p, -eight_bits t) -{ - p->ilk=t; init_node(p); -} - void init_node( name_pointer p)