diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2023-07-21 14:14:07 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2023-07-21 14:14:07 +0000 |
commit | 01b485ff67d2a9b74b908db54b1b030d51d3cf8e (patch) | |
tree | 910ecded44c0373e549775a7d71eacd8f8a3ca3b /Build/source/texk/web2c/cwebboot.cin | |
parent | 692a5ac8d0ba11a7fb1dbac5f5a35d7b34f29262 (diff) |
[CWEB] Match common.w with common.h.
git-svn-id: svn://tug.org/texlive/trunk@67688 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebboot.cin')
-rw-r--r-- | Build/source/texk/web2c/cwebboot.cin | 249 |
1 files changed, 126 insertions, 123 deletions
diff --git a/Build/source/texk/web2c/cwebboot.cin b/Build/source/texk/web2c/cwebboot.cin index adc605332d2..ccca99d5cbb 100644 --- a/Build/source/texk/web2c/cwebboot.cin +++ b/Build/source/texk/web2c/cwebboot.cin @@ -1,8 +1,8 @@ /*1:*/ #line 62 "cwebdir/common.w" -/*3:*/ -#line 54 "cwebdir/comm-w2c.h" +/*4:*/ +#line 61 "cwebdir/comm-w2c.h" #include <ctype.h> #include <kpathsea/simpletypes.h> @@ -15,17 +15,17 @@ #ifndef HAVE_GETTEXT #define HAVE_GETTEXT 0 #endif -#line 66 "cwebdir/comm-w2c.h" +#line 73 "cwebdir/comm-w2c.h" #if HAVE_GETTEXT #include <libintl.h> #else -#line 70 "cwebdir/comm-w2c.h" +#line 77 "cwebdir/comm-w2c.h" #define gettext(a) a #endif -#line 72 "cwebdir/comm-w2c.h" +#line 79 "cwebdir/comm-w2c.h" -/*:3*//*91:*/ +/*:4*//*91:*/ #line 733 "cwebdir/comm-w2c.ch" #if HAVE_GETTEXT @@ -188,24 +188,24 @@ ctangle,cweave,ctwill extern cweb program; extern int phase; -/*:2*//*4:*/ -#line 94 "cwebdir/comm-w2c.h" +/*:2*//*5:*/ +#line 101 "cwebdir/comm-w2c.h" extern char section_text[]; extern char*section_text_end; extern char*id_first; extern char*id_loc; -/*:4*//*5:*/ -#line 112 "cwebdir/comm-w2c.h" +/*:5*//*6:*/ +#line 119 "cwebdir/comm-w2c.h" extern char buffer[]; extern char*buffer_end; extern char*loc; extern char*limit; -/*:5*//*6:*/ -#line 129 "cwebdir/comm-w2c.h" +/*:6*//*7:*/ +#line 136 "cwebdir/comm-w2c.h" extern int include_depth; extern FILE*file[]; @@ -221,16 +221,16 @@ extern boolean input_has_ended; extern boolean changing; extern boolean web_file_open; -/*:6*//*8:*/ -#line 150 "cwebdir/comm-w2c.h" +/*:7*//*9:*/ +#line 157 "cwebdir/comm-w2c.h" extern sixteen_bits section_count; extern boolean changed_section[]; extern boolean change_pending; extern boolean print_where; -/*:8*//*9:*/ -#line 164 "cwebdir/comm-w2c.h" +/*:9*//*10:*/ +#line 171 "cwebdir/comm-w2c.h" typedef struct name_info{ char*byte_start; @@ -254,13 +254,13 @@ extern name_pointer hash[]; extern hash_pointer hash_end; extern hash_pointer h; -/*:9*//*11:*/ -#line 208 "cwebdir/comm-w2c.h" +/*:10*//*12:*/ +#line 217 "cwebdir/comm-w2c.h" extern int history; -/*:11*//*13:*/ -#line 225 "cwebdir/comm-w2c.h" +/*:12*//*14:*/ +#line 234 "cwebdir/comm-w2c.h" extern int argc; extern char**argv; @@ -272,8 +272,8 @@ extern char check_file_name[]; extern boolean flags[]; extern const char*use_language; -/*:13*//*14:*/ -#line 241 "cwebdir/comm-w2c.h" +/*:14*//*15:*/ +#line 250 "cwebdir/comm-w2c.h" extern FILE*C_file; extern FILE*tex_file; @@ -282,7 +282,7 @@ extern FILE*scn_file; extern FILE*active_file; extern FILE*check_file; -/*:14*/ +/*:15*/ #line 65 "cwebdir/common.w" /*18:*/ @@ -338,8 +338,8 @@ boolean web_file_open= false; static char change_buffer[buf_size]; static char*change_limit; -/*:26*//*37:*/ -#line 393 "cwebdir/common.w" +/*:26*//*42:*/ +#line 545 "cwebdir/common.w" sixteen_bits section_count; boolean changed_section[max_sections]; @@ -347,7 +347,7 @@ boolean change_pending; boolean print_where= false; -/*:37*//*43:*/ +/*:42*//*43:*/ #line 590 "cwebdir/common.w" char byte_mem[max_bytes]; @@ -420,42 +420,45 @@ string texmf_locale; /*:87*/ #line 66 "cwebdir/common.w" -/*7:*/ -#line 144 "cwebdir/comm-w2c.h" +/*3:*/ +#line 44 "cwebdir/comm-w2c.h" + +extern void common_init(void); +extern void cb_show_banner(void); + +extern void print_stats(void); + +/*:3*//*8:*/ +#line 151 "cwebdir/comm-w2c.h" extern boolean get_line(void); extern void check_complete(void); extern void reset_input(void); -/*:7*//*10:*/ -#line 187 "cwebdir/comm-w2c.h" +/*:8*//*11:*/ +#line 194 "cwebdir/comm-w2c.h" -extern boolean names_match(name_pointer,const char*,size_t,eight_bits); extern name_pointer id_lookup(const char*,const char*,eight_bits); extern name_pointer section_lookup(char*,char*,boolean); -extern void init_node(name_pointer); -extern void init_p(name_pointer,eight_bits); extern void print_prefix_name(name_pointer); extern void print_section_name(name_pointer); extern void sprint_section_name(char*,name_pointer); -/*:10*//*12:*/ -#line 211 "cwebdir/comm-w2c.h" +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 220 "cwebdir/comm-w2c.h" extern int wrap_up(void); extern void err_print(const char*); extern void fatal(const char*,const char*); extern void overflow(const char*); -/*:12*//*15:*/ -#line 250 "cwebdir/comm-w2c.h" - -extern void common_init(void); -extern void print_stats(void); -extern void cb_show_banner(void); - -/*:15*//*24:*/ +/*:13*//*24:*/ #line 176 "cwebdir/common.w" static boolean input_ln(FILE*); @@ -775,67 +778,20 @@ if(lines_dont_match)n++; } /*:32*//*35:*/ -#line 356 "cwebdir/common.w" - -void -reset_input(void) -{ -limit= buffer;loc= buffer+1;buffer[0]= ' '; -/*36:*/ -#line 371 "cwebdir/common.w" - -#line 150 "cwebdir/comm-w2c.ch" -if((found_filename= kpse_find_cweb(web_file_name))==NULL -||(web_file= fopen(found_filename,"r"))==NULL) -fatal(_("! Cannot open input file "),web_file_name); -else if(strlen(found_filename)<max_file_name_length){ - -if(strcmp(web_file_name,found_filename)) -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 377 "cwebdir/common.w" - - -web_file_open= true; -#line 166 "cwebdir/comm-w2c.ch" -if((found_filename= kpse_find_cweb(change_file_name))==NULL -||(change_file= fopen(found_filename,"r"))==NULL) -fatal(_("! Cannot open change file "),change_file_name); -else if(strlen(found_filename)<max_file_name_length){ - -if(strcmp(change_file_name,found_filename)) -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 382 "cwebdir/common.w" - -/*:36*/ -#line 361 "cwebdir/common.w" - -include_depth= cur_line= change_line= 0; -change_depth= include_depth; -changing= true;prime_the_change_buffer();changing= !changing; -limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false; -} - -/*:35*//*38:*/ -#line 400 "cwebdir/common.w" +#line 362 "cwebdir/common.w" boolean get_line(void) { restart: if(changing&&include_depth==change_depth) -/*41:*/ -#line 508 "cwebdir/common.w" +/*38:*/ +#line 470 "cwebdir/common.w" { change_line++; if(!input_ln(change_file)){ -#line 275 "cwebdir/comm-w2c.ch" +#line 240 "cwebdir/comm-w2c.ch" err_print(_("! Change file ended without @z")); -#line 512 "cwebdir/common.w" +#line 474 "cwebdir/common.w" buffer[0]= '@';buffer[1]= 'z';limit= buffer+2; } @@ -851,9 +807,9 @@ if(buffer[0]=='@'){ if(xisupper(buffer[1]))buffer[1]= tolower((int)buffer[1]); if(buffer[1]=='x'||buffer[1]=='y'){ loc= buffer+2; -#line 281 "cwebdir/comm-w2c.ch" +#line 246 "cwebdir/comm-w2c.ch" err_print(_("! Where is the matching @z?")); -#line 528 "cwebdir/common.w" +#line 490 "cwebdir/common.w" } else if(buffer[1]=='z'){ @@ -863,12 +819,12 @@ prime_the_change_buffer();changing= !changing;print_where= true; } } -/*:41*/ -#line 405 "cwebdir/common.w" +/*:38*/ +#line 367 "cwebdir/common.w" if(!changing||include_depth> change_depth){ -/*40:*/ -#line 491 "cwebdir/common.w" +/*37:*/ +#line 453 "cwebdir/common.w" { cur_line++; while(!input_ln(cur_file)){ @@ -886,8 +842,8 @@ if(buffer[0]==change_buffer[0]) if(change_limit> change_buffer)check_change(); } -/*:40*/ -#line 407 "cwebdir/common.w" +/*:37*/ +#line 369 "cwebdir/common.w" if(changing&&include_depth==change_depth)goto restart; } @@ -897,27 +853,27 @@ if(buffer[0]=='@'&&(buffer[1]=='i'||buffer[1]=='I')){ loc= buffer+2;*limit= '"'; while(*loc==' '||*loc=='\t')loc++; if(loc>=limit){ -#line 181 "cwebdir/comm-w2c.ch" +#line 146 "cwebdir/comm-w2c.ch" err_print(_("! Include file name not given")); -#line 417 "cwebdir/common.w" +#line 379 "cwebdir/common.w" goto restart; } if(include_depth>=max_include_depth-1){ -#line 187 "cwebdir/comm-w2c.ch" +#line 152 "cwebdir/comm-w2c.ch" err_print(_("! Too many nested includes")); -#line 422 "cwebdir/common.w" +#line 384 "cwebdir/common.w" goto restart; } include_depth++; -/*39:*/ -#line 445 "cwebdir/common.w" +/*36:*/ +#line 407 "cwebdir/common.w" { -#line 224 "cwebdir/comm-w2c.ch" +#line 189 "cwebdir/comm-w2c.ch" char*cur_file_name_end= cur_file_name+max_file_name_length-1; char*k= cur_file_name; -#line 450 "cwebdir/common.w" +#line 412 "cwebdir/common.w" if(*loc=='"'){ loc++; @@ -928,7 +884,7 @@ while(*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end)*k++= *loc++; if(k> cur_file_name_end)too_long(); *k= '\0'; -#line 231 "cwebdir/comm-w2c.ch" +#line 196 "cwebdir/comm-w2c.ch" if((found_filename= kpse_find_cweb(cur_file_name))!=NULL &&(cur_file= fopen(found_filename,"r"))!=NULL){ @@ -938,25 +894,25 @@ 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 461 "cwebdir/common.w" +#line 423 "cwebdir/common.w" cur_line= 0;print_where= true; goto restart; } -#line 269 "cwebdir/comm-w2c.ch" +#line 234 "cwebdir/comm-w2c.ch" include_depth--;err_print(_("! Cannot open include file"));goto restart; -#line 489 "cwebdir/common.w" +#line 451 "cwebdir/common.w" } -/*:39*/ -#line 426 "cwebdir/common.w" +/*:36*/ +#line 388 "cwebdir/common.w" } return true; } -#line 202 "cwebdir/comm-w2c.ch" -/*:38*//*42:*/ -#line 540 "cwebdir/common.w" +#line 167 "cwebdir/comm-w2c.ch" +/*:35*//*39:*/ +#line 502 "cwebdir/common.w" void check_complete(void){ @@ -964,14 +920,61 @@ if(change_limit!=change_buffer){ strncpy(buffer,change_buffer,(size_t)(change_limit-change_buffer+1)); limit= buffer+(ptrdiff_t)(change_limit-change_buffer); changing= true;change_depth= include_depth;loc= buffer; -#line 287 "cwebdir/comm-w2c.ch" +#line 252 "cwebdir/comm-w2c.ch" err_print(_("! Change file entry did not match")); -#line 548 "cwebdir/common.w" +#line 510 "cwebdir/common.w" } } -/*:42*//*48:*/ +/*:39*//*40:*/ +#line 518 "cwebdir/common.w" + +void +reset_input(void) +{ +limit= buffer;loc= buffer+1;buffer[0]= ' '; +/*41:*/ +#line 533 "cwebdir/common.w" + +#line 262 "cwebdir/comm-w2c.ch" +if((found_filename= kpse_find_cweb(web_file_name))==NULL +||(web_file= fopen(found_filename,"r"))==NULL) +fatal(_("! Cannot open input file "),web_file_name); +else if(strlen(found_filename)<max_file_name_length){ + +if(strcmp(web_file_name,found_filename)) +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 539 "cwebdir/common.w" + + +web_file_open= true; +#line 278 "cwebdir/comm-w2c.ch" +if((found_filename= kpse_find_cweb(change_file_name))==NULL +||(change_file= fopen(found_filename,"r"))==NULL) +fatal(_("! Cannot open change file "),change_file_name); +else if(strlen(found_filename)<max_file_name_length){ + +if(strcmp(change_file_name,found_filename)) +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 544 "cwebdir/common.w" + +/*:41*/ +#line 523 "cwebdir/common.w" + +include_depth= cur_line= change_line= 0; +change_depth= include_depth; +changing= true;prime_the_change_buffer();changing= !changing; +limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false; +} + +/*:40*//*48:*/ #line 633 "cwebdir/common.w" name_pointer |