diff options
Diffstat (limited to 'Build/source/texk/web2c/cwebboot.cin')
-rw-r--r-- | Build/source/texk/web2c/cwebboot.cin | 373 |
1 files changed, 183 insertions, 190 deletions
diff --git a/Build/source/texk/web2c/cwebboot.cin b/Build/source/texk/web2c/cwebboot.cin index 21ccb238c4a..d9f7c934973 100644 --- a/Build/source/texk/web2c/cwebboot.cin +++ b/Build/source/texk/web2c/cwebboot.cin @@ -11,7 +11,7 @@ #if HAVE_GETTEXT #include <libintl.h> #else -#define gettext(A) A +#define gettext(a) a #endif #include <ctype.h> @@ -23,18 +23,18 @@ #include <string.h> /*:3*//*89:*/ -#line 711 "cwebdir/comm-w2c.ch" +#line 717 "cwebdir/comm-w2c.ch" #if HAVE_GETTEXT #include <locale.h> #else -#define setlocale(A,B) "" -#define bindtextdomain(A,B) "" -#define textdomain(A) "" +#define setlocale(a,b) "" +#define bindtextdomain(a,b) "" +#define textdomain(a) "" #endif /*:89*//*91:*/ -#line 758 "cwebdir/comm-w2c.ch" +#line 764 "cwebdir/comm-w2c.ch" typedef bool boolean; #define HAVE_BOOLEAN @@ -44,7 +44,7 @@ typedef bool boolean; #include <lib/lib.h> /*:91*//*94:*/ -#line 797 "cwebdir/comm-w2c.ch" +#line 803 "cwebdir/comm-w2c.ch" #define CWEB #include "help.h" @@ -52,7 +52,7 @@ typedef bool boolean; /*:94*/ #line 63 "cwebdir/common.w" -#define _(S) gettext(S) \ +#define _(s) gettext(s) \ #define and_and 04 #define lt_lt 020 @@ -93,7 +93,7 @@ typedef bool boolean; #define web_file_name file_name[0] \ #define length(c) (size_t) ((c+1) ->byte_start-(c) ->byte_start) -#define print_id(c) term_write((c) ->byte_start,length((c) ) ) +#define print_id(c) term_write((c) ->byte_start,length(c) ) #define llink link #define rlink dummy.Rlink #define root name_dir->rlink \ @@ -119,27 +119,24 @@ typedef bool boolean; #define new_line putchar('\n') #define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \ +#define buf_size 1000 +#define longest_name 10000 \ + +#define long_buf_size (buf_size+longest_name) #define max_bytes 1000000 \ -#define max_toks 1000000 #define max_names 10239 \ -#define max_sections 4000 -#define max_texts 10239 -#define longest_name 10000 -#define stack_size 500 -#define buf_size 1000 -#define long_buf_size (buf_size+longest_name) \ +#define max_sections 4000 \ #define lines_dont_match (change_limit-change_buffer!=limit-buffer|| \ strncmp(buffer,change_buffer,(size_t) (limit-buffer) ) ) \ -#define if_section_start_make_pending(b) { \ +#define if_section_start_make_pending(b) \ *limit= '!'; \ for(loc= buffer;xisspace(*loc) ;loc++) ; \ *limit= ' '; \ if(*loc=='@'&&(xisspace(*(loc+1) ) ||*(loc+1) =='*') ) change_pending= b; \ -} \ #define too_long() {include_depth--; \ err_print(_("! Include file name too long") ) ;goto restart;} \ @@ -337,7 +334,7 @@ static char change_buffer[buf_size]; static char*change_limit; /*:26*//*37:*/ -#line 396 "cwebdir/common.w" +#line 393 "cwebdir/common.w" sixteen_bits section_count; boolean changed_section[max_sections]; @@ -346,7 +343,7 @@ boolean change_pending; boolean print_where= false; /*:37*//*43:*/ -#line 593 "cwebdir/common.w" +#line 590 "cwebdir/common.w" char byte_mem[max_bytes]; char*byte_mem_end= byte_mem+max_bytes-1; @@ -354,60 +351,60 @@ name_info name_dir[max_names]; name_pointer name_dir_end= name_dir+max_names-1; /*:43*//*44:*/ -#line 604 "cwebdir/common.w" +#line 601 "cwebdir/common.w" char*byte_ptr; name_pointer name_ptr; /*:44*//*46:*/ -#line 624 "cwebdir/common.w" +#line 621 "cwebdir/common.w" name_pointer hash[hash_size]; hash_pointer hash_end= hash+hash_size-1; hash_pointer h; /*:46*//*65:*/ -#line 1006 "cwebdir/common.w" +#line 1003 "cwebdir/common.w" int history= spotless; /*:65*//*73:*/ -#line 1129 "cwebdir/common.w" +#line 1126 "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 441 "cwebdir/comm-w2c.ch" +#line 447 "cwebdir/comm-w2c.ch" char scn_file_name[max_file_name_length]; char check_file_name[max_file_name_length]; -#line 1136 "cwebdir/common.w" +#line 1133 "cwebdir/common.w" boolean flags[128]; /*:73*//*83:*/ -#line 1272 "cwebdir/common.w" +#line 1269 "cwebdir/common.w" FILE*C_file; FILE*tex_file; FILE*idx_file; -#line 571 "cwebdir/comm-w2c.ch" +#line 577 "cwebdir/comm-w2c.ch" FILE*scn_file; FILE*check_file; -#line 578 "cwebdir/comm-w2c.ch" +#line 584 "cwebdir/comm-w2c.ch" FILE*active_file; char*found_filename; -#line 1278 "cwebdir/common.w" +#line 1275 "cwebdir/common.w" -#line 595 "cwebdir/comm-w2c.ch" +#line 601 "cwebdir/comm-w2c.ch" /*:83*//*86:*/ -#line 640 "cwebdir/comm-w2c.ch" +#line 646 "cwebdir/comm-w2c.ch" const char*use_language= ""; /*:86*//*87:*/ -#line 653 "cwebdir/comm-w2c.ch" +#line 659 "cwebdir/comm-w2c.ch" char cb_banner[max_banner]; string texmf_locale; @@ -463,27 +460,27 @@ static boolean input_ln(FILE*); static void prime_the_change_buffer(void); /*:28*//*33:*/ -#line 337 "cwebdir/common.w" +#line 334 "cwebdir/common.w" static void check_change(void); /*:33*//*55:*/ -#line 767 "cwebdir/common.w" +#line 764 "cwebdir/common.w" static int web_strcmp(char*,int,char*,int); 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 994 "cwebdir/common.w" +#line 991 "cwebdir/common.w" static int section_name_cmp(char**,int,name_pointer); /*:64*//*76:*/ -#line 1189 "cwebdir/common.w" +#line 1186 "cwebdir/common.w" static void scan_args(void); -#line 501 "cwebdir/comm-w2c.ch" +#line 507 "cwebdir/comm-w2c.ch" /*:76*//*96:*/ -#line 810 "cwebdir/comm-w2c.ch" +#line 816 "cwebdir/comm-w2c.ch" static void cb_usage(const_string str); static void cb_usagehelp(const_string*message,const_string bug_email); @@ -500,7 +497,7 @@ common_init(void) { #line 78 "cwebdir/comm-w2c.ch" /*45:*/ -#line 608 "cwebdir/common.w" +#line 605 "cwebdir/common.w" name_dir->byte_start= byte_ptr= byte_mem; name_ptr= name_dir+1; @@ -508,7 +505,7 @@ name_ptr->byte_start= byte_mem; root= NULL; /*:45*//*47:*/ -#line 631 "cwebdir/common.w" +#line 628 "cwebdir/common.w" for(h= hash;h<=hash_end;*h++= NULL); @@ -516,7 +513,7 @@ for(h= hash;h<=hash_end;*h++= NULL); #line 78 "cwebdir/comm-w2c.ch" /*92:*/ -#line 772 "cwebdir/comm-w2c.ch" +#line 778 "cwebdir/comm-w2c.ch" kpse_set_program_name(argv[0],"cweb"); @@ -525,7 +522,7 @@ kpse_set_program_name(argv[0],"cweb"); #line 85 "cwebdir/comm-w2c.ch" /*90:*/ -#line 720 "cwebdir/comm-w2c.ch" +#line 726 "cwebdir/comm-w2c.ch" setlocale(LC_MESSAGES,setlocale(LC_CTYPE,"")); texmf_locale= kpse_var_expand("${TEXMFLOCALEDIR}"); @@ -544,18 +541,18 @@ textdomain("cweb"); #line 85 "cwebdir/comm-w2c.ch" /*74:*/ -#line 1142 "cwebdir/common.w" +#line 1139 "cwebdir/common.w" -#line 448 "cwebdir/comm-w2c.ch" +#line 454 "cwebdir/comm-w2c.ch" make_xrefs= check_for_change= true; -#line 1144 "cwebdir/common.w" +#line 1141 "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){ @@ -586,9 +583,9 @@ else strcpy(dot_pos,".wtp"); if((tex_file= fopen(check_file_name,"wb"))==NULL) fatal(_("! Cannot open output file "),check_file_name); } -#line 1290 "cwebdir/common.w" +#line 1287 "cwebdir/common.w" -#line 630 "cwebdir/comm-w2c.ch" +#line 636 "cwebdir/comm-w2c.ch" /*:84*/ #line 101 "cwebdir/common.w" @@ -669,10 +666,8 @@ return; /*31:*/ #line 270 "cwebdir/common.w" -{ change_limit= change_buffer+(ptrdiff_t)(limit-buffer); strncpy(change_buffer,buffer,(size_t)(limit-buffer+1)); -} /*:31*/ #line 234 "cwebdir/common.w" @@ -680,7 +675,7 @@ strncpy(change_buffer,buffer,(size_t)(limit-buffer+1)); } /*:27*//*32:*/ -#line 299 "cwebdir/common.w" +#line 296 "cwebdir/common.w" static void check_change(void) @@ -697,7 +692,7 @@ changing= print_where= true;change_line++; if(!input_ln(change_file)){ #line 121 "cwebdir/comm-w2c.ch" err_print(_("! Change file ended before @y")); -#line 314 "cwebdir/common.w" +#line 311 "cwebdir/common.w" change_limit= change_buffer;changing= false; return; @@ -705,12 +700,12 @@ return; if(limit> buffer+1&&buffer[0]=='@'){ char xyz_code= xisupper(buffer[1])?tolower((eight_bits)buffer[1]):buffer[1]; /*34:*/ -#line 339 "cwebdir/common.w" +#line 336 "cwebdir/common.w" if(xyz_code=='x'||xyz_code=='z'){ #line 133 "cwebdir/comm-w2c.ch" loc= buffer+2;err_print(_("! Where is the matching @y?")); -#line 342 "cwebdir/common.w" +#line 339 "cwebdir/common.w" } else if(xyz_code=='y'){ @@ -719,7 +714,7 @@ loc= buffer+2; printf("\n! Hmm... %d ",n); #line 139 "cwebdir/comm-w2c.ch" err_print(_("of the preceding lines failed to match")); -#line 349 "cwebdir/common.w" +#line 346 "cwebdir/common.w" } change_depth= include_depth; @@ -727,26 +722,24 @@ return; } /*:34*/ -#line 321 "cwebdir/common.w" +#line 318 "cwebdir/common.w" } /*31:*/ #line 270 "cwebdir/common.w" -{ change_limit= change_buffer+(ptrdiff_t)(limit-buffer); strncpy(change_buffer,buffer,(size_t)(limit-buffer+1)); -} /*:31*/ -#line 323 "cwebdir/common.w" +#line 320 "cwebdir/common.w" changing= false;cur_line++; while(!input_ln(cur_file)){ if(include_depth==0){ #line 127 "cwebdir/comm-w2c.ch" err_print(_("! CWEB file ended during a change")); -#line 328 "cwebdir/common.w" +#line 325 "cwebdir/common.w" input_has_ended= true;return; } @@ -757,14 +750,14 @@ if(lines_dont_match)n++; } /*:32*//*35:*/ -#line 359 "cwebdir/common.w" +#line 356 "cwebdir/common.w" void reset_input(void) { limit= buffer;loc= buffer+1;buffer[0]= ' '; /*36:*/ -#line 374 "cwebdir/common.w" +#line 371 "cwebdir/common.w" #line 149 "cwebdir/comm-w2c.ch" if((found_filename= kpse_find_cweb(web_file_name))==NULL @@ -777,7 +770,7 @@ strcpy(web_file_name,found_filename+ ((strncmp(found_filename,"./",2)==0)?2:0)); free(found_filename); }else fatal(_("! Filename too long\n"),found_filename); -#line 380 "cwebdir/common.w" +#line 377 "cwebdir/common.w" web_file_open= true; @@ -792,10 +785,10 @@ strcpy(change_file_name,found_filename+ ((strncmp(found_filename,"./",2)==0)?2:0)); free(found_filename); }else fatal(_("! Filename too long\n"),found_filename); -#line 385 "cwebdir/common.w" +#line 382 "cwebdir/common.w" /*:36*/ -#line 364 "cwebdir/common.w" +#line 361 "cwebdir/common.w" include_depth= cur_line= change_line= 0; change_depth= include_depth; @@ -804,20 +797,20 @@ limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false; } /*:35*//*38:*/ -#line 403 "cwebdir/common.w" +#line 400 "cwebdir/common.w" boolean get_line(void) { restart: if(changing&&include_depth==change_depth) /*41:*/ -#line 511 "cwebdir/common.w" +#line 508 "cwebdir/common.w" { change_line++; if(!input_ln(change_file)){ #line 274 "cwebdir/comm-w2c.ch" err_print(_("! Change file ended without @z")); -#line 515 "cwebdir/common.w" +#line 512 "cwebdir/common.w" buffer[0]= '@';buffer[1]= 'z';limit= buffer+2; } @@ -835,7 +828,7 @@ if(buffer[1]=='x'||buffer[1]=='y'){ loc= buffer+2; #line 280 "cwebdir/comm-w2c.ch" err_print(_("! Where is the matching @z?")); -#line 531 "cwebdir/common.w" +#line 528 "cwebdir/common.w" } else if(buffer[1]=='z'){ @@ -846,11 +839,11 @@ prime_the_change_buffer();changing= !changing;print_where= true; } /*:41*/ -#line 408 "cwebdir/common.w" +#line 405 "cwebdir/common.w" if(!changing||include_depth> change_depth){ /*40:*/ -#line 494 "cwebdir/common.w" +#line 491 "cwebdir/common.w" { cur_line++; while(!input_ln(cur_file)){ @@ -869,7 +862,7 @@ if(change_limit> change_buffer)check_change(); } /*:40*/ -#line 410 "cwebdir/common.w" +#line 407 "cwebdir/common.w" if(changing&&include_depth==change_depth)goto restart; } @@ -881,25 +874,25 @@ while(*loc==' '||*loc=='\t')loc++; if(loc>=limit){ #line 180 "cwebdir/comm-w2c.ch" err_print(_("! Include file name not given")); -#line 420 "cwebdir/common.w" +#line 417 "cwebdir/common.w" goto restart; } if(include_depth>=max_include_depth-1){ #line 186 "cwebdir/comm-w2c.ch" err_print(_("! Too many nested includes")); -#line 425 "cwebdir/common.w" +#line 422 "cwebdir/common.w" goto restart; } include_depth++; /*39:*/ -#line 448 "cwebdir/common.w" +#line 445 "cwebdir/common.w" { #line 223 "cwebdir/comm-w2c.ch" char*cur_file_name_end= cur_file_name+max_file_name_length-1; char*k= cur_file_name; -#line 453 "cwebdir/common.w" +#line 450 "cwebdir/common.w" if(*loc=='"'){ loc++; @@ -920,17 +913,17 @@ strcpy(cur_file_name,found_filename+ ((strncmp(found_filename,"./",2)==0)?2:0)); free(found_filename); }else fatal(_("! Filename too long\n"),found_filename); -#line 464 "cwebdir/common.w" +#line 461 "cwebdir/common.w" cur_line= 0;print_where= true; goto restart; } #line 268 "cwebdir/comm-w2c.ch" include_depth--;err_print(_("! Cannot open include file"));goto restart; -#line 492 "cwebdir/common.w" +#line 489 "cwebdir/common.w" } /*:39*/ -#line 429 "cwebdir/common.w" +#line 426 "cwebdir/common.w" } return true; @@ -938,7 +931,7 @@ return true; #line 201 "cwebdir/comm-w2c.ch" /*:38*//*42:*/ -#line 543 "cwebdir/common.w" +#line 540 "cwebdir/common.w" void check_complete(void){ @@ -948,13 +941,13 @@ limit= buffer+(ptrdiff_t)(change_limit-change_buffer); changing= true;change_depth= include_depth;loc= buffer; #line 286 "cwebdir/comm-w2c.ch" err_print(_("! Change file entry did not match")); -#line 551 "cwebdir/common.w" +#line 548 "cwebdir/common.w" } } /*:42*//*48:*/ -#line 636 "cwebdir/common.w" +#line 633 "cwebdir/common.w" name_pointer id_lookup( @@ -969,17 +962,17 @@ name_pointer p; if(last==NULL)for(last= first;*last!='\0';last++); l= (int)(last-first); /*49:*/ -#line 659 "cwebdir/common.w" +#line 656 "cwebdir/common.w" h= (eight_bits)*i; while(++i<last)h= (h+h+(int)((eight_bits)*i))%hash_size; /*:49*/ -#line 649 "cwebdir/common.w" +#line 646 "cwebdir/common.w" /*50:*/ -#line 667 "cwebdir/common.w" +#line 664 "cwebdir/common.w" p= hash[h]; while(p&&!names_match(p,first,l,t))p= p->link; @@ -989,28 +982,28 @@ p->link= hash[h];hash[h]= p; } /*:50*/ -#line 650 "cwebdir/common.w" +#line 647 "cwebdir/common.w" if(p==name_ptr)/*51:*/ -#line 679 "cwebdir/common.w" +#line 676 "cwebdir/common.w" { -#line 293 "cwebdir/comm-w2c.ch" +#line 299 "cwebdir/comm-w2c.ch" if(byte_ptr+l> byte_mem_end)overflow(_("byte memory")); if(name_ptr>=name_dir_end)overflow(_("name")); -#line 682 "cwebdir/common.w" +#line 679 "cwebdir/common.w" strncpy(byte_ptr,first,l); (++name_ptr)->byte_start= byte_ptr+= l; init_p(p,t); } /*:51*/ -#line 651 "cwebdir/common.w" +#line 648 "cwebdir/common.w" return p; } /*:48*//*52:*/ -#line 711 "cwebdir/common.w" +#line 708 "cwebdir/common.w" void print_section_name( @@ -1029,7 +1022,7 @@ if(q)term_write("...",3); } /*:52*//*53:*/ -#line 728 "cwebdir/common.w" +#line 725 "cwebdir/common.w" void sprint_section_name( @@ -1049,7 +1042,7 @@ s= p->byte_start; } /*:53*//*54:*/ -#line 746 "cwebdir/common.w" +#line 743 "cwebdir/common.w" void print_prefix_name( @@ -1062,7 +1055,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); } /*:54*//*56:*/ -#line 772 "cwebdir/common.w" +#line 769 "cwebdir/common.w" static int web_strcmp( char*j, @@ -1080,7 +1073,7 @@ else return greater; } /*:56*//*57:*/ -#line 801 "cwebdir/common.w" +#line 798 "cwebdir/common.w" static name_pointer add_section_name( @@ -1093,10 +1086,10 @@ boolean ispref) name_pointer p= name_ptr; char*s= first_chunk(p); int name_len= (int)(last-first)+ispref; -#line 301 "cwebdir/comm-w2c.ch" +#line 307 "cwebdir/comm-w2c.ch" if(s+name_len> byte_mem_end)overflow(_("byte memory")); if(name_ptr+1>=name_dir_end)overflow(_("name")); -#line 815 "cwebdir/common.w" +#line 812 "cwebdir/common.w" (++name_ptr)->byte_start= byte_ptr= s+name_len; if(ispref){ *(byte_ptr-1)= ' '; @@ -1112,7 +1105,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); } /*:57*//*58:*/ -#line 829 "cwebdir/common.w" +#line 826 "cwebdir/common.w" static void extend_section_name( @@ -1124,23 +1117,23 @@ boolean ispref) char*s; name_pointer q= p+1; int name_len= (int)(last-first)+ispref; -#line 308 "cwebdir/comm-w2c.ch" +#line 314 "cwebdir/comm-w2c.ch" if(name_ptr>=name_dir_end)overflow(_("name")); -#line 841 "cwebdir/common.w" +#line 838 "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 314 "cwebdir/comm-w2c.ch" +#line 320 "cwebdir/comm-w2c.ch" if(s+name_len> byte_mem_end)overflow(_("byte memory")); -#line 846 "cwebdir/common.w" +#line 843 "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 857 "cwebdir/common.w" +#line 854 "cwebdir/common.w" name_pointer section_lookup( @@ -1155,7 +1148,7 @@ name_pointer par= NULL; int name_len= (int)(last-first)+1; /*60:*/ -#line 881 "cwebdir/common.w" +#line 878 "cwebdir/common.w" while(p){ c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p)); @@ -1165,14 +1158,14 @@ par= p; p= (c==less?p->llink:p->rlink); }else{ if(r!=NULL){ -#line 320 "cwebdir/comm-w2c.ch" +#line 326 "cwebdir/comm-w2c.ch" fputs(_("\n! Ambiguous prefix: matches <"),stdout); -#line 891 "cwebdir/common.w" +#line 888 "cwebdir/common.w" print_prefix_name(p); -#line 326 "cwebdir/comm-w2c.ch" +#line 332 "cwebdir/comm-w2c.ch" fputs(_(">\n and <"),stdout); -#line 894 "cwebdir/common.w" +#line 891 "cwebdir/common.w" print_prefix_name(r); err_print(">"); return name_dir; @@ -1186,27 +1179,27 @@ p= q,q= NULL; } /*:60*/ -#line 871 "cwebdir/common.w" +#line 868 "cwebdir/common.w" /*61:*/ -#line 906 "cwebdir/common.w" +#line 903 "cwebdir/common.w" if(r==NULL) return add_section_name(par,c,first,last+1,ispref); /*:61*/ -#line 872 "cwebdir/common.w" +#line 869 "cwebdir/common.w" /*62:*/ -#line 914 "cwebdir/common.w" +#line 911 "cwebdir/common.w" switch(section_name_cmp(&first,name_len,r)){ case prefix: if(!ispref){ -#line 332 "cwebdir/comm-w2c.ch" +#line 338 "cwebdir/comm-w2c.ch" fputs(_("\n! New name is a prefix of <"),stdout); -#line 920 "cwebdir/common.w" +#line 917 "cwebdir/common.w" print_section_name(r); err_print(">"); @@ -1218,34 +1211,34 @@ case extension:if(!ispref||first<=last) extend_section_name(r,first,last+1,ispref); break; case bad_extension: -#line 338 "cwebdir/comm-w2c.ch" +#line 344 "cwebdir/comm-w2c.ch" fputs(_("\n! New name extends <"),stdout); -#line 932 "cwebdir/common.w" +#line 929 "cwebdir/common.w" print_section_name(r); err_print(">"); break; default: -#line 344 "cwebdir/comm-w2c.ch" +#line 350 "cwebdir/comm-w2c.ch" fputs(_("\n! Section name incompatible with <"),stdout); -#line 938 "cwebdir/common.w" +#line 935 "cwebdir/common.w" print_prefix_name(r); -#line 350 "cwebdir/comm-w2c.ch" +#line 356 "cwebdir/comm-w2c.ch" fputs(_(">,\n which abbreviates <"),stdout); -#line 941 "cwebdir/common.w" +#line 938 "cwebdir/common.w" print_section_name(r); err_print(">"); } return r; /*:62*/ -#line 873 "cwebdir/common.w" +#line 870 "cwebdir/common.w" } /*:59*//*63:*/ -#line 962 "cwebdir/common.w" +#line 959 "cwebdir/common.w" static int section_name_cmp( char**pfirst, @@ -1279,23 +1272,23 @@ default:return c; } /*:63*//*66:*/ -#line 1016 "cwebdir/common.w" +#line 1013 "cwebdir/common.w" void err_print( const char*s) { -char*k,*l; printf(*s=='!'?"\n%s":"%s",s); if(web_file_open)/*67:*/ -#line 1036 "cwebdir/common.w" +#line 1032 "cwebdir/common.w" -{if(changing&&include_depth==change_depth) -#line 358 "cwebdir/comm-w2c.ch" +{char*k,*l; +if(changing&&include_depth==change_depth) +#line 364 "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 1041 "cwebdir/common.w" +#line 1038 "cwebdir/common.w" l= (loc>=limit?limit:loc); if(l> buffer){ for(k= buffer;k<l;k++) @@ -1310,24 +1303,24 @@ putchar(' '); } /*:67*/ -#line 1023 "cwebdir/common.w" +#line 1019 "cwebdir/common.w" update_terminal;mark_error; } /*:66*//*68:*/ -#line 1068 "cwebdir/common.w" +#line 1065 "cwebdir/common.w" int wrap_up(void){ if(show_progress)new_line; if(show_stats) print_stats(); -#line 388 "cwebdir/comm-w2c.ch" +#line 394 "cwebdir/comm-w2c.ch" /*69:*/ -#line 1078 "cwebdir/common.w" +#line 1075 "cwebdir/common.w" switch(history){ -#line 414 "cwebdir/comm-w2c.ch" +#line 420 "cwebdir/comm-w2c.ch" case spotless: if(show_happiness)puts(_("(No errors were found.)"));break; case harmless_message: @@ -1336,14 +1329,14 @@ case error_message: puts(_("(Pardon me, but I think I spotted something wrong.)"));break; case fatal_message:default: puts(_("(That was a fatal error, my friend.)")); -#line 1088 "cwebdir/common.w" +#line 1085 "cwebdir/common.w" } /*:69*/ -#line 388 "cwebdir/comm-w2c.ch" +#line 394 "cwebdir/comm-w2c.ch" /*88:*/ -#line 664 "cwebdir/comm-w2c.ch" +#line 670 "cwebdir/comm-w2c.ch" if(C_file)fclose(C_file); if(tex_file)fclose(tex_file); @@ -1352,20 +1345,20 @@ if(strlen(check_file_name)) remove(check_file_name); /*:88*/ -#line 389 "cwebdir/comm-w2c.ch" +#line 395 "cwebdir/comm-w2c.ch" -#line 396 "cwebdir/comm-w2c.ch" +#line 402 "cwebdir/comm-w2c.ch" switch(history){ case spotless:return RETURN_OK; case harmless_message:return RETURN_WARN; case error_message:return RETURN_ERROR; case fatal_message:default:return RETURN_FAIL; } -#line 1076 "cwebdir/common.w" +#line 1073 "cwebdir/common.w" } /*:68*//*70:*/ -#line 1096 "cwebdir/common.w" +#line 1093 "cwebdir/common.w" void fatal( const char*s,const char*t) @@ -1376,19 +1369,19 @@ history= fatal_message;exit(wrap_up()); } /*:70*//*71:*/ -#line 1107 "cwebdir/common.w" +#line 1104 "cwebdir/common.w" void overflow( const char*t) { -#line 427 "cwebdir/comm-w2c.ch" +#line 433 "cwebdir/comm-w2c.ch" printf(_("\n! Sorry, %s capacity exceeded"),t);fatal("",""); -#line 1112 "cwebdir/common.w" +#line 1109 "cwebdir/common.w" } /*:71*//*75:*/ -#line 1160 "cwebdir/common.w" +#line 1157 "cwebdir/common.w" static void scan_args(void) @@ -1399,7 +1392,7 @@ register char*s; boolean found_web= false,found_change= false,found_out= false; -#line 471 "cwebdir/comm-w2c.ch" +#line 477 "cwebdir/comm-w2c.ch" strcpy(change_file_name,"/dev/null"); #if defined DEV_NULL strncpy(change_file_name,DEV_NULL,max_file_name_length-2); @@ -1409,29 +1402,29 @@ strncpy(change_file_name,_DEV_NULL,max_file_name_length-2); change_file_name[max_file_name_length-2]= '\0'; #endif -#line 1171 "cwebdir/common.w" +#line 1168 "cwebdir/common.w" while(--argc> 0){ if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/ -#line 1250 "cwebdir/common.w" +#line 1247 "cwebdir/common.w" -#line 514 "cwebdir/comm-w2c.ch" +#line 520 "cwebdir/comm-w2c.ch" { if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0) /*95:*/ -#line 801 "cwebdir/comm-w2c.ch" +#line 807 "cwebdir/comm-w2c.ch" cb_usagehelp(program==ctangle?CTANGLEHELP: program==cweave?CWEAVEHELP:CTWILLHELP,NULL); /*:95*/ -#line 517 "cwebdir/comm-w2c.ch" +#line 523 "cwebdir/comm-w2c.ch" if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0) /*98:*/ -#line 849 "cwebdir/comm-w2c.ch" +#line 855 "cwebdir/comm-w2c.ch" printversionandexit(cb_banner, program==ctwill?"Donald E. Knuth":"Silvio Levy and Donald E. Knuth", @@ -1439,7 +1432,7 @@ NULL,"Contemporary development on https://github.com/ascherer/cweb.\n"); /*:98*/ -#line 520 "cwebdir/comm-w2c.ch" +#line 526 "cwebdir/comm-w2c.ch" if(strcmp("-verbose",*argv)==0||strcmp("--verbose",*argv)==0) @@ -1453,15 +1446,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 557 "cwebdir/comm-w2c.ch" +#line 563 "cwebdir/comm-w2c.ch" cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1265 "cwebdir/common.w" +#line 1262 "cwebdir/common.w" -#line 565 "cwebdir/comm-w2c.ch" +#line 571 "cwebdir/comm-w2c.ch" /*:81*/ -#line 532 "cwebdir/comm-w2c.ch" +#line 538 "cwebdir/comm-w2c.ch" while(isdigit(*dot_pos))dot_pos++; dot_pos--; @@ -1472,43 +1465,43 @@ default:flags[(eight_bits)*dot_pos]= flag_change;continue; break; } } -#line 1253 "cwebdir/common.w" +#line 1250 "cwebdir/common.w" -#line 557 "cwebdir/comm-w2c.ch" +#line 563 "cwebdir/comm-w2c.ch" /*:80*/ -#line 1172 "cwebdir/common.w" +#line 1169 "cwebdir/common.w" else{ s= name_pos= *argv;dot_pos= NULL; -#line 488 "cwebdir/comm-w2c.ch" +#line 494 "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 1179 "cwebdir/common.w" +#line 1176 "cwebdir/common.w" if(!found_web)/*77:*/ -#line 1198 "cwebdir/common.w" +#line 1195 "cwebdir/common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 565 "cwebdir/comm-w2c.ch" +#line 571 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1267 "cwebdir/common.w" +#line 1264 "cwebdir/common.w" /*:82*/ -#line 1201 "cwebdir/common.w" +#line 1198 "cwebdir/common.w" if(dot_pos==NULL) sprintf(web_file_name,"%s.w",*argv); else{ strcpy(web_file_name,*argv); -*dot_pos= 0; +*dot_pos= '\0'; } -#line 1209 "cwebdir/common.w" +#line 1206 "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); @@ -1517,22 +1510,22 @@ found_web= true; } /*:77*/ -#line 1180 "cwebdir/common.w" +#line 1177 "cwebdir/common.w" else if(!found_change)/*78:*/ -#line 1216 "cwebdir/common.w" +#line 1213 "cwebdir/common.w" { if(strcmp(*argv,"-")!=0){ if(s-*argv> max_file_name_length-4) /*82:*/ -#line 565 "cwebdir/comm-w2c.ch" +#line 571 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1267 "cwebdir/common.w" +#line 1264 "cwebdir/common.w" /*:82*/ -#line 1220 "cwebdir/common.w" +#line 1217 "cwebdir/common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1542,21 +1535,21 @@ found_change= true; } /*:78*/ -#line 1181 "cwebdir/common.w" +#line 1178 "cwebdir/common.w" else if(!found_out)/*79:*/ -#line 1228 "cwebdir/common.w" +#line 1225 "cwebdir/common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 565 "cwebdir/comm-w2c.ch" +#line 571 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1267 "cwebdir/common.w" +#line 1264 "cwebdir/common.w" /*:82*/ -#line 1231 "cwebdir/common.w" +#line 1228 "cwebdir/common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1567,7 +1560,7 @@ sprintf(C_file_name,"%s.c",*argv); strcpy(tex_file_name,*argv); strcpy(C_file_name,*argv); if(make_xrefs){ -*dot_pos= 0; +*dot_pos= '\0'; sprintf(idx_file_name,"%s.idx",*argv); sprintf(scn_file_name,"%s.scn",*argv); } @@ -1576,36 +1569,36 @@ found_out= true; } /*:79*/ -#line 1182 "cwebdir/common.w" +#line 1179 "cwebdir/common.w" else/*81:*/ -#line 557 "cwebdir/comm-w2c.ch" +#line 563 "cwebdir/comm-w2c.ch" cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1265 "cwebdir/common.w" +#line 1262 "cwebdir/common.w" -#line 565 "cwebdir/comm-w2c.ch" +#line 571 "cwebdir/comm-w2c.ch" /*:81*/ -#line 1183 "cwebdir/common.w" +#line 1180 "cwebdir/common.w" } } if(!found_web)/*81:*/ -#line 557 "cwebdir/comm-w2c.ch" +#line 563 "cwebdir/comm-w2c.ch" cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1265 "cwebdir/common.w" +#line 1262 "cwebdir/common.w" -#line 565 "cwebdir/comm-w2c.ch" +#line 571 "cwebdir/comm-w2c.ch" /*:81*/ -#line 1186 "cwebdir/common.w" +#line 1183 "cwebdir/common.w" } /*:75*//*97:*/ -#line 814 "cwebdir/comm-w2c.ch" +#line 820 "cwebdir/comm-w2c.ch" static void cb_usage(const_string str) { @@ -1639,7 +1632,7 @@ history= spotless;exit(wrap_up()); } /*:97*//*99:*/ -#line 857 "cwebdir/comm-w2c.ch" +#line 863 "cwebdir/comm-w2c.ch" void cb_show_banner(void) { |