diff options
Diffstat (limited to 'Build/source/texk/web2c/ctangleboot.cin')
-rw-r--r-- | Build/source/texk/web2c/ctangleboot.cin | 221 |
1 files changed, 108 insertions, 113 deletions
diff --git a/Build/source/texk/web2c/ctangleboot.cin b/Build/source/texk/web2c/ctangleboot.cin index 0013e74be5f..bb7a8621820 100644 --- a/Build/source/texk/web2c/ctangleboot.cin +++ b/Build/source/texk/web2c/ctangleboot.cin @@ -25,7 +25,7 @@ /*:4*/ #line 67 "cwebdir/ctangle.w" -#define banner "This is CTANGLE, Version 4.0" \ +#define banner "This is CTANGLE, Version 4.1" \ \ #define _(S) gettext(S) \ @@ -148,7 +148,7 @@ #define ishigh(c) ((eight_bits) (c) > 0177) \ \ -#define compress(c) if(loc++<=limit) return(c) \ +#define compress(c) if(loc++<=limit) return c \ #define macro 0 #define app_repl(c) {if(tok_ptr==tok_mem_end) overflow(_("token") ) ;*tok_ptr++= c;} \ @@ -263,12 +263,12 @@ extern FILE*scn_file; extern FILE*active_file; extern FILE*check_file; -/*:15*//*116:*/ +/*:15*//*115:*/ #line 473 "cwebdir/ctang-w2c.ch" extern char cb_banner[]; -/*:116*/ +/*:115*/ #line 69 "cwebdir/ctangle.w" /*19:*/ @@ -370,12 +370,7 @@ boolean no_where; text_pointer cur_text; eight_bits next_control; -/*:82*//*90:*/ -#line 1348 "cwebdir/ctangle.w" - -extern sixteen_bits section_count; - -/*:90*/ +/*:82*/ #line 71 "cwebdir/ctangle.w" /*8:*/ @@ -461,22 +456,22 @@ static eight_bits get_next(void); static void scan_repl(eight_bits); -/*:83*//*91:*/ -#line 1355 "cwebdir/ctangle.w" +/*:83*//*90:*/ +#line 1348 "cwebdir/ctangle.w" static void scan_section(void); -/*:91*//*99:*/ -#line 1458 "cwebdir/ctangle.w" +/*:90*//*98:*/ +#line 1455 "cwebdir/ctangle.w" static void phase_one(void); -/*:99*//*101:*/ -#line 1476 "cwebdir/ctangle.w" +/*:98*//*100:*/ +#line 1473 "cwebdir/ctangle.w" static void skip_limbo(void); -/*:101*/ +/*:100*/ #line 72 "cwebdir/ctangle.w" @@ -542,12 +537,12 @@ ccode['\'']= ord; #line 1108 "cwebdir/ctangle.w" section_text[0]= ' '; -/*:78*//*117:*/ +/*:78*//*116:*/ #line 476 "cwebdir/ctang-w2c.ch" strncpy(cb_banner,banner,max_banner-1); -/*:117*/ +/*:116*/ #line 88 "cwebdir/ctangle.w" common_init(); @@ -752,11 +747,11 @@ writeloop:/*50:*/ #line 130 "cwebdir/ctang-w2c.ch" fclose(C_file);C_file= NULL; -/*106:*/ +/*105:*/ #line 356 "cwebdir/ctang-w2c.ch" if((C_file= fopen(C_file_name,"r"))!=NULL){ -/*107:*/ +/*106:*/ #line 363 "cwebdir/ctang-w2c.ch" char x[BUFSIZ],y[BUFSIZ]; @@ -766,7 +761,7 @@ if((check_file= fopen(check_file_name,"r"))==NULL) fatal(_("! Cannot open output file "),check_file_name); -if(temporary_output)/*108:*/ +if(temporary_output)/*107:*/ #line 378 "cwebdir/ctang-w2c.ch" do{ @@ -776,17 +771,17 @@ comparison= (x_size==y_size); if(comparison)comparison= !memcmp(x,y,x_size); }while(comparison&&!feof(C_file)&&!feof(check_file)); -/*:108*/ +/*:107*/ #line 371 "cwebdir/ctang-w2c.ch" fclose(C_file);C_file= NULL; fclose(check_file);check_file= NULL; -/*:107*/ +/*:106*/ #line 358 "cwebdir/ctang-w2c.ch" -/*109:*/ +/*108:*/ #line 389 "cwebdir/ctang-w2c.ch" if(comparison) @@ -796,13 +791,13 @@ remove(C_file_name); rename(check_file_name,C_file_name); } -/*:109*/ +/*:108*/ #line 359 "cwebdir/ctang-w2c.ch" }else rename(check_file_name,C_file_name); -/*:106*/ +/*:105*/ #line 132 "cwebdir/ctang-w2c.ch" for(an_output_file= end_output_files;an_output_file> cur_out_file;){ @@ -823,14 +818,14 @@ 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; -/*110:*/ +/*109:*/ #line 402 "cwebdir/ctang-w2c.ch" if(0==strcmp("/dev/stdout",output_file_name)) -/*112:*/ +/*111:*/ #line 429 "cwebdir/ctang-w2c.ch" { -/*115:*/ +/*114:*/ #line 460 "cwebdir/ctang-w2c.ch" char in_buf[BUFSIZ+1]; @@ -839,7 +834,7 @@ if((check_file= fopen(check_file_name,"r"))==NULL) fatal(_("! Cannot open output file "),check_file_name); -/*:115*/ +/*:114*/ #line 430 "cwebdir/ctang-w2c.ch" do{ @@ -848,7 +843,7 @@ in_buf[in_size]= '\0'; fprintf(stdout,"%s",in_buf); }while(!feof(check_file)); fclose(check_file);check_file= NULL; -/*111:*/ +/*110:*/ #line 419 "cwebdir/ctang-w2c.ch" if(comparison) @@ -858,19 +853,19 @@ remove(output_file_name); rename(check_file_name,output_file_name); } -/*:111*/ +/*:110*/ #line 437 "cwebdir/ctang-w2c.ch" } -/*:112*/ +/*:111*/ #line 404 "cwebdir/ctang-w2c.ch" else if(0==strcmp("/dev/stderr",output_file_name)) -/*113:*/ +/*112:*/ #line 442 "cwebdir/ctang-w2c.ch" { -/*115:*/ +/*114:*/ #line 460 "cwebdir/ctang-w2c.ch" char in_buf[BUFSIZ+1]; @@ -879,7 +874,7 @@ if((check_file= fopen(check_file_name,"r"))==NULL) fatal(_("! Cannot open output file "),check_file_name); -/*:115*/ +/*:114*/ #line 443 "cwebdir/ctang-w2c.ch" do{ @@ -888,7 +883,7 @@ in_buf[in_size]= '\0'; fprintf(stderr,"%s",in_buf); }while(!feof(check_file)); fclose(check_file);check_file= NULL; -/*111:*/ +/*110:*/ #line 419 "cwebdir/ctang-w2c.ch" if(comparison) @@ -898,20 +893,20 @@ remove(output_file_name); rename(check_file_name,output_file_name); } -/*:111*/ +/*:110*/ #line 450 "cwebdir/ctang-w2c.ch" } -/*:113*/ +/*:112*/ #line 406 "cwebdir/ctang-w2c.ch" else if(0==strcmp("/dev/null",output_file_name)) -/*114:*/ +/*113:*/ #line 455 "cwebdir/ctang-w2c.ch" { int comparison= true; -/*111:*/ +/*110:*/ #line 419 "cwebdir/ctang-w2c.ch" if(comparison) @@ -921,17 +916,17 @@ remove(output_file_name); rename(check_file_name,output_file_name); } -/*:111*/ +/*:110*/ #line 457 "cwebdir/ctang-w2c.ch" } -/*:114*/ +/*:113*/ #line 408 "cwebdir/ctang-w2c.ch" else{ if((C_file= fopen(output_file_name,"r"))!=NULL){ -/*107:*/ +/*106:*/ #line 363 "cwebdir/ctang-w2c.ch" char x[BUFSIZ],y[BUFSIZ]; @@ -941,7 +936,7 @@ if((check_file= fopen(check_file_name,"r"))==NULL) fatal(_("! Cannot open output file "),check_file_name); -if(temporary_output)/*108:*/ +if(temporary_output)/*107:*/ #line 378 "cwebdir/ctang-w2c.ch" do{ @@ -951,17 +946,17 @@ comparison= (x_size==y_size); if(comparison)comparison= !memcmp(x,y,x_size); }while(comparison&&!feof(C_file)&&!feof(check_file)); -/*:108*/ +/*:107*/ #line 371 "cwebdir/ctang-w2c.ch" fclose(C_file);C_file= NULL; fclose(check_file);check_file= NULL; -/*:107*/ +/*:106*/ #line 411 "cwebdir/ctang-w2c.ch" -/*111:*/ +/*110:*/ #line 419 "cwebdir/ctang-w2c.ch" if(comparison) @@ -971,14 +966,14 @@ remove(output_file_name); rename(check_file_name,output_file_name); } -/*:111*/ +/*:110*/ #line 412 "cwebdir/ctang-w2c.ch" }else rename(check_file_name,output_file_name); } -/*:110*/ +/*:109*/ #line 151 "cwebdir/ctang-w2c.ch" } @@ -1148,12 +1143,12 @@ skip_ahead(void) { eight_bits c; while(true){ -if(loc> limit&&(get_line()==false))return(new_section); +if(loc> limit&&(get_line()==false))return new_section; *(limit+1)= '@'; while(*loc!='@')loc++; if(loc<=limit){ loc++;c= ccode[(eight_bits)*loc];loc++; -if(c!=ignore||*(loc-1)=='>')return(c); +if(c!=ignore||*(loc-1)=='>')return c; } } } @@ -1168,20 +1163,20 @@ char c; while(true){ if(loc> limit){ if(is_long_comment){ -if(get_line())return(comment_continues= true); +if(get_line())return comment_continues= true; else{ #line 165 "cwebdir/ctang-w2c.ch" err_print(_("! Input ended in mid-comment")); #line 848 "cwebdir/ctangle.w" -return(comment_continues= false); +return comment_continues= false; } } -else return(comment_continues= false); +else return comment_continues= false; } c= *(loc++); if(is_long_comment&&c=='*'&&*loc=='/'){ -loc++;return(comment_continues= false); +loc++;return comment_continues= false; } if(c=='@'){ if(ccode[(eight_bits)*loc]==new_section){ @@ -1189,7 +1184,7 @@ if(ccode[(eight_bits)*loc]==new_section){ err_print(_("! Section name ended in mid-comment"));loc--; #line 861 "cwebdir/ctangle.w" -return(comment_continues= false); +return comment_continues= false; } else loc++; } @@ -1207,7 +1202,7 @@ eight_bits c; while(true){ if(loc> limit){ if(preprocessing&&*(limit-1)!='\\')preprocessing= 0; -if(get_line()==false)return(new_section); +if(get_line()==false)return new_section; else if(print_where&&!no_where){ print_where= false; /*85:*/ @@ -1229,13 +1224,13 @@ app_repl(a_l%0400);} #line 900 "cwebdir/ctangle.w" } -else return('\n'); +else return'\n'; } c= *loc; if(comment_continues||(c=='/'&&(*(loc+1)=='*'||*(loc+1)=='/'))){ skip_comment(comment_continues||*(loc+1)=='*'); -if(comment_continues)return('\n'); +if(comment_continues)return'\n'; else continue; } loc++; @@ -1261,7 +1256,7 @@ while(xisdigit(*loc))loc++; found:while(*loc=='u'||*loc=='U'||*loc=='l'||*loc=='L' ||*loc=='f'||*loc=='F')loc++; id_loc= loc; -return(constant); +return constant; } /*:73*/ @@ -1317,7 +1312,7 @@ term_write(section_text+1,25); err_print("..."); } id_loc++; -return(string); +return string; } /*:74*/ @@ -1330,7 +1325,7 @@ else if(isalpha(c)||isxalpha(c)||ishigh(c)) id_first= --loc; while(isalpha((eight_bits)*++loc)||isdigit((eight_bits)*loc) ||isxalpha((eight_bits)*loc)||ishigh((eight_bits)*loc)); -id_loc= loc;return(identifier); +id_loc= loc;return identifier; } /*:72*/ @@ -1443,7 +1438,7 @@ overflow(_("output files")); /*:47*/ #line 1098 "cwebdir/ctangle.w" -return(section_name); +return section_name; } /*:77*/ @@ -1459,7 +1454,7 @@ if(loc>=limit)err_print(_("! Verbatim string didn't end")); #line 1160 "cwebdir/ctangle.w" id_loc= loc;loc+= 2; -return(string); +return string; } /*:81*/ @@ -1490,12 +1485,12 @@ err_print(_("! String didn't end"));loc= limit-1;break; } } loc++; -return(ord); +return ord; /*:76*/ #line 1058 "cwebdir/ctangle.w" -default:return(c); +default:return c; } } @@ -1505,7 +1500,7 @@ default:return(c); else if(xisspace(c)){ if(!preprocessing||loc> limit)continue; -else return(' '); +else return' '; } else if(c=='#'&&loc==buffer+1)preprocessing= 1; mistake:/*71:*/ @@ -1535,7 +1530,7 @@ case'!':if(*loc=='=')compress(non_eq);break; /*:71*/ #line 926 "cwebdir/ctangle.w" -return(c); +return c; } } @@ -1744,8 +1739,8 @@ if(text_ptr> text_info_end)overflow(_("text")); cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } -/*:84*//*92:*/ -#line 1358 "cwebdir/ctangle.w" +/*:84*//*91:*/ +#line 1355 "cwebdir/ctangle.w" static void scan_section(void) @@ -1759,8 +1754,8 @@ printf("*%d",section_count);update_terminal; } next_control= 0; while(true){ -/*93:*/ -#line 1397 "cwebdir/ctangle.w" +/*92:*/ +#line 1394 "cwebdir/ctangle.w" while(next_control<definition) @@ -1768,18 +1763,18 @@ if((next_control= skip_ahead())==section_name){ loc-= 2;next_control= get_next(); } -/*:93*/ -#line 1372 "cwebdir/ctangle.w" +/*:92*/ +#line 1369 "cwebdir/ctangle.w" if(next_control==definition){ -/*94:*/ -#line 1404 "cwebdir/ctangle.w" +/*93:*/ +#line 1401 "cwebdir/ctangle.w" { while((next_control= get_next())=='\n'); if(next_control!=identifier){ #line 291 "cwebdir/ctang-w2c.ch" err_print(_("! Definition flushed, must start with identifier")); -#line 1408 "cwebdir/ctangle.w" +#line 1405 "cwebdir/ctangle.w" continue; } @@ -1793,8 +1788,8 @@ scan_repl(macro); cur_text->text_link= macro; } -/*:94*/ -#line 1374 "cwebdir/ctangle.w" +/*:93*/ +#line 1371 "cwebdir/ctangle.w" continue; } @@ -1803,36 +1798,36 @@ p= name_dir;break; } if(next_control==section_name){ p= cur_section_name; -/*95:*/ -#line 1429 "cwebdir/ctangle.w" +/*94:*/ +#line 1426 "cwebdir/ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; -/*:95*/ -#line 1382 "cwebdir/ctangle.w" +/*:94*/ +#line 1379 "cwebdir/ctangle.w" break; } return; } no_where= print_where= false; -/*96:*/ -#line 1434 "cwebdir/ctangle.w" +/*95:*/ +#line 1431 "cwebdir/ctangle.w" -/*97:*/ -#line 1439 "cwebdir/ctangle.w" +/*96:*/ +#line 1436 "cwebdir/ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); -/*:97*/ -#line 1435 "cwebdir/ctangle.w" +/*:96*/ +#line 1432 "cwebdir/ctangle.w" scan_repl(section_name); -/*98:*/ -#line 1443 "cwebdir/ctangle.w" +/*97:*/ +#line 1440 "cwebdir/ctangle.w" if(p==name_dir||p==0){ (last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1848,17 +1843,17 @@ q->text_link= cur_text-text_info; cur_text->text_link= section_flag; -/*:98*/ -#line 1437 "cwebdir/ctangle.w" +/*:97*/ +#line 1434 "cwebdir/ctangle.w" -/*:96*/ -#line 1388 "cwebdir/ctangle.w" +/*:95*/ +#line 1385 "cwebdir/ctangle.w" } -/*:92*//*100:*/ -#line 1461 "cwebdir/ctangle.w" +/*:91*//*99:*/ +#line 1458 "cwebdir/ctangle.w" static void phase_one(void){ @@ -1871,8 +1866,8 @@ check_complete(); phase= 2; } -/*:100*//*102:*/ -#line 1479 "cwebdir/ctangle.w" +/*:99*//*101:*/ +#line 1476 "cwebdir/ctangle.w" static void skip_limbo(void) @@ -1886,8 +1881,8 @@ if(loc++<=limit){ c= *loc++; if(ccode[(eight_bits)c]==new_section)break; switch(ccode[(eight_bits)c]){ -case translit_code:/*103:*/ -#line 1508 "cwebdir/ctangle.w" +case translit_code:/*102:*/ +#line 1505 "cwebdir/ctangle.w" while(xisspace(*loc)&&loc<limit)loc++; loc+= 3; @@ -1895,7 +1890,7 @@ if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2)) ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1))) #line 309 "cwebdir/ctang-w2c.ch" err_print(_("! Improper hex number following @l")); -#line 1514 "cwebdir/ctangle.w" +#line 1511 "cwebdir/ctangle.w" else{ unsigned int i; @@ -1907,7 +1902,7 @@ while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||*loc=='_'))loc++; if(loc-beg>=translit_length) #line 315 "cwebdir/ctang-w2c.ch" err_print(_("! Replacement string in @l too long")); -#line 1524 "cwebdir/ctangle.w" +#line 1521 "cwebdir/ctangle.w" else{ strncpy(translit[i-0200],beg,(size_t)(loc-beg)); @@ -1915,8 +1910,8 @@ translit[i-0200][loc-beg]= '\0'; } } -/*:103*/ -#line 1492 "cwebdir/ctangle.w" +/*:102*/ +#line 1489 "cwebdir/ctangle.w" break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1924,21 +1919,21 @@ while((c= skip_ahead())=='@'); if(*(loc-1)!='>') #line 297 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in control text")); -#line 1498 "cwebdir/ctangle.w" +#line 1495 "cwebdir/ctangle.w" break; } #line 303 "cwebdir/ctang-w2c.ch" default:err_print(_("! Double @ should be used in limbo")); -#line 1502 "cwebdir/ctangle.w" +#line 1499 "cwebdir/ctangle.w" } } } } -/*:102*//*104:*/ -#line 1534 "cwebdir/ctangle.w" +/*:101*//*103:*/ +#line 1531 "cwebdir/ctangle.w" void print_stats(void){ @@ -1951,9 +1946,9 @@ printf(_("%ld replacement texts (out of %ld)\n"), printf(_("%ld bytes (out of %ld)\n"), (ptrdiff_t)(byte_ptr-byte_mem),(long)max_bytes); printf(_("%ld tokens (out of %ld)\n"), -#line 1545 "cwebdir/ctangle.w" +#line 1542 "cwebdir/ctangle.w" (ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks); } #line 341 "cwebdir/ctang-w2c.ch" -/*:104*/ +/*:103*/ |