diff options
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/cweav-w2c.ch')
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cweav-w2c.ch | 353 |
1 files changed, 268 insertions, 85 deletions
diff --git a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch index 4d74596a0a1..11058fb5172 100644 --- a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch @@ -83,6 +83,12 @@ int main (int ac, char **av) } @z +@x l.112 - 'use' print_text(), used nowhere else + return wrap_up(); /* and exit gracefully */ +@y + if (0) print_text(text_ptr); + return wrap_up(); /* and exit gracefully */ +@z Section 5. @@ -93,7 +99,7 @@ typedef short boolean; Section 6. -@x l.36 +@x common.h l.36 #include <stdio.h> @y #include <stdio.h> @@ -104,22 +110,17 @@ extern char *versionstring; Section 9. -@x common.h l.109 +@x common.h l.109 - protos now all in cweb.h. extern name_pointer id_lookup(); /* looks up a string in the identifier table */ extern name_pointer section_lookup(); /* finds section name */ extern void print_section_name(), sprint_section_name(); @y -/* looks up a string in the identifier table */ -extern name_pointer id_lookup (char*, char*, char); -/* finds section name */ -extern name_pointer section_lookup (char*, char*, char); -extern void print_section_name (name_pointer); -extern void sprint_section_name (char*, name_pointer); +#include "cweb.h" @z Section 10. -@x common.h l.123 - explicit types. +@x common.h l.123 - explicit types, protos now all in cweb.h. extern history; /* indicates how bad this run was */ extern err_print(); /* print error message and context */ extern wrap_up(); /* indicate |history| and exit */ @@ -127,10 +128,6 @@ extern void fatal(); /* issue error message and die */ extern void overflow(); /* succumb because a table has overflowed */ @y extern int history; /* indicates how bad this run was */ -extern void err_print (char*); /* print error message and context */ -extern int wrap_up (void); /* indicate |history| and exit */ -extern void fatal (char*, char*); /* issue error message and die */ -extern void overflow (char*); /* succumb because a table has overflowed */ @z Section 11. @@ -155,48 +152,50 @@ extern int line[]; /* number of current line in the stacked files */ extern int change_line; /* number of current line in change file */ @z -@x common.h l.153 - explicit types. +@x common.h l.153 - protos now all in cweb.h. extern reset_input(); /* initialize to read the web file and change file */ extern get_line(); /* inputs the next line */ extern check_complete(); /* checks that all changes were picked up */ @y -extern void reset_input (void); /* initialize to read the web file and change file */ -extern int get_line (void); /* inputs the next line */ -extern void check_complete (void); /* checks that all changes were picked up */ @z Section 15. -@x common.h l.192 +@x common.h l.192 - protos now all in cweb.h. extern void common_init(); @y -extern void common_init (void); @z Section 21. -@x l.276 +@x l.275 +void new_xref(p) name_pointer p; @y +static void new_xref (name_pointer p) @z Section 22. -@x l.307 +@x l.306 +void new_section_xref(p) name_pointer p; @y +static void new_section_xref (name_pointer p) @z Section 23. -@x l.327 +@x l.326 +void set_file_flag(p) name_pointer p; @y +static void set_file_flag (name_pointer p) @z @@ -209,7 +208,8 @@ char *first; /* position of first character of string */ int l; /* length of identifier */ eight_bits t; /* desired ilk */ @y -int names_match (name_pointer p, char *first, int l, char t) +int +names_match (name_pointer p, const char *first, int l, char t) @z @x l.383 @@ -232,22 +232,26 @@ Section 34. @x l.600 void skip_limbo(); @y -void skip_limbo (void); +static void skip_limbo (void); @z Section 35. -@x l.604 +@x l.603 +void skip_limbo() { @y +static void skip_limbo (void) { @z Section 36. -@x l.626 +@x l.625 +unsigned skip_TeX() /* skip past pure \TEX/ code */ @y +static unsigned skip_TeX (void) /* skip past pure \TEX/ code */ @z @@ -263,30 +267,60 @@ Section 39. @x l.696 eight_bits get_next(); @y -eight_bits get_next (void); +static eight_bits get_next (void); @z Section 40. -@x l.700 +@x l.699 +eight_bits get_next() /* produces the next input token */ @y +static eight_bits get_next (void) /* produces the next input token */ @z +Section 45. + +@x l.780 + else if (*loc=='>') if (*(loc+1)=='*') {loc++; compress(minus_gt_ast);} + else compress(minus_gt); break; +@y + else if (*loc=='>') {if (*(loc+1)=='*') {loc++; compress(minus_gt_ast);} + else compress(minus_gt);} break; +@z + +Section 48. + +@x l.870 + if (c=='\\') if (loc>=limit) continue; + else if (++id_loc<=section_text_end) { + *id_loc = '\\'; c=*loc++; + } +@y + if (c=='\\') { + if (loc>=limit) continue; + else if (++id_loc<=section_text_end) { + *id_loc = '\\'; c=*loc++; + } + } +@z + Section 55. @x l.971 void skip_restricted(); @y -void skip_restricted (void); +static void skip_restricted (void); @z Section 56. -@x l.975 +@x l.974 +void skip_restricted() @y +static void skip_restricted (void) @z @@ -295,14 +329,16 @@ Section 59. @x l.1024 void phase_one(); @y -void phase_one (void); +static void phase_one (void); @z Section 60. -@x l.1028 +@x l.1027 +void phase_one() { @y +static void phase_one (void) { @z @@ -311,15 +347,17 @@ Section 62. @x l.1076 void C_xref(); @y -void C_xref (eight_bits); +static void C_xref (eight_bits); @z Section 63. @x l.1080 +void C_xref( spec_ctrl ) /* makes cross-references for \CEE/ identifiers */ eight_bits spec_ctrl; @y +static void C_xref (eight_bits spec_ctrl) /* makes cross-references for \CEE/ identifiers */ @z @@ -328,14 +366,16 @@ Section 64. @x l.1104 void outer_xref(); @y -void outer_xref (void); +static void outer_xref (void); @z Section 65. -@x l.1108 +@x l.1107 +void outer_xref() /* extension of |C_xref| */ @y +static void outer_xref (void) /* extension of |C_xref| */ @z @@ -344,43 +384,51 @@ Section 74. @x l.1266 void section_check(); @y -void section_check (name_pointer); +static void section_check (name_pointer); @z Section 75. -@x l.1270 +@x l.1269 +void section_check(p) name_pointer p; /* print anomalies in subtree |p| */ @y +static void section_check (name_pointer p) /* print anomalies in subtree |p| */ @z Section 78. -@x l.1323 +@x l.1322 +void flush_buffer(b,per_cent,carryover) char *b; /* outputs from |out_buf+1| to |b|,where |b<=out_ptr| */ boolean per_cent,carryover; @y +static void flush_buffer (char *b, boolean per_cent, boolean carryover) @z Section 79. -@x l.1352 +@x l.1351 +void finish_line() /* do this at the end of a line */ @y +static void finish_line (void) /* do this at the end of a line */ @z Section 81. -@x l.1384 +@x l.1383 +void out_str(s) /* output characters from |s| to end of string */ char *s; @y -out_str (char *s) /* output characters from |s| to end of string */ +static void +out_str (const char *s) /* output characters from |s| to end of string */ @z Section 83. @@ -388,49 +436,59 @@ Section 83. @x l.1402 void break_out(); @y -void break_out (void); +static void break_out (void); @z Section 84. -@x l.1406 +@x l.1405 +void break_out() /* finds a way to break the output line */ @y +static void break_out (void) /* finds a way to break the output line */ @z Section 86. -@x l.1441 +@x l.1440 +void out_section(n) sixteen_bits n; @y +static void out_section (sixteen_bits n) @z Section 87. -@x l.1455 +@x l.1454 +void out_name(p,quote_xalpha) name_pointer p; boolean quote_xalpha; @y +static void out_name (name_pointer p, boolean quote_xalpha) @z Section 88. -@x l.1485 +@x l.1484 +void copy_limbo() @y +static void copy_limbo (void) @z Section 90. -@x l.1520 +@x l.1519 +eight_bits copy_TeX() @y +static eight_bits copy_TeX (void) @z @@ -439,7 +497,7 @@ Section 91. @x l.1449 int copy_comment(); @y -int copy_comment (boolean, int); +static int copy_comment (boolean, int); @z Section 92. @@ -449,75 +507,100 @@ int copy_comment(is_long_comment,bal) /* copies \TEX/ code in comments */ boolean is_long_comment; /* is this a traditional \CEE/ comment? */ int bal; /* brace balance */ @y -int copy_comment (boolean is_long_comment, int bal) +static int +copy_comment (boolean is_long_comment, int bal) +@z + +Section 93. + +@x l.1608 + if (phase==2) app_tok(*(loc++)) else loc++; +@y + {if (phase==2) app_tok(*(loc++)) else loc++;} @z Section 99. -@x l.1784 +@x l.1783 +void print_cat(c) /* symbolic printout of a category */ eight_bits c; @y +static void print_cat (eight_bits c) @z Section 106. -@x l.2139 +@x l.2138 +void print_text(p) /* prints a token list for debugging; not used in |main| */ text_pointer p; @y +static void print_text (text_pointer p) @z Section 109. -@x l.2264 +@x l.2263 +void app_str(s) char *s; @y -app_str (char *s) +static void +app_str (const char *s) @z -@x l.2271 +@x l.2270 +void big_app(a) token a; @y +static void big_app (token a) @z -@x l.2288 +@x l.2287 +void big_app1(a) scrap_pointer a; @y +static void big_app1 (scrap_pointer a) @z Section 111. -@x l.2415 +@x l.2414 +token_pointer find_first_ident(p) text_pointer p; @y +static token_pointer find_first_ident (text_pointer p) @z Section 112. -@x l.2447 +@x l.2446 +void make_reserved(p) /* make the first identifier in |p->trans| like |int| */ scrap_pointer p; @y +static void make_reserved (scrap_pointer p) @z Section 113. -@x l.2478 +@x l.2477 +void make_underlined(p) /* underline the entry for the first identifier in |p->trans| */ scrap_pointer p; @y +static void make_underlined (scrap_pointer p) @z @@ -526,54 +609,90 @@ Section 114. @x l.2495 void underline_xref(); @y -void underline_xref (name_pointer); +static void underline_xref (name_pointer); @z Section 115. -@x l.2499 +@x l.2498 +void underline_xref(p) name_pointer p; @y +static void underline_xref (name_pointer p) @z Section 164. -@x l.3004 +@x l.3003 +void reduce(j,k,c,d,n) scrap_pointer j; eight_bits c; short k, d, n; @y +static void reduce (scrap_pointer j, short k, eight_bits c, short d, short n) @z Section 165. -@x l.3030 +@x l.3029 +void squash(j,k,c,d,n) scrap_pointer j; eight_bits c; short k, d, n; @y +static void squash (scrap_pointer j, short k, eight_bits c, short d, short n) @z +Section 169. + +@x l.3096 -- rename local var, not to shadow param +{ scrap_pointer k; /* pointer into |scrap_info| */ + if (tracing==2) { + printf("\n%d:",n); + for (k=scrap_base; k<=lo_ptr; k++) { + if (k==pp) putxchar('*'); else putxchar(' '); + if (k->mathness %4 == yes_math) putchar('+'); + else if (k->mathness %4 == no_math) putchar('-'); + print_cat(k->cat); + if (k->mathness /4 == yes_math) putchar('+'); + else if (k->mathness /4 == no_math) putchar('-'); +@y +{ scrap_pointer k_l; /* pointer into |scrap_info| */ + if (tracing==2) { + printf("\n%d:",n); + for (k_l=scrap_base; k_l<=lo_ptr; k_l++) { + if (k_l==pp) putxchar('*'); else putxchar(' '); + if (k_l->mathness %4 == yes_math) putchar('+'); + else if (k_l->mathness %4 == no_math) putchar('-'); + print_cat(k_l->cat); + if (k_l->mathness /4 == yes_math) putchar('+'); + else if (k_l->mathness /4 == no_math) putchar('-'); +@z + Section 170. -@x l.3126 +@x l.3125 +text_pointer translate() /* converts a sequence of scraps */ @y +static text_pointer translate (void) /* converts a sequence of scraps */ @z Section 174. -@x l.3191 +@x l.3190 +void C_parse(spec_ctrl) /* creates scraps from \CEE/ tokens */ eight_bits spec_ctrl; @y +static void C_parse (eight_bits spec_ctrl) /* creates scraps from \CEE/ tokens */ @z @@ -582,64 +701,78 @@ Section 181. @x l.3421 void app_cur_id(); @y -void app_cur_id (boolean); +static void app_cur_id (boolean); @z Section 182. -@x l.3425 +@x l.3424 +void app_cur_id(scrapping) boolean scrapping; /* are we making this into a scrap? */ @y +static void app_cur_id (boolean scrapping) @z Section 183. -@x l.3451 +@x l.3449 +text_pointer C_translate() @y +static text_pointer C_translate (void) @z Section 184. -@x l.3480 +@x l.3479 +void outer_parse() /* makes scraps from \CEE/ tokens and comments */ @y +static void outer_parse (void) /* makes scraps from \CEE/ tokens and comments */ @z Section 189. -@x l.3586 +@x l.3585 +void push_level(p) /* suspends the current level */ text_pointer p; @y +static void push_level (text_pointer p) /* suspends the current level */ @z Section 190. -@x l.3606 +@x l.3605 +void pop_level() @y +static void pop_level (void) @z Section 192. -@x l.3628 +@x l.3627 +eight_bits get_output() /* returns the next token of output */ @y +static eight_bits get_output (void) /* returns the next token of output */ @z Section 193. -@x l.3665 +@x l.3664 +void output_C() /* outputs the current token list */ @y +static void output_C (void) /* outputs the current token list */ @z @@ -648,30 +781,47 @@ Section 194. @x l.3687 void make_output(); @y -void make_output (void); +static void make_output (void); @z Section 195. -@x l.3691 +@x l.3690 +void make_output() /* outputs the equivalents of tokens */ @y +static void make_output (void) /* outputs the equivalents of tokens */ @z +Section 202. + +@x l.3927 + if (b=='\'' || b=='"') + if (delim==0) delim=b; + else if (delim==b) delim=0; +@y + if (b=='\'' || b=='"') { + if (delim==0) delim=b; + else if (delim==b) delim=0; + } +@z + Section 205. @x l.3951 void phase_two(); @y -void phase_two (void); +static void phase_two (void); @z Section 206. @x l.3955 +void phase_two() { @y +static void phase_two (void) { @z @@ -680,32 +830,48 @@ Section 212. @x l.4074 void finish_C(); @y -void finish_C (boolean); +static void finish_C (boolean); @z Section 213. -@x l.4078 +@x l.4077 +void finish_C(visible) /* finishes a definition or a \CEE/ part */ boolean visible; /* nonzero if we should produce \TEX/ output */ @y +static void finish_C (boolean visible) /* finishes a definition or a \CEE/ part */ @z +Section 212. + +@x l.4092 + if (*out_ptr=='6') out_ptr-=2; + else if (*out_ptr=='7') *out_ptr='Y'; +@y + { + if (*out_ptr=='6') out_ptr-=2; + else if (*out_ptr=='7') *out_ptr='Y'; + } +@z + Section 221. @x l.4245 void footnote(); @y -void footnote (sixteen_bits); +static void footnote (sixteen_bits); @z Section 222. -@x l.4249 +@x l.4248 +void footnote(flag) /* outputs section cross-references */ sixteen_bits flag; @y +static void footnote (sixteen_bits flag) /* outputs section cross-references */ @z @@ -714,14 +880,16 @@ Section 225. @x l.4294 void phase_three(); @y -void phase_three (void); +static void phase_three (void); @z Section 226. -@x l.4298 +@x l.4297 +void phase_three() { @y +static void phase_three (void) { @z @@ -730,15 +898,17 @@ Section 237. @x l.4474 void unbucket(); @y -void unbucket (eight_bits); +static void unbucket (eight_bits); @z Section 238. -@x l.4478 +@x l.4477 +void unbucket(d) /* empties buckets having depth |d| */ eight_bits d; @y +static void unbucket (eight_bits d) /* empties buckets having depth |d| */ @z @@ -747,15 +917,17 @@ Section 246. @x l.4594 void section_print(); @y -void section_print (name_pointer); +static void section_print (name_pointer); @z Section 247. -@x l.4598 +@x l.4597 +void section_print(p) /* print all section names in subtree |p| */ name_pointer p; @y +static void section_print (name_pointer p) /* print all section names in subtree |p| */ @z @@ -766,3 +938,14 @@ print_stats() { @y print_stats (void) { @z + +Section 250. (added) + +@x l.4643 - declare print_text(), so it can be 'used' in main. +@** Index. +@y +@ @<Predecl...@>= +static void print_text (text_pointer p); + +@** Index. +@z |