diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2021-02-24 18:19:47 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2021-02-24 18:19:47 +0000 |
commit | 5f6231423ff11a042181be707faa0db6012b8e35 (patch) | |
tree | 1aa670b8921584ddbc3c972cb6016d4bbb670606 /Build/source/texk/web2c/cwebdir | |
parent | 180bb00c12d352e3d1c374a1587d4dc898300c5f (diff) |
[CWEB] Code review.
Compactify single function declarations.
git-svn-id: svn://tug.org/texlive/trunk@57874 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir')
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ChangeLog | 13 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/comm-w2c.h | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/common.c | 226 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/common.h | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/common.w | 44 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctangle.c | 285 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctangle.w | 85 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctwill-mini.ch | 38 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctwill-w2c.ch | 32 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cweav-w2c.ch | 21 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cweave.w | 130 |
11 files changed, 437 insertions, 445 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index 37db3501d51..24c02b0db69 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -1,5 +1,18 @@ 2021-02-24 Andreas Scherer <https://ascherer.github.io> + * comm-w2c.h, + * common.c, + * common.h + * common.w, + * ctangle.c, + * ctangle.w, + * ctwill-mini.ch, + * ctwill-w2c.ch, + * cweav-w2c.ch, + * cweave.w: Fix spacing for |#include| in TeX comment. + +2021-02-24 Andreas Scherer <https://ascherer.github.io> + * cweave.w: Fix spacing for |#include| in TeX comment. 2021-02-24 Andreas Scherer <https://ascherer.github.io> diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.h b/Build/source/texk/web2c/cwebdir/comm-w2c.h index 2a8e3e861a5..ca8b94a7f46 100644 --- a/Build/source/texk/web2c/cwebdir/comm-w2c.h +++ b/Build/source/texk/web2c/cwebdir/comm-w2c.h @@ -186,7 +186,7 @@ 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);@/ +extern void sprint_section_name(char *,name_pointer); @ Code related to error handling: @d spotless 0 /* |history| value for normal jobs */ @@ -244,7 +244,7 @@ extern FILE *check_file; /* temporary output file */ @<Predecl...@>= extern void common_init(void);@/ extern void print_stats(void);@/ -extern void cb_show_banner(void);@/ +extern void cb_show_banner(void); @ The following parameters were sufficient in the original \.{WEB} to handle \TEX/, so they should be sufficient for most applications of diff --git a/Build/source/texk/web2c/cwebdir/common.c b/Build/source/texk/web2c/cwebdir/common.c index 7462a25d9d6..7dd0f0c0838 100644 --- a/Build/source/texk/web2c/cwebdir/common.c +++ b/Build/source/texk/web2c/cwebdir/common.c @@ -232,10 +232,11 @@ boolean program; /*:18*//*19:*/ #line 92 "common.w" + int phase; /*:19*//*21:*/ -#line 129 "common.w" +#line 130 "common.w" char section_text[longest_name+1]; char*section_text_end= section_text+longest_name; @@ -243,7 +244,7 @@ char*id_first; char*id_loc; /*:21*//*22:*/ -#line 149 "common.w" +#line 150 "common.w" char buffer[long_buf_size]; char*buffer_end= buffer+buf_size-2; @@ -274,7 +275,7 @@ static char change_buffer[buf_size]; static char*change_limit; /*:26*//*37:*/ -#line 401 "common.w" +#line 399 "common.w" sixteen_bits section_count; boolean changed_section[max_sections]; @@ -283,7 +284,7 @@ boolean change_pending; boolean print_where= false; /*:37*//*43:*/ -#line 598 "common.w" +#line 596 "common.w" char byte_mem[max_bytes]; char*byte_mem_end= byte_mem+max_bytes-1; @@ -291,25 +292,25 @@ name_info name_dir[max_names]; name_pointer name_dir_end= name_dir+max_names-1; /*:43*//*44:*/ -#line 609 "common.w" +#line 607 "common.w" char*byte_ptr; name_pointer name_ptr; /*:44*//*46:*/ -#line 629 "common.w" +#line 627 "common.w" name_pointer hash[hash_size]; hash_pointer hash_end= hash+hash_size-1; hash_pointer h; /*:46*//*65:*/ -#line 1017 "common.w" +#line 1014 "common.w" int history= spotless; /*:65*//*73:*/ -#line 1138 "common.w" +#line 1135 "common.w" int argc; char**argv; @@ -320,7 +321,7 @@ char scn_file_name[max_file_name_length]; boolean flags[128]; /*:73*//*83:*/ -#line 1286 "common.w" +#line 1282 "common.w" FILE*C_file; FILE*tex_file; @@ -365,50 +366,45 @@ extern void overflow(const char*); extern void common_init(void); extern void print_stats(void); -/*:15*//*23:*/ -#line 159 "common.w" - +/*:15*//*24:*/ +#line 180 "common.w" static boolean input_ln(FILE*); -/*:23*//*27:*/ -#line 231 "common.w" - +/*:24*//*28:*/ +#line 241 "common.w" static void prime_the_change_buffer(void); -/*:27*//*32:*/ -#line 303 "common.w" - +/*:28*//*33:*/ +#line 340 "common.w" static void check_change(void); -/*:32*//*55:*/ -#line 776 "common.w" +/*:33*//*55:*/ +#line 774 "common.w" static int web_strcmp(char*,int,char*,int); static name_pointer add_section_name(name_pointer,int,char*,char*,int); static void extend_section_name(name_pointer,char*,char*,int); -/*:55*//*63:*/ -#line 972 "common.w" - +/*:55*//*64:*/ +#line 1002 "common.w" static int section_name_cmp(char**,int,name_pointer); -/*:63*//*75:*/ -#line 1170 "common.w" - +/*:64*//*76:*/ +#line 1197 "common.w" static void scan_args(void); -/*:75*/ +/*:76*/ #line 71 "common.w" /*:1*//*20:*/ -#line 98 "common.w" +#line 99 "common.w" void common_init(void) { /*45:*/ -#line 613 "common.w" +#line 611 "common.w" name_dir->byte_start= byte_ptr= byte_mem; name_ptr= name_dir+1; @@ -416,24 +412,24 @@ name_ptr->byte_start= byte_mem; root= NULL; /*:45*//*47:*/ -#line 636 "common.w" +#line 634 "common.w" for(h= hash;h<=hash_end;*h++= NULL); /*:47*/ -#line 102 "common.w" +#line 103 "common.w" /*74:*/ -#line 1151 "common.w" +#line 1148 "common.w" show_banner= show_happiness= show_progress= make_xrefs= true; show_stats= false; /*:74*/ -#line 103 "common.w" +#line 104 "common.w" /*84:*/ -#line 1293 "common.w" +#line 1289 "common.w" scan_args(); if(program==ctangle){ @@ -447,12 +443,12 @@ fatal("! Cannot open output file ",tex_file_name); } /*:84*/ -#line 104 "common.w" +#line 105 "common.w" } -/*:20*//*24:*/ -#line 162 "common.w" +/*:20*//*23:*/ +#line 160 "common.w" static boolean input_ln( FILE*fp) @@ -473,15 +469,15 @@ if(c==EOF&&limit==buffer)return false; return true; } -/*:24*//*28:*/ -#line 234 "common.w" +/*:23*//*27:*/ +#line 231 "common.w" static void prime_the_change_buffer(void) { change_limit= change_buffer; /*29:*/ -#line 248 "common.w" +#line 247 "common.w" while(true){ change_line++; @@ -498,10 +494,10 @@ err_print("! Missing @x in change file"); } /*:29*/ -#line 239 "common.w" +#line 236 "common.w" /*30:*/ -#line 265 "common.w" +#line 264 "common.w" do{ change_line++; @@ -513,10 +509,10 @@ return; }while(limit==buffer); /*:30*/ -#line 240 "common.w" +#line 237 "common.w" /*31:*/ -#line 275 "common.w" +#line 274 "common.w" { change_limit= change_buffer+(ptrdiff_t)(limit-buffer); @@ -524,12 +520,12 @@ strncpy(change_buffer,buffer,(size_t)(limit-buffer+1)); } /*:31*/ -#line 241 "common.w" +#line 238 "common.w" } -/*:28*//*33:*/ -#line 306 "common.w" +/*:27*//*32:*/ +#line 302 "common.w" static void check_change(void) @@ -552,7 +548,7 @@ return; if(limit> buffer+1&&buffer[0]=='@'){ char xyz_code= xisupper(buffer[1])?tolower((eight_bits)buffer[1]):buffer[1]; /*34:*/ -#line 344 "common.w" +#line 342 "common.w" if(xyz_code=='x'||xyz_code=='z'){ loc= buffer+2;err_print("! Where is the matching @y?"); @@ -570,11 +566,11 @@ return; } /*:34*/ -#line 328 "common.w" +#line 324 "common.w" } /*31:*/ -#line 275 "common.w" +#line 274 "common.w" { change_limit= change_buffer+(ptrdiff_t)(limit-buffer); @@ -582,7 +578,7 @@ strncpy(change_buffer,buffer,(size_t)(limit-buffer+1)); } /*:31*/ -#line 330 "common.w" +#line 326 "common.w" changing= false;cur_line++; while(!input_ln(cur_file)){ @@ -597,15 +593,15 @@ if(lines_dont_match)n++; } } -/*:33*//*35:*/ -#line 364 "common.w" +/*:32*//*35:*/ +#line 362 "common.w" void reset_input(void) { limit= buffer;loc= buffer+1;buffer[0]= ' '; /*36:*/ -#line 379 "common.w" +#line 377 "common.w" if((web_file= fopen(web_file_name,"r"))==NULL){ strcpy(web_file_name,alt_web_file_name); @@ -619,7 +615,7 @@ if((change_file= fopen(change_file_name,"r"))==NULL) fatal("! Cannot open change file ",change_file_name); /*:36*/ -#line 369 "common.w" +#line 367 "common.w" include_depth= 0;cur_line= 0;change_line= 0; change_depth= include_depth; @@ -628,14 +624,14 @@ limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false; } /*:35*//*38:*/ -#line 408 "common.w" +#line 406 "common.w" boolean get_line(void) { restart: if(changing&&include_depth==change_depth) /*41:*/ -#line 516 "common.w" +#line 514 "common.w" { change_line++; if(!input_ln(change_file)){ @@ -666,11 +662,11 @@ prime_the_change_buffer();changing= !changing;print_where= true; } /*:41*/ -#line 413 "common.w" +#line 411 "common.w" if(!changing||include_depth> change_depth){ /*40:*/ -#line 499 "common.w" +#line 497 "common.w" { cur_line++; while(!input_ln(cur_file)){ @@ -689,7 +685,7 @@ if(change_limit> change_buffer)check_change(); } /*:40*/ -#line 415 "common.w" +#line 413 "common.w" if(changing&&include_depth==change_depth)goto restart; } @@ -710,7 +706,7 @@ goto restart; } include_depth++; /*39:*/ -#line 453 "common.w" +#line 451 "common.w" { char temp_file_name[max_file_name_length]; char*cur_file_name_end= cur_file_name+max_file_name_length-1; @@ -758,14 +754,14 @@ include_depth--;err_print("! Cannot open include file");goto restart; } /*:39*/ -#line 434 "common.w" +#line 432 "common.w" } return true; } /*:38*//*42:*/ -#line 548 "common.w" +#line 546 "common.w" void check_complete(void){ @@ -779,7 +775,7 @@ err_print("! Change file entry did not match"); } /*:42*//*48:*/ -#line 641 "common.w" +#line 639 "common.w" name_pointer id_lookup( @@ -794,17 +790,17 @@ name_pointer p; if(last==NULL)for(last= first;*last!='\0';last++); l= (int)(last-first); /*49:*/ -#line 664 "common.w" +#line 662 "common.w" h= (eight_bits)*i; while(++i<last)h= (h+h+(int)((eight_bits)*i))%hash_size; /*:49*/ -#line 654 "common.w" +#line 652 "common.w" /*50:*/ -#line 672 "common.w" +#line 670 "common.w" p= hash[h]; while(p&&!names_match(p,first,l,t))p= p->link; @@ -814,10 +810,10 @@ p->link= hash[h];hash[h]= p; } /*:50*/ -#line 655 "common.w" +#line 653 "common.w" if(p==name_ptr)/*51:*/ -#line 683 "common.w" +#line 681 "common.w" { if(byte_ptr+l> byte_mem_end)overflow("byte memory"); if(name_ptr>=name_dir_end)overflow("name"); @@ -827,13 +823,13 @@ init_p(p,t); } /*:51*/ -#line 656 "common.w" +#line 654 "common.w" return p; } /*:48*//*52:*/ -#line 715 "common.w" +#line 713 "common.w" void print_section_name( @@ -854,7 +850,7 @@ if(q)term_write("...",3); } /*:52*//*53:*/ -#line 734 "common.w" +#line 732 "common.w" void sprint_section_name( @@ -877,7 +873,7 @@ s= p->byte_start; } /*:53*//*54:*/ -#line 755 "common.w" +#line 753 "common.w" void print_prefix_name( @@ -890,7 +886,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); } /*:54*//*56:*/ -#line 781 "common.w" +#line 779 "common.w" static int web_strcmp( char*j, @@ -908,7 +904,7 @@ else return greater; } /*:56*//*57:*/ -#line 810 "common.w" +#line 808 "common.w" static name_pointer add_section_name( @@ -939,7 +935,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); } /*:57*//*58:*/ -#line 839 "common.w" +#line 837 "common.w" static void extend_section_name( @@ -963,7 +959,7 @@ if(ispref)*(byte_ptr-1)= ' '; } /*:58*//*59:*/ -#line 867 "common.w" +#line 865 "common.w" name_pointer section_lookup( @@ -978,7 +974,7 @@ name_pointer par= NULL; int name_len= (int)(last-first)+1; /*60:*/ -#line 891 "common.w" +#line 889 "common.w" while(p){ c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p)); @@ -1005,19 +1001,19 @@ p= q,q= NULL; } /*:60*/ -#line 881 "common.w" +#line 879 "common.w" /*61:*/ -#line 916 "common.w" +#line 914 "common.w" if(r==NULL) return add_section_name(par,c,first,last+1,ispref); /*:61*/ -#line 882 "common.w" +#line 880 "common.w" /*62:*/ -#line 924 "common.w" +#line 922 "common.w" switch(section_name_cmp(&first,name_len,r)){ @@ -1051,12 +1047,12 @@ return r; } /*:62*/ -#line 883 "common.w" +#line 881 "common.w" } -/*:59*//*64:*/ -#line 975 "common.w" +/*:59*//*63:*/ +#line 970 "common.w" static int section_name_cmp( char**pfirst, @@ -1089,8 +1085,8 @@ default:return c; } } -/*:64*//*66:*/ -#line 1027 "common.w" +/*:63*//*66:*/ +#line 1024 "common.w" void err_print( @@ -1099,7 +1095,7 @@ const char*s) char*k,*l; printf(*s=='!'?"\n%s":"%s",s); if(web_file_open)/*67:*/ -#line 1047 "common.w" +#line 1044 "common.w" {if(changing&&include_depth==change_depth) printf(". (l. %d of change file)\n",change_line); @@ -1119,20 +1115,20 @@ putchar(' '); } /*:67*/ -#line 1034 "common.w" +#line 1031 "common.w" update_terminal;mark_error; } /*:66*//*68:*/ -#line 1079 "common.w" +#line 1076 "common.w" int wrap_up(void){ if(show_progress)new_line; if(show_stats) print_stats(); /*69:*/ -#line 1089 "common.w" +#line 1086 "common.w" switch(history){ case spotless:if(show_happiness)puts("(No errors were found.)");break; @@ -1144,14 +1140,14 @@ case fatal_message:puts("(That was a fatal error, my friend.)"); } /*:69*/ -#line 1084 "common.w" +#line 1081 "common.w" if(history> harmless_message)return EXIT_FAILURE; else return EXIT_SUCCESS; } /*:68*//*70:*/ -#line 1105 "common.w" +#line 1102 "common.w" void fatal( const char*s,const char*t) @@ -1162,7 +1158,7 @@ history= fatal_message;exit(wrap_up()); } /*:70*//*71:*/ -#line 1116 "common.w" +#line 1113 "common.w" void overflow( const char*t) @@ -1171,8 +1167,8 @@ printf("\n! Sorry, %s capacity exceeded",t);fatal("",""); } -/*:71*//*76:*/ -#line 1173 "common.w" +/*:71*//*75:*/ +#line 1167 "common.w" static void scan_args(void) @@ -1186,7 +1182,7 @@ 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 1262 "common.w" +#line 1258 "common.w" { for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++) @@ -1194,7 +1190,7 @@ flags[(eight_bits)*dot_pos]= flag_change; } /*:80*/ -#line 1185 "common.w" +#line 1179 "common.w" else{ s= name_pos= *argv;dot_pos= NULL; @@ -1204,17 +1200,17 @@ else if(*s=='/')dot_pos= NULL,name_pos= ++s; else s++; } if(!found_web)/*77:*/ -#line 1210 "common.w" +#line 1206 "common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1280 "common.w" +#line 1276 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1213 "common.w" +#line 1209 "common.w" if(dot_pos==NULL) sprintf(web_file_name,"%s.w",*argv); @@ -1231,21 +1227,21 @@ found_web= true; } /*:77*/ -#line 1194 "common.w" +#line 1188 "common.w" else if(!found_change)/*78:*/ -#line 1228 "common.w" +#line 1224 "common.w" { if(strcmp(*argv,"-")!=0){ if(s-*argv> max_file_name_length-4) /*82:*/ -#line 1280 "common.w" +#line 1276 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1232 "common.w" +#line 1228 "common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1255,20 +1251,20 @@ found_change= true; } /*:78*/ -#line 1195 "common.w" +#line 1189 "common.w" else if(!found_out)/*79:*/ -#line 1240 "common.w" +#line 1236 "common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1280 "common.w" +#line 1276 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1243 "common.w" +#line 1239 "common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1288,10 +1284,10 @@ found_out= true; } /*:79*/ -#line 1196 "common.w" +#line 1190 "common.w" else/*81:*/ -#line 1268 "common.w" +#line 1264 "common.w" { if(program==ctangle) @@ -1305,12 +1301,12 @@ else fatal( } /*:81*/ -#line 1197 "common.w" +#line 1191 "common.w" } } if(!found_web)/*81:*/ -#line 1268 "common.w" +#line 1264 "common.w" { if(program==ctangle) @@ -1324,8 +1320,8 @@ else fatal( } /*:81*/ -#line 1200 "common.w" +#line 1194 "common.w" } -/*:76*/ +/*:75*/ diff --git a/Build/source/texk/web2c/cwebdir/common.h b/Build/source/texk/web2c/cwebdir/common.h index d79059621b7..dd9bbfdb347 100644 --- a/Build/source/texk/web2c/cwebdir/common.h +++ b/Build/source/texk/web2c/cwebdir/common.h @@ -168,7 +168,7 @@ 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);@/ +extern void sprint_section_name(char *,name_pointer); @ Code related to error handling: @d spotless 0 /* |history| value for normal jobs */ @@ -222,7 +222,7 @@ extern FILE *active_file; /* currently active file for \.{CWEAVE} output */ @ The procedure that gets everything rolling: @<Predecl...@>= extern void common_init(void);@/ -extern void print_stats(void);@/ +extern void print_stats(void); @ The following parameters were sufficient in the original \.{WEB} to handle \TEX/, so they should be sufficient for most applications of diff --git a/Build/source/texk/web2c/cwebdir/common.w b/Build/source/texk/web2c/cwebdir/common.w index 2b90275437d..d8ce0be34cd 100644 --- a/Build/source/texk/web2c/cwebdir/common.w +++ b/Build/source/texk/web2c/cwebdir/common.w @@ -68,7 +68,7 @@ The file begins with a few basic definitions. @h @<Common code for \.{CWEAVE} and \.{CTANGLE}@>@/ @<Global variables@>@/ -@<Predeclaration of procedures@>@/ +@<Predeclaration of procedures@> @ The details will be filled in due course. The interface of this module is included first. It is also used by the main programs. @@ -89,7 +89,8 @@ produces the \TEX/ output file, and finally it sorts and outputs the index. Similarly, \.{CTANGLE} operates in two phases. The global variable |phase| tells which phase we are in. -@<Global var...@>= int phase; /* which phase are we in? */ +@<Global var...@>= +int phase; /* which phase are we in? */ @ There's an initialization procedure that gets both \.{CTANGLE} and \.{CWEAVE} off to a good start. We will fill in the details of this @@ -156,10 +157,7 @@ char *limit=buffer; /* points to the last character in the buffer */ support |feof|, |getc|, and |ungetc| you may have to change things here. @^system dependencies@> -@<Predecl...@>= -static boolean input_ln(FILE *);@/ - -@ @c +@c static boolean input_ln(@t\1\1@> /* copies a line into |buffer| or returns |false| */ FILE *fp@t\2\2@>) /* what file to read from */ { @@ -179,6 +177,8 @@ FILE *fp@t\2\2@>) /* what file to read from */ return true; } +@ @<Predecl...@>=@+static boolean input_ln(FILE *); + @ Now comes the problem of deciding which file to read from next. Recall that the actual text that \.{CWEB} should process comes from two streams: a |web_file|, which can contain possibly nested include @@ -228,10 +228,7 @@ Since blank lines in the change file are not used for matching, we have the change file is exhausted. This procedure is called only when |changing| is |true|; hence error messages will be reported correctly. -@<Predecl...@>= -static void prime_the_change_buffer(void);@/ - -@ @c +@c static void prime_the_change_buffer(void) { @@ -241,6 +238,8 @@ prime_the_change_buffer(void) @<Move |buffer| and |limit| to |change_buffer| and |change_limit|@>@; } +@ @<Predecl...@>=@+static void prime_the_change_buffer(void); + @ While looking for a line that begins with \.{@@x} in the change file, we allow lines that begin with \.{@@}, as long as they don't begin with \.{@@y}, \.{@@z}, or \.{@@i} (which would probably mean that the change file is fouled up). @@ -300,10 +299,7 @@ current line is nonempty. if (*loc=='@@' && (xisspace(*(loc+1)) || *(loc+1)=='*')) change_pending=b; } -@<Predecl...@>= -static void check_change(void);@/ - -@ @c +@c static void check_change(void) /* switches to |change_file| if the buffers match */ { @@ -341,6 +337,8 @@ check_change(void) /* switches to |change_file| if the buffers match */ } } +@ @<Predecl...@>=@+static void check_change(void); + @ @<If the current line starts with \.{@@y}...@>= if (xyz_code=='x' || xyz_code=='z') { loc=buffer+2; err_print("! Where is the matching @@y?"); @@ -776,7 +774,7 @@ are null-terminated, and we keep an eye open for prefixes and extensions. @<Predecl...@>= static int web_strcmp(char *,int,char *,int);@/ static name_pointer add_section_name(name_pointer,int,char *,char *,int);@/ -static void extend_section_name(name_pointer,char *,char *,int);@/ +static void extend_section_name(name_pointer,char *,char *,int); @ @c static int web_strcmp(@t\1\1@> /* fuller comparison than |strcmp| */ @@ -969,10 +967,7 @@ us to regard \.{@@<foo...@@>} as an ``extension'' of itself. @d bad_extension 5 -@<Predec...@>= -static int section_name_cmp(char **,int,name_pointer);@/ - -@ @c +@c static int section_name_cmp(@t\1\1@> char **pfirst, /* pointer to beginning of comparison string */ int len, /* length of string */ @@ -1004,6 +999,8 @@ name_pointer r@t\2\2@>) /* section name being compared */ } } +@ @<Predec...@>=@+static int section_name_cmp(char **,int,name_pointer); + @** Reporting errors to the user. A global variable called |history| will contain one of four values at the end of every run: |spotless| means that no unusual messages were @@ -1150,7 +1147,7 @@ should be set before calling |common_init|. @<Set the default options common to \.{CTANGLE} and \.{CWEAVE}@>= show_banner=show_happiness=show_progress=make_xrefs=true;@/ -show_stats=false;@/ +show_stats=false; @ We now must look at the command line arguments and set the file names accordingly. At least one file name must be present: the \.{CWEB} @@ -1167,10 +1164,7 @@ when no changes are desired. If there's a third file name, it will be the output file. -@<Pred...@>= -static void scan_args(void);@/ - -@ @c +@c static void scan_args(void) { @@ -1200,6 +1194,8 @@ scan_args(void) if (!found_web) @<Print usage error message and quit@>@; } +@ @<Pred...@>=@+static void scan_args(void); + @ We use all of |*argv| for the |web_file_name| if there is a |'.'| in it, otherwise we add |".w"|. If this file can't be opened, we prepare an |alt_web_file_name| by adding |"web"| after the dot. diff --git a/Build/source/texk/web2c/cwebdir/ctangle.c b/Build/source/texk/web2c/cwebdir/ctangle.c index 769dc071f7c..aead827388e 100644 --- a/Build/source/texk/web2c/cwebdir/ctangle.c +++ b/Build/source/texk/web2c/cwebdir/ctangle.c @@ -257,7 +257,7 @@ sixteen_bits text_link; typedef text*text_pointer; /*:19*//*31:*/ -#line 270 "ctangle.w" +#line 269 "ctangle.w" typedef struct{ eight_bits*end_field; @@ -287,7 +287,7 @@ static eight_bits*tok_ptr; static text_pointer last_unnamed; /*:26*//*32:*/ -#line 286 "ctangle.w" +#line 285 "ctangle.w" static output_state cur_state; @@ -296,18 +296,18 @@ static stack_pointer stack_end= stack+stack_size; static stack_pointer stack_ptr; /*:32*//*37:*/ -#line 362 "ctangle.w" +#line 361 "ctangle.w" static int cur_val; /*:37*//*42:*/ -#line 454 "ctangle.w" +#line 452 "ctangle.w" static eight_bits out_state; static boolean protect; /*:42*//*45:*/ -#line 486 "ctangle.w" +#line 483 "ctangle.w" static name_pointer output_files[max_files]; static name_pointer*cur_out_file,*end_output_files,*an_output_file; @@ -315,33 +315,33 @@ static char cur_section_name_char; static char output_file_name[longest_name+1]; /*:45*//*52:*/ -#line 586 "ctangle.w" +#line 582 "ctangle.w" static boolean output_defs_seen= false; /*:52*//*57:*/ -#line 695 "ctangle.w" +#line 691 "ctangle.w" static char translit[128][translit_length]; /*:57*//*62:*/ -#line 774 "ctangle.w" +#line 770 "ctangle.w" static eight_bits ccode[256]; /*:62*//*66:*/ -#line 834 "ctangle.w" +#line 830 "ctangle.w" static boolean comment_continues= false; /*:66*//*68:*/ -#line 873 "ctangle.w" +#line 869 "ctangle.w" static name_pointer cur_section_name; static boolean no_where; /*:68*//*82:*/ -#line 1187 "ctangle.w" +#line 1182 "ctangle.w" static text_pointer cur_text; static eight_bits next_control; @@ -383,70 +383,61 @@ extern void overflow(const char*); extern void common_init(void); extern void print_stats(void); -/*:16*//*29:*/ -#line 231 "ctangle.w" - +/*:16*//*30:*/ +#line 241 "ctangle.w" static void store_two_bytes(sixteen_bits); -/*:29*//*34:*/ -#line 310 "ctangle.w" +/*:30*//*35:*/ +#line 324 "ctangle.w" static void push_level(name_pointer); static void pop_level(boolean); -/*:34*//*38:*/ -#line 369 "ctangle.w" - +/*:35*//*39:*/ +#line 397 "ctangle.w" static void get_output(void); -/*:38*//*43:*/ -#line 462 "ctangle.w" - +/*:39*//*44:*/ +#line 473 "ctangle.w" static void flush_buffer(void); -/*:43*//*48:*/ -#line 517 "ctangle.w" - +/*:44*//*49:*/ +#line 549 "ctangle.w" static void phase_two(void); -/*:48*//*53:*/ -#line 589 "ctangle.w" +/*:49*//*53:*/ +#line 585 "ctangle.w" static void output_defs(void); static void out_char(eight_bits); -/*:53*//*64:*/ -#line 798 "ctangle.w" +/*:53*//*65:*/ +#line 810 "ctangle.w" static eight_bits skip_ahead(void); static boolean skip_comment(boolean); -/*:64*//*69:*/ -#line 885 "ctangle.w" - +/*:65*//*70:*/ +#line 924 "ctangle.w" static eight_bits get_next(void); -/*:69*//*83:*/ -#line 1191 "ctangle.w" - +/*:70*//*84:*/ +#line 1208 "ctangle.w" static void scan_repl(eight_bits); -/*:83*//*90:*/ -#line 1348 "ctangle.w" - +/*:84*//*91:*/ +#line 1379 "ctangle.w" static void scan_section(void); -/*:90*//*98:*/ -#line 1455 "ctangle.w" - +/*:91*//*99:*/ +#line 1460 "ctangle.w" static void phase_one(void); -/*:98*//*100:*/ -#line 1473 "ctangle.w" - +/*:99*//*101:*/ +#line 1494 "ctangle.w" static void skip_limbo(void); -/*:100*/ +/*:101*/ #line 72 "ctangle.w" @@ -476,12 +467,12 @@ init_node(name_dir); last_unnamed= text_info;text_info->text_link= 0; /*:27*//*46:*/ -#line 496 "ctangle.w" +#line 493 "ctangle.w" cur_out_file= end_output_files= output_files+max_files; /*:46*//*58:*/ -#line 698 "ctangle.w" +#line 694 "ctangle.w" { int i; @@ -489,7 +480,7 @@ for(i= 0;i<128;i++)sprintf(translit[i],"X%02X",(unsigned int)(128+i)); } /*:58*//*63:*/ -#line 777 "ctangle.w" +#line 773 "ctangle.w" { int c; for(c= 0;c<256;c++)ccode[c]= ignore; @@ -509,7 +500,7 @@ ccode['\'']= ord; } /*:63*//*78:*/ -#line 1108 "ctangle.w" +#line 1103 "ctangle.w" section_text[0]= ' '; /*:78*/ @@ -547,10 +538,10 @@ node->equiv= (void*)text_info; void init_p(name_pointer p,eight_bits t){(void)p;(void)t;} -/*:25*//*30:*/ -#line 234 "ctangle.w" +/*:25*//*29:*/ +#line 231 "ctangle.w" -void +static void store_two_bytes( sixteen_bits x) { @@ -559,8 +550,8 @@ if(tok_ptr+2> tok_mem_end)overflow("token"); *tok_ptr++= x&0377; } -/*:30*//*35:*/ -#line 314 "ctangle.w" +/*:29*//*34:*/ +#line 309 "ctangle.w" static void push_level( @@ -576,8 +567,8 @@ cur_section= 0; } } -/*:35*//*36:*/ -#line 333 "ctangle.w" +/*:34*//*36:*/ +#line 332 "ctangle.w" static void pop_level( @@ -592,8 +583,8 @@ stack_ptr--; if(stack_ptr> stack)cur_state= *stack_ptr; } -/*:36*//*39:*/ -#line 372 "ctangle.w" +/*:36*//*38:*/ +#line 368 "ctangle.w" static void get_output(void) @@ -616,7 +607,7 @@ switch(a/024000){ case 0:cur_val= a;out_char(identifier);break; case 1:if(a==output_defs_flag)output_defs(); else/*40:*/ -#line 404 "ctangle.w" +#line 402 "ctangle.w" { a-= 024000; @@ -630,7 +621,7 @@ goto restart; } /*:40*/ -#line 393 "ctangle.w" +#line 389 "ctangle.w" break; default:cur_val= a-050000;if(cur_val> 0)cur_section= cur_val; @@ -639,8 +630,8 @@ out_char(section_number); } } -/*:39*//*44:*/ -#line 465 "ctangle.w" +/*:38*//*43:*/ +#line 460 "ctangle.w" static void flush_buffer(void) @@ -654,30 +645,30 @@ update_terminal; cur_line++; } -/*:44*//*49:*/ -#line 520 "ctangle.w" +/*:43*//*48:*/ +#line 514 "ctangle.w" static void phase_two(void){ web_file_open= false; cur_line= 1; /*33:*/ -#line 299 "ctangle.w" +#line 298 "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_end= (cur_repl+1)->tok_start;cur_section= 0; /*:33*/ -#line 525 "ctangle.w" +#line 519 "ctangle.w" /*51:*/ -#line 582 "ctangle.w" +#line 578 "ctangle.w" if(!output_defs_seen) output_defs(); /*:51*/ -#line 526 "ctangle.w" +#line 520 "ctangle.w" if(text_info->text_link==0&&cur_out_file==end_output_files){ fputs("\n! No program text was specified.",stdout);mark_harmless; @@ -700,7 +691,7 @@ if(text_info->text_link==0)goto writeloop; while(stack_ptr> stack)get_output(); flush_buffer(); writeloop:/*50:*/ -#line 559 "ctangle.w" +#line 555 "ctangle.w" for(an_output_file= end_output_files;an_output_file> cur_out_file;){ an_output_file--; @@ -721,7 +712,7 @@ flush_buffer(); } /*:50*/ -#line 547 "ctangle.w" +#line 541 "ctangle.w" if(show_happiness){ if(show_progress)new_line; @@ -730,8 +721,8 @@ fputs("Done.",stdout); } } -/*:49*//*54:*/ -#line 593 "ctangle.w" +/*:48*//*54:*/ +#line 589 "ctangle.w" static void output_defs(void) @@ -771,7 +762,7 @@ pop_level(false); } /*:54*//*55:*/ -#line 636 "ctangle.w" +#line 632 "ctangle.w" static void out_char( @@ -784,7 +775,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 704 "ctangle.w" +#line 700 "ctangle.w" case identifier: if(out_state==num_or_id)C_putc(' '); @@ -799,10 +790,10 @@ j++; out_state= num_or_id;break; /*:59*/ -#line 647 "ctangle.w" +#line 643 "ctangle.w" /*60:*/ -#line 717 "ctangle.w" +#line 713 "ctangle.w" case section_number: if(cur_val> 0)C_printf("/*%d:*/",cur_val); @@ -829,10 +820,10 @@ C_printf("%s","\"\n"); break; /*:60*/ -#line 648 "ctangle.w" +#line 644 "ctangle.w" /*56:*/ -#line 666 "ctangle.w" +#line 662 "ctangle.w" case plus_plus:C_putc('+');C_putc('+');out_state= normal;break; case minus_minus:C_putc('-');C_putc('-');out_state= normal;break; @@ -853,7 +844,7 @@ case minus_gt_ast:C_putc('-');C_putc('>');C_putc('*');out_state= normal; break; /*:56*/ -#line 649 "ctangle.w" +#line 645 "ctangle.w" case'=':case'>':C_putc(cur_char);C_putc(' '); out_state= normal;break; @@ -871,8 +862,8 @@ default:C_putc(cur_char);out_state= normal;break; } } -/*:55*//*65:*/ -#line 802 "ctangle.w" +/*:55*//*64:*/ +#line 794 "ctangle.w" static eight_bits skip_ahead(void) @@ -889,8 +880,8 @@ if(c!=ignore||*(loc-1)=='>')return c; } } -/*:65*//*67:*/ -#line 837 "ctangle.w" +/*:64*//*67:*/ +#line 833 "ctangle.w" static boolean skip_comment( boolean is_long_comment) @@ -923,8 +914,8 @@ else loc++; } } -/*:67*//*70:*/ -#line 888 "ctangle.w" +/*:67*//*69:*/ +#line 881 "ctangle.w" static eight_bits get_next(void) @@ -938,7 +929,7 @@ if(get_line()==false)return new_section; else if(print_where&&!no_where){ print_where= false; /*85:*/ -#line 1220 "ctangle.w" +#line 1214 "ctangle.w" store_two_bytes(0150000); if(changing&&include_depth==change_depth){ @@ -953,7 +944,7 @@ id_loc= id_first+strlen(id_first); app_repl(a_l%0400);} /*:85*/ -#line 900 "ctangle.w" +#line 893 "ctangle.w" } else return'\n'; @@ -967,7 +958,7 @@ else continue; } loc++; if(xisdigit(c)||c=='.')/*73:*/ -#line 969 "ctangle.w" +#line 964 "ctangle.w" { id_first= loc-1; if(*id_first=='.'&&!xisdigit(*loc))goto mistake; @@ -992,13 +983,13 @@ return constant; } /*:73*/ -#line 912 "ctangle.w" +#line 905 "ctangle.w" else if(c=='\''||c=='"' ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"')) ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"'))) /*74:*/ -#line 997 "ctangle.w" +#line 992 "ctangle.w" { char delim= c; id_first= section_text+1; @@ -1042,11 +1033,11 @@ return string; } /*:74*/ -#line 916 "ctangle.w" +#line 909 "ctangle.w" else if(isalpha(c)||isxalpha(c)||ishigh(c)) /*72:*/ -#line 962 "ctangle.w" +#line 957 "ctangle.w" { id_first= --loc; while(isalpha((eight_bits)*++loc)||isdigit((eight_bits)*loc) @@ -1055,10 +1046,10 @@ id_loc= loc;return identifier; } /*:72*/ -#line 918 "ctangle.w" +#line 911 "ctangle.w" else if(c=='@')/*75:*/ -#line 1042 "ctangle.w" +#line 1037 "ctangle.w" { c= ccode[(eight_bits)*loc++]; switch(c){ @@ -1074,11 +1065,11 @@ continue; case section_name: cur_section_name_char= *(loc-1); /*77:*/ -#line 1090 "ctangle.w" +#line 1085 "ctangle.w" { char*k; /*79:*/ -#line 1110 "ctangle.w" +#line 1105 "ctangle.w" k= section_text; while(true){ @@ -1089,7 +1080,7 @@ loc= buffer+1;break; } c= *loc; /*80:*/ -#line 1134 "ctangle.w" +#line 1129 "ctangle.w" if(c=='@'){ c= *(loc+1); @@ -1108,7 +1099,7 @@ err_print("! Nesting of section names not allowed");break; } /*:80*/ -#line 1119 "ctangle.w" +#line 1114 "ctangle.w" loc++;if(k<section_text_end)k++; if(xisspace(c)){ @@ -1125,14 +1116,14 @@ printf("...");mark_harmless; if(*k==' '&&k> section_text)k--; /*:79*/ -#line 1092 "ctangle.w" +#line 1087 "ctangle.w" if(k-section_text> 3&&strncmp(k-2,"...",3)==0) cur_section_name= section_lookup(section_text+1,k-3,1); else cur_section_name= section_lookup(section_text+1,k,0); if(cur_section_name_char=='(') /*47:*/ -#line 500 "ctangle.w" +#line 497 "ctangle.w" { for(an_output_file= cur_out_file; @@ -1148,16 +1139,16 @@ overflow("output files"); } /*:47*/ -#line 1098 "ctangle.w" +#line 1093 "ctangle.w" return section_name; } /*:77*/ -#line 1056 "ctangle.w" +#line 1051 "ctangle.w" case string:/*81:*/ -#line 1156 "ctangle.w" +#line 1151 "ctangle.w" { id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; while(*loc!='@'||*(loc+1)!='>')loc++; @@ -1168,10 +1159,10 @@ return string; } /*:81*/ -#line 1057 "ctangle.w" +#line 1052 "ctangle.w" case ord:/*76:*/ -#line 1069 "ctangle.w" +#line 1064 "ctangle.w" id_first= loc; if(*loc=='\\'){ @@ -1194,14 +1185,14 @@ loc++; return ord; /*:76*/ -#line 1058 "ctangle.w" +#line 1053 "ctangle.w" default:return c; } } /*:75*/ -#line 919 "ctangle.w" +#line 912 "ctangle.w" else if(xisspace(c)){ if(!preprocessing||loc> limit)continue; @@ -1210,7 +1201,7 @@ else return' '; } else if(c=='#'&&loc==buffer+1)preprocessing= 1; mistake:/*71:*/ -#line 940 "ctangle.w" +#line 935 "ctangle.w" switch(c){ case'+':if(*loc=='+')compress(plus_plus);break; @@ -1234,14 +1225,14 @@ case'!':if(*loc=='=')compress(non_eq);break; } /*:71*/ -#line 926 "ctangle.w" +#line 919 "ctangle.w" return c; } } -/*:70*//*84:*/ -#line 1194 "ctangle.w" +/*:69*//*83:*/ +#line 1186 "ctangle.w" static void scan_repl( @@ -1249,7 +1240,7 @@ eight_bits t) { sixteen_bits a; if(t==section_name){/*85:*/ -#line 1220 "ctangle.w" +#line 1214 "ctangle.w" store_two_bytes(0150000); if(changing&&include_depth==change_depth){ @@ -1264,11 +1255,11 @@ id_loc= id_first+strlen(id_first); app_repl(a_l%0400);} /*:85*/ -#line 1200 "ctangle.w" +#line 1192 "ctangle.w" } while(true)switch(a= get_next()){ /*86:*/ -#line 1233 "ctangle.w" +#line 1227 "ctangle.w" case identifier:a= id_lookup(id_first,id_loc,0)-name_dir; app_repl((a/0400)+0200); @@ -1276,7 +1267,7 @@ app_repl(a%0400);break; case section_name:if(t!=section_name)goto done; else{ /*87:*/ -#line 1266 "ctangle.w" +#line 1260 "ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loc<limit)try_loc++; @@ -1289,13 +1280,13 @@ if(*try_loc=='=')err_print("! Missing `@ ' before a named section"); } /*:87*/ -#line 1239 "ctangle.w" +#line 1233 "ctangle.w" a= cur_section_name-name_dir; app_repl((a/0400)+0250); app_repl(a%0400); /*85:*/ -#line 1220 "ctangle.w" +#line 1214 "ctangle.w" store_two_bytes(0150000); if(changing&&include_depth==change_depth){ @@ -1310,7 +1301,7 @@ id_loc= id_first+strlen(id_first); app_repl(a_l%0400);} /*:85*/ -#line 1243 "ctangle.w" +#line 1237 "ctangle.w" break; } case output_defs_code:if(t!=section_name)err_print("! Misplaced @h"); @@ -1321,7 +1312,7 @@ a= output_defs_flag; app_repl((a/0400)+0200); app_repl(a%0400); /*85:*/ -#line 1220 "ctangle.w" +#line 1214 "ctangle.w" store_two_bytes(0150000); if(changing&&include_depth==change_depth){ @@ -1336,13 +1327,13 @@ id_loc= id_first+strlen(id_first); app_repl(a_l%0400);} /*:85*/ -#line 1252 "ctangle.w" +#line 1246 "ctangle.w" } break; case constant:case string: /*88:*/ -#line 1277 "ctangle.w" +#line 1271 "ctangle.w" app_repl(a); while(id_first<id_loc){ @@ -1356,11 +1347,11 @@ app_repl(*id_first++); app_repl(a);break; /*:88*/ -#line 1256 "ctangle.w" +#line 1250 "ctangle.w" case ord: /*89:*/ -#line 1293 "ctangle.w" +#line 1287 "ctangle.w" { int c= (eight_bits)*id_first; if(c=='\\'){ @@ -1411,7 +1402,7 @@ app_repl(constant); break; /*:89*/ -#line 1258 "ctangle.w" +#line 1252 "ctangle.w" case definition:case format_code:case begin_C:if(t!=section_name)goto done; else{ @@ -1421,7 +1412,7 @@ err_print("! @d, @f and @c are ignored in C text");continue; case new_section:goto done; /*:86*/ -#line 1205 "ctangle.w" +#line 1197 "ctangle.w" case')':app_repl(a); if(t==macro)app_repl(' '); @@ -1433,8 +1424,8 @@ if(text_ptr> text_info_end)overflow("text"); cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } -/*:84*//*91:*/ -#line 1355 "ctangle.w" +/*:83*//*90:*/ +#line 1346 "ctangle.w" static void scan_section(void) @@ -1449,7 +1440,7 @@ printf("*%d",section_count);update_terminal; next_control= 0; while(true){ /*92:*/ -#line 1394 "ctangle.w" +#line 1387 "ctangle.w" while(next_control<definition) @@ -1458,11 +1449,11 @@ loc-= 2;next_control= get_next(); } /*:92*/ -#line 1369 "ctangle.w" +#line 1360 "ctangle.w" if(next_control==definition){ /*93:*/ -#line 1401 "ctangle.w" +#line 1394 "ctangle.w" { while((next_control= get_next())=='\n'); if(next_control!=identifier){ @@ -1481,7 +1472,7 @@ cur_text->text_link= macro; } /*:93*/ -#line 1371 "ctangle.w" +#line 1362 "ctangle.w" continue; } @@ -1491,14 +1482,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1426 "ctangle.w" +#line 1419 "ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1379 "ctangle.w" +#line 1370 "ctangle.w" break; } @@ -1506,20 +1497,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1431 "ctangle.w" +#line 1424 "ctangle.w" /*96:*/ -#line 1436 "ctangle.w" +#line 1429 "ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1432 "ctangle.w" +#line 1425 "ctangle.w" scan_repl(section_name); /*97:*/ -#line 1440 "ctangle.w" +#line 1433 "ctangle.w" if(p==name_dir||p==0){ (last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1536,16 +1527,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1434 "ctangle.w" +#line 1427 "ctangle.w" /*:95*/ -#line 1385 "ctangle.w" +#line 1376 "ctangle.w" } -/*:91*//*99:*/ -#line 1458 "ctangle.w" +/*:90*//*98:*/ +#line 1448 "ctangle.w" static void phase_one(void){ @@ -1558,8 +1549,8 @@ check_complete(); phase= 2; } -/*:99*//*101:*/ -#line 1476 "ctangle.w" +/*:98*//*100:*/ +#line 1465 "ctangle.w" static void skip_limbo(void) @@ -1574,7 +1565,7 @@ c= *loc++; if(ccode[(eight_bits)c]==new_section)break; switch(ccode[(eight_bits)c]){ case translit_code:/*102:*/ -#line 1505 "ctangle.w" +#line 1496 "ctangle.w" while(xisspace(*loc)&&loc<limit)loc++; loc+= 3; @@ -1599,7 +1590,7 @@ translit[i-0200][loc-beg]= '\0'; } /*:102*/ -#line 1489 "ctangle.w" +#line 1478 "ctangle.w" break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1616,8 +1607,8 @@ default:err_print("! Double @ should be used in limbo"); } } -/*:101*//*103:*/ -#line 1531 "ctangle.w" +/*:100*//*103:*/ +#line 1522 "ctangle.w" void print_stats(void){ diff --git a/Build/source/texk/web2c/cwebdir/ctangle.w b/Build/source/texk/web2c/cwebdir/ctangle.w index 0c5bd413282..4857e01203e 100644 --- a/Build/source/texk/web2c/cwebdir/ctangle.w +++ b/Build/source/texk/web2c/cwebdir/ctangle.w @@ -69,7 +69,7 @@ is modified. @<Common code for \.{CWEAVE} and \.{CTANGLE}@>@/ @<Typedef declarations@>@/ @<Private variables@>@/ -@<Predeclaration of procedures@>@/ +@<Predeclaration of procedures@> @ \.{CTANGLE} has a fairly straightforward outline. It operates in two phases: First it reads the source file, saving the \CEE/ code in @@ -228,11 +228,8 @@ construction or numerical constant. @ The following procedure is used to enter a two-byte value into |tok_mem| when a replacement text is being generated. -@<Predecl...@>= -static void store_two_bytes(sixteen_bits);@/ - -@ @c -void +@c +static void store_two_bytes( sixteen_bits x) { @@ -241,6 +238,8 @@ sixteen_bits x) *tok_ptr++=x&0377; /* store low byte */ } +@ @<Predecl...@>=@+static void store_two_bytes(sixteen_bits); + @** Stacks for output. The output process uses a stack to keep track of what is going on at different ``levels'' as the sections are being written out. Entries on this stack have five parts: @@ -307,11 +306,7 @@ the new one going. We assume that the \CEE/ compiler can copy structures. @^system dependencies@> -@<Predecl...@>= -static void push_level(name_pointer);@/ -static void pop_level(boolean);@/ - -@ @c +@c static void push_level(@t\1\1@> /* suspends the current level */ name_pointer p@t\2\2@>) @@ -326,6 +321,10 @@ name_pointer p@t\2\2@>) } } +@ @<Predecl...@>= +static void push_level(name_pointer);@/ +static void pop_level(boolean); + @ When we come to the end of a replacement text, the |pop_level| subroutine does the right thing: It either moves to the continuation of this replacement text or returns the state to the most recently stacked level. @@ -366,10 +365,7 @@ static int cur_val; /* additional information corresponding to output token */ |stack_ptr==stack|. @^high-bit character handling@> -@<Predecl...@>= -static void get_output(void);@/ - -@ @c +@c static void get_output(void) /* sends next token to |out_char| */ { @@ -398,6 +394,8 @@ get_output(void) /* sends next token to |out_char| */ } } +@ @<Predecl...@>=@+static void get_output(void); + @ The user may have forgotten to give any \CEE/ text for a section name, or the \CEE/ text may have been associated with a different name by mistake. @@ -459,10 +457,7 @@ static boolean protect; /* should newline characters be quoted? */ During the output process, |cur_line| equals the number of the next line to be output. -@<Predecl...@>= -static void flush_buffer(void);@/ - -@ @c +@c static void flush_buffer(void) /* writes one line to output file */ { @@ -475,6 +470,8 @@ flush_buffer(void) /* writes one line to output file */ cur_line++; } +@ @<Predecl...@>=@+static void flush_buffer(void); + @ Second, we have modified the original \.{TANGLE} so that it will write output on multiple files. If a section name is introduced in at least one place by \.{@@(} @@ -514,10 +511,7 @@ complain we're out of room@>= @* The big output switch. Here then is the routine that does the output. -@<Predecl...@>= -static void phase_two(void);@/ - -@ @c +@c static void phase_two (void) { web_file_open=false; @@ -552,6 +546,8 @@ writeloop: @<Write all the named output files@>@; } } +@ @<Predecl...@>=@+static void phase_two(void); + @ To write the named output files, we proceed as for the unnamed section. The only subtlety is that we have to open each one. @@ -588,7 +584,7 @@ static boolean output_defs_seen=false; @ @<Predecl...@>= static void output_defs(void);@/ -static void out_char(eight_bits);@/ +static void out_char(eight_bits); @ @c static void @@ -795,11 +791,7 @@ static eight_bits ccode[256]; /* meaning of a char following \.{@@} */ @ The |skip_ahead| procedure reads through the input at fairly high speed until finding the next non-ignorable control code, which it returns. -@<Predecl...@>= -static eight_bits skip_ahead(void);@/ -static boolean skip_comment(boolean);@/ - -@ @c +@c static eight_bits skip_ahead(void) /* skip to next control code */ { @@ -815,6 +807,10 @@ skip_ahead(void) /* skip to next control code */ } } +@ @<Predecl...@>= +static eight_bits skip_ahead(void);@/ +static boolean skip_comment(boolean); + @ The |skip_comment| procedure reads through the input at somewhat high speed in order to pass over comments, which \.{CTANGLE} does not transmit to the output. If the comment is introduced by \.{/*}, |skip_comment| @@ -882,10 +878,7 @@ that branches to the various special cases that can arise. @d ishigh(c) ((eight_bits)(c)>0177) @^high-bit character handling@> -@<Predecl...@>= -static eight_bits get_next(void);@/ - -@ @c +@c static eight_bits get_next(void) /* produces the next input token */ { @@ -928,6 +921,8 @@ get_next(void) /* produces the next input token */ } } +@ @<Predecl...@>=@+static eight_bits get_next(void); + @ The following code assigns values to the combinations \.{++}, \.{--}, \.{->}, \.{>=}, \.{<=}, \.{==}, \.{<<}, \.{>>}, \.{!=}, \.{||} and \.{\&\&}, and to the \CPLUSPLUS/ @@ -1188,9 +1183,6 @@ acted, |cur_text| will point to the replacement text just generated, and static text_pointer cur_text; /* replacement text formed by |scan_repl| */ static eight_bits next_control; -@ @<Predecl...@>= -static void scan_repl(eight_bits);@/ - @ @c static void scan_repl(@t\1\1@> /* creates a replacement text */ @@ -1213,6 +1205,8 @@ eight_bits t@t\2\2@>) cur_text=text_ptr; (++text_ptr)->tok_start=tok_ptr; } +@ @<Predecl...@>=@+static void scan_repl(eight_bits); + @ Here is the code for the line number: first a |sixteen_bits| equal to |0150000|; then the numeric line number; then a pointer to the file name. @@ -1345,10 +1339,7 @@ sensed in the input, and it proceeds until the end of that section. It uses |section_count| to keep track of the current section number; with luck, \.{CWEAVE} and \.{CTANGLE} will both assign the same numbers to sections. -@<Predecl...@>= -static void scan_section(void);@/ - -@ The body of |scan_section| is a loop where we look for control codes +The body of |scan_section| is a loop where we look for control codes that are significant to \.{CTANGLE}: those that delimit a definition, the \CEE/ part of a module, or a new module. @@ -1385,6 +1376,8 @@ scan_section(void) @<Scan the \CEE/ part of the current section@>@; } +@ @<Predecl...@>=@+static void scan_section(void); + @ At the top of this loop, if |next_control==section_name|, the section name has already been scanned (see |@<Get control code and...@>|). Thus, if we encounter |next_control==section_name| in the @@ -1452,9 +1445,6 @@ else { cur_text->text_link=section_flag; /* mark this replacement text as a nonmacro */ -@ @<Predec...@>= -static void phase_one(void);@/ - @ @c static void phase_one(void) { @@ -1467,13 +1457,12 @@ phase_one(void) { phase=2; } +@ @<Predec...@>=@+static void phase_one(void); + @ Only a small subset of the control codes is legal in limbo, so limbo processing is straightforward. -@<Predecl...@>= -static void skip_limbo(void);@/ - -@ @c +@c static void skip_limbo(void) { @@ -1502,6 +1491,8 @@ skip_limbo(void) } } +@ @<Predecl...@>=@+static void skip_limbo(void); + @ @<Read in transliteration of a character@>= while(xisspace(*loc)&&loc<limit) loc++; loc+=3; diff --git a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch index 1b5c284433f..77a892db20e 100644 --- a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch +++ b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch @@ -707,21 +707,21 @@ the category codes |pp->cat,@,@,(pp+1)->cat|$,\,\,\ldots\,$ the category codes |pp->cat|, |(pp+1)->cat|, $\,\ldots\,$ @z -Section 138. +Section 139. @x -@ @<Set init...@>= +@ Token lists in |@!tok_mem| are composed of the following kinds of @y -@r @ @<Set init...@>= +@ Token lists in |@!tok_mem| are composed of the following kinds of +@-p@> @z -Section 139. +Section 141. @x -@ Token lists in |@!tok_mem| are composed of the following kinds of +@ @<Print token |r|...@>= @y -@ Token lists in |@!tok_mem| are composed of the following kinds of -@-p@> +@r @ @<Print token |r|...@>= @z Section 142. @@ -933,6 +933,14 @@ Section 168. @r @ @<Cases for |decl_head|@>= @z +Section 173. + +@x +@ @<Cases for |fn_decl|@>= +@y +@r @ @<Cases for |fn_decl|@>= +@z + Section 208. @x @@ -941,6 +949,14 @@ Section 208. @r @ Here's the |squash| procedure, which @z +Section 212. + +@x +@ @<Print a snapsh...@>= +@y +@r @ @<Print a snapsh...@>= +@z + Section 220. @x @@ -1063,14 +1079,6 @@ Section 272. @r @ The |footnote| procedure gives cross-reference information about @z -Section 277. - -@x -@ @<Output information about usage of id's defined in other sections@>= -@y -@r @ @<Output information about usage of id's defined in other sections@>= -@z - Section 284. @x diff --git a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch index e87b31170a1..682e2c0e039 100644 --- a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch @@ -500,11 +500,11 @@ ccode['r']=ccode['R']=right_start; @z @x -static eight_bits skip_TeX(void);@/ +static eight_bits skip_TeX(void); @ @c @y -static eight_bits skip_TeX(void);@/ +static eight_bits skip_TeX(void); @ We look for a clue about the program's title, because this will become part of all meanings. @@ -899,17 +899,15 @@ null_scrap.trans=&tok_start[0]; @z @x -static void print_text(text_pointer p);@/ -@y -#if 0 -static void print_text(text_pointer p);@/ -#endif -@z +@d inner_tok_flag 5*id_flag /* signifies a token list in `\pb' */ -@x +@c static void print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */ @y +@d inner_tok_flag 5*id_flag /* signifies a token list in `\pb' */ + +@c #if 0 static void print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */ @@ -929,6 +927,15 @@ print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */ @z @x +@ @<Predecl...@>=@+static void print_text(text_pointer p); +@y +@ @<Predecl...@>= +#if 0 +static void print_text(text_pointer p); +#endif +@z + +@x the |for| loop below. @c @@ -1633,7 +1640,7 @@ placed on the list, unless they are reserved and their current } @ @<Output information about usage of id's defined in other sections@>= -{@+struct perm_meaning *q; +{ struct perm_meaning *q; while (temp_meaning_ptr>temp_meaning_stack) { out_mini(--temp_meaning_ptr); q=temp_meaning_ptr->id-name_dir+cur_meaning; @@ -1647,9 +1654,6 @@ placed on the list, unless they are reserved and their current } } -@ @<Predec...@>= -static void out_mini(meaning_struct *);@/ - @ @c static void out_mini( meaning_struct *m) @@ -1669,6 +1673,8 @@ out_mini( out(' '); out_str(m->tex_part); finish_line(); } +@ @<Predec...@>=@+static void out_mini(meaning_struct *); + @ @<Mini-output...@>= switch (cur_name->ilk) { case normal: case func_template: if (length(cur_name)==1) out_str("\\|"); diff --git a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch index 79ff089b8ce..102bbc06a93 100644 --- a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch @@ -248,17 +248,15 @@ tex_puts("cwebma"); @z @x -static void print_text(text_pointer p);@/ -@y -#if 0 -static void print_text(text_pointer p);@/ -#endif -@z +@d inner_tok_flag 5*id_flag /* signifies a token list in `\pb' */ -@x +@c static void print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */ @y +@d inner_tok_flag 5*id_flag /* signifies a token list in `\pb' */ + +@c #if 0 static void print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */ @@ -272,6 +270,15 @@ print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */ @z @x +@ @<Predecl...@>=@+static void print_text(text_pointer p); +@y +@ @<Predecl...@>= +#if 0 +static void print_text(text_pointer p); +#endif +@z + +@x @<Cases for |exp|@>= if (cat1==lbrace || cat1==int_like || cat1==decl) { make_underlined(pp); big_app1(pp); big_app(indent); app(indent); diff --git a/Build/source/texk/web2c/cwebdir/cweave.w b/Build/source/texk/web2c/cwebdir/cweave.w index 2c589a5662b..bf4232339a5 100644 --- a/Build/source/texk/web2c/cwebdir/cweave.w +++ b/Build/source/texk/web2c/cwebdir/cweave.w @@ -251,7 +251,7 @@ If one were careful, one could probably make more changes around section @<Predecl...@>= static void new_xref(name_pointer);@/ static void new_section_xref(name_pointer);@/ -static void set_file_flag(name_pointer);@/ +static void set_file_flag(name_pointer); @ @c static void @@ -383,8 +383,7 @@ name_pointer p) p->xref=(void *)xref_ptr; } -@ @<Predecl...@>= -static void update_node(name_pointer p);@/ +@ @<Predecl...@>=@+static void update_node(name_pointer p); @ We have to get \CEE/'s reserved words into the hash table, and the simplest way to do this is @@ -490,8 +489,7 @@ id_lookup("volatile",NULL,const_like); id_lookup("wchar_t",NULL,raw_int); id_lookup("while",NULL,for_like); id_lookup("xor",NULL,alfop); -id_lookup("xor_eq",NULL,alfop); -res_wd_end=name_ptr; +id_lookup("xor_eq",NULL,alfop);@+ res_wd_end=name_ptr; id_lookup("TeX",NULL,custom); id_lookup("make_pair",NULL,func_template); @@ -590,7 +588,7 @@ interpretation of identifiers. @<Predec...@>= static void skip_limbo(void);@/ -static eight_bits skip_TeX(void);@/ +static eight_bits skip_TeX(void); @ @c static void @@ -681,10 +679,7 @@ compilers even allow the dollar sign. @d ishigh(c) ((eight_bits)(c)>0177) @^high-bit character handling@> -@<Predecl...@>= -static eight_bits get_next(void);@/ - -@ @c +@c static eight_bits get_next(void) /* produces the next input token */ { @@ -709,6 +704,8 @@ get_next(void) /* produces the next input token */ } } +@ @<Predecl...@>=@+static eight_bits get_next(void); + @ Because preprocessor commands do not fit in with the rest of the syntax of \CEE/, we have to deal with them separately. One solution is to enclose such @@ -961,10 +958,7 @@ if (c=='@@') { @ This function skips over a restricted context at relatively high speed. -@<Predecl...@>= -static void skip_restricted(void);@/ - -@ @c +@c static void skip_restricted(void) { @@ -984,6 +978,8 @@ false_alarm: } } +@ @<Predecl...@>=@+static void skip_restricted(void); + @ At the present point in the program we have |*(loc-1)==verbatim|; we set |id_first| to the beginning of the string itself, and |id_loc| to its ending-plus-one location in the @@ -1014,10 +1010,7 @@ static eight_bits next_control; /* control code waiting to be acting upon */ @ The overall processing strategy in phase one has the following straightforward outline. -@<Predecl...@>= -static void phase_one(void);@/ - -@ @c +@c static void phase_one(void) { phase=1; reset_input(); section_count=0; @@ -1030,6 +1023,8 @@ phase_one(void) { @<Print error messages about unused or undefined section names@>@; } +@ @<Predecl...@>=@+static void phase_one(void); + @ @<Store cross-reference data...@>= { if (++section_count==max_sections) overflow("section number"); @@ -1068,7 +1063,7 @@ as well as |normal==0|. @<Predecl...@>= static void C_xref(eight_bits);@/ -static void outer_xref(void);@/ +static void outer_xref(void); @ @c static void @@ -1254,10 +1249,7 @@ static boolean an_output; /* did |file_flag| precede |cur_xref|? */ walks through the tree of section names and prints out anomalies. @^recursion@> -@<Predecl...@>= -static void section_check(name_pointer);@/ - -@ @c +@c static void section_check( name_pointer p) /* print anomalies in subtree |p| */ @@ -1282,6 +1274,8 @@ name_pointer p) /* print anomalies in subtree |p| */ } } +@ @<Predecl...@>=@+static void section_check(name_pointer); + @ @<Print error messages about un...@>=section_check(root); @* Low-level output routines. @@ -1315,7 +1309,7 @@ of commented-out text). @<Predecl...@>= static void flush_buffer(char *,boolean,boolean);@/ -static void finish_line(void);@/ +static void finish_line(void); @ @c static void @@ -1380,7 +1374,7 @@ A line break will occur at a space or after a single-nonletter @<Predecl...@>= static void out_str(const char *);@/ -static void break_out(void);@/ +static void break_out(void); @ @c static void @@ -1438,7 +1432,7 @@ the section is changed, we output `\.{\\*}' just after the number. @<Predecl...@>= static void out_section(sixteen_bits);@/ -static void out_name(name_pointer,boolean);@/ +static void out_name(name_pointer,boolean); @ @c static void @@ -1485,7 +1479,7 @@ The use of `\.{@@}' signs is severely restricted in such material: @<Predecl...@>= static void copy_limbo(void);@/ static eight_bits copy_TeX(void);@/ -static int copy_comment(boolean,int);@/ +static int copy_comment(boolean,int); @ @c static void @@ -1784,10 +1778,7 @@ static char cat_name[256][12]; @ This code allows \.{CWEAVE} to display its parsing steps. -@<Predecl...@>= -static void print_cat(eight_bits);@/ - -@ @c +@c static void print_cat(@t\1\1@> /* symbolic printout of a category */ eight_bits c@t\2\2@>) @@ -1795,6 +1786,8 @@ eight_bits c@t\2\2@>) fputs(cat_name[c],stdout); } +@ @<Predecl...@>=@+static void print_cat(eight_bits); + @ The token lists for translated \TEX/ output contain some special control symbols as well as ordinary characters. These control symbols are interpreted by \.{CWEAVE} before they are written to the output file. @@ -2142,10 +2135,7 @@ translated without line-break controls. @d tok_flag 4*id_flag /* signifies a token list */ @d inner_tok_flag 5*id_flag /* signifies a token list in `\pb' */ -@<Predecl...@>= -static void print_text(text_pointer p);@/ - -@ @c +@c static void print_text(@t\1\1@> /* prints a token list for debugging; not used in |main| */ text_pointer p@t\2\2@>) @@ -2170,6 +2160,8 @@ text_pointer p@t\2\2@>) update_terminal; } +@ @<Predecl...@>=@+static void print_text(text_pointer p); + @ @<Print token |r|...@>= switch (r) { case math_rel: printf("\\mathrel{"@q}@>); break; @@ -2272,7 +2264,7 @@ static int cur_mathness, init_mathness; @ @<Predecl...@>= static void app_str(const char *);@/ static void big_app(token);@/ -static void big_app1(scrap_pointer);@/ +static void big_app1(scrap_pointer); @ @c static void @@ -2429,7 +2421,7 @@ more properly alpha\-betized, static token_pointer find_first_ident(text_pointer);@/ static void make_reserved(scrap_pointer);@/ static void make_underlined(scrap_pointer);@/ -static void underline_xref(name_pointer);@/ +static void underline_xref(name_pointer); @ @c static token_pointer @@ -3023,7 +3015,7 @@ too large, since it is assumed that this test was done beforehand. @<Predecl...@>= static void reduce(scrap_pointer,short,eight_bits,short,short);@/ -static void squash(scrap_pointer,short,eight_bits,short,short);@/ +static void squash(scrap_pointer,short,eight_bits,short,short); @ @c static void @@ -3147,10 +3139,7 @@ lists with up to six tokens without checking for overflow. Before calling since |translate| might add a new text and a new scrap before it checks for overflow. -@<Predecl...@>= -static text_pointer translate(void);@/ - -@ @c +@c static text_pointer translate(void) /* converts a sequence of scraps */ { @@ -3162,6 +3151,8 @@ translate(void) /* converts a sequence of scraps */ @<Combine the irreducible scraps that remain@>@; } +@ @<Predecl...@>=@+static text_pointer translate(void); + @ If the initial sequence of scraps does not reduce to a single scrap, we concatenate the translations of all remaining scraps, separated by blank spaces, with dollar signs surrounding the translations of scraps @@ -3215,10 +3206,7 @@ repeatedly to read \CEE/ text until encountering the next `\.{\v}' or what it reads are appended into the |cat| and |trans| arrays, and |scrap_ptr| is advanced. -@<Predecl...@>= -static void C_parse(eight_bits);@/ - -@ @c +@c static void C_parse(@t\1\1@> /* creates scraps from \CEE/ tokens */ eight_bits spec_ctrl@t\2\2@>) @@ -3232,6 +3220,8 @@ C_parse(@t\1\1@> /* creates scraps from \CEE/ tokens */ } } +@ @<Predecl...@>=@+static void C_parse(eight_bits); + @ The following macro is used to append a scrap whose tokens have just been appended: @@ -3453,7 +3443,7 @@ token list; it also builds a new scrap if |scrapping==true|. @<Predec...@>= static void app_cur_id(boolean);@/ static text_pointer C_translate(void);@/ -static void outer_parse(void);@/ +static void outer_parse(void); @ @c static void @@ -3621,7 +3611,7 @@ The value of |cur_mode| is not changed. @<Predecl...@>= static void push_level(text_pointer);@/ -static void pop_level(void);@/ +static void pop_level(void); @ @c static void @@ -3668,7 +3658,7 @@ static name_pointer cur_name; @<Predecl...@>= static eight_bits get_output(void);@/ static void output_C(void);@/ -static void make_output(void);@/ +static void make_output(void); @ @c static eight_bits @@ -3991,10 +3981,7 @@ is analogous to phase one, except that more work is involved because we must actually output the \TEX/ material instead of merely looking at the \.{CWEB} specifications. -@<Predecl...@>= -static void phase_two(void);@/ - -@ @c +@c static void phase_two(void) { reset_input(); if (show_progress) fputs("\nWriting the output file...",stdout); @@ -4004,6 +3991,8 @@ finish_line(); flush_buffer(out_buf,false,false); /* insert a blank line, it loo while (!input_has_ended) @<Translate the current section@>@; } +@ @<Predecl...@>=@+static void phase_two(void); + @ The output file will contain the control sequence \.{\\Y} between non-null sections of a section, e.g., between the \TEX/ and definition parts if both are nonempty. This puts a little white space between the parts when they are @@ -4114,10 +4103,7 @@ takes place, so that the translation will normally end with \.{\\6} or \.{\\7} (the \TEX/ macros for |force| and |big_force|). This \.{\\6} or \.{\\7} is replaced by the concluding \.{\\par} or by \.{\\Y\\par}. -@<Predecl...@>= -static void finish_C(boolean);@/ - -@ @c +@c static void finish_C(@t\1\1@> /* finishes a definition or a \CEE/ part */ boolean visible@t\2\2@>) /* nonzero if we should produce \TeX\ output */ @@ -4146,6 +4132,8 @@ finish_C(@t\1\1@> /* finishes a definition or a \CEE/ part */ /* forget the tokens and the scraps */ } +@ @<Predecl...@>=@+static void finish_C(boolean); + @ Keeping in line with the conventions of the \CEE/ preprocessor (and otherwise contrary to the rules of \.{CWEB}) we distinguish here between the case that `\.(' immediately follows an identifier and the @@ -4287,10 +4275,7 @@ leaves |cur_xref| pointing to the first element not printed. Typical outputs: Note that the output of \.{CWEAVE} is not English-specific; users may supply new definitions for the macros \.{\\A}, \.{\\As}, etc. -@<Predecl...@>= -static void footnote(sixteen_bits);@/ - -@ @c +@c static void footnote(@t\1\1@> /* outputs section cross-references */ sixteen_bits flag@t\2\2@>) @@ -4306,6 +4291,8 @@ sixteen_bits flag@t\2\2@>) out('.'); } +@ @<Predecl...@>=@+static void footnote(sixteen_bits); + @ The following code distinguishes three cases, according as the number of cross-references is one, two, or more than two. Variable |q| points to the first cross-reference, and the last link is a zero. @@ -4336,10 +4323,7 @@ If the user has set the |no_xref| flag (the \.{-x} option on the command line), just finish off the page, omitting the index, section name list, and table of contents. -@<Predecl...@>= -static void phase_three(void);@/ - -@ @c +@c static void phase_three(void) { if (no_xref) { @@ -4387,6 +4371,8 @@ if (show_happiness) { check_complete(); /* was all of the change file used? */ } +@ @<Predecl...@>=@+static void phase_three(void); + @ Just before the index comes a list of all the changed sections, including the index section itself. @@ -4531,10 +4517,7 @@ regarded as identical. @d infinity 255 /* $\infty$ (approximately) */ -@<Predecl...@>= -static void unbucket(eight_bits);@/ - -@ @c +@c static void unbucket(@t\1\1@> /* empties buckets having depth |d| */ eight_bits d@t\2\2@>) @@ -4552,6 +4535,8 @@ eight_bits d@t\2\2@>) } } +@ @<Predecl...@>=@+static void unbucket(eight_bits); + @ @<Sort and output...@>= sort_ptr=scrap_info; unbucket(1); while (sort_ptr>scrap_info) { @@ -4651,10 +4636,7 @@ do { prints them. @^recursion@> -@<Predecl...@>= -static void section_print(name_pointer);@/ - -@ @c +@c static void section_print(@t\1\1@> /* print all section names in subtree |p| */ name_pointer p@t\2\2@>) @@ -4671,6 +4653,8 @@ name_pointer p@t\2\2@>) } } +@ @<Predecl...@>=@+static void section_print(name_pointer); + @ @<Output all the section names@>=section_print(root); @ Because on some systems the difference between two pointers is a |ptrdiff_t| |