texlive[67688] Build/source/texk/web2c: [CWEB] Match common.w with
commits+ascherer at tug.org
commits+ascherer at tug.org
Fri Jul 21 16:14:08 CEST 2023
Revision: 67688
http://tug.org/svn/texlive?view=revision&revision=67688
Author: ascherer
Date: 2023-07-21 16:14:07 +0200 (Fri, 21 Jul 2023)
Log Message:
-----------
[CWEB] Match common.w with common.h.
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/comm-mac.ch
trunk/Build/source/texk/web2c/cwebdir/comm-mini.ch
trunk/Build/source/texk/web2c/cwebdir/comm-vms.ch
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.bux
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/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.bux
Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/ChangeLog 2023-07-21 14:14:07 UTC (rev 67688)
@@ -1,3 +1,8 @@
+2023-06-21 Andreas Scherer <https://ascherer.github.io>
+
+ * ctangleboot.cin,
+ * cwebboot.cin: Match common.w with common.h.
+
2023-07-18 Andreas Scherer <https://ascherer.github.io>
* cwebboot.cin: Discard rest of overfull input line.
Modified: trunk/Build/source/texk/web2c/ctangleboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/ctangleboot.cin 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/ctangleboot.cin 2023-07-21 14:14:07 UTC (rev 67688)
@@ -1,8 +1,8 @@
/*1:*/
#line 66 "cwebdir/ctangle.w"
-/*4:*/
-#line 54 "cwebdir/comm-w2c.h"
+/*5:*/
+#line 61 "cwebdir/comm-w2c.h"
#include <ctype.h>
#include <kpathsea/simpletypes.h>
@@ -15,17 +15,17 @@
#ifndef HAVE_GETTEXT
#define HAVE_GETTEXT 0
#endif
-#line 66 "cwebdir/comm-w2c.h"
+#line 73 "cwebdir/comm-w2c.h"
#if HAVE_GETTEXT
#include <libintl.h>
#else
-#line 70 "cwebdir/comm-w2c.h"
+#line 77 "cwebdir/comm-w2c.h"
#define gettext(a) a
#endif
-#line 72 "cwebdir/comm-w2c.h"
+#line 79 "cwebdir/comm-w2c.h"
-/*:4*/
+/*:5*/
#line 67 "cwebdir/ctangle.w"
#define banner "This is CTANGLE, Version 4.9" \
@@ -186,8 +186,8 @@
extern cweb program;
extern int phase;
-/*:3*//*5:*/
-#line 94 "cwebdir/comm-w2c.h"
+/*:3*//*6:*/
+#line 101 "cwebdir/comm-w2c.h"
extern char section_text[];
extern char*section_text_end;
@@ -194,8 +194,8 @@
extern char*id_first;
extern char*id_loc;
-/*:5*//*6:*/
-#line 112 "cwebdir/comm-w2c.h"
+/*:6*//*7:*/
+#line 119 "cwebdir/comm-w2c.h"
extern char buffer[];
extern char*buffer_end;
@@ -202,8 +202,8 @@
extern char*loc;
extern char*limit;
-/*:6*//*7:*/
-#line 129 "cwebdir/comm-w2c.h"
+/*:7*//*8:*/
+#line 136 "cwebdir/comm-w2c.h"
extern int include_depth;
extern FILE*file[];
@@ -219,8 +219,8 @@
extern boolean changing;
extern boolean web_file_open;
-/*:7*//*9:*/
-#line 150 "cwebdir/comm-w2c.h"
+/*:8*//*10:*/
+#line 157 "cwebdir/comm-w2c.h"
extern sixteen_bits section_count;
extern boolean changed_section[];
@@ -227,8 +227,8 @@
extern boolean change_pending;
extern boolean print_where;
-/*:9*//*10:*/
-#line 164 "cwebdir/comm-w2c.h"
+/*:10*//*11:*/
+#line 171 "cwebdir/comm-w2c.h"
typedef struct name_info{
char*byte_start;
@@ -252,13 +252,13 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:10*//*12:*/
-#line 208 "cwebdir/comm-w2c.h"
+/*:11*//*13:*/
+#line 217 "cwebdir/comm-w2c.h"
extern int history;
-/*:12*//*14:*/
-#line 225 "cwebdir/comm-w2c.h"
+/*:13*//*15:*/
+#line 234 "cwebdir/comm-w2c.h"
extern int argc;
extern char**argv;
@@ -270,8 +270,8 @@
extern boolean flags[];
extern const char*use_language;
-/*:14*//*15:*/
-#line 241 "cwebdir/comm-w2c.h"
+/*:15*//*16:*/
+#line 250 "cwebdir/comm-w2c.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -280,7 +280,7 @@
extern FILE*active_file;
extern FILE*check_file;
-/*:15*//*116:*/
+/*:16*//*116:*/
#line 553 "cwebdir/ctang-w2c.ch"
extern char cb_banner[];
@@ -388,42 +388,45 @@
/*:82*/
#line 71 "cwebdir/ctangle.w"
-/*8:*/
-#line 144 "cwebdir/comm-w2c.h"
+/*4:*/
+#line 44 "cwebdir/comm-w2c.h"
+extern void common_init(void);
+extern void cb_show_banner(void);
+
+extern void print_stats(void);
+
+/*:4*//*9:*/
+#line 151 "cwebdir/comm-w2c.h"
+
extern boolean get_line(void);
extern void check_complete(void);
extern void reset_input(void);
-/*:8*//*11:*/
-#line 187 "cwebdir/comm-w2c.h"
+/*:9*//*12:*/
+#line 194 "cwebdir/comm-w2c.h"
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,eight_bits);
extern name_pointer section_lookup(char*,char*,boolean);
-extern void init_node(name_pointer);
-extern void init_p(name_pointer,eight_bits);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:11*//*13:*/
-#line 211 "cwebdir/comm-w2c.h"
+extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern void init_node(name_pointer);
+extern void init_p(name_pointer,eight_bits);
+
+/*:12*//*14:*/
+#line 220 "cwebdir/comm-w2c.h"
+
extern int wrap_up(void);
extern void err_print(const char*);
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:13*//*16:*/
-#line 250 "cwebdir/comm-w2c.h"
-
-extern void common_init(void);
-extern void print_stats(void);
-extern void cb_show_banner(void);
-
-/*:16*//*30:*/
+/*:14*//*30:*/
#line 246 "cwebdir/ctangle.w"
static void store_two_bytes(sixteen_bits);
Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebboot.cin 2023-07-21 14:14:07 UTC (rev 67688)
@@ -1,8 +1,8 @@
/*1:*/
#line 62 "cwebdir/common.w"
-/*3:*/
-#line 54 "cwebdir/comm-w2c.h"
+/*4:*/
+#line 61 "cwebdir/comm-w2c.h"
#include <ctype.h>
#include <kpathsea/simpletypes.h>
@@ -15,17 +15,17 @@
#ifndef HAVE_GETTEXT
#define HAVE_GETTEXT 0
#endif
-#line 66 "cwebdir/comm-w2c.h"
+#line 73 "cwebdir/comm-w2c.h"
#if HAVE_GETTEXT
#include <libintl.h>
#else
-#line 70 "cwebdir/comm-w2c.h"
+#line 77 "cwebdir/comm-w2c.h"
#define gettext(a) a
#endif
-#line 72 "cwebdir/comm-w2c.h"
+#line 79 "cwebdir/comm-w2c.h"
-/*:3*//*91:*/
+/*:4*//*91:*/
#line 733 "cwebdir/comm-w2c.ch"
#if HAVE_GETTEXT
@@ -188,8 +188,8 @@
extern cweb program;
extern int phase;
-/*:2*//*4:*/
-#line 94 "cwebdir/comm-w2c.h"
+/*:2*//*5:*/
+#line 101 "cwebdir/comm-w2c.h"
extern char section_text[];
extern char*section_text_end;
@@ -196,8 +196,8 @@
extern char*id_first;
extern char*id_loc;
-/*:4*//*5:*/
-#line 112 "cwebdir/comm-w2c.h"
+/*:5*//*6:*/
+#line 119 "cwebdir/comm-w2c.h"
extern char buffer[];
extern char*buffer_end;
@@ -204,8 +204,8 @@
extern char*loc;
extern char*limit;
-/*:5*//*6:*/
-#line 129 "cwebdir/comm-w2c.h"
+/*:6*//*7:*/
+#line 136 "cwebdir/comm-w2c.h"
extern int include_depth;
extern FILE*file[];
@@ -221,8 +221,8 @@
extern boolean changing;
extern boolean web_file_open;
-/*:6*//*8:*/
-#line 150 "cwebdir/comm-w2c.h"
+/*:7*//*9:*/
+#line 157 "cwebdir/comm-w2c.h"
extern sixteen_bits section_count;
extern boolean changed_section[];
@@ -229,8 +229,8 @@
extern boolean change_pending;
extern boolean print_where;
-/*:8*//*9:*/
-#line 164 "cwebdir/comm-w2c.h"
+/*:9*//*10:*/
+#line 171 "cwebdir/comm-w2c.h"
typedef struct name_info{
char*byte_start;
@@ -254,13 +254,13 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:9*//*11:*/
-#line 208 "cwebdir/comm-w2c.h"
+/*:10*//*12:*/
+#line 217 "cwebdir/comm-w2c.h"
extern int history;
-/*:11*//*13:*/
-#line 225 "cwebdir/comm-w2c.h"
+/*:12*//*14:*/
+#line 234 "cwebdir/comm-w2c.h"
extern int argc;
extern char**argv;
@@ -272,8 +272,8 @@
extern boolean flags[];
extern const char*use_language;
-/*:13*//*14:*/
-#line 241 "cwebdir/comm-w2c.h"
+/*:14*//*15:*/
+#line 250 "cwebdir/comm-w2c.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -282,7 +282,7 @@
extern FILE*active_file;
extern FILE*check_file;
-/*:14*/
+/*:15*/
#line 65 "cwebdir/common.w"
/*18:*/
@@ -338,8 +338,8 @@
static char change_buffer[buf_size];
static char*change_limit;
-/*:26*//*37:*/
-#line 393 "cwebdir/common.w"
+/*:26*//*42:*/
+#line 545 "cwebdir/common.w"
sixteen_bits section_count;
boolean changed_section[max_sections];
@@ -347,7 +347,7 @@
boolean print_where= false;
-/*:37*//*43:*/
+/*:42*//*43:*/
#line 590 "cwebdir/common.w"
char byte_mem[max_bytes];
@@ -420,42 +420,45 @@
/*:87*/
#line 66 "cwebdir/common.w"
-/*7:*/
-#line 144 "cwebdir/comm-w2c.h"
+/*3:*/
+#line 44 "cwebdir/comm-w2c.h"
+extern void common_init(void);
+extern void cb_show_banner(void);
+
+extern void print_stats(void);
+
+/*:3*//*8:*/
+#line 151 "cwebdir/comm-w2c.h"
+
extern boolean get_line(void);
extern void check_complete(void);
extern void reset_input(void);
-/*:7*//*10:*/
-#line 187 "cwebdir/comm-w2c.h"
+/*:8*//*11:*/
+#line 194 "cwebdir/comm-w2c.h"
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,eight_bits);
extern name_pointer section_lookup(char*,char*,boolean);
-extern void init_node(name_pointer);
-extern void init_p(name_pointer,eight_bits);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:10*//*12:*/
-#line 211 "cwebdir/comm-w2c.h"
+extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern void init_node(name_pointer);
+extern void init_p(name_pointer,eight_bits);
+
+/*:11*//*13:*/
+#line 220 "cwebdir/comm-w2c.h"
+
extern int wrap_up(void);
extern void err_print(const char*);
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:12*//*15:*/
-#line 250 "cwebdir/comm-w2c.h"
-
-extern void common_init(void);
-extern void print_stats(void);
-extern void cb_show_banner(void);
-
-/*:15*//*24:*/
+/*:13*//*24:*/
#line 176 "cwebdir/common.w"
static boolean input_ln(FILE*);
@@ -775,67 +778,20 @@
}
/*:32*//*35:*/
-#line 356 "cwebdir/common.w"
+#line 362 "cwebdir/common.w"
-void
-reset_input(void)
-{
-limit= buffer;loc= buffer+1;buffer[0]= ' ';
-/*36:*/
-#line 371 "cwebdir/common.w"
-
-#line 150 "cwebdir/comm-w2c.ch"
-if((found_filename= kpse_find_cweb(web_file_name))==NULL
-||(web_file= fopen(found_filename,"r"))==NULL)
-fatal(_("! Cannot open input file "),web_file_name);
-else if(strlen(found_filename)<max_file_name_length){
-
-if(strcmp(web_file_name,found_filename))
-strcpy(web_file_name,found_filename+
-((strncmp(found_filename,"./",2)==0)?2:0));
-free(found_filename);
-}else fatal(_("! Filename too long\n"),found_filename);
-#line 377 "cwebdir/common.w"
-
-
-web_file_open= true;
-#line 166 "cwebdir/comm-w2c.ch"
-if((found_filename= kpse_find_cweb(change_file_name))==NULL
-||(change_file= fopen(found_filename,"r"))==NULL)
-fatal(_("! Cannot open change file "),change_file_name);
-else if(strlen(found_filename)<max_file_name_length){
-
-if(strcmp(change_file_name,found_filename))
-strcpy(change_file_name,found_filename+
-((strncmp(found_filename,"./",2)==0)?2:0));
-free(found_filename);
-}else fatal(_("! Filename too long\n"),found_filename);
-#line 382 "cwebdir/common.w"
-
-/*:36*/
-#line 361 "cwebdir/common.w"
-
-include_depth= cur_line= change_line= 0;
-change_depth= include_depth;
-changing= true;prime_the_change_buffer();changing= !changing;
-limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false;
-}
-
-/*:35*//*38:*/
-#line 400 "cwebdir/common.w"
-
boolean get_line(void)
{
restart:
if(changing&&include_depth==change_depth)
-/*41:*/
-#line 508 "cwebdir/common.w"
+/*38:*/
+#line 470 "cwebdir/common.w"
{
change_line++;
if(!input_ln(change_file)){
-#line 275 "cwebdir/comm-w2c.ch"
+#line 240 "cwebdir/comm-w2c.ch"
err_print(_("! Change file ended without @z"));
-#line 512 "cwebdir/common.w"
+#line 474 "cwebdir/common.w"
buffer[0]= '@';buffer[1]= 'z';limit= buffer+2;
}
@@ -851,9 +807,9 @@
if(xisupper(buffer[1]))buffer[1]= tolower((int)buffer[1]);
if(buffer[1]=='x'||buffer[1]=='y'){
loc= buffer+2;
-#line 281 "cwebdir/comm-w2c.ch"
+#line 246 "cwebdir/comm-w2c.ch"
err_print(_("! Where is the matching @z?"));
-#line 528 "cwebdir/common.w"
+#line 490 "cwebdir/common.w"
}
else if(buffer[1]=='z'){
@@ -863,12 +819,12 @@
}
}
-/*:41*/
-#line 405 "cwebdir/common.w"
+/*:38*/
+#line 367 "cwebdir/common.w"
if(!changing||include_depth> change_depth){
-/*40:*/
-#line 491 "cwebdir/common.w"
+/*37:*/
+#line 453 "cwebdir/common.w"
{
cur_line++;
while(!input_ln(cur_file)){
@@ -886,8 +842,8 @@
if(change_limit> change_buffer)check_change();
}
-/*:40*/
-#line 407 "cwebdir/common.w"
+/*:37*/
+#line 369 "cwebdir/common.w"
if(changing&&include_depth==change_depth)goto restart;
}
@@ -897,27 +853,27 @@
loc= buffer+2;*limit= '"';
while(*loc==' '||*loc=='\t')loc++;
if(loc>=limit){
-#line 181 "cwebdir/comm-w2c.ch"
+#line 146 "cwebdir/comm-w2c.ch"
err_print(_("! Include file name not given"));
-#line 417 "cwebdir/common.w"
+#line 379 "cwebdir/common.w"
goto restart;
}
if(include_depth>=max_include_depth-1){
-#line 187 "cwebdir/comm-w2c.ch"
+#line 152 "cwebdir/comm-w2c.ch"
err_print(_("! Too many nested includes"));
-#line 422 "cwebdir/common.w"
+#line 384 "cwebdir/common.w"
goto restart;
}
include_depth++;
-/*39:*/
-#line 445 "cwebdir/common.w"
+/*36:*/
+#line 407 "cwebdir/common.w"
{
-#line 224 "cwebdir/comm-w2c.ch"
+#line 189 "cwebdir/comm-w2c.ch"
char*cur_file_name_end= cur_file_name+max_file_name_length-1;
char*k= cur_file_name;
-#line 450 "cwebdir/common.w"
+#line 412 "cwebdir/common.w"
if(*loc=='"'){
loc++;
@@ -928,7 +884,7 @@
if(k> cur_file_name_end)too_long();
*k= '\0';
-#line 231 "cwebdir/comm-w2c.ch"
+#line 196 "cwebdir/comm-w2c.ch"
if((found_filename= kpse_find_cweb(cur_file_name))!=NULL
&&(cur_file= fopen(found_filename,"r"))!=NULL){
@@ -938,25 +894,25 @@
((strncmp(found_filename,"./",2)==0)?2:0));
free(found_filename);
}else fatal(_("! Filename too long\n"),found_filename);
-#line 461 "cwebdir/common.w"
+#line 423 "cwebdir/common.w"
cur_line= 0;print_where= true;
goto restart;
}
-#line 269 "cwebdir/comm-w2c.ch"
+#line 234 "cwebdir/comm-w2c.ch"
include_depth--;err_print(_("! Cannot open include file"));goto restart;
-#line 489 "cwebdir/common.w"
+#line 451 "cwebdir/common.w"
}
-/*:39*/
-#line 426 "cwebdir/common.w"
+/*:36*/
+#line 388 "cwebdir/common.w"
}
return true;
}
-#line 202 "cwebdir/comm-w2c.ch"
-/*:38*//*42:*/
-#line 540 "cwebdir/common.w"
+#line 167 "cwebdir/comm-w2c.ch"
+/*:35*//*39:*/
+#line 502 "cwebdir/common.w"
void
check_complete(void){
@@ -964,14 +920,61 @@
strncpy(buffer,change_buffer,(size_t)(change_limit-change_buffer+1));
limit= buffer+(ptrdiff_t)(change_limit-change_buffer);
changing= true;change_depth= include_depth;loc= buffer;
-#line 287 "cwebdir/comm-w2c.ch"
+#line 252 "cwebdir/comm-w2c.ch"
err_print(_("! Change file entry did not match"));
-#line 548 "cwebdir/common.w"
+#line 510 "cwebdir/common.w"
}
}
-/*:42*//*48:*/
+/*:39*//*40:*/
+#line 518 "cwebdir/common.w"
+
+void
+reset_input(void)
+{
+limit= buffer;loc= buffer+1;buffer[0]= ' ';
+/*41:*/
+#line 533 "cwebdir/common.w"
+
+#line 262 "cwebdir/comm-w2c.ch"
+if((found_filename= kpse_find_cweb(web_file_name))==NULL
+||(web_file= fopen(found_filename,"r"))==NULL)
+fatal(_("! Cannot open input file "),web_file_name);
+else if(strlen(found_filename)<max_file_name_length){
+
+if(strcmp(web_file_name,found_filename))
+strcpy(web_file_name,found_filename+
+((strncmp(found_filename,"./",2)==0)?2:0));
+free(found_filename);
+}else fatal(_("! Filename too long\n"),found_filename);
+#line 539 "cwebdir/common.w"
+
+
+web_file_open= true;
+#line 278 "cwebdir/comm-w2c.ch"
+if((found_filename= kpse_find_cweb(change_file_name))==NULL
+||(change_file= fopen(found_filename,"r"))==NULL)
+fatal(_("! Cannot open change file "),change_file_name);
+else if(strlen(found_filename)<max_file_name_length){
+
+if(strcmp(change_file_name,found_filename))
+strcpy(change_file_name,found_filename+
+((strncmp(found_filename,"./",2)==0)?2:0));
+free(found_filename);
+}else fatal(_("! Filename too long\n"),found_filename);
+#line 544 "cwebdir/common.w"
+
+/*:41*/
+#line 523 "cwebdir/common.w"
+
+include_depth= cur_line= change_line= 0;
+change_depth= include_depth;
+changing= true;prime_the_change_buffer();changing= !changing;
+limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false;
+}
+
+/*:40*//*48:*/
#line 633 "cwebdir/common.w"
name_pointer
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2023-07-21 14:14:07 UTC (rev 67688)
@@ -1,3 +1,13 @@
+2023-07-21 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-{mac,mini,vms,w2c}.ch,
+ * comm-w2c.h,
+ * common.bux,
+ * common.{c,h,w},
+ * ctangle.{c,w},
+ * ctwill-mini.ch,
+ * ctwill.bux: Match common.w with common.h.
+
2023-07-18 Andreas Scherer <https://ascherer.github.io>
* cwebdir/comm-mac.ch,
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-mac.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-mac.ch 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-mac.ch 2023-07-21 14:14:07 UTC (rev 67688)
@@ -81,16 +81,6 @@
@<Skip over comment lines in the change file; |return| if end of file@>@;
@z
- at x section 36, don't try to open a change file if none was specified
-if ((change_file=fopen(change_file_name,"r"))==NULL)
- fatal("! Cannot open change file ", change_file_name);
- at y
-if (change_file_name[0] == '\0') /* no change file specified */
- change_file = NULL; /* reset at least the |change_file| */
-else if ((change_file=fopen(change_file_name,"r"))==NULL)
- fatal("! Cannot open change file ", change_file_name);
- at z
-
@x section 39, declare colon as Mac's path separator
(Colon-separated paths are not supported.)
The remainder of the \.{@@i} line after the file name is ignored.
@@ -110,6 +100,16 @@
cur_file_name[l]=PATH_SEP; /* pathname separator */
@z
+ at x section 41, don't try to open a change file if none was specified
+if ((change_file=fopen(change_file_name,"r"))==NULL)
+ fatal("! Cannot open change file ", change_file_name);
+ at y
+if (change_file_name[0] == '\0') /* no change file specified */
+ change_file = NULL; /* reset at least the |change_file| */
+else if ((change_file=fopen(change_file_name,"r"))==NULL)
+ fatal("! Cannot open change file ", change_file_name);
+ at z
+
@x section 75, explain the convention for omitted change files
An omitted change file argument means that |"/dev/null"| should be used,
@y
@@ -134,7 +134,7 @@
@z
@x section 85, insert an extra module before the index
-@** Index.
+@* Index.
@y by putting the new module here, we preserve all the previous section numbers
@ We assume an interface to \CEE/ command-line emulation as supplied by
the |ccommand| function of Metrowerks CodeWarrior, as defined in
@@ -144,5 +144,5 @@
#include <console.h>
@^system dependencies@>
-@** Index.
+@* Index.
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-mini.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-mini.ch 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-mini.ch 2023-07-21 14:14:07 UTC (rev 67688)
@@ -7,7 +7,7 @@
\def\contentspagenumber{0}
@z
-Section 3.
+Section 4.
@x
internationalization.
@@ -17,7 +17,7 @@
@-S@>
@z
-Section 5.
+Section 6.
@x
@ Code related to input routines:
@@ -26,7 +26,7 @@
@-c@>
@z
-Section 9.
+Section 10.
@x
@ Code related to identifier and section name storage:
@@ -35,7 +35,7 @@
@-c@>
@z
-Section 14.
+Section 15.
@x
@ Code related to output:
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-vms.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-vms.ch 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-vms.ch 2023-07-21 14:14:07 UTC (rev 67688)
@@ -75,7 +75,7 @@
@z
@x section 85 (01-FEB-1992 ST)
-@** Index.
+@* Index.
@y
@* VAX/VMS specific code.
We have used |SS$_NORMAL| and |SS$_ABORT| as return codes,
@@ -84,5 +84,5 @@
@<Include files@>=
#include ssdef /* we need VAX/VMS system messages */
-@** Index.
+@* Index.
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch 2023-07-21 14:14:07 UTC (rev 67688)
@@ -141,41 +141,6 @@
@z
@x
-if ((web_file=fopen(web_file_name,"r"))==NULL) {
- strcpy(web_file_name,alt_web_file_name);
- if ((web_file=fopen(web_file_name,"r"))==NULL)
- fatal("! Cannot open input file ", web_file_name);
-}
- at y
-if ((found_filename=kpse_find_cweb(web_file_name))==NULL @|
- || (web_file=fopen(found_filename,"r"))==NULL)
- fatal(_("! Cannot open input file "), web_file_name);
-else if (strlen(found_filename) < max_file_name_length) {
- /* Copy name for \#\&{line} directives. */
- if (strcmp(web_file_name, found_filename))
- strcpy(web_file_name, found_filename +
- ((strncmp(found_filename,"./",2)==0) ? 2 : 0));
- free(found_filename);
-} else fatal(_("! Filename too long\n"), found_filename);
- at z
-
- at x
-if ((change_file=fopen(change_file_name,"r"))==NULL)
- fatal("! Cannot open change file ", change_file_name);
- at y
-if ((found_filename=kpse_find_cweb(change_file_name))==NULL @|
- || (change_file=fopen(found_filename,"r"))==NULL)
- fatal(_("! Cannot open change file "), change_file_name);
-else if (strlen(found_filename) < max_file_name_length) {
- /* Copy name for \#\&{line} directives. */
- if (strcmp(change_file_name, found_filename))
- strcpy(change_file_name, found_filename +
- ((strncmp(found_filename,"./",2)==0) ? 2 : 0));
- free(found_filename);
-} else fatal(_("! Filename too long\n"), found_filename);
- at z
-
- at x
err_print("! Include file name not given");
@y
err_print(_("! Include file name not given"));
@@ -288,6 +253,41 @@
@z
@x
+if ((web_file=fopen(web_file_name,"r"))==NULL) {
+ strcpy(web_file_name,alt_web_file_name);
+ if ((web_file=fopen(web_file_name,"r"))==NULL)
+ fatal("! Cannot open input file ", web_file_name);
+}
+ at y
+if ((found_filename=kpse_find_cweb(web_file_name))==NULL @|
+ || (web_file=fopen(found_filename,"r"))==NULL)
+ fatal(_("! Cannot open input file "), web_file_name);
+else if (strlen(found_filename) < max_file_name_length) {
+ /* Copy name for \#\&{line} directives. */
+ if (strcmp(web_file_name, found_filename))
+ strcpy(web_file_name, found_filename +
+ ((strncmp(found_filename,"./",2)==0) ? 2 : 0));
+ free(found_filename);
+} else fatal(_("! Filename too long\n"), found_filename);
+ at z
+
+ at x
+if ((change_file=fopen(change_file_name,"r"))==NULL)
+ fatal("! Cannot open change file ", change_file_name);
+ at y
+if ((found_filename=kpse_find_cweb(change_file_name))==NULL @|
+ || (change_file=fopen(found_filename,"r"))==NULL)
+ fatal(_("! Cannot open change file "), change_file_name);
+else if (strlen(found_filename) < max_file_name_length) {
+ /* Copy name for \#\&{line} directives. */
+ if (strcmp(change_file_name, found_filename))
+ strcpy(change_file_name, found_filename +
+ ((strncmp(found_filename,"./",2)==0) ? 2 : 0));
+ free(found_filename);
+} else fatal(_("! Filename too long\n"), found_filename);
+ at z
+
+ at x
@d hash_size 353 /* should be prime */
@y
@d hash_size 8501 /* should be prime */
@@ -608,7 +608,7 @@
@z
@x
-@** Index.
+@* Index.
@y
@** Extensions to {\tentex CWEB}. The following sections introduce new or
improved features that have been created by numerous contributors over the
Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.h 2023-07-21 14:14:07 UTC (rev 67688)
@@ -40,6 +40,13 @@
extern cweb program; /* \.{CTANGLE} or \.{CWEAVE} or \.{CTWILL}? */
extern int phase; /* which phase are we in? */
+@ The procedure that gets everything rolling:
+@<Predecl...@>=
+extern void common_init(void);@/
+extern void cb_show_banner(void);
+@#
+extern void print_stats(void); /* defined in \.{ctangle.w} and \.{cweave.w} */
+
@ You may have noticed that almost all \.{"strings"} in the \.{CWEB} sources
are placed in the context of the `|_|'~macro. This is just a shortcut for the
`|@!gettext|' function from the ``GNU~gettext utilities.'' For systems that do
@@ -185,15 +192,17 @@
extern hash_pointer h; /* index into hash-head array */
@ @<Predecl...@>=
-extern boolean names_match(name_pointer,const char *,size_t,eight_bits);@/
extern name_pointer id_lookup(const char *,const char *,eight_bits);
/* looks up a string in the identifier table */
extern name_pointer section_lookup(char *,char *,boolean); /* finds section name */
-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 boolean names_match(name_pointer,const char *,size_t,eight_bits);@/
+/* three routines defined in \.{ctangle.w} and \.{cweave.w} */
+extern void init_node(name_pointer);@/
+extern void init_p(name_pointer,eight_bits);@/
@ Code related to error handling:
@d spotless 0 /* |history| value for normal jobs */
@@ -246,12 +255,6 @@
extern FILE *active_file; /* currently active file for \.{CWEAVE} output */
extern FILE *check_file; /* temporary output file */
-@ The procedure that gets everything rolling:
-@<Predecl...@>=
-extern void common_init(void);@/
-extern void print_stats(void);@/
-extern void cb_show_banner(void);
-
@ The following parameters are sufficient to handle \TEX/ (converted to
\.{CWEB}), so they should be sufficient for most applications of \.{CWEB}.
Modified: trunk/Build/source/texk/web2c/cwebdir/common.bux
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.bux 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/common.bux 2023-07-21 14:14:07 UTC (rev 67688)
@@ -4,25 +4,25 @@
@$HAVE_GETTEXT "common.h" \zip@>
-@$init_p {CWEAVE.W}32 \&{void} (\,)@>
-@$init_node {CWEAVE.W}32 \&{void} (\,)@>
-@$names_match {CWEAVE.W}32 \&{boolean} (\,)@>
+@$DEV_NULL {COMMON.W}75 macro@>
+@$_DEV_NULL {COMMON.W}75 macro@>
@$ac {CWEAVE.W}2 \&{int}@>
@$av {CWEAVE.W}2 \&{char} ${*}{*}$@>
@$main {CWEAVE.W}2 \&{int} (\,)@>
-@$print_stats {CWEAVE.W}262 \&{void} (\,)@>
+@$ilk {CWEAVE.W}20 \\{dummy.Ilk}@>
@$xmem {CWEAVE.W}23 \&{xref\_info} [\,]@>
@$xref {CWEAVE.W}24 \\{equiv\_or\_xref}@>
+@$init_p {CWEAVE.W}32 \&{void} (\,)@>
+@$init_node {CWEAVE.W}32 \&{void} (\,)@>
+@$names_match {CWEAVE.W}32 \&{boolean} (\,)@>
+
+@$print_stats {CWEAVE.W}270 \&{void} (\,)@>
+
@$text_info {CTANGLE.W}20 \&{text} [\,]@>
@$equiv {CTANGLE.W}22 \\{equiv\_or\_xref}@>
-
-@$ilk {CWEAVE.W}20 \\{dummy.Ilk}@>
-
-@$DEV_NULL {COMMON.W}75 macro@>
-@$_DEV_NULL {COMMON.W}75 macro@>
Modified: trunk/Build/source/texk/web2c/cwebdir/common.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.c 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/common.c 2023-07-21 14:14:07 UTC (rev 67688)
@@ -1,8 +1,8 @@
/*1:*/
#line 62 "common.w"
-/*3:*/
-#line 44 "common.h"
+/*4:*/
+#line 49 "common.h"
#include <ctype.h>
#include <stdbool.h>
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
-/*:3*/
+/*:4*/
#line 63 "common.w"
#define ctangle false
@@ -133,8 +133,8 @@
extern boolean program;
extern int phase;
-/*:2*//*4:*/
-#line 74 "common.h"
+/*:2*//*5:*/
+#line 79 "common.h"
extern char section_text[];
extern char*section_text_end;
@@ -141,8 +141,8 @@
extern char*id_first;
extern char*id_loc;
-/*:4*//*5:*/
-#line 92 "common.h"
+/*:5*//*6:*/
+#line 97 "common.h"
extern char buffer[];
extern char*buffer_end;
@@ -149,8 +149,8 @@
extern char*loc;
extern char*limit;
-/*:5*//*6:*/
-#line 109 "common.h"
+/*:6*//*7:*/
+#line 114 "common.h"
extern int include_depth;
extern FILE*file[];
@@ -165,8 +165,8 @@
extern boolean changing;
extern boolean web_file_open;
-/*:6*//*8:*/
-#line 129 "common.h"
+/*:7*//*9:*/
+#line 134 "common.h"
extern sixteen_bits section_count;
extern boolean changed_section[];
@@ -173,8 +173,8 @@
extern boolean change_pending;
extern boolean print_where;
-/*:8*//*9:*/
-#line 143 "common.h"
+/*:9*//*10:*/
+#line 148 "common.h"
typedef struct name_info{
char*byte_start;
@@ -198,13 +198,13 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:9*//*11:*/
-#line 187 "common.h"
+/*:10*//*12:*/
+#line 194 "common.h"
extern int history;
-/*:11*//*13:*/
-#line 203 "common.h"
+/*:12*//*14:*/
+#line 210 "common.h"
extern int argc;
extern char**argv;
@@ -214,8 +214,8 @@
extern char scn_file_name[];
extern boolean flags[];
-/*:13*//*14:*/
-#line 217 "common.h"
+/*:14*//*15:*/
+#line 224 "common.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -223,7 +223,7 @@
extern FILE*scn_file;
extern FILE*active_file;
-/*:14*/
+/*:15*/
#line 65 "common.w"
/*18:*/
@@ -275,8 +275,8 @@
static char change_buffer[buf_size];
static char*change_limit;
-/*:26*//*37:*/
-#line 393 "common.w"
+/*:26*//*42:*/
+#line 545 "common.w"
sixteen_bits section_count;
boolean changed_section[max_sections];
@@ -284,7 +284,7 @@
boolean print_where= false;
-/*:37*//*43:*/
+/*:42*//*43:*/
#line 590 "common.w"
char byte_mem[max_bytes];
@@ -333,41 +333,43 @@
/*:83*/
#line 66 "common.w"
-/*7:*/
-#line 123 "common.h"
+/*3:*/
+#line 43 "common.h"
+extern void common_init(void);
+extern void print_stats(void);
+
+/*:3*//*8:*/
+#line 128 "common.h"
+
extern boolean get_line(void);
extern void check_complete(void);
extern void reset_input(void);
-/*:7*//*10:*/
-#line 166 "common.h"
+/*:8*//*11:*/
+#line 171 "common.h"
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,eight_bits);
extern name_pointer section_lookup(char*,char*,boolean);
-extern void init_node(name_pointer);
-extern void init_p(name_pointer,eight_bits);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:10*//*12:*/
-#line 190 "common.h"
+extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern void init_node(name_pointer);
+extern void init_p(name_pointer,eight_bits);
+
+/*:11*//*13:*/
+#line 197 "common.h"
+
extern int wrap_up(void);
extern void err_print(const char*);
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:12*//*15:*/
-#line 225 "common.h"
-
-extern void common_init(void);
-extern void print_stats(void);
-
-/*:15*//*24:*/
+/*:13*//*24:*/
#line 176 "common.w"
static boolean input_ln(FILE*);
@@ -590,44 +592,14 @@
}
/*:32*//*35:*/
-#line 356 "common.w"
+#line 362 "common.w"
-void
-reset_input(void)
-{
-limit= buffer;loc= buffer+1;buffer[0]= ' ';
-/*36:*/
-#line 371 "common.w"
-
-if((web_file= fopen(web_file_name,"r"))==NULL){
-strcpy(web_file_name,alt_web_file_name);
-if((web_file= fopen(web_file_name,"r"))==NULL)
-fatal("! Cannot open input file ",web_file_name);
-}
-
-
-web_file_open= true;
-if((change_file= fopen(change_file_name,"r"))==NULL)
-fatal("! Cannot open change file ",change_file_name);
-
-/*:36*/
-#line 361 "common.w"
-
-include_depth= cur_line= change_line= 0;
-change_depth= include_depth;
-changing= true;prime_the_change_buffer();changing= !changing;
-limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false;
-}
-
-/*:35*//*38:*/
-#line 400 "common.w"
-
boolean get_line(void)
{
restart:
if(changing&&include_depth==change_depth)
-/*41:*/
-#line 508 "common.w"
+/*38:*/
+#line 470 "common.w"
{
change_line++;
if(!input_ln(change_file)){
@@ -657,12 +629,12 @@
}
}
-/*:41*/
-#line 405 "common.w"
+/*:38*/
+#line 367 "common.w"
if(!changing||include_depth> change_depth){
-/*40:*/
-#line 491 "common.w"
+/*37:*/
+#line 453 "common.w"
{
cur_line++;
while(!input_ln(cur_file)){
@@ -680,8 +652,8 @@
if(change_limit> change_buffer)check_change();
}
-/*:40*/
-#line 407 "common.w"
+/*:37*/
+#line 369 "common.w"
if(changing&&include_depth==change_depth)goto restart;
}
@@ -701,8 +673,8 @@
goto restart;
}
include_depth++;
-/*39:*/
-#line 445 "common.w"
+/*36:*/
+#line 407 "common.w"
{
char temp_file_name[max_file_name_length];
char*cur_file_name_end= cur_file_name+max_file_name_length-1;
@@ -732,10 +704,10 @@
if((l= strlen(CWEBINPUTS))> max_file_name_length-2)too_long();
strcpy(temp_file_name,CWEBINPUTS);
#else
-#line 474 "common.w"
+#line 436 "common.w"
l= 0;
#endif
-#line 476 "common.w"
+#line 438 "common.w"
}
if(l> 0){
if(k+l+2>=cur_file_name_end)too_long();
@@ -751,15 +723,15 @@
include_depth--;err_print("! Cannot open include file");goto restart;
}
-/*:39*/
-#line 426 "common.w"
+/*:36*/
+#line 388 "common.w"
}
return true;
}
-/*:38*//*42:*/
-#line 540 "common.w"
+/*:35*//*39:*/
+#line 502 "common.w"
void
check_complete(void){
@@ -772,7 +744,37 @@
}
}
-/*:42*//*48:*/
+/*:39*//*40:*/
+#line 518 "common.w"
+
+void
+reset_input(void)
+{
+limit= buffer;loc= buffer+1;buffer[0]= ' ';
+/*41:*/
+#line 533 "common.w"
+
+if((web_file= fopen(web_file_name,"r"))==NULL){
+strcpy(web_file_name,alt_web_file_name);
+if((web_file= fopen(web_file_name,"r"))==NULL)
+fatal("! Cannot open input file ",web_file_name);
+}
+
+
+web_file_open= true;
+if((change_file= fopen(change_file_name,"r"))==NULL)
+fatal("! Cannot open change file ",change_file_name);
+
+/*:41*/
+#line 523 "common.w"
+
+include_depth= cur_line= change_line= 0;
+change_depth= include_depth;
+changing= true;prime_the_change_buffer();changing= !changing;
+limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false;
+}
+
+/*:40*//*48:*/
#line 633 "common.w"
name_pointer
Modified: trunk/Build/source/texk/web2c/cwebdir/common.h
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.h 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/common.h 2023-07-21 14:14:07 UTC (rev 67688)
@@ -39,6 +39,11 @@
extern boolean program; /* \.{CWEAVE} or \.{CTANGLE}? */
extern int phase; /* which phase are we in? */
+@ The procedure that gets everything rolling:
+@<Predecl...@>=
+extern void common_init(void);@/
+extern void print_stats(void); /* defined in \.{ctangle.w} and \.{cweave.w} */
+
@ Interface to the standard \CEE/ library:
@<Include files@>=
@@ -164,15 +169,17 @@
extern hash_pointer h; /* index into hash-head array */
@ @<Predecl...@>=
-extern boolean names_match(name_pointer,const char *,size_t,eight_bits);@/
extern name_pointer id_lookup(const char *,const char *,eight_bits);
/* looks up a string in the identifier table */
extern name_pointer section_lookup(char *,char *,boolean); /* finds section name */
-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 boolean names_match(name_pointer,const char *,size_t,eight_bits);@/
+/* three routines defined in \.{ctangle.w} and \.{cweave.w} */
+extern void init_node(name_pointer);@/
+extern void init_p(name_pointer,eight_bits);@/
@ Code related to error handling:
@d spotless 0 /* |history| value for normal jobs */
@@ -221,11 +228,6 @@
extern FILE *scn_file; /* where list of sections from \.{CWEAVE} goes */
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);
-
@ The following parameters are sufficient to handle \TEX/ (converted to
\.{CWEB}), so they should be sufficient for most applications of \.{CWEB}.
Modified: trunk/Build/source/texk/web2c/cwebdir/common.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/common.w 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/common.w 2023-07-21 14:14:07 UTC (rev 67688)
@@ -47,7 +47,7 @@
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iftrue
-@** Introduction. This file contains code common
+@* Introduction. This file contains code common
to both \.{CTANGLE} and \.{CWEAVE}, which roughly concerns the following
problems: character uniformity, input routines, error handling and
parsing of command line. We have tried to concentrate in this file
@@ -129,7 +129,7 @@
char *id_first; /* where the current identifier begins in the buffer */
char *id_loc; /* just after the current identifier in the buffer */
-@** Input routines. The lowest level of input to the \.{CWEB} programs
+@* Input routines. The lowest level of input to the \.{CWEB} programs
is performed by |input_ln|, which must be told which file to read from.
The return value of |input_ln| is |true| if the read is successful and
|false| if not (generally this means the file has ended). The conventions
@@ -175,8 +175,8 @@
@ @<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
+@* File handling. 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
commands~\.{@@i}, and a |change_file|, which might also contain
includes. The |web_file| together with the currently open include
@@ -349,37 +349,6 @@
return;
}
-@ The |reset_input| procedure, which gets \.{CWEB} ready to read the
-user's \.{CWEB} input, is used at the beginning of phase one of \.{CTANGLE},
-phases one and two of \.{CWEAVE}.
-
- at c
-void
-reset_input(void)
-{
- limit=buffer; loc=buffer+1; buffer[0]=' ';
- @<Open input files@>@;
- include_depth=cur_line=change_line=0;
- change_depth=include_depth;
- changing=true; prime_the_change_buffer(); changing=!changing;
- limit=buffer; loc=buffer+1; buffer[0]=' '; input_has_ended=false;
-}
-
-@ The following code opens the input files.
-@^system dependencies@>
-
-@<Open input files@>=
-if ((web_file=fopen(web_file_name,"r"))==NULL) {
- strcpy(web_file_name,alt_web_file_name);
- if ((web_file=fopen(web_file_name,"r"))==NULL)
- fatal("! Cannot open input file ", web_file_name);
-}
- at .Cannot open input file@>
- at .Cannot open change file@>
-web_file_open=true;
-if ((change_file=fopen(change_file_name,"r"))==NULL)
- fatal("! Cannot open change file ", change_file_name);
-
@ The |get_line| procedure is called when |loc>limit|; it puts the next
line of merged input into the buffer and updates the other variables
appropriately. A space is placed at the right end of the line.
@@ -390,14 +359,7 @@
the |cur_file| has changed, we tell \.{CTANGLE} to print this
information in the \CEE/ file by means of the |print_where| flag.
-@<Global var...@>=
-sixteen_bits section_count; /* the current section number */
-boolean changed_section[max_sections]; /* is the section changed? */
-boolean change_pending; /* if the current change is not yet recorded in
- |changed_section[section_count]| */
-boolean print_where=false; /* should \.{CTANGLE} print line and file info? */
-
-@ @c
+ at c
boolean get_line(void) /* inputs the next line */
{
restart:
@@ -549,7 +511,45 @@
}
}
-@** Storage of names and strings.
+@ The |reset_input| procedure, which gets \.{CWEB} ready to read the
+user's \.{CWEB} input, is used at the beginning of phase one of \.{CTANGLE},
+phases one and two of \.{CWEAVE}.
+
+ at c
+void
+reset_input(void)
+{
+ limit=buffer; loc=buffer+1; buffer[0]=' ';
+ @<Open input files@>@;
+ include_depth=cur_line=change_line=0;
+ change_depth=include_depth;
+ changing=true; prime_the_change_buffer(); changing=!changing;
+ limit=buffer; loc=buffer+1; buffer[0]=' '; input_has_ended=false;
+}
+
+@ The following code opens the input files.
+@^system dependencies@>
+
+@<Open input files@>=
+if ((web_file=fopen(web_file_name,"r"))==NULL) {
+ strcpy(web_file_name,alt_web_file_name);
+ if ((web_file=fopen(web_file_name,"r"))==NULL)
+ fatal("! Cannot open input file ", web_file_name);
+}
+ at .Cannot open input file@>
+ at .Cannot open change file@>
+web_file_open=true;
+if ((change_file=fopen(change_file_name,"r"))==NULL)
+ fatal("! Cannot open change file ", change_file_name);
+
+@ @<Global var...@>=
+sixteen_bits section_count; /* the current section number */
+boolean changed_section[max_sections]; /* is the section changed? */
+boolean change_pending; /* if the current change is not yet recorded in
+ |changed_section[section_count]| */
+boolean print_where=false; /* should \.{CTANGLE} print line and file info? */
+
+@* Storage of names and strings.
Both \.{CWEAVE} and \.{CTANGLE} store identifiers, section names and
other strings in a large array of |char|s, called |byte_mem|.
Information about the names is kept in the array |name_dir|, whose
@@ -990,7 +990,7 @@
@ @<Predec...@>=@+static int section_name_cmp(char **,size_t,name_pointer);
-@** Reporting errors to the user.
+@* 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
printed; |harmless_message| means that a message of possible interest
@@ -1114,7 +1114,7 @@
maintenance person, not the user. In such cases the program says
|confusion("indication of where we are")|.
-@** Command line arguments.
+@* Command line arguments.
The user calls \.{CWEAVE} and \.{CTANGLE} with arguments on the command line.
These are either file names or flags to be turned off (beginning with |"-"|)
or flags to be turned on (beginning with |"+"|).
@@ -1261,7 +1261,7 @@
@ @<Complain about arg...@>= fatal("! Filename too long\n", *argv);
@.Filename too long@>
-@** Output. Here is the code that opens the output file:
+@* Output. Here is the code that opens the output file:
@^system dependencies@>
@<Global var...@>=
@@ -1283,4 +1283,4 @@
fatal("! Cannot open output file ", tex_file_name);
}
-@** Index.
+@* Index.
Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.c
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.c 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.c 2023-07-21 14:14:07 UTC (rev 67688)
@@ -1,8 +1,8 @@
/*1:*/
#line 66 "ctangle.w"
-/*4:*/
-#line 44 "common.h"
+/*5:*/
+#line 49 "common.h"
#include <ctype.h>
#include <stdbool.h>
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
-/*:4*/
+/*:5*/
#line 67 "ctangle.w"
#define banner "This is CTANGLE (Version 4.9)" \
@@ -166,8 +166,8 @@
extern boolean program;
extern int phase;
-/*:3*//*5:*/
-#line 74 "common.h"
+/*:3*//*6:*/
+#line 79 "common.h"
extern char section_text[];
extern char*section_text_end;
@@ -174,8 +174,8 @@
extern char*id_first;
extern char*id_loc;
-/*:5*//*6:*/
-#line 92 "common.h"
+/*:6*//*7:*/
+#line 97 "common.h"
extern char buffer[];
extern char*buffer_end;
@@ -182,8 +182,8 @@
extern char*loc;
extern char*limit;
-/*:6*//*7:*/
-#line 109 "common.h"
+/*:7*//*8:*/
+#line 114 "common.h"
extern int include_depth;
extern FILE*file[];
@@ -198,8 +198,8 @@
extern boolean changing;
extern boolean web_file_open;
-/*:7*//*9:*/
-#line 129 "common.h"
+/*:8*//*10:*/
+#line 134 "common.h"
extern sixteen_bits section_count;
extern boolean changed_section[];
@@ -206,8 +206,8 @@
extern boolean change_pending;
extern boolean print_where;
-/*:9*//*10:*/
-#line 143 "common.h"
+/*:10*//*11:*/
+#line 148 "common.h"
typedef struct name_info{
char*byte_start;
@@ -231,13 +231,13 @@
extern hash_pointer hash_end;
extern hash_pointer h;
-/*:10*//*12:*/
-#line 187 "common.h"
+/*:11*//*13:*/
+#line 194 "common.h"
extern int history;
-/*:12*//*14:*/
-#line 203 "common.h"
+/*:13*//*15:*/
+#line 210 "common.h"
extern int argc;
extern char**argv;
@@ -247,8 +247,8 @@
extern char scn_file_name[];
extern boolean flags[];
-/*:14*//*15:*/
-#line 217 "common.h"
+/*:15*//*16:*/
+#line 224 "common.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -256,7 +256,7 @@
extern FILE*scn_file;
extern FILE*active_file;
-/*:15*/
+/*:16*/
#line 69 "ctangle.w"
/*19:*/
@@ -358,41 +358,43 @@
/*:82*/
#line 71 "ctangle.w"
-/*8:*/
-#line 123 "common.h"
+/*4:*/
+#line 43 "common.h"
+extern void common_init(void);
+extern void print_stats(void);
+
+/*:4*//*9:*/
+#line 128 "common.h"
+
extern boolean get_line(void);
extern void check_complete(void);
extern void reset_input(void);
-/*:8*//*11:*/
-#line 166 "common.h"
+/*:9*//*12:*/
+#line 171 "common.h"
-extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,eight_bits);
extern name_pointer section_lookup(char*,char*,boolean);
-extern void init_node(name_pointer);
-extern void init_p(name_pointer,eight_bits);
extern void print_prefix_name(name_pointer);
extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
-/*:11*//*13:*/
-#line 190 "common.h"
+extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
+extern void init_node(name_pointer);
+extern void init_p(name_pointer,eight_bits);
+
+/*:12*//*14:*/
+#line 197 "common.h"
+
extern int wrap_up(void);
extern void err_print(const char*);
extern void fatal(const char*,const char*);
extern void overflow(const char*);
-/*:13*//*16:*/
-#line 225 "common.h"
-
-extern void common_init(void);
-extern void print_stats(void);
-
-/*:16*//*30:*/
+/*:14*//*30:*/
#line 246 "ctangle.w"
static void store_two_bytes(sixteen_bits);
Modified: trunk/Build/source/texk/web2c/cwebdir/ctangle.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctangle.w 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/ctangle.w 2023-07-21 14:14:07 UTC (rev 67688)
@@ -162,8 +162,8 @@
return length(p)==l && strncmp(first,p->byte_start,l)==0;
}
-@ The common lookup routine refers to separate routines |init_node| and
-|init_p| when the data structure grows. Actually |init_p| is called only by
+@ The common lookup routine |id_lookup| refers to separate routines |init_node|
+and |init_p| when the data structure grows. Actually |init_p| is called only by
\.{CWEAVE}, but we need to declare a dummy version so that
the loader won't complain of its absence.
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2023-07-21 14:14:07 UTC (rev 67688)
@@ -80,7 +80,7 @@
@$show_progress {CTWILL}14 =\\{flags}[\.{'p'}]@>
@z
-Section 4.
+Section 5.
@x
For backward compatibility with pre-{\mc ANSI} compilers, we replace the
@@ -97,7 +97,7 @@
@-HAVE_GETTEXT@>
@z
-Section 5.
+Section 6.
@x
@d compress(c) if (loc++<=limit) return c
@@ -106,7 +106,7 @@
@-c@>
@z
-Section 6.
+Section 7.
@x
@ Code related to input routines:
@@ -115,9 +115,15 @@
@-c@>
@z
-Section 7.
+Section 8.
@x
+ at f line x /* make |line| an unreserved word */
+ at y
+ at s line x @q/* make |line| an unreserved word */@>
+ at z
+
+ at x
@d cur_line line[include_depth] /* number of current line in current file */
@y
@d cur_line line[include_depth] /* number of current line in current file */
@@ -129,7 +135,7 @@
@$cur_line {CTWILL}7 =\\{line}[\\{include\_depth}]@>
@z
-Section 10.
+Section 11.
@x
@ Code related to identifier and section name storage:
@@ -144,7 +150,7 @@
@$root {CTWILL}10 =\\{name\_dir}$\MG$\\{rlink}@>
@z
-Section 12.
+Section 13.
@x
@ Code related to error handling:
@@ -173,7 +179,7 @@
@$check_for_change {CTWILL}14 =\\{flags}[\.{'c'}]@>
@z
-Section 15.
+Section 16.
@x
@ Code related to output:
@@ -188,16 +194,14 @@
@$new_line {CTWILL}15 =\\{putchar}(\.{'\\n'})@>
@z
-Section 16.
+Section 17.
@x
-@ The procedure that gets everything rolling:
+@ The following parameters are sufficient to handle \TEX/ (converted to
@y
- at r @ The procedure that gets everything rolling:
+ at r @ The following parameters are sufficient to handle \TEX/ (converted to
@z
-Section 17.
-
@x
@d long_buf_size (buf_size+longest_name) /* for \.{CWEAVE} */
@y
@@ -1292,6 +1296,14 @@
return; /* this happens, for example, in \&{case} \\{found}: */
@z
+Section 141.
+
+ at x
+ while (q != xmem) {
+ at y
+ while (q != xmem) { @+
+ at z
+
Section 143.
@x
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill.bux
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill.bux 2023-07-20 23:43:55 UTC (rev 67687)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill.bux 2023-07-21 14:14:07 UTC (rev 67688)
@@ -23,15 +23,17 @@
@$changing {COMMON.W}25 \&{boolean}@>
@$web_file_open {COMMON.W}25 \&{boolean}@>
-@$reset_input {COMMON.W}35 \&{void} (\,)@>
+@$get_line {COMMON.W}35 \&{boolean} (\,)@>
-@$section_count {COMMON.W}37 \&{sixteen\_bits}@>
-@$changed_section {COMMON.W}37 \&{boolean} [\,]@>
-@$change_pending {COMMON.W}37 \&{boolean}@>
-@$print_where {COMMON.W}37 \&{boolean}@>
-@$get_line {COMMON.W}38 \&{boolean} (\,)@>
+@$check_complete {COMMON.W}39 \&{void} (\,)@>
-@$check_complete {COMMON.W}42 \&{void} (\,)@>
+@$reset_input {COMMON.W}40 \&{void} (\,)@>
+
+@$section_count {COMMON.W}42 \&{sixteen\_bits}@>
+@$changed_section {COMMON.W}42 \&{boolean} [\,]@>
+@$change_pending {COMMON.W}42 \&{boolean}@>
+@$print_where {COMMON.W}42 \&{boolean}@>
+
@$byte_mem {COMMON.W}43 \&{char} [\,]@>
@$byte_mem_end {COMMON.W}43 \&{char} ${*}$@>
@$name_dir {COMMON.W}43 \&{name\_info} [\,]@>
More information about the tex-live-commits
mailing list.