texlive[62544] Build/source/texk/web2c/hitexdir: HiTeX: Implementing

commits+mruckert at tug.org commits+mruckert at tug.org
Wed Mar 9 14:00:00 CET 2022


Revision: 62544
          http://tug.org/svn/texlive?view=revision&revision=62544
Author:   mruckert
Date:     2022-03-09 14:00:00 +0100 (Wed, 09 Mar 2022)
Log Message:
-----------
HiTeX: Implementing the -recorder option

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/hitexdir/doc/hiformat.hnt
    trunk/Build/source/texk/web2c/hitexdir/doc/hiformat.pdf
    trunk/Build/source/texk/web2c/hitexdir/hiformat.w
    trunk/Build/source/texk/web2c/hitexdir/hilexer.c
    trunk/Build/source/texk/web2c/hitexdir/hiparser.c
    trunk/Build/source/texk/web2c/hitexdir/hiparser.h
    trunk/Build/source/texk/web2c/hitexdir/hitex.w

Modified: trunk/Build/source/texk/web2c/hitexdir/doc/hiformat.hnt
===================================================================
(Binary files differ)

Modified: trunk/Build/source/texk/web2c/hitexdir/doc/hiformat.pdf
===================================================================
(Binary files differ)

Modified: trunk/Build/source/texk/web2c/hitexdir/hiformat.w
===================================================================
--- trunk/Build/source/texk/web2c/hitexdir/hiformat.w	2022-03-09 12:10:50 UTC (rev 62543)
+++ trunk/Build/source/texk/web2c/hitexdir/hiformat.w	2022-03-09 13:00:00 UTC (rev 62544)
@@ -7631,19 +7631,24 @@
 
 @
 
-Now let us look at the optional sections described in the directory entries 3 and above
-Where these files are found depends on the {\tt -g} and {\tt -a} options.
+Now let us look at the optional sections described in the directory
+entries 3 and above. Where these files are found depends on the {\tt
+-g} and {\tt -a} options.
 
-With the {\tt -g} option given, only the file names as given in the directory entries are used.
-With the {\tt -a} option given, the file names are translated to filenames in the {|hin_name|\tt .abs} and  {|hin_name|\tt .rel} directories, as described in section~\secref{absrel}.
-If neither the {\tt -a} nor the {\tt -g} option is given, {\tt shrink} first trys the translated
-filename and then the global filename before it gives up.
+With the {\tt -g} option given, only the file names as given in the
+directory entries are used.  With the {\tt -a} option given, the file
+names are translated to filenames in the {|hin_name|\tt .abs} and
+{|hin_name|\tt .rel} directories, as described in
+section~\secref{absrel}.  If neither the {\tt -a} nor the {\tt -g}
+option is given, {\tt shrink} first tries the translated filename and
+then the global filename before it gives up.
 
-When the \.{shrink} program writes the directory section in the short format,
-it needs to know the sizes of all the  sections---including the optional sections.
-These sizes are not provided in the long format because it is safer and more 
-convenient to let the machine figure out the file sizes\index{file size}.
-But before we can determine the size, we need to determine the file.
+When the \.{shrink} program writes the directory section in the short
+format, it needs to know the sizes of all the sections---including the
+optional sections.  These sizes are not provided in the long format
+because it is safer and more convenient to let the machine figure out
+the file sizes\index{file size}.  But before we can determine the
+size, we need to determine the file.
 
 @<update the file sizes of optional sections@>=
 { int i;

Modified: trunk/Build/source/texk/web2c/hitexdir/hilexer.c
===================================================================
--- trunk/Build/source/texk/web2c/hitexdir/hilexer.c	2022-03-09 12:10:50 UTC (rev 62543)
+++ trunk/Build/source/texk/web2c/hitexdir/hilexer.c	2022-03-09 13:00:00 UTC (rev 62544)
@@ -849,7 +849,7 @@
 #line 1 "lexer.l"
 #line 2 "lexer.l"
 	/*519:*/
-	#line 10731 "format.w"
+	#line 10736 "format.w"
 	
 #include "hibasetypes.h"
 #include "hierror.h"
@@ -985,7 +985,7 @@
 	}
 	/*:61*/
 int yywrap(void){
-	#line 10742 "format.w"
+	#line 10747 "format.w"
 	return 1;}
 #ifdef _MSC_VER
 #pragma  warning( disable : 4267)

Modified: trunk/Build/source/texk/web2c/hitexdir/hiparser.c
===================================================================
--- trunk/Build/source/texk/web2c/hitexdir/hiparser.c	2022-03-09 12:10:50 UTC (rev 62543)
+++ trunk/Build/source/texk/web2c/hitexdir/hiparser.c	2022-03-09 13:00:00 UTC (rev 62544)
@@ -69,7 +69,7 @@
 /* First part of user prologue.  */
 #line 2 "parser.y"
 
-	#line 10772 "format.w"
+	#line 10777 "format.w"
 	
 #include "hibasetypes.h"
 #include <string.h>
@@ -81,7 +81,7 @@
 
 	/*366:*/
 uint32_t definition_bits[0x100/32][32]= {
-	#line 8073 "format.w"
+	#line 8078 "format.w"
 	{0}};
 
 #define SET_DBIT(N,K) ((N)>0xFF?1:(definition_bits[N/32][K]	|= (1<<((N)&(32-1)))))
@@ -113,7 +113,7 @@
 	/*362:*/
 void hset_max(Kind k,int n)
 {
-	#line 7916 "format.w"
+	#line 7921 "format.w"
 	DBG(DBGDEF,"Setting max %s to %d\n",definition_name[k],n);
 	RNG("Maximum",n,max_fixed[k]+1,MAX_REF(k));
 	if(n>max_ref[k])
@@ -122,7 +122,7 @@
 	/*:362*/	/*373:*/
 void check_param_def(Ref*df)
 {
-	#line 8222 "format.w"
+	#line 8227 "format.w"
 	if(df->k!=int_kind&&df->k!=dimen_kind&&df->k!=glue_kind)
 	QUIT("Kind %s not allowed in parameter list",definition_name[df->k]);
 	if(df->n<=max_fixed[df->k]||max_default[df->k]<df->n)
@@ -132,7 +132,7 @@
 extern int yylineno;
 int yyerror(const char*msg)
 {
-	#line 9346 "format.w"
+	#line 9351 "format.w"
 	QUIT(" in line %d %s",yylineno,msg);
 	return 0;
 	}
@@ -3405,7 +3405,7 @@
   case 198: /* $@11: %empty  */
 #line 879 "parser.y"
                                     {
-	#line 7772 "format.w"
+	#line 7777 "format.w"
 	hput_definitions_start();}
 #line 3411 "parser.c"
     break;
@@ -3413,7 +3413,7 @@
   case 199: /* definition_section: "<" "definitions" $@11 max_definitions definition_list ">"  */
 #line 883 "parser.y"
    {
-	#line 7774 "format.w"
+	#line 7779 "format.w"
 	hput_definitions_end();}
 #line 3419 "parser.c"
     break;
@@ -3421,7 +3421,7 @@
   case 202: /* max_definitions: "<" "max" max_list ">"  */
 #line 889 "parser.y"
 {
-	#line 7890 "format.w"
+	#line 7895 "format.w"
 		/*253:*/
 	if(max_ref[label_kind]>=0)
 	ALLOCATE(labels,max_ref[label_kind]+1,Label);
@@ -3449,7 +3449,7 @@
   case 205: /* max_value: "font" UNSIGNED  */
 #line 915 "parser.y"
                        {
-	#line 7894 "format.w"
+	#line 7899 "format.w"
 	hset_max(font_kind,(yyvsp[0].u));}
 #line 3455 "parser.c"
     break;
@@ -3457,7 +3457,7 @@
   case 206: /* max_value: "int" UNSIGNED  */
 #line 918 "parser.y"
                          {
-	#line 7895 "format.w"
+	#line 7900 "format.w"
 	hset_max(int_kind,(yyvsp[0].u));}
 #line 3463 "parser.c"
     break;
@@ -3465,7 +3465,7 @@
   case 207: /* max_value: "dimen" UNSIGNED  */
 #line 921 "parser.y"
                        {
-	#line 7896 "format.w"
+	#line 7901 "format.w"
 	hset_max(dimen_kind,(yyvsp[0].u));}
 #line 3471 "parser.c"
     break;
@@ -3473,7 +3473,7 @@
   case 208: /* max_value: "ligature" UNSIGNED  */
 #line 924 "parser.y"
                           {
-	#line 7897 "format.w"
+	#line 7902 "format.w"
 	hset_max(ligature_kind,(yyvsp[0].u));}
 #line 3479 "parser.c"
     break;
@@ -3481,7 +3481,7 @@
   case 209: /* max_value: "disc" UNSIGNED  */
 #line 927 "parser.y"
                       {
-	#line 7898 "format.w"
+	#line 7903 "format.w"
 	hset_max(disc_kind,(yyvsp[0].u));}
 #line 3487 "parser.c"
     break;
@@ -3489,7 +3489,7 @@
   case 210: /* max_value: "glue" UNSIGNED  */
 #line 930 "parser.y"
                       {
-	#line 7899 "format.w"
+	#line 7904 "format.w"
 	hset_max(glue_kind,(yyvsp[0].u));}
 #line 3495 "parser.c"
     break;
@@ -3497,7 +3497,7 @@
   case 211: /* max_value: "language" UNSIGNED  */
 #line 933 "parser.y"
                           {
-	#line 7900 "format.w"
+	#line 7905 "format.w"
 	hset_max(language_kind,(yyvsp[0].u));}
 #line 3503 "parser.c"
     break;
@@ -3505,7 +3505,7 @@
   case 212: /* max_value: "rule" UNSIGNED  */
 #line 936 "parser.y"
                       {
-	#line 7901 "format.w"
+	#line 7906 "format.w"
 	hset_max(rule_kind,(yyvsp[0].u));}
 #line 3511 "parser.c"
     break;
@@ -3513,7 +3513,7 @@
   case 213: /* max_value: "image" UNSIGNED  */
 #line 939 "parser.y"
                        {
-	#line 7902 "format.w"
+	#line 7907 "format.w"
 	hset_max(image_kind,(yyvsp[0].u));}
 #line 3519 "parser.c"
     break;
@@ -3521,7 +3521,7 @@
   case 214: /* max_value: "leaders" UNSIGNED  */
 #line 942 "parser.y"
                          {
-	#line 7903 "format.w"
+	#line 7908 "format.w"
 	hset_max(leaders_kind,(yyvsp[0].u));}
 #line 3527 "parser.c"
     break;
@@ -3529,7 +3529,7 @@
   case 215: /* max_value: "baseline" UNSIGNED  */
 #line 945 "parser.y"
                           {
-	#line 7904 "format.w"
+	#line 7909 "format.w"
 	hset_max(baseline_kind,(yyvsp[0].u));}
 #line 3535 "parser.c"
     break;
@@ -3537,7 +3537,7 @@
   case 216: /* max_value: "xdimen" UNSIGNED  */
 #line 948 "parser.y"
                         {
-	#line 7905 "format.w"
+	#line 7910 "format.w"
 	hset_max(xdimen_kind,(yyvsp[0].u));}
 #line 3543 "parser.c"
     break;
@@ -3545,7 +3545,7 @@
   case 217: /* max_value: "param" UNSIGNED  */
 #line 951 "parser.y"
                        {
-	#line 7906 "format.w"
+	#line 7911 "format.w"
 	hset_max(param_kind,(yyvsp[0].u));}
 #line 3551 "parser.c"
     break;
@@ -3553,7 +3553,7 @@
   case 218: /* max_value: "stream (definition)" UNSIGNED  */
 #line 954 "parser.y"
                            {
-	#line 7907 "format.w"
+	#line 7912 "format.w"
 	hset_max(stream_kind,(yyvsp[0].u));}
 #line 3559 "parser.c"
     break;
@@ -3561,7 +3561,7 @@
   case 219: /* max_value: "page" UNSIGNED  */
 #line 957 "parser.y"
                       {
-	#line 7908 "format.w"
+	#line 7913 "format.w"
 	hset_max(page_kind,(yyvsp[0].u));}
 #line 3567 "parser.c"
     break;
@@ -3569,7 +3569,7 @@
   case 220: /* max_value: "range" UNSIGNED  */
 #line 960 "parser.y"
                        {
-	#line 7909 "format.w"
+	#line 7914 "format.w"
 	hset_max(range_kind,(yyvsp[0].u));}
 #line 3575 "parser.c"
     break;
@@ -3577,7 +3577,7 @@
   case 221: /* max_value: "label" UNSIGNED  */
 #line 963 "parser.y"
                        {
-	#line 7910 "format.w"
+	#line 7915 "format.w"
 	hset_max(label_kind,(yyvsp[0].u));}
 #line 3583 "parser.c"
     break;
@@ -3585,7 +3585,7 @@
   case 222: /* def_node: start "font" ref font ">"  */
 #line 969 "parser.y"
                        {
-	#line 8107 "format.w"
+	#line 8112 "format.w"
 	DEF((yyval.rf),font_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),(yyvsp[-1].info));}
 #line 3591 "parser.c"
     break;
@@ -3593,7 +3593,7 @@
   case 223: /* def_node: start "int" ref integer ">"  */
 #line 972 "parser.y"
                                       {
-	#line 8108 "format.w"
+	#line 8113 "format.w"
 	DEF((yyval.rf),int_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_int((yyvsp[-1].i)));}
 #line 3599 "parser.c"
     break;
@@ -3601,7 +3601,7 @@
   case 224: /* def_node: start "dimen" ref dimension ">"  */
 #line 975 "parser.y"
                                       {
-	#line 8109 "format.w"
+	#line 8114 "format.w"
 	DEF((yyval.rf),dimen_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_dimen((yyvsp[-1].d)));}
 #line 3607 "parser.c"
     break;
@@ -3609,7 +3609,7 @@
   case 225: /* def_node: start "language" ref string ">"  */
 #line 978 "parser.y"
                                       {
-	#line 8110 "format.w"
+	#line 8115 "format.w"
 	DEF((yyval.rf),language_kind,(yyvsp[-2].u));hput_string((yyvsp[-1].s));hput_tags((yyvsp[-4].u),TAG(language_kind,0));}
 #line 3615 "parser.c"
     break;
@@ -3617,7 +3617,7 @@
   case 226: /* def_node: start "glue" ref glue ">"  */
 #line 981 "parser.y"
                                 {
-	#line 8111 "format.w"
+	#line 8116 "format.w"
 	DEF((yyval.rf),glue_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_glue(&((yyvsp[-1].g))));}
 #line 3623 "parser.c"
     break;
@@ -3625,7 +3625,7 @@
   case 227: /* def_node: start "xdimen" ref xdimen ">"  */
 #line 984 "parser.y"
                                     {
-	#line 8112 "format.w"
+	#line 8117 "format.w"
 	DEF((yyval.rf),xdimen_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_xdimen(&((yyvsp[-1].xd))));}
 #line 3631 "parser.c"
     break;
@@ -3633,7 +3633,7 @@
   case 228: /* def_node: start "rule" ref rule ">"  */
 #line 987 "parser.y"
                                 {
-	#line 8113 "format.w"
+	#line 8118 "format.w"
 	DEF((yyval.rf),rule_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_rule(&((yyvsp[-1].r))));}
 #line 3639 "parser.c"
     break;
@@ -3641,7 +3641,7 @@
   case 229: /* def_node: start "leaders" ref leaders ">"  */
 #line 990 "parser.y"
                                       {
-	#line 8114 "format.w"
+	#line 8119 "format.w"
 	DEF((yyval.rf),leaders_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),TAG(leaders_kind,(yyvsp[-1].info)));}
 #line 3647 "parser.c"
     break;
@@ -3649,7 +3649,7 @@
   case 230: /* def_node: start "baseline" ref baseline ">"  */
 #line 993 "parser.y"
                                         {
-	#line 8115 "format.w"
+	#line 8120 "format.w"
 	DEF((yyval.rf),baseline_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),TAG(baseline_kind,(yyvsp[-1].info)));}
 #line 3655 "parser.c"
     break;
@@ -3657,7 +3657,7 @@
   case 231: /* def_node: start "ligature" ref ligature ">"  */
 #line 996 "parser.y"
                                         {
-	#line 8116 "format.w"
+	#line 8121 "format.w"
 	DEF((yyval.rf),ligature_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_ligature(&((yyvsp[-1].lg))));}
 #line 3663 "parser.c"
     break;
@@ -3665,7 +3665,7 @@
   case 232: /* def_node: start "disc" ref disc ">"  */
 #line 999 "parser.y"
                                 {
-	#line 8117 "format.w"
+	#line 8122 "format.w"
 	DEF((yyval.rf),disc_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_disc(&((yyvsp[-1].dc))));}
 #line 3671 "parser.c"
     break;
@@ -3673,7 +3673,7 @@
   case 233: /* def_node: start "image" ref image ">"  */
 #line 1002 "parser.y"
                                   {
-	#line 8118 "format.w"
+	#line 8123 "format.w"
 	DEF((yyval.rf),image_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),TAG(image_kind,(yyvsp[-1].info)));}
 #line 3679 "parser.c"
     break;
@@ -3681,7 +3681,7 @@
   case 234: /* def_node: start "param" ref parameters ">"  */
 #line 1005 "parser.y"
                                        {
-	#line 8119 "format.w"
+	#line 8124 "format.w"
 	DEF((yyval.rf),param_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),hput_list((yyvsp[-4].u)+2,&((yyvsp[-1].l))));}
 #line 3687 "parser.c"
     break;
@@ -3689,7 +3689,7 @@
   case 235: /* def_node: start "page" ref page ">"  */
 #line 1008 "parser.y"
                                 {
-	#line 8120 "format.w"
+	#line 8125 "format.w"
 	DEF((yyval.rf),page_kind,(yyvsp[-2].u));hput_tags((yyvsp[-4].u),TAG(page_kind,0));}
 #line 3695 "parser.c"
     break;
@@ -3697,7 +3697,7 @@
   case 236: /* def_node: start "int" ref ref ">"  */
 #line 1013 "parser.y"
                          {
-	#line 8139 "format.w"
+	#line 8144 "format.w"
 	DEF_REF((yyval.rf),int_kind,(yyvsp[-2].u),(yyvsp[-1].u));hput_tags((yyvsp[-4].u),TAG(int_kind,0));}
 #line 3703 "parser.c"
     break;
@@ -3705,7 +3705,7 @@
   case 237: /* def_node: start "dimen" ref ref ">"  */
 #line 1016 "parser.y"
                                 {
-	#line 8140 "format.w"
+	#line 8145 "format.w"
 	DEF_REF((yyval.rf),dimen_kind,(yyvsp[-2].u),(yyvsp[-1].u));hput_tags((yyvsp[-4].u),TAG(dimen_kind,0));}
 #line 3711 "parser.c"
     break;
@@ -3713,7 +3713,7 @@
   case 238: /* def_node: start "glue" ref ref ">"  */
 #line 1019 "parser.y"
                                {
-	#line 8141 "format.w"
+	#line 8146 "format.w"
 	DEF_REF((yyval.rf),glue_kind,(yyvsp[-2].u),(yyvsp[-1].u));hput_tags((yyvsp[-4].u),TAG(glue_kind,0));}
 #line 3719 "parser.c"
     break;
@@ -3721,7 +3721,7 @@
   case 240: /* def_list: def_list def_node  */
 #line 1024 "parser.y"
                           {
-	#line 8255 "format.w"
+	#line 8260 "format.w"
 	check_param_def(&((yyvsp[0].rf)));}
 #line 3727 "parser.c"
     break;
@@ -3729,7 +3729,7 @@
   case 241: /* parameters: estimate def_list  */
 #line 1027 "parser.y"
                             {
-	#line 8256 "format.w"
+	#line 8261 "format.w"
 	(yyval.l).p= (yyvsp[0].u);(yyval.l).k= param_kind;(yyval.l).s= (hpos-hstart)-(yyvsp[0].u);}
 #line 3735 "parser.c"
     break;
@@ -3737,7 +3737,7 @@
   case 242: /* empty_param_list: position  */
 #line 1031 "parser.y"
                          {
-	#line 8277 "format.w"
+	#line 8282 "format.w"
 	HPUTX(2);hpos++;hput_tags((yyvsp[0].u),TAG(param_kind,1));}
 #line 3743 "parser.c"
     break;
@@ -3745,7 +3745,7 @@
   case 243: /* $@12: %empty  */
 #line 1034 "parser.y"
                                 {
-	#line 8278 "format.w"
+	#line 8283 "format.w"
 	hpos= hpos-2;}
 #line 3751 "parser.c"
     break;
@@ -3753,7 +3753,7 @@
   case 244: /* non_empty_param_list: start "param" $@12 parameters ">"  */
 #line 1037 "parser.y"
 {
-	#line 8279 "format.w"
+	#line 8284 "format.w"
 	hput_tags((yyvsp[-4].u)-2,hput_list((yyvsp[-4].u)-1,&((yyvsp[-1].l))));}
 #line 3759 "parser.c"
     break;
@@ -3761,7 +3761,7 @@
   case 246: /* font_head: string dimension UNSIGNED UNSIGNED  */
 #line 1045 "parser.y"
 {
-	#line 8421 "format.w"
+	#line 8426 "format.w"
 	uint8_t f= (yyvsp[-4].u);SET_DBIT(f,font_kind);hfont_name[f]= strdup((yyvsp[-3].s));(yyval.info)= hput_font_head(f,hfont_name[f],(yyvsp[-2].d),(yyvsp[-1].u),(yyvsp[0].u));}
 #line 3767 "parser.c"
     break;
@@ -3769,7 +3769,7 @@
   case 249: /* font_param: start "penalty" fref penalty ">"  */
 #line 1052 "parser.y"
                               {
-	#line 8426 "format.w"
+	#line 8431 "format.w"
 	hput_tags((yyvsp[-4].u),hput_int((yyvsp[-1].i)));}
 #line 3775 "parser.c"
     break;
@@ -3777,7 +3777,7 @@
   case 250: /* font_param: start "kern" fref kern ">"  */
 #line 1055 "parser.y"
                                  {
-	#line 8427 "format.w"
+	#line 8432 "format.w"
 	hput_tags((yyvsp[-4].u),hput_kern(&((yyvsp[-1].kt))));}
 #line 3783 "parser.c"
     break;
@@ -3785,7 +3785,7 @@
   case 251: /* font_param: start "ligature" fref ligature ">"  */
 #line 1058 "parser.y"
                                          {
-	#line 8428 "format.w"
+	#line 8433 "format.w"
 	hput_tags((yyvsp[-4].u),hput_ligature(&((yyvsp[-1].lg))));}
 #line 3791 "parser.c"
     break;
@@ -3793,7 +3793,7 @@
   case 252: /* font_param: start "disc" fref disc ">"  */
 #line 1061 "parser.y"
                                  {
-	#line 8429 "format.w"
+	#line 8434 "format.w"
 	hput_tags((yyvsp[-4].u),hput_disc(&((yyvsp[-1].dc))));}
 #line 3799 "parser.c"
     break;
@@ -3801,7 +3801,7 @@
   case 253: /* font_param: start "glue" fref glue ">"  */
 #line 1064 "parser.y"
                                  {
-	#line 8430 "format.w"
+	#line 8435 "format.w"
 	hput_tags((yyvsp[-4].u),hput_glue(&((yyvsp[-1].g))));}
 #line 3807 "parser.c"
     break;
@@ -3809,7 +3809,7 @@
   case 254: /* font_param: start "language" fref string ">"  */
 #line 1067 "parser.y"
                                        {
-	#line 8431 "format.w"
+	#line 8436 "format.w"
 	hput_string((yyvsp[-1].s));hput_tags((yyvsp[-4].u),TAG(language_kind,0));}
 #line 3815 "parser.c"
     break;
@@ -3817,7 +3817,7 @@
   case 255: /* font_param: start "rule" fref rule ">"  */
 #line 1070 "parser.y"
                                  {
-	#line 8432 "format.w"
+	#line 8437 "format.w"
 	hput_tags((yyvsp[-4].u),hput_rule(&((yyvsp[-1].r))));}
 #line 3823 "parser.c"
     break;
@@ -3825,7 +3825,7 @@
   case 256: /* font_param: start "image" fref image ">"  */
 #line 1073 "parser.y"
                                    {
-	#line 8433 "format.w"
+	#line 8438 "format.w"
 	hput_tags((yyvsp[-4].u),TAG(image_kind,(yyvsp[-1].info)));}
 #line 3831 "parser.c"
     break;
@@ -3833,7 +3833,7 @@
   case 257: /* fref: ref  */
 #line 1077 "parser.y"
         {
-	#line 8435 "format.w"
+	#line 8440 "format.w"
 	RNG("Font parameter",(yyvsp[0].u),0,MAX_FONT_PARAMS);}
 #line 3839 "parser.c"
     break;
@@ -3841,7 +3841,7 @@
   case 258: /* xdimen_ref: ref  */
 #line 1081 "parser.y"
               {
-	#line 8508 "format.w"
+	#line 8513 "format.w"
 	REF(xdimen_kind,(yyvsp[0].u));}
 #line 3847 "parser.c"
     break;
@@ -3849,7 +3849,7 @@
   case 259: /* param_ref: ref  */
 #line 1084 "parser.y"
              {
-	#line 8509 "format.w"
+	#line 8514 "format.w"
 	REF(param_kind,(yyvsp[0].u));}
 #line 3855 "parser.c"
     break;
@@ -3857,7 +3857,7 @@
   case 260: /* stream_ref: ref  */
 #line 1087 "parser.y"
               {
-	#line 8510 "format.w"
+	#line 8515 "format.w"
 	REF_RNG(stream_kind,(yyvsp[0].u));}
 #line 3863 "parser.c"
     break;
@@ -3865,7 +3865,7 @@
   case 261: /* content_node: start "penalty" ref ">"  */
 #line 1093 "parser.y"
                      {
-	#line 8514 "format.w"
+	#line 8519 "format.w"
 	REF(penalty_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(penalty_kind,0));}
 #line 3871 "parser.c"
     break;
@@ -3873,7 +3873,7 @@
   case 262: /* content_node: start "kern" explicit ref ">"  */
 #line 1097 "parser.y"
 {
-	#line 8516 "format.w"
+	#line 8521 "format.w"
 	REF(dimen_kind,(yyvsp[-1].u));hput_tags((yyvsp[-4].u),TAG(kern_kind,((yyvsp[-2].b))?b100:b000));}
 #line 3879 "parser.c"
     break;
@@ -3881,7 +3881,7 @@
   case 263: /* content_node: start "kern" explicit "xdimen" ref ">"  */
 #line 1101 "parser.y"
 {
-	#line 8518 "format.w"
+	#line 8523 "format.w"
 	REF(xdimen_kind,(yyvsp[-1].u));hput_tags((yyvsp[-5].u),TAG(kern_kind,((yyvsp[-3].b))?b101:b001));}
 #line 3887 "parser.c"
     break;
@@ -3889,7 +3889,7 @@
   case 264: /* content_node: start "glue" ref ">"  */
 #line 1104 "parser.y"
                            {
-	#line 8519 "format.w"
+	#line 8524 "format.w"
 	REF(glue_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(glue_kind,0));}
 #line 3895 "parser.c"
     break;
@@ -3897,7 +3897,7 @@
   case 265: /* content_node: start "ligature" ref ">"  */
 #line 1107 "parser.y"
                                {
-	#line 8520 "format.w"
+	#line 8525 "format.w"
 	REF(ligature_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(ligature_kind,0));}
 #line 3903 "parser.c"
     break;
@@ -3905,7 +3905,7 @@
   case 266: /* content_node: start "disc" ref ">"  */
 #line 1110 "parser.y"
                            {
-	#line 8521 "format.w"
+	#line 8526 "format.w"
 	REF(disc_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(disc_kind,0));}
 #line 3911 "parser.c"
     break;
@@ -3913,7 +3913,7 @@
   case 267: /* content_node: start "rule" ref ">"  */
 #line 1113 "parser.y"
                            {
-	#line 8522 "format.w"
+	#line 8527 "format.w"
 	REF(rule_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(rule_kind,0));}
 #line 3919 "parser.c"
     break;
@@ -3921,7 +3921,7 @@
   case 268: /* content_node: start "image" ref ">"  */
 #line 1116 "parser.y"
                             {
-	#line 8523 "format.w"
+	#line 8528 "format.w"
 	REF(image_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(image_kind,0));}
 #line 3927 "parser.c"
     break;
@@ -3929,7 +3929,7 @@
   case 269: /* content_node: start "leaders" ref ">"  */
 #line 1119 "parser.y"
                               {
-	#line 8524 "format.w"
+	#line 8529 "format.w"
 	REF(leaders_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(leaders_kind,0));}
 #line 3935 "parser.c"
     break;
@@ -3937,7 +3937,7 @@
   case 270: /* content_node: start "baseline" ref ">"  */
 #line 1122 "parser.y"
                                {
-	#line 8525 "format.w"
+	#line 8530 "format.w"
 	REF(baseline_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),TAG(baseline_kind,0));}
 #line 3943 "parser.c"
     break;
@@ -3945,7 +3945,7 @@
   case 271: /* content_node: start "language" REFERENCE ">"  */
 #line 1125 "parser.y"
                                      {
-	#line 8526 "format.w"
+	#line 8531 "format.w"
 	REF(language_kind,(yyvsp[-1].u));hput_tags((yyvsp[-3].u),hput_language((yyvsp[-1].u)));}
 #line 3951 "parser.c"
     break;
@@ -3953,7 +3953,7 @@
   case 272: /* glue_node: start "glue" ref ">"  */
 #line 1129 "parser.y"
                             {
-	#line 8528 "format.w"
+	#line 8533 "format.w"
 	REF(glue_kind,(yyvsp[-1].u));
 	if((yyvsp[-1].u)==zero_skip_no){hpos= hpos-2;(yyval.b)= false;}
 	else{hput_tags((yyvsp[-3].u),TAG(glue_kind,0));(yyval.b)= true;}}
@@ -3963,7 +3963,7 @@
   case 273: /* $@13: %empty  */
 #line 1136 "parser.y"
                              {
-	#line 8959 "format.w"
+	#line 8964 "format.w"
 	hput_content_start();}
 #line 3969 "parser.c"
     break;
@@ -3971,7 +3971,7 @@
   case 274: /* content_section: "<" "content" $@13 content_list ">"  */
 #line 1139 "parser.y"
 {
-	#line 8960 "format.w"
+	#line 8965 "format.w"
 	hput_content_end();hput_range_defs();hput_label_defs();}
 #line 3977 "parser.c"
     break;

Modified: trunk/Build/source/texk/web2c/hitexdir/hiparser.h
===================================================================
--- trunk/Build/source/texk/web2c/hitexdir/hiparser.h	2022-03-09 12:10:50 UTC (rev 62543)
+++ trunk/Build/source/texk/web2c/hitexdir/hiparser.h	2022-03-09 13:00:00 UTC (rev 62544)
@@ -149,7 +149,7 @@
 {
 #line 79 "parser.y"
 
-	#line 10797 "format.w"
+	#line 10802 "format.w"
 	uint32_t u;  int32_t i;  char *s;  float64_t f;  Glyph c;
 	Dimen d;Stretch st;Xdimen xd;Kern kt;
 	Rule r;Glue g;Image x;

Modified: trunk/Build/source/texk/web2c/hitexdir/hitex.w
===================================================================
--- trunk/Build/source/texk/web2c/hitexdir/hitex.w	2022-03-09 12:10:50 UTC (rev 62543)
+++ trunk/Build/source/texk/web2c/hitexdir/hitex.w	2022-03-09 13:00:00 UTC (rev 62544)
@@ -906,7 +906,7 @@
 }
 
 static bool b_open_in(byte_file *f)   /*open a binary file for input*/
-{@+f->f= kpse_open_file((char *)name_of_file+1,kpse_tfm_format);
+{@+f->f= open_in((char *)name_of_file+1,kpse_tfm_format,"r");
    if (f->f!=NULL) get(*f);
    return f->f!=NULL && ferror(f->f)==0;
 }
@@ -10880,6 +10880,8 @@
 char @!months[]=" JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"; /*abbreviations of month names*/
 old_setting=selector;
 if (job_name==0) job_name=s_no(c_job_name?c_job_name:"texput"); /* k\TeX\ */
+pack_job_name(".fls");
+recorder_change_filename((char *)name_of_file+1);
 @.texput@>
 pack_job_name(".log");
 while (!a_open_out(&log_file)) @<Try to get a different log file name@>;
@@ -25141,7 +25143,7 @@
 start_of_TEX: @<Initialize the output routines@>;
 @<Get the first line of input and prepare to start@>;
 history=spotless; /*ready to go!*/
-hhsize=hsize; hvsize=vsize;@/
+hhsize=hsize; hvsize=vsize; hout_allocate();@/
 main_control();  /*come to life*/
 final_cleanup(); /*prepare for death*/
 close_files_and_terminate();
@@ -30190,6 +30192,8 @@
 @<Hi\TeX\ routines@>@;
 
 @ @<Forward declarations@>=
+static void hout_allocate(void);
+static void hout_init(void);
 static void hint_open(void);
 static void hint_close(void);
 
@@ -30841,7 +30845,7 @@
         break; /* else fall through */
     case hlist_node: case vlist_node: case rule_node:
       if (page_contents==empty)
-      { hint_open();
+      { hint_open(); hout_init();
         freeze_page_specs(box_there);
         hfix_defaults();
       }
@@ -30849,7 +30853,7 @@
       break;
     case ins_node:
       if (page_contents==empty)
-      { hint_open();
+      { hint_open(); hout_init();
         freeze_page_specs(inserts_only);
         hfix_defaults();
       }
@@ -31774,14 +31778,16 @@
     print_err("end of setstream group without setstream node");
   return s;
 }
+
 @* \HINT\ Output.
 Here are the routines to initialize and terminate the output.
-\noindent
+The initialization is done in three steps:
+First we allocate the data structurs to write nodes into buffers;
+this requires a directory and buffers for sections 0, 1, and 2.
 
-@<Hi\TeX\ routines@>=
-static void hout_init(void)
-{
-  new_directory(dir_entries);
+@ @<Hi\TeX\ routines@>=
+static void hout_allocate(void)
+{ new_directory(dir_entries);
   new_output_buffers();
   max_section_no=2;
   hdef_init();
@@ -31789,7 +31795,23 @@
   @<insert an initial language node@>@;
 }
 
-extern int option_global;
+@ Second we initialize the definitions and start the content section
+before the first content node is written; this is done when the
+|page_contents| is about to change from |empty| to not |empty|.
+Finally, the actual output file |hout| needs to be opened; this
+must be done before calling |hput_hint| which is already
+part of the termination routines. It is placed, however, much earlier
+because asking for the output file name---according to \TeX's
+conventions---should come before the first item is put on the first
+page by the page builder. For this reason, |hint_open| is called
+when calling |hout_init|.
+
+@<Hi\TeX\ routines@>=
+static void hout_init(void)
+{
+
+}
+
 static void hint_open(void)
 { if (job_name==0) open_log_file();
   pack_job_name(".hnt");
@@ -31798,19 +31820,20 @@
   output_file_name=make_name_string();
   hlog=stderr;
   DBG(DBGBASIC,"Output file %s opened\n",(char *)name_of_file+1);
-  option_global=true;
-  hout_init();
 }
 
 #define HITEX_VERSION "1.1"
 static void  hput_definitions();
+extern int option_global;
 static void hout_terminate(void)
 { size_t s;
   if (hout==NULL) return;
   hput_content_end();
   hput_definitions();
+  option_global=true; /* use global names in the directory */
   hput_directory();
   s = hput_hint("created by HiTeX Version " HITEX_VERSION);
+  @<record the names of files in optional sections@>@;
   print_nl("Output written on "); slow_print(output_file_name);
 @.Output written on x@>
   print(" (1 page, "); print_int(s); print(" bytes).");
@@ -31823,6 +31846,18 @@
   hout=NULL;
 }
 
+@ The file name recording feature of Hi\TeX\ makes it necessary to
+record the names of the files that are added as optional sections.
+This feature is not part of the |hput_optional_sections| function
+which is called from |hput_hint|. The following simple
+loop will achive this.
+
+@<record the names of files in optional sections@>=
+{ int i;
+  for(i= 3;i<=max_section_no;i++)
+    recorder_record_input(dir[i].file_name);
+}
+
 @* The \HINT\ Directory.
 There is not much to do here: some code to find a new or existing directory entry,
 a variable to hold the number of directory entries allocated,
@@ -31833,6 +31868,7 @@
 for (i=3; i<= max_section_no;i++)
   if (dir[i].file_name!=NULL && strcmp(dir[i].file_name,file_name)==0)
     return i;
+
 @ @<Allocate a new directory entry@>=
   i = max_section_no;
   i++;
@@ -31851,8 +31887,11 @@
     (S)=_n;                           \
   }                                   \
 }
+
+
 @ @<Hi\TeX\ variables@>=
 static int dir_entries=4;
+
 @ @<Hi\TeX\ auxiliar routines@>=
 static uint16_t hnew_file_section(char *file_name)
 { uint16_t i;
@@ -33965,6 +34004,8 @@
   " -kpathsea-debug=NUMBER"@/
   @t\qquad@>"\t set path searching debugging flags according\n"@/
   @t\qquad@>"\t\t\t to the bits of NUMBER\n"@/
+  " -recorder"@/
+  @t\qquad@>"\t\t enable filename recorder\n"@/
   " [-no]-parse-first-line"@/
   @t\qquad@>"\t disable/enable parsing of the first line of\n"@/
   @t\qquad@>"\t\t\t the input file\n"@/
@@ -34010,6 +34051,7 @@
 static int iniversion=0;
 static int etexp=0;
 static int ltxp=0;
+static int recorder_enabled=0;
 static int parsefirstlinep=-1;
 static int filelineerrorstylep=-1;
 static int interaction_option=-1;
@@ -34035,7 +34077,8 @@
       { "cnf-line",                  1, 0, 0 },@/
       { "ini",                       0, &iniversion, 1 },@/
       { "etex",                      0, &etexp, 1 },@/
-      { "ltx",                     0, &ltxp, 1 },@/
+      { "ltx",                       0, &ltxp, 1 },@/
+      { "recorder",                  0, &recorder_enabled, 1 },@/
       { "parse-first-line",          0, &parsefirstlinep, 1 },@/
       { "no-parse-first-line",       0, &parsefirstlinep, 0 },@/
       { "file-line-error",           0, &filelineerrorstylep, 1 },@/
@@ -34127,7 +34170,7 @@
 
 
 @ To debug the searching done by the \.{kpathsearch} library,
-the following otion can be used.
+the following option can be used.
 The argument value 3 is a good choice to start with.
 
 @<handle the option at |option_index|@>=
@@ -34135,6 +34178,7 @@
       kpathsea_debug |= atoi (optarg);
 
 
+
 @ The remaining options either set a flag and are handled by
 the |getopt_long_only| function or they take a string argument
 and assign it to the corresponding string variable.
@@ -34163,6 +34207,131 @@
   hint_debug_help();
 #endif
 
+
+@ The recorder option can be used to enable the file name recorder.
+It is crucial for getting a reliable list of files used in a given run.
+Many post-processors use it, and it is used in \TeX\ Live for
+checking the format building infrastructure.
+
+When we start the file name recorder,
+we would like to use mkstemp, but it is not portable,
+and doing the autoconfiscation (and providing fallbacks) is more
+than we want to cope with.  So we have to be content with using a
+default name.  We throw in the pid so at least parallel builds might
+work. Windows, however, seems to have no |pid_t|, so instead of storing the
+value returned by |getpid|, we immediately consume it.
+
+@<k\TeX\ auxiliar functions@>=
+static char *recorder_name=NULL;
+static FILE *recorder_file=NULL;
+static void
+recorder_start(void)
+{ char *cwd;
+  char pid_str[MAX_INT_LENGTH];
+  sprintf (pid_str, "%ld", (long) getpid());
+  recorder_name = concat3(kpse_program_name, pid_str, ".fls");
+  if (output_directory) {
+    char *temp = concat3(output_directory, DIR_SEP_STRING, recorder_name);
+    free(recorder_name);
+    recorder_name = temp;
+  }
+  recorder_file = xfopen(recorder_name, FOPEN_W_MODE);
+  cwd = xgetcwd();
+  fprintf(recorder_file, "PWD %s\n", cwd);
+  free(cwd);
+}
+
+@ After we know the log file name, we have used |recorder_change_filename|
+to change the name of the recorder file to the usual thing.
+@<Forward declarations@>=
+static void recorder_change_filename (const char *new_name);
+
+@ Now its time to define this function.
+Unfortunately, we have to explicitly take
+the output directory into account, since the new name we are
+called with does not; it is just the log file name with {\tt .log}
+replaced by {\tt .fls}.
+
+@ @<k\TeX\ auxiliar functions@>=
+static void
+recorder_change_filename (const char *new_name)
+{ char *temp = NULL;
+  if (!recorder_file)
+   return;
+#if defined(_WIN32)
+   fclose (recorder_file); /* An opened file cannot be renamed. */
+#endif /* _WIN32 */
+   if (output_directory) {
+     temp = concat3(output_directory, DIR_SEP_STRING, new_name);
+     new_name = temp;
+   }
+
+   /* On windows, renaming fails if a file with new_name exists. */
+#if defined(_WIN32)
+   remove (new_name); /* Renaming fails if a file with the |new_name| exists. */
+#endif /* _WIN32 */
+   rename(recorder_name, new_name);
+   free(recorder_name);
+   recorder_name = xstrdup(new_name);
+#if defined(_WIN32)
+   recorder_file = xfopen (recorder_name, FOPEN_A_MODE);
+#endif /* _WIN32 */
+   if (temp)
+     free (temp);
+}
+
+@ Now we are ready to record file names. The prefix INPUT is added
+to an input file and the prefiex OUTPUT to an output file.
+But both functions for recording a file name use the same
+function otherwise, which on first use will start the recorder.
+
+@<k\TeX\ auxiliar functions@>=
+static void
+recorder_record_name (const char *pfx, const char *fname)
+{ if (recorder_enabled) {
+    if (!recorder_file)
+      recorder_start();
+    fprintf(recorder_file, "%s %s\n", pfx, fname);
+    fflush(recorder_file);
+  }
+}
+
+
+static void
+recorder_record_input (const char *fname)
+{ recorder_record_name ("INPUT", fname);
+}
+
+static void
+recorder_record_output (const char * fname)
+{ recorder_record_name ("OUTPUT", fname);
+}
+
+@ Because input files are also recorded when writing the optional sections,
+we need the following declaration.
+
+@<Forward declarations@>=
+static void recorder_record_input (const char *fname);
+
+@ In WIN32, texmf.cnf is not recorded in
+the case of {\tt -recorder}, because |parse_options| is executed
+after the start of kpathsea due to special initializations.
+Therefore we record {\tt texmf.cnf} with the following code:
+
+@<record {\tt texmf.cnf}@>=
+if (recorder_enabled) {
+  char *p = kpse_find_file_generic ("texmf.cnf", kpse_cnf_format, 0, 1);
+  if (p && *p) {
+    char *pp = p;
+    while (*p) {
+    recorder_record_input (*p);
+    free (*p);
+    p++;
+    }
+  free (pp);
+}
+
+
 @ When string arguments specify files or directories,
 special care is needed if arguments are quoted and/or contain spaces.
 The function |normalize_quotes| makes shure that arguments containing
@@ -34529,7 +34698,10 @@
   char *new_name=NULL;
   int absolute = kpse_absolute_p(file_name, false);
   if (absolute)
-    return fopen(file_name,file_mode);
+  { f=fopen(file_name,file_mode);
+    if (f!=NULL) recorder_record_output (file_name);
+    return f;
+  }
   if (output_directory)
   { new_name = concat3(output_directory, DIR_SEP_STRING, file_name);
     f = fopen(new_name,file_mode);
@@ -34547,6 +34719,7 @@
   }
   if (f!=NULL && new_name!=NULL)
     update_name_of_file(new_name,(int)strlen(new_name));
+  if (f!=NULL) recorder_record_output ((char*)name_of_file+1);
   if (new_name!=NULL) free(new_name);
   return f;
 }
@@ -34585,6 +34758,7 @@
   if(fname!=NULL)
   {@+
     f= fopen(fname,rwb);
+    if (f!=NULL) recorder_record_input(fname);
     free(fname);@+
   }
   return f;
@@ -34631,7 +34805,10 @@
   char* main_input_file;
   argc = ac;
   argv = av;
-  interaction = error_stop_mode;@/
+  interaction = error_stop_mode;
+  kpse_record_input = recorder_record_input;
+  kpse_record_output = recorder_record_output;
+
   @<parse options@>@;
   @<set the program and engine name@>@;
   @<activate configuration lines@>@;
@@ -34652,6 +34829,7 @@
   enc = kpse_var_value("command_line_encoding");
   get_command_line_args_utf8(enc, &argc, &argv);@/
   parse_options (argc, argv);
+  @<record {\tt texmf.cnf}@>@;
 }
 #else
   parse_options (ac, av);
@@ -34868,6 +35046,7 @@
       if (f != NULL)
       { int r;
         char file_buf[FILE_BUF_SIZE];
+        recorder_record_input(fname);
         md5_init(&st);
         while ((r = fread(&file_buf, 1, FILE_BUF_SIZE, f)) > 0)
           md5_append(&st, (const md5_byte_t *) file_buf, r);



More information about the tex-live-commits mailing list.