texlive[48882] Build/source/texk: dviout-util: import

commits+hironobu at tug.org commits+hironobu at tug.org
Thu Oct 11 16:22:06 CEST 2018


Revision: 48882
          http://tug.org/svn/texlive?view=revision&revision=48882
Author:   hironobu
Date:     2018-10-11 16:22:06 +0200 (Thu, 11 Oct 2018)
Log Message:
-----------
dviout-util: import aminophen/dviout-util at 28bf5ad

Modified Paths:
--------------
    trunk/Build/source/texk/README
    trunk/Build/source/texk/dviout-util/ChangeLog
    trunk/Build/source/texk/dviout-util/Makefile.am
    trunk/Build/source/texk/dviout-util/Makefile.in
    trunk/Build/source/texk/dviout-util/dvispc.c
    trunk/Build/source/texk/dviout-util/dvispc.test

Added Paths:
-----------
    trunk/Build/source/texk/dviout-util/tests/longspec.dvi
    trunk/Build/source/texk/dviout-util/tests/longspec.tex
    trunk/Build/source/texk/dviout-util/tests/longspecout.dvi

Modified: trunk/Build/source/texk/README
===================================================================
--- trunk/Build/source/texk/README	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/README	2018-10-11 14:22:06 UTC (rev 48882)
@@ -49,6 +49,7 @@
 
 dviout-util - by Japanese TeX Development Community (Hironobu, Takuji et al.)
   https://github.com/texjporg/tex-jp-build
+  but also: https://github.com/aminophen/dviout-util
 
 dvipdfm-x - maintained here, by us, contains
   dvipdfmx

Modified: trunk/Build/source/texk/dviout-util/ChangeLog
===================================================================
--- trunk/Build/source/texk/dviout-util/ChangeLog	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/dviout-util/ChangeLog	2018-10-11 14:22:06 UTC (rev 48882)
@@ -1,3 +1,11 @@
+2018-10-11  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* dvispc.c: Support page-independence even with long
+	specials. Use MAX_... constants for error messages.
+	* dvispc.test: Test long specials.
+	* tests/longspec.{tex,dvi}, tests/longspecout.dvi: New tests.
+	* Makefile.am: Adjusted.
+
 2018-10-10  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* dvispc.c: Clean up code, more comments. Mostly revert

Modified: trunk/Build/source/texk/dviout-util/Makefile.am
===================================================================
--- trunk/Build/source/texk/dviout-util/Makefile.am	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/dviout-util/Makefile.am	2018-10-11 14:22:06 UTC (rev 48882)
@@ -30,12 +30,13 @@
 EXTRA_DIST = $(TESTS)
 
 ## dvispc.test
-EXTRA_DIST += \
-	tests/test.tex tests/test.dvi \
-	tests/oldindep.tex tests/oldindep.dvi \
-	tests/test.spc tests/testout.dvi tests/oldindepout.dvi
-DISTCLEANFILES = x*test.spc x*testa.txt x*testax.dvi \
-	x*oldindepout.dvi x*testout.dvi
+EXTRA_DIST += tests/test.spc \
+	tests/test.tex tests/test.dvi tests/testout.dvi \
+	tests/oldindep.tex tests/oldindep.dvi tests/oldindepout.dvi \
+	tests/longspec.tex tests/longspec.dvi tests/longspecout.dvi
+DISTCLEANFILES = x*test.spc \
+	x*testa.txt x*testax.dvi \
+	x*testout.dvi x*oldindepout.dvi x*longspecout.dvi
 
 ## chkdvifont.test
 EXTRA_DIST += tests/test.cfn \

Modified: trunk/Build/source/texk/dviout-util/Makefile.in
===================================================================
--- trunk/Build/source/texk/dviout-util/Makefile.in	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/dviout-util/Makefile.in	2018-10-11 14:22:06 UTC (rev 48882)
@@ -559,14 +559,15 @@
 dvispc_LDADD = $(PTEXENC_LIBS) $(LDADD)
 dist_man1_MANS = dvispc.man chkdvifont.man
 TESTS = dvispc.test chkdvifont.test
-EXTRA_DIST = $(TESTS) tests/test.tex tests/test.dvi tests/oldindep.tex \
-	tests/oldindep.dvi tests/test.spc tests/testout.dvi \
-	tests/oldindepout.dvi tests/test.cfn tests/jis.tfm \
+EXTRA_DIST = $(TESTS) tests/test.spc tests/test.tex tests/test.dvi \
+	tests/testout.dvi tests/oldindep.tex tests/oldindep.dvi \
+	tests/oldindepout.dvi tests/longspec.tex tests/longspec.dvi \
+	tests/longspecout.dvi tests/test.cfn tests/jis.tfm \
 	tests/jis.cfn tests/eufm10.tfm tests/eufm10.cfn tests/cmr10.pk \
 	tests/cmr10.cfn tests/upjisr-h.vf tests/upsjir-h.cfn
-DISTCLEANFILES = x*test.spc x*testa.txt x*testax.dvi x*oldindepout.dvi \
-	x*testout.dvi test.dvi xtest.cfn xjis.cfn xeufm10.cfn \
-	xeufm10.ed.cfn xcmr10.cfn xupjisr-h.cfn
+DISTCLEANFILES = x*test.spc x*testa.txt x*testax.dvi x*testout.dvi \
+	x*oldindepout.dvi x*longspecout.dvi test.dvi xtest.cfn \
+	xjis.cfn xeufm10.cfn xeufm10.ed.cfn xcmr10.cfn xupjisr-h.cfn
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 

Modified: trunk/Build/source/texk/dviout-util/dvispc.c
===================================================================
--- trunk/Build/source/texk/dviout-util/dvispc.c	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/dviout-util/dvispc.c	2018-10-11 14:22:06 UTC (rev 48882)
@@ -221,15 +221,14 @@
 int f_dtl = 0;
 
 enum {
-    EXE2NONE, EXE2MODIFY, EXE2CHECK, EXE2SPECIAL, EXE2TEXT, EXE2DVI
+    EXE2MODIFY, EXE2CHECK, EXE2SPECIAL, EXE2TEXT, EXE2DVI
 };
 
-int  f_mode = EXE2NONE; /*  1: -c modify
-                            2: -d report only
-                            3: -s specials
-                            4: -a to_Text
-                            5: -x to_DVI   */
-/* default mode will be set in main() to be page_indep */
+int f_mode = EXE2MODIFY; /*  0: -c modify
+                             1: -d report only
+                             2: -s specials
+                             3: -a to_Text
+                             4: -x to_DVI   */
 
 int f_debug = 0;        /* -v */
 int f_overwrite = 0;
@@ -610,8 +609,6 @@
        cf.  argc = (number of all arguments) + 1
         {argv[0] is the program name itself} ^^^ */
 
-    if(!f_mode) f_mode = EXE2MODIFY; /* default mode */
-
     fnum = 0;
     if(!isatty(fileno(stdin))){  /* if stdin is redirected from a file */
         fp_in = stdin;
@@ -796,11 +793,16 @@
     int len;
     len = strlen(sp);
 
-    if(len > 255){
+    if(len <= 0xff)
+        fprintf(fp, "%c%c%s", XXX1, len, sp);
+    else if(len <= 0xffffffff){
+        fprintf(fp, "%c", XXX1+3);
+        write_long(len, fp);
+        fprintf(fp, "%s", sp);
+    }else{
         fprintf(stderr, "Too long special:\n%s\n", sp);
         Exit(1);
     }
-    fprintf(fp, "%c%c%s", XXX1, len, sp);
 }
 
 
@@ -1368,8 +1370,10 @@
         return;
     }
     if(strstr(sp, "push")){
-        if(color_depth >= MAX_COLOR)
-            error("Too many color push > 512");
+        if(color_depth >= MAX_COLOR){
+            fprintf(stderr, "Too many color push > %d\n", MAX_COLOR);
+            Exit(1);
+        }
         if(color_depth){
             s = color_pt[color_depth-1];
             s += strlen(s) + 1;
@@ -1393,8 +1397,10 @@
     char *s;
 
     /* copied from "color push" routine of sp_color */
-    if(pdf_color_depth >= MAX_COLOR)
-        error("Too many pdf:bcolor > 512");
+    if(pdf_color_depth >= MAX_COLOR){
+        fprintf(stderr, "Too many pdf:bcolor > %d\n", MAX_COLOR);
+        Exit(1);
+    }
     if(pdf_color_depth){
         s = pdf_color_pt[pdf_color_depth-1];
         s += strlen(s) + 1;
@@ -1430,8 +1436,10 @@
 void sp_pdf_bann(char *sp)
 {
     char *s;
-    if(pdf_annot_depth >= MAX_ANNOT)
-        error("Too many pdf:bann > 8");
+    if(pdf_annot_depth >= MAX_ANNOT){
+        fprintf(stderr, "Too many pdf:bann > %d\n", MAX_ANNOT);
+        Exit(1);
+    }
     if(pdf_annot_depth){
         s = pdf_annot_pt[pdf_annot_depth-1];
         s += strlen(s) + 1;

Modified: trunk/Build/source/texk/dviout-util/dvispc.test
===================================================================
--- trunk/Build/source/texk/dviout-util/dvispc.test	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/dviout-util/dvispc.test	2018-10-11 14:22:06 UTC (rev 48882)
@@ -43,24 +43,25 @@
 
 # not working as expected only for test ??
 #./dvispc -a $testdir/test.dvi | ./dvispc -x x2testax.dvi && \
-#  cmp $testdir/test.dvi x2testax.dvi && echo || exit 5
+#  cmp $testdir/test.dvi x2testax.dvi && echo || exit 6
 
 ./dvispc -a $testdir/test.dvi | ./dvispc -x > x2testax.dvi && \
-  cmp $testdir/test.dvi x2testax.dvi && echo || exit 5
+  cmp $testdir/test.dvi x2testax.dvi && echo || exit 7
 
 
 ## EXE2INDEP
 
 ./dvispc -c $testdir/oldindep.dvi xoldindepout.dvi && \
-  cmp $testdir/oldindepout.dvi xoldindepout.dvi && echo || exit 6
+  cmp $testdir/oldindepout.dvi xoldindepout.dvi && echo || exit 8
 
 ./dvispc -c $testdir/oldindep.dvi > x1oldindepout.dvi && \
-  cmp $testdir/oldindepout.dvi x1oldindepout.dvi && echo || exit 7
+  cmp $testdir/oldindepout.dvi x1oldindepout.dvi && echo || exit 9
 
 ./dvispc && echo || exit 0
 
 # the following tests include
 #   * correction of dvipdfmx-style specials
+#   * correction of long (>255) specials
 #   * correction in reversed order which requires prior scanning
 # so will not pass for old version written by SHIMA.
 # that version can be distinguished from the new version by
@@ -67,10 +68,10 @@
 # exit code 1 for usage without argument. (the above line did it!)
 
 ./dvispc -c $testdir/test.dvi xtestout.dvi && \
-  cmp $testdir/testout.dvi xtestout.dvi && echo || exit 8
+  cmp $testdir/testout.dvi xtestout.dvi && echo || exit 10
 
 ./dvispc -c $testdir/test.dvi > x1testout.dvi && \
-  cmp $testdir/testout.dvi x1testout.dvi && echo || exit 9
+  cmp $testdir/testout.dvi x1testout.dvi && echo || exit 11
 
 ## invalid usage
 #./dvispc -c < $testdir/test.dvi x2testout.dvi && \
@@ -78,8 +79,15 @@
 
 ## stdin is a DVI, random access may not be supported, no test
 #./dvispc -c < $testdir/test.dvi > x3testout.dvi && \
-#  cmp $testdir/testout.dvi x3testout.dvi && echo || exit 10
+#  cmp $testdir/testout.dvi x3testout.dvi && echo || exit 12
 
+./dvispc -c $testdir/longspec.dvi xlongspecout.dvi && \
+  cmp $testdir/longspecout.dvi xlongspecout.dvi && echo || exit 13
 
+## check default is -c
+./dvispc $testdir/longspec.dvi x1longspecout.dvi && \
+  cmp $testdir/longspecout.dvi x1longspecout.dvi && echo || exit 14
+
+
 exit 0
 

Added: trunk/Build/source/texk/dviout-util/tests/longspec.dvi
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/dviout-util/tests/longspec.dvi
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/longspec.dvi	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/dviout-util/tests/longspec.dvi	2018-10-11 14:22:06 UTC (rev 48882)

Property changes on: trunk/Build/source/texk/dviout-util/tests/longspec.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/x-dvi
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/longspec.tex
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/longspec.tex	                        (rev 0)
+++ trunk/Build/source/texk/dviout-util/tests/longspec.tex	2018-10-11 14:22:06 UTC (rev 48882)
@@ -0,0 +1,9 @@
+\documentclass[dvipdfmx]{article}
+\usepackage{hyperref}
+\begin{document}
+\noindent
+% length of special: 282 (0x0000011A)
+\href{https://www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex?revision=20236&view=markup}{%
+A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\%
+A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A\\A}
+\end{document}


Property changes on: trunk/Build/source/texk/dviout-util/tests/longspec.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/longspecout.dvi
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/dviout-util/tests/longspecout.dvi
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/longspecout.dvi	2018-10-11 00:23:02 UTC (rev 48881)
+++ trunk/Build/source/texk/dviout-util/tests/longspecout.dvi	2018-10-11 14:22:06 UTC (rev 48882)

Property changes on: trunk/Build/source/texk/dviout-util/tests/longspecout.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/x-dvi
\ No newline at end of property


More information about the tex-live-commits mailing list