texlive[57841] Build/source/texk/web2c: [CWEB] Code review.
commits+ascherer at tug.org
commits+ascherer at tug.org
Mon Feb 22 15:22:20 CET 2021
Revision: 57841
http://tug.org/svn/texlive?view=revision&revision=57841
Author: ascherer
Date: 2021-02-22 15:22:20 +0100 (Mon, 22 Feb 2021)
Log Message:
-----------
[CWEB] Code review.
* Decouple CTANGLE and CWEAVE from COMMON by using 'static' variables.
* Reshuffle variable declarations in 'common.h' to match the definitions
in 'common.w'.
* Eliminate some unused stuff in CTWILL.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/ChangeLog
trunk/Build/source/texk/web2c/ctangleboot.cin
trunk/Build/source/texk/web2c/cwebboot.cin
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/Makefile
trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h
trunk/Build/source/texk/web2c/cwebdir/common.c
trunk/Build/source/texk/web2c/cwebdir/common.h
trunk/Build/source/texk/web2c/cwebdir/common.w
trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch
trunk/Build/source/texk/web2c/cwebdir/ctangle.c
trunk/Build/source/texk/web2c/cwebdir/ctangle.w
trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweav-bs.ch
trunk/Build/source/texk/web2c/cwebdir/cweav-man.ch
trunk/Build/source/texk/web2c/cwebdir/cweave.w
Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/ChangeLog 2021-02-22 14:22:20 UTC (rev 57841)
@@ -1,3 +1,8 @@
+2021-02-22 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: Code review.
+
2021-02-20 Andreas Scherer <https://ascherer.github.io>
* ctangleboot.cin,
Modified: trunk/Build/source/texk/web2c/ctangleboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/ctangleboot.cin 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/ctangleboot.cin 2021-02-22 14:22:20 UTC (rev 57841)
@@ -53,6 +53,15 @@
#define xisupper(c) (isupper((eight_bits) c) &&((eight_bits) c<0200) )
#define xisxdigit(c) (isxdigit((eight_bits) c) &&((eight_bits) c<0200) ) \
+#define max_include_depth 10 \
+
+#define max_file_name_length 1024
+#define cur_file file[include_depth]
+#define cur_file_name file_name[include_depth]
+#define cur_line line[include_depth]
+#define web_file file[0]
+#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 llink link
@@ -69,15 +78,6 @@
#define confusion(s) fatal(_("! This can't happen: ") ,s) \
\
-#define max_include_depth 10 \
-
-#define max_file_name_length 1024
-#define cur_file file[include_depth]
-#define cur_file_name file_name[include_depth]
-#define cur_line line[include_depth]
-#define web_file file[0]
-#define web_file_name file_name[0] \
-
#define show_banner flags['b']
#define show_progress flags['p']
#define show_stats flags['s']
@@ -187,8 +187,33 @@
extern char*limit;
/*:6*//*7:*/
-#line 119 "cwebdir/comm-w2c.h"
+#line 122 "cwebdir/comm-w2c.h"
+extern int include_depth;
+extern FILE*file[];
+extern FILE*change_file;
+extern char file_name[][max_file_name_length];
+
+extern char change_file_name[];
+extern char check_file_name[];
+extern int line[];
+extern int change_line;
+extern int change_depth;
+extern boolean input_has_ended;
+extern boolean changing;
+extern boolean web_file_open;
+
+/*:7*//*9:*/
+#line 143 "cwebdir/comm-w2c.h"
+
+extern sixteen_bits section_count;
+extern boolean changed_section[];
+extern boolean change_pending;
+extern boolean print_where;
+
+/*:9*//*10:*/
+#line 157 "cwebdir/comm-w2c.h"
+
typedef struct name_info{
char*byte_start;
struct name_info*link;
@@ -211,45 +236,20 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:7*//*9:*/
-#line 163 "cwebdir/comm-w2c.h"
+/*:10*//*12:*/
+#line 201 "cwebdir/comm-w2c.h"
extern int history;
-/*:9*//*11:*/
-#line 183 "cwebdir/comm-w2c.h"
+/*:12*//*14:*/
+#line 218 "cwebdir/comm-w2c.h"
-extern int include_depth;
-extern FILE*file[];
-extern FILE*change_file;
+extern int argc;
+extern char**argv;
extern char C_file_name[];
extern char tex_file_name[];
extern char idx_file_name[];
extern char scn_file_name[];
-extern char file_name[][max_file_name_length];
-
-extern char change_file_name[];
-extern char check_file_name[];
-extern int line[];
-extern int change_line;
-extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
-
-/*:11*//*13:*/
-#line 208 "cwebdir/comm-w2c.h"
-
-extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
-
-/*:13*//*14:*/
-#line 222 "cwebdir/comm-w2c.h"
-
-extern int argc;
-extern char**argv;
extern boolean flags[];
extern const char*use_language;
@@ -298,84 +298,91 @@
/*20:*/
#line 129 "cwebdir/ctangle.w"
-text text_info[max_texts];
-text_pointer text_info_end= text_info+max_texts-1;
-text_pointer text_ptr;
-eight_bits tok_mem[max_toks];
-eight_bits*tok_mem_end= tok_mem+max_toks-1;
-eight_bits*tok_ptr;
+static text text_info[max_texts];
+static text_pointer text_info_end= text_info+max_texts-1;
+static text_pointer text_ptr;
+static eight_bits tok_mem[max_toks];
+static eight_bits*tok_mem_end= tok_mem+max_toks-1;
+static eight_bits*tok_ptr;
/*:20*//*26:*/
#line 198 "cwebdir/ctangle.w"
-text_pointer last_unnamed;
+static text_pointer last_unnamed;
/*:26*//*32:*/
#line 286 "cwebdir/ctangle.w"
-output_state cur_state;
+static output_state cur_state;
-output_state stack[stack_size+1];
-stack_pointer stack_end= stack+stack_size;
-stack_pointer stack_ptr;
+static output_state stack[stack_size+1];
+static stack_pointer stack_end= stack+stack_size;
+static stack_pointer stack_ptr;
/*:32*//*37:*/
#line 362 "cwebdir/ctangle.w"
-int cur_val;
+static int cur_val;
/*:37*//*42:*/
#line 454 "cwebdir/ctangle.w"
-eight_bits out_state;
-boolean protect;
+static eight_bits out_state;
+static boolean protect;
/*:42*//*45:*/
#line 486 "cwebdir/ctangle.w"
-name_pointer output_files[max_files];
-name_pointer*cur_out_file,*end_output_files,*an_output_file;
-char cur_section_name_char;
-char output_file_name[longest_name+1];
+static name_pointer output_files[max_files];
+static name_pointer*cur_out_file,*end_output_files,*an_output_file;
+static char cur_section_name_char;
+static char output_file_name[longest_name+1];
/*:45*//*52:*/
#line 586 "cwebdir/ctangle.w"
-boolean output_defs_seen= false;
+static boolean output_defs_seen= false;
/*:52*//*57:*/
#line 695 "cwebdir/ctangle.w"
-char translit[128][translit_length];
+static char translit[128][translit_length];
/*:57*//*62:*/
#line 774 "cwebdir/ctangle.w"
-eight_bits ccode[256];
+static eight_bits ccode[256];
/*:62*//*66:*/
#line 834 "cwebdir/ctangle.w"
-boolean comment_continues= false;
+static boolean comment_continues= false;
/*:66*//*68:*/
#line 873 "cwebdir/ctangle.w"
-name_pointer cur_section_name;
-boolean no_where;
+static name_pointer cur_section_name;
+static boolean no_where;
/*:68*//*82:*/
#line 1187 "cwebdir/ctangle.w"
-text_pointer cur_text;
-eight_bits next_control;
+static text_pointer cur_text;
+static eight_bits next_control;
/*:82*/
#line 71 "cwebdir/ctangle.w"
/*8:*/
-#line 142 "cwebdir/comm-w2c.h"
+#line 137 "cwebdir/comm-w2c.h"
+extern boolean get_line(void);
+extern void check_complete(void);
+extern void reset_input(void);
+
+/*:8*//*11:*/
+#line 180 "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*,char);
@@ -386,8 +393,8 @@
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:8*//*10:*/
-#line 166 "cwebdir/comm-w2c.h"
+/*:11*//*13:*/
+#line 204 "cwebdir/comm-w2c.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -394,14 +401,7 @@
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:10*//*12:*/
-#line 202 "cwebdir/comm-w2c.h"
-
-extern boolean get_line(void);
-extern void check_complete(void);
-extern void reset_input(void);
-
-/*:12*//*16:*/
+/*:13*//*16:*/
#line 244 "cwebdir/comm-w2c.h"
extern void common_init(void);
Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebboot.cin 2021-02-22 14:22:20 UTC (rev 57841)
@@ -77,6 +77,15 @@
#define xisupper(c) (isupper((eight_bits) c) &&((eight_bits) c<0200) )
#define xisxdigit(c) (isxdigit((eight_bits) c) &&((eight_bits) c<0200) ) \
+#define max_include_depth 10 \
+
+#define max_file_name_length 1024
+#define cur_file file[include_depth]
+#define cur_file_name file_name[include_depth]
+#define cur_line line[include_depth]
+#define web_file file[0]
+#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 llink link
@@ -93,15 +102,6 @@
#define confusion(s) fatal(_("! This can't happen: ") ,s) \
\
-#define max_include_depth 10 \
-
-#define max_file_name_length 1024
-#define cur_file file[include_depth]
-#define cur_file_name file_name[include_depth]
-#define cur_line line[include_depth]
-#define web_file file[0]
-#define web_file_name file_name[0] \
-
#define show_banner flags['b']
#define show_progress flags['p']
#define show_stats flags['s']
@@ -202,8 +202,33 @@
extern char*limit;
/*:5*//*6:*/
-#line 119 "cwebdir/comm-w2c.h"
+#line 122 "cwebdir/comm-w2c.h"
+extern int include_depth;
+extern FILE*file[];
+extern FILE*change_file;
+extern char file_name[][max_file_name_length];
+
+extern char change_file_name[];
+extern char check_file_name[];
+extern int line[];
+extern int change_line;
+extern int change_depth;
+extern boolean input_has_ended;
+extern boolean changing;
+extern boolean web_file_open;
+
+/*:6*//*8:*/
+#line 143 "cwebdir/comm-w2c.h"
+
+extern sixteen_bits section_count;
+extern boolean changed_section[];
+extern boolean change_pending;
+extern boolean print_where;
+
+/*:8*//*9:*/
+#line 157 "cwebdir/comm-w2c.h"
+
typedef struct name_info{
char*byte_start;
struct name_info*link;
@@ -226,45 +251,20 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:6*//*8:*/
-#line 163 "cwebdir/comm-w2c.h"
+/*:9*//*11:*/
+#line 201 "cwebdir/comm-w2c.h"
extern int history;
-/*:8*//*10:*/
-#line 183 "cwebdir/comm-w2c.h"
+/*:11*//*13:*/
+#line 218 "cwebdir/comm-w2c.h"
-extern int include_depth;
-extern FILE*file[];
-extern FILE*change_file;
+extern int argc;
+extern char**argv;
extern char C_file_name[];
extern char tex_file_name[];
extern char idx_file_name[];
extern char scn_file_name[];
-extern char file_name[][max_file_name_length];
-
-extern char change_file_name[];
-extern char check_file_name[];
-extern int line[];
-extern int change_line;
-extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
-
-/*:10*//*12:*/
-#line 208 "cwebdir/comm-w2c.h"
-
-extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
-
-/*:12*//*13:*/
-#line 222 "cwebdir/comm-w2c.h"
-
-extern int argc;
-extern char**argv;
extern boolean flags[];
extern const char*use_language;
@@ -305,8 +305,8 @@
char buffer[long_buf_size];
char*buffer_end= buffer+buf_size-2;
+char*loc= buffer;
char*limit= buffer;
-char*loc= buffer;
/*:22*//*25:*/
#line 194 "cwebdir/common.w"
@@ -328,8 +328,8 @@
/*:25*//*26:*/
#line 220 "cwebdir/common.w"
-char change_buffer[buf_size];
-char*change_limit;
+static char change_buffer[buf_size];
+static char*change_limit;
/*:26*//*37:*/
#line 401 "cwebdir/common.w"
@@ -351,8 +351,8 @@
/*:43*//*44:*/
#line 609 "cwebdir/common.w"
+char*byte_ptr;
name_pointer name_ptr;
-char*byte_ptr;
/*:44*//*46:*/
#line 629 "cwebdir/common.w"
@@ -415,8 +415,15 @@
#line 70 "cwebdir/common.w"
/*7:*/
-#line 142 "cwebdir/comm-w2c.h"
+#line 137 "cwebdir/comm-w2c.h"
+extern boolean get_line(void);
+extern void check_complete(void);
+extern void reset_input(void);
+
+/*:7*//*10:*/
+#line 180 "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*,char);
@@ -427,8 +434,8 @@
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:7*//*9:*/
-#line 166 "cwebdir/comm-w2c.h"
+/*:10*//*12:*/
+#line 204 "cwebdir/comm-w2c.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -435,14 +442,7 @@
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:9*//*11:*/
-#line 202 "cwebdir/comm-w2c.h"
-
-extern boolean get_line(void);
-extern void check_complete(void);
-extern void reset_input(void);
-
-/*:11*//*15:*/
+/*:12*//*15:*/
#line 244 "cwebdir/comm-w2c.h"
extern void common_init(void);
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2021-02-22 14:22:20 UTC (rev 57841)
@@ -1,3 +1,20 @@
+2021-02-22 Andreas Scherer <https://ascherer.github.io>
+
+ * Makefile,
+ * comm-w2c.ch
+ * comm-w2c.h
+ * common.c
+ * common.h
+ * common.w
+ * ctang-bs.ch,
+ * ctangle.c,
+ * ctangle.w,
+ * ctwill-mini.ch,
+ * ctwill-w2c.ch,
+ * cweav-bs.ch,
+ * cweav-man.ch,
+ * cweave.w: Decouple CTANGLE and CWEAVE from COMMON.
+
2021-02-20 Andreas Scherer <https://ascherer.github.io>
* Makefile,
Modified: trunk/Build/source/texk/web2c/cwebdir/Makefile
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/Makefile 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/Makefile 2021-02-22 14:22:20 UTC (rev 57841)
@@ -63,8 +63,10 @@
CP= /bin/cp
# uncomment the second line if you use pdftex to bypass .dvi files
+# uncomment the third line if you use xetex to bypass .dvi files
PDFTEX = dvipdfm
#PDFTEX = pdftex
+#PDFTEX = xetex
########## You shouldn't have to change anything after this point #######
@@ -105,6 +107,7 @@
case "$(PDFTEX)" in \
dvipdfm ) tex "\let\pdf+ \input $*"; dvipdfm $* ;; \
pdftex ) pdftex $* ;; \
+ xetex ) xetex $* ;; \
esac
all: ctangle cweave
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch 2021-02-22 14:22:20 UTC (rev 57841)
@@ -99,7 +99,7 @@
@z
@x
-char alt_web_file_name[max_file_name_length]; /* alternate name to try */
+static char alt_web_file_name[max_file_name_length]; /* alternate name to try */
@y
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h 2021-02-22 14:22:20 UTC (rev 57841)
@@ -108,6 +108,44 @@
extern char *loc; /* points to the next character to be read from the buffer */
extern char *limit; /* points to the last character in the buffer */
+@ Code related to file handling:
+ at f line x /* make |line| an unreserved word */
+ at d max_include_depth 10 /* maximum number of source files open
+ simultaneously, not counting the change file */
+ at d max_file_name_length 1024
+ at d cur_file file[include_depth] /* current file */
+ at d cur_file_name file_name[include_depth] /* current file name */
+ at d cur_line line[include_depth] /* number of current line in current file */
+ at d web_file file[0] /* main source file */
+ at d web_file_name file_name[0] /* main source file name */
+
+@<Common code...@>=
+extern int include_depth; /* current level of nesting */
+extern FILE *file[]; /* stack of non-change files */
+extern FILE *change_file; /* change file */
+extern char file_name[][max_file_name_length];
+ /* stack of non-change file names */
+extern char change_file_name[]; /* name of change file */
+extern char check_file_name[]; /* name of |check_file| */
+extern int line[]; /* number of current line in the stacked files */
+extern int change_line; /* number of current line in change file */
+extern int change_depth; /* where \.{@@y} originated during a change */
+extern boolean input_has_ended; /* if there is no more input */
+extern boolean changing; /* if the current line is from |change_file| */
+extern boolean web_file_open; /* if the web file is being read */
+
+@ @<Predecl...@>=
+extern boolean get_line(void); /* inputs the next line */
+extern void check_complete(void); /* checks that all changes were picked up */
+extern void reset_input(void); /* initialize to read the web file and change file */
+
+@ Code related to section numbers:
+@<Common code...@>=
+extern sixteen_bits section_count; /* the current section number */
+extern boolean changed_section[]; /* is the section changed? */
+extern boolean change_pending; /* is a decision about change still unclear? */
+extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */
+
@ Code related to identifier and section name storage:
@d length(c) (size_t)((c+1)->byte_start-(c)->byte_start) /* the length of a name */
@d print_id(c) term_write((c)->byte_start,length((c))) /* print identifier */
@@ -169,48 +207,6 @@
extern void fatal(const char *,const char *); /* issue error message and die */
extern void overflow(const char *); /* succumb because a table has overflowed */
-@ Code related to file handling:
- at f line x /* make |line| an unreserved word */
- at d max_include_depth 10 /* maximum number of source files open
- simultaneously, not counting the change file */
- at d max_file_name_length 1024
- at d cur_file file[include_depth] /* current file */
- at d cur_file_name file_name[include_depth] /* current file name */
- at d cur_line line[include_depth] /* number of current line in current file */
- at d web_file file[0] /* main source file */
- at d web_file_name file_name[0] /* main source file name */
-
-@<Common code...@>=
-extern int include_depth; /* current level of nesting */
-extern FILE *file[]; /* stack of non-change files */
-extern FILE *change_file; /* change file */
-extern char C_file_name[]; /* name of |C_file| */
-extern char tex_file_name[]; /* name of |tex_file| */
-extern char idx_file_name[]; /* name of |idx_file| */
-extern char scn_file_name[]; /* name of |scn_file| */
-extern char file_name[][max_file_name_length];
- /* stack of non-change file names */
-extern char change_file_name[]; /* name of change file */
-extern char check_file_name[]; /* name of |check_file| */
-extern int line[]; /* number of current line in the stacked files */
-extern int change_line; /* number of current line in change file */
-extern int change_depth; /* where \.{@@y} originated during a change */
-extern boolean input_has_ended; /* if there is no more input */
-extern boolean changing; /* if the current line is from |change_file| */
-extern boolean web_file_open; /* if the web file is being read */
-
-@ @<Predecl...@>=
-extern boolean get_line(void); /* inputs the next line */
-extern void check_complete(void); /* checks that all changes were picked up */
-extern void reset_input(void); /* initialize to read the web file and change file */
-
-@ Code related to section numbers:
-@<Common code...@>=
-extern sixteen_bits section_count; /* the current section number */
-extern boolean changed_section[]; /* is the section changed? */
-extern boolean change_pending; /* is a decision about change still unclear? */
-extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */
-
@ Code related to command line arguments:
@d show_banner flags['b'] /* should the banner line be printed? */
@d show_progress flags['p'] /* should progress reports be printed? */
@@ -222,10 +218,14 @@
@<Common code...@>=
extern int argc; /* copy of |ac| parameter to |main| */
extern char **argv; /* copy of |av| parameter to |main| */
+extern char C_file_name[]; /* name of |C_file| */
+extern char tex_file_name[]; /* name of |tex_file| */
+extern char idx_file_name[]; /* name of |idx_file| */
+extern char scn_file_name[]; /* name of |scn_file| */
extern boolean flags[]; /* an option for each 7-bit code */
extern const char *use_language; /* prefix to \.{cwebmac.tex} in \TEX/ output */
-@ Code relating to output:
+@ Code related to output:
@d update_terminal fflush(stdout) /* empty the terminal output buffer */
@d new_line putchar('\n') @d putxchar putchar
@d term_write(a,b) fflush(stdout),fwrite(a,sizeof(char),b,stdout)
Modified: trunk/Build/source/texk/web2c/cwebdir/common.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.c 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/common.c 2021-02-22 14:22:20 UTC (rev 57841)
@@ -41,6 +41,15 @@
#define xisupper(c) (isupper((eight_bits) c) &&((eight_bits) c<0200) )
#define xisxdigit(c) (isxdigit((eight_bits) c) &&((eight_bits) c<0200) ) \
+#define max_include_depth 10 \
+
+#define max_file_name_length 1024
+#define cur_file file[include_depth]
+#define cur_file_name file_name[include_depth]
+#define cur_line line[include_depth]
+#define web_file file[0]
+#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 llink link
@@ -57,15 +66,6 @@
#define confusion(s) fatal("! This can't happen: ",s) \
\
-#define max_include_depth 10 \
-
-#define max_file_name_length 1024
-#define cur_file file[include_depth]
-#define cur_file_name file_name[include_depth]
-#define cur_line line[include_depth]
-#define web_file file[0]
-#define web_file_name file_name[0] \
-
#define show_banner flags['b']
#define show_progress flags['p']
#define show_stats flags['s']
@@ -149,8 +149,32 @@
extern char*limit;
/*:5*//*6:*/
-#line 102 "common.h"
+#line 105 "common.h"
+extern int include_depth;
+extern FILE*file[];
+extern FILE*change_file;
+extern char file_name[][max_file_name_length];
+
+extern char change_file_name[];
+extern int line[];
+extern int change_line;
+extern int change_depth;
+extern boolean input_has_ended;
+extern boolean changing;
+extern boolean web_file_open;
+
+/*:6*//*8:*/
+#line 125 "common.h"
+
+extern sixteen_bits section_count;
+extern boolean changed_section[];
+extern boolean change_pending;
+extern boolean print_where;
+
+/*:8*//*9:*/
+#line 139 "common.h"
+
typedef struct name_info{
char*byte_start;
struct name_info*link;
@@ -173,44 +197,20 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:6*//*8:*/
-#line 146 "common.h"
+/*:9*//*11:*/
+#line 183 "common.h"
extern int history;
-/*:8*//*10:*/
-#line 166 "common.h"
+/*:11*//*13:*/
+#line 199 "common.h"
-extern int include_depth;
-extern FILE*file[];
-extern FILE*change_file;
+extern int argc;
+extern char**argv;
extern char C_file_name[];
extern char tex_file_name[];
extern char idx_file_name[];
extern char scn_file_name[];
-extern char file_name[][max_file_name_length];
-
-extern char change_file_name[];
-extern int line[];
-extern int change_line;
-extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
-
-/*:10*//*12:*/
-#line 190 "common.h"
-
-extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
-
-/*:12*//*13:*/
-#line 203 "common.h"
-
-extern int argc;
-extern char**argv;
extern boolean flags[];
/*:13*//*14:*/
@@ -247,8 +247,8 @@
char buffer[long_buf_size];
char*buffer_end= buffer+buf_size-2;
+char*loc= buffer;
char*limit= buffer;
-char*loc= buffer;
/*:22*//*25:*/
#line 194 "common.w"
@@ -259,7 +259,7 @@
char file_name[max_include_depth][max_file_name_length];
char change_file_name[max_file_name_length];
-char alt_web_file_name[max_file_name_length];
+static char alt_web_file_name[max_file_name_length];
int line[max_include_depth];
int change_line;
int change_depth;
@@ -270,8 +270,8 @@
/*:25*//*26:*/
#line 220 "common.w"
-char change_buffer[buf_size];
-char*change_limit;
+static char change_buffer[buf_size];
+static char*change_limit;
/*:26*//*37:*/
#line 401 "common.w"
@@ -293,8 +293,8 @@
/*:43*//*44:*/
#line 609 "common.w"
+char*byte_ptr;
name_pointer name_ptr;
-char*byte_ptr;
/*:44*//*46:*/
#line 629 "common.w"
@@ -332,8 +332,15 @@
#line 70 "common.w"
/*7:*/
-#line 125 "common.h"
+#line 119 "common.h"
+extern boolean get_line(void);
+extern void check_complete(void);
+extern void reset_input(void);
+
+/*:7*//*10:*/
+#line 162 "common.h"
+
extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,char);
@@ -344,8 +351,8 @@
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:7*//*9:*/
-#line 149 "common.h"
+/*:10*//*12:*/
+#line 186 "common.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -352,14 +359,7 @@
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:9*//*11:*/
-#line 184 "common.h"
-
-extern boolean get_line(void);
-extern void check_complete(void);
-extern void reset_input(void);
-
-/*:11*//*15:*/
+/*:12*//*15:*/
#line 223 "common.h"
extern void common_init(void);
Modified: trunk/Build/source/texk/web2c/cwebdir/common.h
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.h 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/common.h 2021-02-22 14:22:20 UTC (rev 57841)
@@ -91,6 +91,43 @@
extern char *loc; /* points to the next character to be read from the buffer */
extern char *limit; /* points to the last character in the buffer */
+@ Code related to file handling:
+ at f line x /* make |line| an unreserved word */
+ at d max_include_depth 10 /* maximum number of source files open
+ simultaneously, not counting the change file */
+ at d max_file_name_length 1024
+ at d cur_file file[include_depth] /* current file */
+ at d cur_file_name file_name[include_depth] /* current file name */
+ at d cur_line line[include_depth] /* number of current line in current file */
+ at d web_file file[0] /* main source file */
+ at d web_file_name file_name[0] /* main source file name */
+
+@<Common code...@>=
+extern int include_depth; /* current level of nesting */
+extern FILE *file[]; /* stack of non-change files */
+extern FILE *change_file; /* change file */
+extern char file_name[][max_file_name_length];
+ /* stack of non-change file names */
+extern char change_file_name[]; /* name of change file */
+extern int line[]; /* number of current line in the stacked files */
+extern int change_line; /* number of current line in change file */
+extern int change_depth; /* where \.{@@y} originated during a change */
+extern boolean input_has_ended; /* if there is no more input */
+extern boolean changing; /* if the current line is from |change_file| */
+extern boolean web_file_open; /* if the web file is being read */
+
+@ @<Predecl...@>=
+extern boolean get_line(void); /* inputs the next line */
+extern void check_complete(void); /* checks that all changes were picked up */
+extern void reset_input(void); /* initialize to read the web file and change file */
+
+@ Code related to section numbers:
+@<Common code...@>=
+extern sixteen_bits section_count; /* the current section number */
+extern boolean changed_section[]; /* is the section changed? */
+extern boolean change_pending; /* is a decision about change still unclear? */
+extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */
+
@ Code related to identifier and section name storage:
@d length(c) (size_t)((c+1)->byte_start-(c)->byte_start) /* the length of a name */
@d print_id(c) term_write((c)->byte_start,length((c))) /* print identifier */
@@ -152,47 +189,6 @@
extern void fatal(const char *,const char *); /* issue error message and die */
extern void overflow(const char *); /* succumb because a table has overflowed */
-@ Code related to file handling:
- at f line x /* make |line| an unreserved word */
- at d max_include_depth 10 /* maximum number of source files open
- simultaneously, not counting the change file */
- at d max_file_name_length 1024
- at d cur_file file[include_depth] /* current file */
- at d cur_file_name file_name[include_depth] /* current file name */
- at d cur_line line[include_depth] /* number of current line in current file */
- at d web_file file[0] /* main source file */
- at d web_file_name file_name[0] /* main source file name */
-
-@<Common code...@>=
-extern int include_depth; /* current level of nesting */
-extern FILE *file[]; /* stack of non-change files */
-extern FILE *change_file; /* change file */
-extern char C_file_name[]; /* name of |C_file| */
-extern char tex_file_name[]; /* name of |tex_file| */
-extern char idx_file_name[]; /* name of |idx_file| */
-extern char scn_file_name[]; /* name of |scn_file| */
-extern char file_name[][max_file_name_length];
- /* stack of non-change file names */
-extern char change_file_name[]; /* name of change file */
-extern int line[]; /* number of current line in the stacked files */
-extern int change_line; /* number of current line in change file */
-extern int change_depth; /* where \.{@@y} originated during a change */
-extern boolean input_has_ended; /* if there is no more input */
-extern boolean changing; /* if the current line is from |change_file| */
-extern boolean web_file_open; /* if the web file is being read */
-
-@ @<Predecl...@>=
-extern boolean get_line(void); /* inputs the next line */
-extern void check_complete(void); /* checks that all changes were picked up */
-extern void reset_input(void); /* initialize to read the web file and change file */
-
-@ Code related to section numbers:
-@<Common code...@>=
-extern sixteen_bits section_count; /* the current section number */
-extern boolean changed_section[]; /* is the section changed? */
-extern boolean change_pending; /* is a decision about change still unclear? */
-extern boolean print_where; /* tells \.{CTANGLE} to print line and file info */
-
@ Code related to command line arguments:
@d show_banner flags['b'] /* should the banner line be printed? */
@d show_progress flags['p'] /* should progress reports be printed? */
@@ -203,9 +199,13 @@
@<Common code...@>=
extern int argc; /* copy of |ac| parameter to |main| */
extern char **argv; /* copy of |av| parameter to |main| */
+extern char C_file_name[]; /* name of |C_file| */
+extern char tex_file_name[]; /* name of |tex_file| */
+extern char idx_file_name[]; /* name of |idx_file| */
+extern char scn_file_name[]; /* name of |scn_file| */
extern boolean flags[]; /* an option for each 7-bit code */
-@ Code relating to output:
+@ Code related to output:
@d update_terminal fflush(stdout) /* empty the terminal output buffer */
@d new_line putchar('\n') @d putxchar putchar
@d term_write(a,b) fflush(stdout),fwrite(a,sizeof(char),b,stdout)
Modified: trunk/Build/source/texk/web2c/cwebdir/common.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.w 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/common.w 2021-02-22 14:22:20 UTC (rev 57841)
@@ -149,8 +149,8 @@
@<Global var...@>=
char buffer[long_buf_size]; /* where each line of input goes */
char *buffer_end=buffer+buf_size-2; /* end of |buffer| */
+char *loc=buffer; /* points to the next character to be read from the buffer */
char *limit=buffer; /* points to the last character in the buffer */
-char *loc=buffer; /* points to the next character to be read from the buffer */
@ In the unlikely event that your standard I/O library does not
support |feof|, |getc|, and |ungetc| you may have to change things here.
@@ -198,7 +198,7 @@
char file_name[max_include_depth][max_file_name_length];
/* stack of non-change file names */
char change_file_name[max_file_name_length]; /* name of change file */
-char alt_web_file_name[max_file_name_length]; /* alternate name to try */
+static char alt_web_file_name[max_file_name_length]; /* alternate name to try */
int line[max_include_depth]; /* number of current line in the stacked files */
int change_line; /* number of current line in change file */
int change_depth; /* where \.{@@y} originated during a change */
@@ -218,8 +218,8 @@
strncmp(buffer, change_buffer, (size_t)(limit-buffer)))
@<Global var...@>=
-char change_buffer[buf_size]; /* next line of |change_file| */
-char *change_limit; /* points to the last character in |change_buffer| */
+static char change_buffer[buf_size]; /* next line of |change_file| */
+static char *change_limit; /* points to the last character in |change_buffer| */
@ Procedure |prime_the_change_buffer|
sets |change_buffer| in preparation for the next matching operation.
@@ -607,8 +607,8 @@
we want to keep |name_ptr<=name_dir_end| and |byte_ptr<=byte_mem_end|.
@<Global var...@>=
+char *byte_ptr; /* first unused position in |byte_mem| */
name_pointer name_ptr; /* first unused position in |name_dir| */
-char *byte_ptr; /* first unused position in |byte_mem| */
@ @<Init...@>=
name_dir->byte_start=byte_ptr=byte_mem; /* position zero in both arrays */
Modified: trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/ctang-bs.ch 2021-02-22 14:22:20 UTC (rev 57841)
@@ -141,13 +141,13 @@
@x Section 17.
-eight_bits tok_mem[max_toks];
-eight_bits *tok_mem_end=tok_mem+max_toks-1;
-eight_bits *tok_ptr; /* first unused position in |tok_mem| */
+static eight_bits tok_mem[max_toks];
+static eight_bits *tok_mem_end=tok_mem+max_toks-1;
+static eight_bits *tok_ptr; /* first unused position in |tok_mem| */
@y
-eight_bits huge tok_mem[max_toks];
-eight_bits huge* tok_mem_end;
-eight_bits huge* tok_ptr; /* first unused position in |tok_mem| */
+static eight_bits huge tok_mem[max_toks];
+static eight_bits huge* tok_mem_end;
+static eight_bits huge* tok_ptr; /* first unused position in |tok_mem| */
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.c 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.c 2021-02-22 14:22:20 UTC (rev 57841)
@@ -43,6 +43,15 @@
#define xisupper(c) (isupper((eight_bits) c) &&((eight_bits) c<0200) )
#define xisxdigit(c) (isxdigit((eight_bits) c) &&((eight_bits) c<0200) ) \
+#define max_include_depth 10 \
+
+#define max_file_name_length 1024
+#define cur_file file[include_depth]
+#define cur_file_name file_name[include_depth]
+#define cur_line line[include_depth]
+#define web_file file[0]
+#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 llink link
@@ -59,15 +68,6 @@
#define confusion(s) fatal("! This can't happen: ",s) \
\
-#define max_include_depth 10 \
-
-#define max_file_name_length 1024
-#define cur_file file[include_depth]
-#define cur_file_name file_name[include_depth]
-#define cur_line line[include_depth]
-#define web_file file[0]
-#define web_file_name file_name[0] \
-
#define show_banner flags['b']
#define show_progress flags['p']
#define show_stats flags['s']
@@ -171,8 +171,32 @@
extern char*limit;
/*:6*//*7:*/
-#line 102 "common.h"
+#line 105 "common.h"
+extern int include_depth;
+extern FILE*file[];
+extern FILE*change_file;
+extern char file_name[][max_file_name_length];
+
+extern char change_file_name[];
+extern int line[];
+extern int change_line;
+extern int change_depth;
+extern boolean input_has_ended;
+extern boolean changing;
+extern boolean web_file_open;
+
+/*:7*//*9:*/
+#line 125 "common.h"
+
+extern sixteen_bits section_count;
+extern boolean changed_section[];
+extern boolean change_pending;
+extern boolean print_where;
+
+/*:9*//*10:*/
+#line 139 "common.h"
+
typedef struct name_info{
char*byte_start;
struct name_info*link;
@@ -195,44 +219,20 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:7*//*9:*/
-#line 146 "common.h"
+/*:10*//*12:*/
+#line 183 "common.h"
extern int history;
-/*:9*//*11:*/
-#line 166 "common.h"
+/*:12*//*14:*/
+#line 199 "common.h"
-extern int include_depth;
-extern FILE*file[];
-extern FILE*change_file;
+extern int argc;
+extern char**argv;
extern char C_file_name[];
extern char tex_file_name[];
extern char idx_file_name[];
extern char scn_file_name[];
-extern char file_name[][max_file_name_length];
-
-extern char change_file_name[];
-extern int line[];
-extern int change_line;
-extern int change_depth;
-extern boolean input_has_ended;
-extern boolean changing;
-extern boolean web_file_open;
-
-/*:11*//*13:*/
-#line 190 "common.h"
-
-extern sixteen_bits section_count;
-extern boolean changed_section[];
-extern boolean change_pending;
-extern boolean print_where;
-
-/*:13*//*14:*/
-#line 203 "common.h"
-
-extern int argc;
-extern char**argv;
extern boolean flags[];
/*:14*//*15:*/
@@ -274,84 +274,91 @@
/*20:*/
#line 129 "ctangle.w"
-text text_info[max_texts];
-text_pointer text_info_end= text_info+max_texts-1;
-text_pointer text_ptr;
-eight_bits tok_mem[max_toks];
-eight_bits*tok_mem_end= tok_mem+max_toks-1;
-eight_bits*tok_ptr;
+static text text_info[max_texts];
+static text_pointer text_info_end= text_info+max_texts-1;
+static text_pointer text_ptr;
+static eight_bits tok_mem[max_toks];
+static eight_bits*tok_mem_end= tok_mem+max_toks-1;
+static eight_bits*tok_ptr;
/*:20*//*26:*/
#line 198 "ctangle.w"
-text_pointer last_unnamed;
+static text_pointer last_unnamed;
/*:26*//*32:*/
#line 286 "ctangle.w"
-output_state cur_state;
+static output_state cur_state;
-output_state stack[stack_size+1];
-stack_pointer stack_end= stack+stack_size;
-stack_pointer stack_ptr;
+static output_state stack[stack_size+1];
+static stack_pointer stack_end= stack+stack_size;
+static stack_pointer stack_ptr;
/*:32*//*37:*/
#line 362 "ctangle.w"
-int cur_val;
+static int cur_val;
/*:37*//*42:*/
#line 454 "ctangle.w"
-eight_bits out_state;
-boolean protect;
+static eight_bits out_state;
+static boolean protect;
/*:42*//*45:*/
#line 486 "ctangle.w"
-name_pointer output_files[max_files];
-name_pointer*cur_out_file,*end_output_files,*an_output_file;
-char cur_section_name_char;
-char output_file_name[longest_name+1];
+static name_pointer output_files[max_files];
+static name_pointer*cur_out_file,*end_output_files,*an_output_file;
+static char cur_section_name_char;
+static char output_file_name[longest_name+1];
/*:45*//*52:*/
#line 586 "ctangle.w"
-boolean output_defs_seen= false;
+static boolean output_defs_seen= false;
/*:52*//*57:*/
#line 695 "ctangle.w"
-char translit[128][translit_length];
+static char translit[128][translit_length];
/*:57*//*62:*/
#line 774 "ctangle.w"
-eight_bits ccode[256];
+static eight_bits ccode[256];
/*:62*//*66:*/
#line 834 "ctangle.w"
-boolean comment_continues= false;
+static boolean comment_continues= false;
/*:66*//*68:*/
#line 873 "ctangle.w"
-name_pointer cur_section_name;
-boolean no_where;
+static name_pointer cur_section_name;
+static boolean no_where;
/*:68*//*82:*/
#line 1187 "ctangle.w"
-text_pointer cur_text;
-eight_bits next_control;
+static text_pointer cur_text;
+static eight_bits next_control;
/*:82*/
#line 71 "ctangle.w"
/*8:*/
-#line 125 "common.h"
+#line 119 "common.h"
+extern boolean get_line(void);
+extern void check_complete(void);
+extern void reset_input(void);
+
+/*:8*//*11:*/
+#line 162 "common.h"
+
extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,char);
@@ -362,8 +369,8 @@
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:8*//*10:*/
-#line 149 "common.h"
+/*:11*//*13:*/
+#line 186 "common.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -370,14 +377,7 @@
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:10*//*12:*/
-#line 184 "common.h"
-
-extern boolean get_line(void);
-extern void check_complete(void);
-extern void reset_input(void);
-
-/*:12*//*16:*/
+/*:13*//*16:*/
#line 223 "common.h"
extern void common_init(void);
Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.w 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.w 2021-02-22 14:22:20 UTC (rev 57841)
@@ -68,7 +68,7 @@
@h
@<Common code for \.{CWEAVE} and \.{CTANGLE}@>@/
@<Typedef declarations@>@/
-@<Global variables@>@/
+@<Private variables@>@/
@<Predeclaration of procedures@>@/
@ \.{CTANGLE} has a fairly straightforward outline. It operates in
@@ -126,13 +126,13 @@
} text;
typedef text *text_pointer;
-@ @<Glob...@>=
-text text_info[max_texts];
-text_pointer text_info_end=text_info+max_texts-1;
-text_pointer text_ptr; /* first unused position in |text_info| */
-eight_bits tok_mem[max_toks];
-eight_bits *tok_mem_end=tok_mem+max_toks-1;
-eight_bits *tok_ptr; /* first unused position in |tok_mem| */
+@ @<Private...@>=
+static text text_info[max_texts];
+static text_pointer text_info_end=text_info+max_texts-1;
+static text_pointer text_ptr; /* first unused position in |text_info| */
+static eight_bits tok_mem[max_toks];
+static eight_bits *tok_mem_end=tok_mem+max_toks-1;
+static eight_bits *tok_ptr; /* first unused position in |tok_mem| */
@ @<Set init...@>=
text_info->tok_start=tok_ptr=tok_mem;
@@ -195,8 +195,8 @@
@d section_flag max_texts /* final |text_link| in section replacement texts */
-@<Glob...@>=
-text_pointer last_unnamed; /* most recent replacement text of unnamed section */
+@<Private...@>=
+static text_pointer last_unnamed; /* most recent replacement text of unnamed section */
@ @<Set init...@>= last_unnamed=text_info; text_info->text_link=0;
@@ -283,12 +283,12 @@
@d cur_repl cur_state.repl_field /* pointer to current replacement text */
@d cur_section cur_state.section_field /* current section number being expanded */
-@<Global...@>=
-output_state cur_state; /* |cur_end|, |cur_byte|, |cur_name|, |cur_repl|,
+@<Private...@>=
+static output_state cur_state; /* |cur_end|, |cur_byte|, |cur_name|, |cur_repl|,
and |cur_section| */
-output_state stack[stack_size+1]; /* info for non-current levels */
-stack_pointer stack_end=stack+stack_size; /* end of |stack| */
-stack_pointer stack_ptr; /* first unused location in the output state stack */
+static output_state stack[stack_size+1]; /* info for non-current levels */
+static stack_pointer stack_end=stack+stack_size; /* end of |stack| */
+static stack_pointer stack_ptr; /* first unused location in the output state stack */
@ To get the output process started, we will perform the following
initialization steps. We may assume that |text_info->text_link| is nonzero,
@@ -359,8 +359,8 @@
@d section_number 0201 /* code returned by |get_output| for section numbers */
@d identifier 0202 /* code returned by |get_output| for identifiers */
-@<Global...@>=
-int cur_val; /* additional information corresponding to output token */
+@<Private...@>=
+static int cur_val; /* additional information corresponding to output token */
@ If |get_output| finds that no more output remains, it returns with
|stack_ptr==stack|.
@@ -451,9 +451,9 @@
@d unbreakable 3 /* state associated with \.{@@\&} */
@d verbatim 4 /* state in the middle of a string */
-@<Global...@>=
-eight_bits out_state; /* current status of partial output */
-boolean protect; /* should newline characters be quoted? */
+@<Private...@>=
+static eight_bits out_state; /* current status of partial output */
+static boolean protect; /* should newline characters be quoted? */
@ Here is a routine that is invoked when we want to output the current line.
During the output process, |cur_line| equals the number of the next line
@@ -483,11 +483,11 @@
We write them out after we've done the unnamed section.
@d max_files 256
-@<Glob...@>=
-name_pointer output_files[max_files];
-name_pointer *cur_out_file, *end_output_files, *an_output_file;
-char cur_section_name_char; /* is it |'<'| or |'('| */
-char output_file_name[longest_name+1]; /* name of the file */
+@<Private...@>=
+static name_pointer output_files[max_files];
+static name_pointer *cur_out_file, *end_output_files, *an_output_file;
+static char cur_section_name_char; /* is it |'<'| or |'('| */
+static char output_file_name[longest_name+1]; /* name of the file */
@ We make |end_output_files| point just beyond the end of
|output_files|. The stack pointer
@@ -583,8 +583,8 @@
if (!output_defs_seen)
output_defs();
-@ @<Glob...@>=
-boolean output_defs_seen=false;
+@ @<Private...@>=
+static boolean output_defs_seen=false;
@ @<Predecl...@>=
static void output_defs(void);@/
@@ -692,8 +692,8 @@
@d translit_length 10
-@<Glo...@>=
-char translit[128][translit_length];
+@<Private...@>=
+static char translit[128][translit_length];
@ @<Set init...@>=
{
@@ -771,8 +771,8 @@
@d section_name 0311 /* control code for `\.{@@<}' */
@d new_section 0312 /* control code for `\.{@@\ }' and `\.{@@*}' */
-@<Global...@>=
-eight_bits ccode[256]; /* meaning of a char following \.{@@} */
+@<Private...@>=
+static eight_bits ccode[256]; /* meaning of a char following \.{@@} */
@ @<Set ini...@>= {
int c; /* must be |int| so the |for| loop will end */
@@ -831,8 +831,8 @@
If |skip_comment| comes to the end of the section, it prints an error message.
No comment, long or short, is allowed to contain `\.{@@\ }' or `\.{@@*}'.
-@<Global...@>=
-boolean comment_continues=false; /* are we scanning a comment? */
+@<Private...@>=
+static boolean comment_continues=false; /* are we scanning a comment? */
@ @c
static boolean skip_comment(@t\1\1@> /* skips over comments */
@@ -870,9 +870,9 @@
@d constant 03
-@<Global...@>=
-name_pointer cur_section_name; /* name of section just scanned */
-boolean no_where; /* suppress |print_where|? */
+@<Private...@>=
+static name_pointer cur_section_name; /* name of section just scanned */
+static boolean no_where; /* suppress |print_where|? */
@ As one might expect, |get_next| consists mostly of a big switch
that branches to the various special cases that can arise.
@@ -1184,9 +1184,9 @@
@d macro 0
@d app_repl(c) {if (tok_ptr==tok_mem_end) overflow("token"); *tok_ptr++=c;}
-@<Global...@>=
-text_pointer cur_text; /* replacement text formed by |scan_repl| */
-eight_bits next_control;
+@<Private...@>=
+static text_pointer cur_text; /* replacement text formed by |scan_repl| */
+static eight_bits next_control;
@ @<Predecl...@>=
static void scan_repl(eight_bits);@/
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2021-02-22 14:22:20 UTC (rev 57841)
@@ -109,9 +109,17 @@
@-c@>
@z
-Section 10.
+Section 12.
@x
+@ Code related to section numbers:
+ at y
+@ Code related to section numbers:
+ at z
+
+Section 13.
+
+ at x
@ Code related to identifier and section name storage:
@y
@ Code related to identifier and section name storage:
@@ -118,7 +126,7 @@
@-c@>
@z
-Section 12.
+Section 15.
@x
@ Code related to error handling:
@@ -127,14 +135,6 @@
@-s@>
@z
-Section 16.
-
- at x
-@ Code related to section numbers:
- at y
-@ Code related to section numbers:
- at z
-
Section 17.
@x
@@ -146,9 +146,9 @@
Section 18.
@x
-@ Code relating to output:
+@ Code related to output:
@y
-@ Code relating to output:
+@ Code related to output:
@-a@>
@-b@>
@-c@>
@@ -1079,17 +1079,6 @@
@r @ @<Output information about usage of id's defined in other sections@>=
@z
-Section 283.
-
- at x
-the index section itself---NOT!
-
-@<Global...@>=
-sixteen_bits k_section; /* runs through the sections */
- at y
-the index section itself---NOT!
- at z
-
Section 284.
@x
@@ -1099,13 +1088,6 @@
@-c@>
@z
- at x
-name_pointer blink[max_names]; /* links in the buckets */
- at y
-name_pointer blink[max_names]; /* links in the buckets */
-sixteen_bits k_section; /* runs through the sections */
- at z
-
Section 286.
@x
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2021-02-22 14:22:20 UTC (rev 57841)
@@ -285,16 +285,16 @@
@x
turned on during the first phase.
-@<Global...@>=
-boolean change_exists; /* has any section changed? */
+@<Private...@>=
+static boolean change_exists; /* has any section changed? */
@y
turned on during the first phase---NOT!
@z
@x
-sixteen_bits xref_switch,section_xref_switch; /* either zero or |def_flag| */
+static sixteen_bits xref_switch,section_xref_switch; /* either zero or |def_flag| */
@y
-sixteen_bits xref_switch,section_xref_switch; /* either zero or |def_flag| */
+static sixteen_bits xref_switch,section_xref_switch; /* either zero or |def_flag| */
@ \.{CTWILL} also has special data structures to keep track of current
and temporary meanings. These structures were not designed for maximum
@@ -312,21 +312,21 @@
char tex_part[max_tex_chars]; /* \TeX\ part of meaning */
} meaning_struct;
-@ @<Glob...@>=
+@ @<Private...@>=
struct perm_meaning {
meaning_struct perm; /* current meaning of an identifier */
int stamp; /* last section number in which further output suppressed */
struct perm_meaning *link; /* another meaning to output in this section */
} cur_meaning[max_names]; /* the current ``permanent'' meanings */
-struct perm_meaning *top_usage; /* first meaning to output in this section */
-meaning_struct temp_meaning_stack[max_meanings]; /* the current ``temporary'' meanings */
-meaning_struct *temp_meaning_ptr; /* first available slot in |temp_meaning_stack| */
-meaning_struct *max_temp_meaning_ptr; /* its maximum value so far */
-name_pointer title_code[max_titles]; /* program names seen so far */
-name_pointer *title_code_ptr; /* first available slot in |title_code| */
-char ministring_buf[max_tex_chars]; /* \TeX\ code being generated */
-char *ministring_ptr; /* first available slot in |ministring_buf| */
-boolean ms_mode; /* are we outputting to |ministring_buf|? */
+static struct perm_meaning *top_usage; /* first meaning to output in this section */
+static meaning_struct temp_meaning_stack[max_meanings]; /* the current ``temporary'' meanings */
+static meaning_struct *temp_meaning_ptr; /* first available slot in |temp_meaning_stack| */
+static meaning_struct *max_temp_meaning_ptr; /* its maximum value so far */
+static name_pointer title_code[max_titles]; /* program names seen so far */
+static name_pointer *title_code_ptr; /* first available slot in |title_code| */
+static char ministring_buf[max_tex_chars]; /* \TeX\ code being generated */
+static char *ministring_ptr; /* first available slot in |ministring_buf| */
+static boolean ms_mode; /* are we outputting to |ministring_buf|? */
@ @<Set init...@>=
max_temp_meaning_ptr=temp_meaning_stack;
@@ -443,8 +443,8 @@
@y
id_lookup("make_pair",NULL,func_template);
-@ @<Glob...@>=
-sixteen_bits int_loc, ext_loc; /* locations of special reserved words */
+@ @<Private...@>=
+static sixteen_bits int_loc, ext_loc; /* locations of special reserved words */
@z
@x
@@ -885,10 +885,10 @@
@z
@x
-scrap scrap_info[max_scraps]; /* memory array for scraps */
+static scrap scrap_info[max_scraps]; /* memory array for scraps */
@y
-scrap scrap_info[max_scraps]; /* memory array for scraps */
-scrap null_scrap; /* a scrap with empty translation */
+static scrap scrap_info[max_scraps]; /* memory array for scraps */
+static scrap null_scrap; /* a scrap with empty translation */
@z
@x
@@ -1412,9 +1412,9 @@
while (!input_has_ended) @<Translate the current section@>@;
}
-@ @<Glob...@>=
-FILE *aux_file;
-char aux_file_name[max_file_name_length]; /* name of \.{.aux} file */
+@ @<Private...@>=
+static FILE *aux_file;
+static char aux_file_name[max_file_name_length]; /* name of \.{.aux} file */
@ @<Read the \.{.aux} file, if present; then open it for output@>=
memcpy(aux_file_name,tex_file_name,strlen(tex_file_name)-4);
@@ -1439,14 +1439,14 @@
@z
@x
-boolean group_found=false; /* has a starred section occurred? */
+static boolean group_found=false; /* has a starred section occurred? */
@ @<Translate the current section@>= {
section_count++;
@y
-boolean group_found=false; /* has a starred section occurred? */
-boolean right_start_switch; /* has `\.{@@r}' occurred recently? */
-boolean temp_switch; /* has `\.{@@\%}' occurred recently? */
+static boolean group_found=false; /* has a starred section occurred? */
+static boolean right_start_switch; /* has `\.{@@r}' occurred recently? */
+static boolean temp_switch; /* has `\.{@@\%}' occurred recently? */
@ @d usage_sentinel (struct perm_meaning *)1
@<Translate the current section@>= {
@@ -1522,10 +1522,10 @@
doing_format=false;
}
-@ @<Glob...@>=
-boolean is_macro; /* it's a macro def, not a format def */
-int def_diff; /* 0 iff the current macro has parameters */
-name_pointer id_being_defined; /* the definee */
+@ @<Private...@>=
+static boolean is_macro; /* it's a macro def, not a format def */
+static int def_diff; /* 0 iff the current macro has parameters */
+static name_pointer id_being_defined; /* the definee */
@z
@x
@@ -1762,6 +1762,9 @@
@x
the index section itself.
+
+@<Private...@>=
+static sixteen_bits k_section; /* runs through the sections */
@y
the index section itself---NOT!
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweav-bs.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweav-bs.ch 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/cweav-bs.ch 2021-02-22 14:22:20 UTC (rev 57841)
@@ -103,11 +103,11 @@
@x Section 23.
-xref_info xmem[max_refs]; /* contains cross-reference information */
-xref_pointer xmem_end = xmem+max_refs-1;
+static xref_info xmem[max_refs]; /* contains cross-reference information */
+static xref_pointer xmem_end = xmem+max_refs-1;
@y
-xref_info huge xmem[max_refs]; /* contains cross-reference information */
-xref_pointer xmem_end;
+static xref_info huge xmem[max_refs]; /* contains cross-reference information */
+static xref_pointer xmem_end;
@z
@@ -129,21 +129,21 @@
@x Section 30. (to please Borland's C++, version 4.02)
-token tok_mem[max_toks]; /* tokens */
-token_pointer tok_mem_end = tok_mem+max_toks-1; /* end of |tok_mem| */
-token_pointer tok_ptr; /* first unused position in |tok_mem| */
-token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
-token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
-text_pointer tok_start_end = tok_start+max_texts-1; /* end of |tok_start| */
-text_pointer text_ptr; /* first unused position in |tok_start| */
+static token tok_mem[max_toks]; /* tokens */
+static token_pointer tok_mem_end = tok_mem+max_toks-1; /* end of |tok_mem| */
+static token_pointer tok_ptr; /* first unused position in |tok_mem| */
+static token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
+static token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
+static text_pointer tok_start_end = tok_start+max_texts-1; /* end of |tok_start| */
+static text_pointer text_ptr; /* first unused position in |tok_start| */
@y
-token tok_mem[max_toks]; /* tokens */
-token_pointer tok_mem_end; /* end of |tok_mem| */
-token_pointer tok_ptr; /* first unused position in |tok_mem| */
-token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
-token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
-text_pointer tok_start_end; /* end of |tok_start| */
-text_pointer text_ptr; /* first unused position in |tok_start| */
+static token tok_mem[max_toks]; /* tokens */
+static token_pointer tok_mem_end; /* end of |tok_mem| */
+static token_pointer tok_ptr; /* first unused position in |tok_mem| */
+static token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
+static token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
+static text_pointer tok_start_end; /* end of |tok_start| */
+static text_pointer text_ptr; /* first unused position in |tok_start| */
@z
@x Section 31. (goes with the previous change)
@@ -212,9 +212,9 @@
@x Section 246.
-char *cur_byte; /* index into |byte_mem| */
+static char *cur_byte; /* index into |byte_mem| */
@y
-char huge* cur_byte; /* index into |byte_mem| */
+static char huge* cur_byte; /* index into |byte_mem| */
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweav-man.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweav-man.ch 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/cweav-man.ch 2021-02-22 14:22:20 UTC (rev 57841)
@@ -16,7 +16,7 @@
}
@y
\def\botofcontents{\vfill\titlefalse}
-\def\contentspagenumber{110}
+\def\contentspagenumber{111}
\def\title{APPENDIX F: CWEAVE}
\let\K=\leftarrow
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w 2021-02-22 00:47:42 UTC (rev 57840)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w 2021-02-22 14:22:20 UTC (rev 57841)
@@ -73,7 +73,7 @@
@h
@<Common code for \.{CWEAVE} and \.{CTANGLE}@>@/
@<Typedef declarations@>@/
-@<Global variables@>@/
+@<Private variables@>@/
@<Predeclaration of procedures@>
@ \.{CWEAVE} has a fairly straightforward outline. It operates in
@@ -181,8 +181,8 @@
been altered by a change file entry have their |changed_section| flag
turned on during the first phase.
-@<Global...@>=
-boolean change_exists; /* has any section changed? */
+@<Private...@>=
+static boolean change_exists; /* has any section changed? */
@ The other large memory area in \.{CWEAVE} keeps the cross-reference data.
All uses of the name |p| are recorded in a linked list beginning at
@@ -213,11 +213,11 @@
} xref_info;
typedef xref_info *xref_pointer;
-@ @<Global...@>=
-xref_info xmem[max_refs]; /* contains cross-reference information */
-xref_pointer xmem_end = xmem+max_refs-1;
-xref_pointer xref_ptr; /* the largest occupied position in |xmem| */
-sixteen_bits xref_switch,section_xref_switch; /* either zero or |def_flag| */
+@ @<Private...@>=
+static xref_info xmem[max_refs]; /* contains cross-reference information */
+static xref_pointer xmem_end = xmem+max_refs-1;
+static xref_pointer xref_ptr; /* the largest occupied position in |xmem| */
+static sixteen_bits xref_switch,section_xref_switch; /* either zero or |def_flag| */
@ A section that is used for multi-file output (with the \.{@@(} feature)
has a special first cross-reference whose |num| field is |file_flag|.
@@ -332,15 +332,15 @@
unused location of |tok_start| is called |text_ptr|.
Thus, we usually have |*text_ptr==tok_ptr|.
-@<Global...@>=
-token tok_mem[max_toks]; /* tokens */
-token_pointer tok_mem_end = tok_mem+max_toks-1; /* end of |tok_mem| */
-token_pointer tok_ptr; /* first unused position in |tok_mem| */
-token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
-token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
-text_pointer tok_start_end = tok_start+max_texts-1; /* end of |tok_start| */
-text_pointer text_ptr; /* first unused position in |tok_start| */
-text_pointer max_text_ptr; /* largest value of |text_ptr| */
+@<Private...@>=
+static token tok_mem[max_toks]; /* tokens */
+static token_pointer tok_mem_end = tok_mem+max_toks-1; /* end of |tok_mem| */
+static token_pointer tok_ptr; /* first unused position in |tok_mem| */
+static token_pointer max_tok_ptr; /* largest value of |tok_ptr| */
+static token_pointer tok_start[max_texts]; /* directory into |tok_mem| */
+static text_pointer tok_start_end = tok_start+max_texts-1; /* end of |tok_start| */
+static text_pointer text_ptr; /* first unused position in |tok_start| */
+static text_pointer max_text_ptr; /* largest value of |text_ptr| */
@ @<Set init...@>=
tok_ptr=max_tok_ptr=tok_mem+1;@/
@@ -546,8 +546,8 @@
@ Control codes are converted to \.{CWEAVE}'s internal
representation by means of the table |ccode|.
-@<Global...@>=
-eight_bits ccode[256]; /* meaning of a char following \.{@@} */
+@<Private...@>=
+static eight_bits ccode[256]; /* meaning of a char following \.{@@} */
@ @<Set ini...@>=
{int c; for (c=0; c<256; c++) ccode[c]=0;}
@@ -666,9 +666,9 @@
@d string 0201 /* \CEE/ string */
@d identifier 0202 /* \CEE/ identifier or reserved word */
-@<Global...@>=
-name_pointer cur_section; /* name of section just scanned */
-char cur_section_char; /* the character just before that name */
+@<Private...@>=
+static name_pointer cur_section; /* name of section just scanned */
+static char cur_section_char; /* the character just before that name */
@ As one might expect, |get_next| consists mostly of a big switch
that branches to the various special cases that can arise.
@@ -721,8 +721,8 @@
@d left_preproc ord /* begins a preprocessor command */
@d right_preproc 0217 /* ends a preprocessor command */
-@<Glob...@>=
-boolean preprocessing=false; /* are we scanning a preprocessor command? */
+@<Private...@>=
+static boolean preprocessing=false; /* are we scanning a preprocessor command? */
@ @<Raise prep...@>= {
preprocessing=true;
@@ -734,8 +734,8 @@
a file name in lines that start with \.{\#include}. We must treat this file
name as a string.
-@<Glob...@>=
-boolean sharp_include_line=false; /* are we scanning a |#include| line? */
+@<Private...@>=
+static boolean sharp_include_line=false; /* are we scanning a |#include| line? */
@ @<Check if next token is |include|@>=
while (loc<=buffer_end-7 && xisspace(*loc)) loc++;
@@ -1007,8 +1007,8 @@
|get_next|; in interesting cases, this will be the control code that
ended a section or part of a section.
-@<Global...@>=
-eight_bits next_control; /* control code waiting to be acting upon */
+@<Private...@>=
+static eight_bits next_control; /* control code waiting to be acting upon */
@ The overall processing strategy in phase one has the following
straightforward outline.
@@ -1161,9 +1161,9 @@
The variables |lhs| and |rhs| point to the respective identifiers involved
in a format definition.
-@<Global...@>=
-name_pointer lhs, rhs; /* pointers to |byte_start| for format identifiers */
-name_pointer res_wd_end; /* pointer to the first nonreserved identifier */
+@<Private...@>=
+static name_pointer lhs, rhs; /* pointers to |byte_start| for format identifiers */
+static name_pointer res_wd_end; /* pointer to the first nonreserved identifier */
@ When we get to the following code we have |next_control>=format_code|.
@@ -1245,9 +1245,9 @@
section name was both defined and used. The variable |cur_xref| will point
to cross-references for the current section name of interest.
-@<Global...@>=
-xref_pointer cur_xref; /* temporary cross-reference pointer */
-boolean an_output; /* did |file_flag| precede |cur_xref|? */
+@<Private...@>=
+static xref_pointer cur_xref; /* temporary cross-reference pointer */
+static boolean an_output; /* did |file_flag| precede |cur_xref|? */
@ The following recursive procedure
walks through the tree of section names and prints out anomalies.
@@ -1289,11 +1289,11 @@
process, |out_line| will hold the current line number of the line about to
be output.
-@<Global...@>=
-char out_buf[line_length+1]; /* assembled characters */
-char *out_buf_end = out_buf+line_length; /* end of |out_buf| */
-char *out_ptr; /* last character in |out_buf| */
-int out_line; /* number of next line to be output */
+@<Private...@>=
+static char out_buf[line_length+1]; /* assembled characters */
+static char *out_buf_end = out_buf+line_length; /* end of |out_buf| */
+static char *out_ptr; /* last character in |out_buf| */
+static int out_line; /* number of next line to be output */
@ The |flush_buffer| routine empties the buffer up to a given breakpoint,
and moves any remaining characters to the beginning of the next line.
@@ -1716,8 +1716,8 @@
@d begin_arg 61 /* \.{@@[} */
@d end_arg 62 /* \.{@@]} */
-@<Glo...@>=
-char cat_name[256][12];
+@<Private...@>=
+static char cat_name[256][12];
@ @<Set in...@>=
{int c; for (c=0;c<256;c++) strcpy(cat_name[c],"UNKNOWN");}
@@ -2104,15 +2104,15 @@
@ @d trans trans_plus.Trans /* translation texts of scraps */
-@<Global...@>=
-scrap scrap_info[max_scraps]; /* memory array for scraps */
-scrap_pointer scrap_info_end=scrap_info+max_scraps-1; /* end of |scrap_info| */
-scrap_pointer scrap_base; /* beginning of the current scrap sequence */
-scrap_pointer scrap_ptr; /* ending of the current scrap sequence */
-scrap_pointer max_scr_ptr; /* largest value assumed by |scrap_ptr| */
-scrap_pointer pp; /* current position for reducing productions */
-scrap_pointer lo_ptr; /* last scrap that has been examined */
-scrap_pointer hi_ptr; /* first scrap that has not been examined */
+@<Private...@>=
+static scrap scrap_info[max_scraps]; /* memory array for scraps */
+static scrap_pointer scrap_info_end=scrap_info+max_scraps-1; /* end of |scrap_info| */
+static scrap_pointer scrap_base; /* beginning of the current scrap sequence */
+static scrap_pointer scrap_ptr; /* ending of the current scrap sequence */
+static scrap_pointer max_scr_ptr; /* largest value assumed by |scrap_ptr| */
+static scrap_pointer pp; /* current position for reducing productions */
+static scrap_pointer lo_ptr; /* last scrap that has been examined */
+static scrap_pointer hi_ptr; /* first scrap that has not been examined */
@ @<Set init...@>=
scrap_base=scrap_info+1;
@@ -2265,8 +2265,8 @@
@d app(a) *(tok_ptr++)=(token)(a)
@d app1(a) *(tok_ptr++)=(token)(tok_flag+(int)((a)->trans-tok_start))
-@<Global...@>=
-int cur_mathness, init_mathness;
+@<Private...@>=
+static int cur_mathness, init_mathness;
@ @<Predecl...@>=
static void app_str(const char *);@/
@@ -3114,8 +3114,8 @@
a sequence of two or more irreducible scraps will be printed out when
|tracing| is set to 1.
-@<Global...@>=
-int tracing; /* can be used to show parsing details */
+@<Private...@>=
+static int tracing; /* can be used to show parsing details */
@ @<Print a snapsh...@>=
{ scrap_pointer k_l; /* pointer into |scrap_info| */
@@ -3604,12 +3604,12 @@
@d cur_mode cur_state.mode_field /* current mode of interpretation */
@d init_stack stack_ptr=stack;cur_mode=outer /* initialize the stack */
-@<Global...@>=
-output_state cur_state; /* |cur_end|, |cur_tok|, |cur_mode| */
-output_state stack[stack_size]; /* info for non-current levels */
-stack_pointer stack_end=stack+stack_size-1; /* end of |stack| */
-stack_pointer stack_ptr; /* first unused location in the output state stack */
-stack_pointer max_stack_ptr; /* largest value assumed by |stack_ptr| */
+@<Private...@>=
+static output_state cur_state; /* |cur_end|, |cur_tok|, |cur_mode| */
+static output_state stack[stack_size]; /* info for non-current levels */
+static stack_pointer stack_end=stack+stack_size-1; /* end of |stack| */
+static stack_pointer stack_ptr; /* first unused location in the output state stack */
+static stack_pointer max_stack_ptr; /* largest value assumed by |stack_ptr| */
@ @<Set init...@>=
max_stack_ptr=stack;
@@ -3658,8 +3658,8 @@
In these cases |cur_name| points to the identifier or section name in
question.
-@<Global...@>=
-name_pointer cur_name;
+@<Private...@>=
+static name_pointer cur_name;
@ @d res_word 0201 /* returned by |get_output| for reserved words */
@d section_code 0200 /* returned by |get_output| for section names */
@@ -4017,14 +4017,14 @@
space_checked=true;
@.\\Y@>
-@<Global...@>=
-int save_line; /* former value of |out_line| */
-char *save_place; /* former value of |out_ptr| */
-int sec_depth; /* the integer, if any, following \.{@@*} */
-boolean space_checked; /* have we done |emit_space_if_needed|? */
-boolean format_visible; /* should the next format declaration be output? */
-boolean doing_format=false; /* are we outputting a format declaration? */
-boolean group_found=false; /* has a starred section occurred? */
+@<Private...@>=
+static int save_line; /* former value of |out_line| */
+static char *save_place; /* former value of |out_ptr| */
+static int sec_depth; /* the integer, if any, following \.{@@*} */
+static boolean space_checked; /* have we done |emit_space_if_needed|? */
+static boolean format_visible; /* should the next format declaration be output? */
+static boolean doing_format=false; /* are we outputting a format declaration? */
+static boolean group_found=false; /* has a starred section occurred? */
@ @<Translate the current section@>= {
section_count++;
@@ -4202,8 +4202,8 @@
|next_control>=begin_C|. We will make the global variable |this_section|
point to the current section name, if it has a name.
-@<Global...@>=
-name_pointer this_section; /* the current section name, or zero */
+@<Private...@>=
+static name_pointer this_section; /* the current section name, or zero */
@ @<Translate the \CEE/...@>=
this_section=name_dir;
@@ -4389,8 +4389,8 @@
@ Just before the index comes a list of all the changed sections, including
the index section itself.
-@<Global...@>=
-sixteen_bits k_section; /* runs through the sections */
+@<Private...@>=
+static sixteen_bits k_section; /* runs through the sections */
@ @<Tell about changed sections@>= {
/* remember that the index is already marked as changed */
@@ -4415,10 +4415,10 @@
list for character |c| begins at location |bucket[c]| and continues through
the |blink| array.
-@<Global...@>=
-name_pointer bucket[256];
-name_pointer next_name; /* successor of |cur_name| when sorting */
-name_pointer blink[max_names]; /* links in the buckets */
+@<Private...@>=
+static name_pointer bucket[256];
+static name_pointer next_name; /* successor of |cur_name| when sorting */
+static name_pointer blink[max_names]; /* links in the buckets */
@ To begin the sorting, we go through all the hash lists and put each entry
having a nonempty cross-reference list into the proper bucket.
@@ -4458,11 +4458,11 @@
@d sort_ptr scrap_ptr /* ditto */
@d max_sorts max_scraps /* ditto */
-@<Global...@>=
-eight_bits cur_depth; /* depth of current buckets */
-char *cur_byte; /* index into |byte_mem| */
-sixteen_bits cur_val; /* current cross-reference number */
-sort_pointer max_sort_ptr; /* largest value of |sort_ptr| */
+@<Private...@>=
+static eight_bits cur_depth; /* depth of current buckets */
+static char *cur_byte; /* index into |byte_mem| */
+static sixteen_bits cur_val; /* current cross-reference number */
+static sort_pointer max_sort_ptr; /* largest value of |sort_ptr| */
@ @<Set init...@>=
max_sort_ptr=scrap_info;
@@ -4470,8 +4470,8 @@
@ The desired alphabetic order is specified by the |collate| array; namely,
$|collate|[0]<|collate|[1]<\cdots<|collate|[100]$.
-@<Global...@>=
-eight_bits collate[101+128]; /* collation order */
+@<Private...@>=
+static eight_bits collate[101+128]; /* collation order */
@^high-bit character handling@>
@ We use the order $\hbox{null}<\.\ <\hbox{other characters}<{}$\.\_${}<
@@ -4635,8 +4635,8 @@
@ List inversion is best thought of as popping elements off one stack and
pushing them onto another. In this case |cur_xref| will be the head of
the stack that we push things onto.
-@<Global...@>=
-xref_pointer next_xref, this_xref;
+@<Private...@>=
+static xref_pointer next_xref, this_xref;
/* pointer variables for rearranging a list */
@ @<Invert the cross-reference list at |cur_name|, making |cur_xref| the head@>=
More information about the tex-live-commits
mailing list.