texlive[44637] Build/source/texk/seetexk: texk/seetexk: Support pTeX

commits+takuji at tug.org commits+takuji at tug.org
Mon Jun 19 15:53:02 CEST 2017


Revision: 44637
          http://tug.org/svn/texlive?view=revision&revision=44637
Author:   takuji
Date:     2017-06-19 15:53:02 +0200 (Mon, 19 Jun 2017)
Log Message:
-----------
texk/seetexk: Support pTeX dvi by H. Yamashita-san

Modified Paths:
--------------
    trunk/Build/source/texk/seetexk/ChangeLog
    trunk/Build/source/texk/seetexk/Makefile.am
    trunk/Build/source/texk/seetexk/Makefile.in
    trunk/Build/source/texk/seetexk/dvibook.c
    trunk/Build/source/texk/seetexk/dvibook.man
    trunk/Build/source/texk/seetexk/dviclass.c
    trunk/Build/source/texk/seetexk/dviclass.h
    trunk/Build/source/texk/seetexk/dvicodes.h
    trunk/Build/source/texk/seetexk/dviconcat.c
    trunk/Build/source/texk/seetexk/dviselect.c
    trunk/Build/source/texk/seetexk/dvitodvi.c
    trunk/Build/source/texk/seetexk/seetexk.test

Added Paths:
-----------
    trunk/Build/source/texk/seetexk/tests/playbook.3
    trunk/Build/source/texk/seetexk/tests/playbook.4
    trunk/Build/source/texk/seetexk/tests/playconc.3
    trunk/Build/source/texk/seetexk/tests/playdvi.3
    trunk/Build/source/texk/seetexk/tests/playsel.3
    trunk/Build/source/texk/seetexk/tests/playtate.dvi

Modified: trunk/Build/source/texk/seetexk/ChangeLog
===================================================================
--- trunk/Build/source/texk/seetexk/ChangeLog	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/ChangeLog	2017-06-19 13:53:02 UTC (rev 44637)
@@ -1,3 +1,16 @@
+2017-06-18  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* dvibook.c, dviclass.[ch], dvicodes.h, dviconcat.c,
+	dviselect.c, dvitodvi.c: Add support for pTeX tate-kumi
+	DVI. The patch is based on the work by H. Kagotani in 1992.
+	* dvibook.c: Add -r option to generate right-hand side binding
+	books. It would be useful for Japanese tate-kumi documents.
+	* dvibook.man: Add -r option.
+	* seetexk.test: Add tests for pTeX support.
+	* playbook.3, playbook.4, playconc.3, playdvi.3, playsel.3,
+	playtate.dvi: Added.
+	* Makefile.am: Adjusted for pTeX support.
+
 2017-06-11  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* dvibook.c, dviconcat.c, dviselect.c, dvitodvi.c:

Modified: trunk/Build/source/texk/seetexk/Makefile.am
===================================================================
--- trunk/Build/source/texk/seetexk/Makefile.am	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/Makefile.am	2017-06-19 13:53:02 UTC (rev 44637)
@@ -3,7 +3,7 @@
 ## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 ##
-AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DUNIX -DKPATHSEA
+AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DUNIX -DKPATHSEA -DASCIIPTEX
 AM_CFLAGS = $(WARNING_CFLAGS)
 
 noinst_LIBRARIES = libtex.a
@@ -52,6 +52,8 @@
 ## seetexk.test
 EXTRA_DIST += \
 	tests/play.dvi tests/playbook.2 tests/playconc.2 \
-	tests/playdvi.2 tests/playnot.2 tests/playsel.2
-DISTCLEANFILES = play*.2 play*.dvi
+	tests/playdvi.2 tests/playnot.2 tests/playsel.2 \
+	tests/playtate.dvi tests/playbook.3 tests/playbook.4 \
+	tests/playconc.3 tests/playdvi.3 tests/playsel.3
+DISTCLEANFILES = play*.2 play*.3 play*.4 play*.dvi
 

Modified: trunk/Build/source/texk/seetexk/Makefile.in
===================================================================
--- trunk/Build/source/texk/seetexk/Makefile.in	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/Makefile.in	2017-06-19 13:53:02 UTC (rev 44637)
@@ -572,7 +572,7 @@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DUNIX -DKPATHSEA
+AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DUNIX -DKPATHSEA -DASCIIPTEX
 AM_CFLAGS = $(WARNING_CFLAGS)
 noinst_LIBRARIES = libtex.a
 libtex_a_SOURCES = \
@@ -601,8 +601,10 @@
 dist_man1_MANS = dvibook.man dviconcat.man dviselect.man dvitodvi.man
 TESTS = seetexk.test
 EXTRA_DIST = $(TESTS) tests/play.dvi tests/playbook.2 tests/playconc.2 \
-	tests/playdvi.2 tests/playnot.2 tests/playsel.2
-DISTCLEANFILES = play*.2 play*.dvi
+	tests/playdvi.2 tests/playnot.2 tests/playsel.2 \
+	tests/playtate.dvi tests/playbook.3 tests/playbook.4 \
+	tests/playconc.3 tests/playdvi.3 tests/playsel.3
+DISTCLEANFILES = play*.2 play*.3 play*.4 play*.dvi
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 

Modified: trunk/Build/source/texk/seetexk/dvibook.c
===================================================================
--- trunk/Build/source/texk/seetexk/dvibook.c	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dvibook.c	2017-06-19 13:53:02 UTC (rev 44637)
@@ -107,6 +107,10 @@
 
 i32	InputPageNumber;	/* current absolute page in old DVI file */
 int	NumberOfOutputPages;	/* number of pages in new DVI file */
+#ifdef	ASCIIPTEX
+int	ptexdvi;		/* true if dvi file is extended (TATEKUMI) */
+int	inverse;		/* true if 'right-hand side binding' */
+#endif
 
 i32	Numerator;		/* numerator from DVI file */
 i32	Denominator;		/* denominator from DVI file */
@@ -142,6 +146,9 @@
 static void PutFontSelector(i32 index);
 static void ScanDVIFile(void);
 static void HandleDVIFile(void);
+#ifdef	ASCIIPTEX
+static void HandleDVIFileRighty(void);
+#endif
 static int HandlePage(void);
 static void PutEmptyPage(void);
 
@@ -293,6 +300,11 @@
 
 	putbyte(outf, DVI_POSTPOST);
 	PutLong(outf, StartOfLastPage);	/* actually start of postamble */
+#ifdef	ASCIIPTEX
+	if(ptexdvi)
+		putbyte(outf, DVI_PTEXVERSION);
+	else
+#endif
 	putbyte(outf, DVI_VERSION);
 	putbyte(outf, DVI_FILLER);
 	putbyte(outf, DVI_FILLER);
@@ -388,10 +400,17 @@
 
 	Signature = 0;
 
+#ifdef	ASCIIPTEX
+	inverse = 0;
+#endif
 	ProgName = *argv;
 	setbuf(stderr, serrbuf);
 
+#ifdef	ASCIIPTEX
+	while ((c = getopt(argc, argv, "i:o:s:qr")) != EOF) {
+#else
 	while ((c = getopt(argc, argv, "i:o:s:q")) != EOF) {
+#endif
 		switch (c) {
 
 		case 'q':	/* silent */
@@ -420,12 +439,23 @@
 			   error(1, -1,
 				 "-s parameter must be a multiple of 4");
 			break;
+#ifdef	ASCIIPTEX
+		case 'r':
+			inverse = 1;
+			break;
+#endif
 
 		case '?':
 usage:
+#ifdef	ASCIIPTEX
 			(void) fprintf(stderr, "\
+Usage: %s [-s signature] [-q] [-i infile] [-o outfile] [-r] [infile [outfile]]\n",
+				ProgName);
+#else
+			(void) fprintf(stderr, "\
 Usage: %s [-s signature] [-q] [-i infile] [-o outfile] [infile [outfile]]\n",
 				ProgName);
+#endif
 			(void) fflush(stderr);
 			exit(1);
 		}
@@ -465,10 +495,18 @@
 	if ((inf = SeekFile(inf)) == NULL) {
 	        error(1, 0, "can't seek file");
 	}
+#ifdef	ASCIIPTEX
+	ptexdvi = 0;
+#endif
 	InputPageNumber = 0;
 	StartOfLastPage = -1;
 	HandlePreAmble();
 	ScanDVIFile();
+#ifdef	ASCIIPTEX
+	if(inverse)
+		HandleDVIFileRighty();
+	else
+#endif
 	HandleDVIFile();
 	HandlePostAmble();
 	if (!SFlag)
@@ -659,7 +697,12 @@
 	0,			/* DVI_PRE */
 	0,			/* DVI_POST */
 	0,			/* DVI_POSTPOST */
+#ifdef	ASCIIPTEX
+	0, 0, 0, 0, 0,		/* 250 .. 254 */
+	0,			/* DVI_DIR */
+#else
 	0, 0, 0, 0, 0, 0,	/* 250 .. 255 */
+#endif
 };
 
 /*
@@ -710,11 +753,53 @@
 				     "can't seek page %d", ActualPage+1);
 		        HandlePage();
 		} else
+		        PutEmptyPage();
+	}
+	if (fseek(inf, StartOfPage[InputPageNumber]+1, 0) == -1)
+	        error(1, -1, "can't seek last page");
+}
+
+#ifdef	ASCIIPTEX
+/*
+ * Here we read the input DVI file and write relevant pages to the
+ * output DVI file. We also keep track of font changes, handle font
+ * definitions, and perform some other housekeeping.
+ */
+static void
+HandleDVIFileRighty(void)
+{
+        int CurrentPage, ActualPage, MaxPage;
+
+	UseThisPage = 1;
+
+	MaxPage = InputPageNumber + (4-InputPageNumber%4)%4;
+
+	if (!Signature)
+	        Signature = MaxPage;
+	for (CurrentPage = 0; CurrentPage < MaxPage; CurrentPage++) {
+	        ActualPage = CurrentPage - CurrentPage%Signature;
+	        switch (CurrentPage%4) {
+		case 1:	/* case 0: */
+		case 2: /* case 3: */
+		   ActualPage += Signature-1-(CurrentPage%Signature)/2;
+		   break;
+		case 0:	/* case 1: */
+		case 3: /* case 2: */
+		   ActualPage += (CurrentPage%Signature)/2;
+		   break;
+		}
+	        if (ActualPage < InputPageNumber) {
+		        if (fseek(inf, StartOfPage[ActualPage], 0) == -1)
+		               error(1, -1,
+				     "can't seek page %d", ActualPage+1);
+		        HandlePage();
+		} else
     	                PutEmptyPage();
 	}
 	if (fseek(inf, StartOfPage[InputPageNumber]+1, 0) == -1)
 	        error(1, -1, "can't seek last page");
 }
+#endif
 
 static int
 HandlePage(void)
@@ -845,6 +930,16 @@
 				HandleFontDef(p);
 				continue;
 
+#ifdef	ASCIIPTEX
+			case DT_DIR:
+				ptexdvi = 1;
+
+				putbyte(outf, c);
+				putbyte(outf, p);
+				CurrentPosition += 2;
+				continue;
+#endif
+
 			default:
 				panic("HandleDVIFile DVI_DT(%d)=%d",
 				      c, DVI_DT(c));

Modified: trunk/Build/source/texk/seetexk/dvibook.man
===================================================================
--- trunk/Build/source/texk/seetexk/dvibook.man	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dvibook.man	2017-06-19 13:53:02 UTC (rev 44637)
@@ -10,6 +10,8 @@
 ] [
 .B \-s\fI<num>
 ] [
+.B \-r
+] [
 .B \-i
 .I infile
 ] [
@@ -35,6 +37,12 @@
 whole file. Extra blank sides will be added if the file does not contain a
 multiple of four pages.
 .PP
+By default, dvibook rearranges the pages into left\-hand side binding
+signatures; the
+.I \-r
+option switches to right\-hand side binding signatures. This might be useful
+for pTeX vertical writing (tate\-kumi) documents.
+.PP
 Dvibook normally prints the page numbers of the pages rearranged; the
 .I \-q
 option suppresses this.

Modified: trunk/Build/source/texk/seetexk/dviclass.c
===================================================================
--- trunk/Build/source/texk/seetexk/dviclass.c	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dviclass.c	2017-06-19 13:53:02 UTC (rev 44637)
@@ -28,6 +28,9 @@
 
 /* shorthand---in lowercase for contrast (read on!) */
 #define	four(x)		x, x, x, x
+#ifdef ASCIIPTEX
+#define	five(x)		four(x), x
+#endif /* ASCIIPTEX */
 #define	six(x)		four(x), x, x
 #define	sixteen(x)	four(x), four(x), four(x), four(x)
 #define	sixty_four(x)	sixteen(x), sixteen(x), sixteen(x), sixteen(x)
@@ -72,7 +75,12 @@
 	DPL_NONE,		/* DVI_PRE */
 	DPL_NONE,		/* DVI_POST */
 	DPL_NONE,		/* DVI_POSTPOST */
+#ifdef ASCIIPTEX
+	five(DPL_NONE),		/* 250 through 254 */
+	DPL_UNS1,		/* DVI_DIR */
+#else /* !ASCIIPTEX */
 	six(DPL_NONE)		/* 250 through 255 */
+#endif /* !ASCIIPTEX */
 };
 
 char dvi_dt[256] = {
@@ -104,5 +112,10 @@
 	DT_PRE,			/* DVI_PRE */
 	DT_POST,		/* DVI_POST */
 	DT_POSTPOST,		/* DVI_POSTPOST */
+#ifdef ASCIIPTEX
+	five(DT_UNDEF),		/* 250 through 254 */
+	DT_DIR,			/* DVI_DIR */
+#else /* !ASCIIPTEX */
 	six(DT_UNDEF)		/* 250 through 255 */
+#endif /* !ASCIIPTEX */
 };

Modified: trunk/Build/source/texk/seetexk/dviclass.h
===================================================================
--- trunk/Build/source/texk/seetexk/dviclass.h	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dviclass.h	2017-06-19 13:53:02 UTC (rev 44637)
@@ -61,7 +61,12 @@
 #define	DT_PRE		24
 #define	DT_POST		25
 #define	DT_POSTPOST	26
+#ifdef ASCIIPTEX
+#define	DT_DIR		27
+#define	DT_UNDEF	28
+#else /* !ASCIIPTEX */
 #define	DT_UNDEF	27
+#endif /* !ASCIIPTEX */
 
 /*
  * Symbolic names for parameter lengths, obtained via the macro

Modified: trunk/Build/source/texk/seetexk/dvicodes.h
===================================================================
--- trunk/Build/source/texk/seetexk/dvicodes.h	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dvicodes.h	2017-06-19 13:53:02 UTC (rev 44637)
@@ -24,6 +24,11 @@
 
 #define DVI_VERSION	2	/* version number that should appear in
 				   pre- and post-ambles */
+#ifdef ASCIIPTEX
+#define DVI_PTEXVERSION	3	/* version number that should appear in
+				   post-ambles which are contained in
+				   dvi files using DIR command*/
+#endif /* ASCIIPTEX */
 
 #define DVI_SET1	128	/* set character, 1 byte param */
 #define DVI_SET2	129	/* set character, 2 byte param */
@@ -38,8 +43,13 @@
 #define DVI_NOP		138	/* no-op */
 #define DVI_BOP		139	/* begin page */
 #define DVI_EOP		140	/* end page */
+#ifdef ASCIIPTEX
+#define DVI_PUSH	141	/* push h,v,w,x,y,z,d */
+#define DVI_POP		142	/* pop  h,v,w,x,y,z,d */
+#else /* !ASCIIPTEX */
 #define DVI_PUSH	141	/* push h,v,w,x,y,z */
 #define DVI_POP		142	/* pop  h,v,w,x,y,z */
+#endif /* !ASCIIPTEX */
 #define DVI_RIGHT1	143	/* move right, 1 byte signed param */
 #define DVI_RIGHT2	144	/* move right, 2 byte signed param */
 #define DVI_RIGHT3	145	/* etc */
@@ -85,4 +95,7 @@
 #define DVI_PRE		247	/* preamble */
 #define DVI_POST	248	/* postamble */
 #define DVI_POSTPOST	249	/* end of postamble */
+#ifdef ASCIIPTEX
+#define DVI_DIR		255	/* d (direction) = 1 byte signed param */
+#endif /* ASCIIPTEX */
 #define DVI_FILLER	223	/* filler bytes at end of dvi file */

Modified: trunk/Build/source/texk/seetexk/dviconcat.c
===================================================================
--- trunk/Build/source/texk/seetexk/dviconcat.c	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dviconcat.c	2017-06-19 13:53:02 UTC (rev 44637)
@@ -85,6 +85,9 @@
 long	CurrentPosition;	/* The current position of the file */
 
 int	NumberOfOutputPages;	/* number of pages in new DVI file */
+#ifdef ASCIIPTEX
+int	ptexdvi;		/* true => dvi format is extended (TATEKUMI) */
+#endif /* ASCIIPTEX */
 
 i32	Numerator;		/* numerator from current DVI file */
 i32	Denominator;		/* denominator from current DVI file */
@@ -225,6 +228,11 @@
 
 	putbyte(outf, DVI_POSTPOST);
 	PutLong(outf, postpos);
+#ifdef ASCIIPTEX
+	if (ptexdvi)
+	  putbyte(outf, DVI_PTEXVERSION);
+	else
+#endif /* ASCIIPTEX */
 	putbyte(outf, DVI_VERSION);
 	putbyte(outf, DVI_FILLER);
 	putbyte(outf, DVI_FILLER);
@@ -372,6 +380,9 @@
 {
 	static int started;
 
+#ifdef	ASCIIPTEX
+	ptexdvi = 0;
+#endif
 	DVIFileName = name;
 	inf = fp;
 	if (HandlePreAmble(started ? 0 : 1))
@@ -664,7 +675,12 @@
 	0,			/* DVI_PRE */
 	0,			/* DVI_POST */
 	0,			/* DVI_POSTPOST */
+#ifdef ASCIIPTEX
+	0, 0, 0, 0, 0,		/* 250 .. 254 */
+	0,			/* DVI_DIR */
+#else /* !ASCIIPTEX */
 	0, 0, 0, 0, 0, 0,	/* 250 .. 255 */
+#endif /* !ASCIIPTEX */
 };
 
 /*
@@ -751,6 +767,16 @@
 				HandleFontDef(p);
 				continue;
 
+#ifdef ASCIIPTEX
+			case DT_DIR:
+				ptexdvi = 1;
+
+				putbyte(outf, c);
+				putbyte(outf, p);
+				CurrentPosition += 2;
+				continue;
+#endif /* ASCIIPTEX */
+
 			default:
 				panic("HandleDVIFile DVI_DT(%d)=%d",
 				    c, DVI_DT(c));

Modified: trunk/Build/source/texk/seetexk/dviselect.c
===================================================================
--- trunk/Build/source/texk/seetexk/dviselect.c	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dviselect.c	2017-06-19 13:53:02 UTC (rev 44637)
@@ -145,6 +145,9 @@
 long	CurrentPosition;	/* The current position of the file */
 
 int	UseThisPage;		/* true => current page is selected */
+#ifdef ASCIIPTEX
+int	ptexdvi;		/* true => dvi format is extended (TATEKUMI) */
+#endif /* ASCIIPTEX */
 
 i32	InputPageNumber;	/* current absolute page in old DVI file */
 int	NumberOfOutputPages;	/* number of pages in new DVI file */
@@ -396,6 +399,11 @@
 
 	putbyte(outf, DVI_POSTPOST);
 	PutLong(outf, StartOfLastPage);	/* actually start of postamble */
+#ifdef ASCIIPTEX
+	if (ptexdvi)
+	  putbyte(outf, DVI_PTEXVERSION);
+	else
+#endif /* ASCIIPTEX */
 	putbyte(outf, DVI_VERSION);
 	putbyte(outf, DVI_FILLER);
 	putbyte(outf, DVI_FILLER);
@@ -585,6 +593,9 @@
 
 	StartOfLastPage = -1;
 	ReadPreAmble();
+#ifdef ASCIIPTEX
+	ptexdvi = 0;
+#endif /* ASCIIPTEX */
 	HandleDVIFile();
 	HandlePostAmble();
 	if (NumberOfOutputPages > 0) {
@@ -952,7 +963,12 @@
 	0,			/* DVI_PRE */
 	0,			/* DVI_POST */
 	0,			/* DVI_POSTPOST */
+#ifdef ASCIIPTEX
+	0, 0, 0, 0, 0,		/* 250 .. 254 */
+	0,			/* DVI_DIR */
+#else /* !ASCIIPTEX */
 	0, 0, 0, 0, 0, 0,	/* 250 .. 255 */
+#endif /* !ASCIIPTEX */
 };
 
 /*
@@ -1089,6 +1105,18 @@
 				HandleFontDef(p);
 				continue;
 
+#ifdef ASCIIPTEX
+			case DT_DIR:
+				if (!UseThisPage)
+					continue;
+				ptexdvi = 1;
+
+				putbyte(outf, c);
+				putbyte(outf, p);
+				CurrentPosition += 2;
+				continue;
+#endif /* ASCIIPTEX */
+
 			default:
 				panic("HandleDVIFile DVI_DT(%d)=%d",
 				      c, DVI_DT(c));

Modified: trunk/Build/source/texk/seetexk/dvitodvi.c
===================================================================
--- trunk/Build/source/texk/seetexk/dvitodvi.c	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/dvitodvi.c	2017-06-19 13:53:02 UTC (rev 44637)
@@ -114,6 +114,9 @@
 
 i32	InputPageNumber;	/* current absolute page in old DVI file */
 int	NumberOfOutputPages;	/* number of pages in new DVI file */
+#ifdef	ASCIIPTEX
+int	ptexdvi;		/* true if dvi file is extended (TATEKUMI) */
+#endif
 
 i32	Numerator;		/* numerator from DVI file */
 i32	Denominator;		/* denominator from DVI file */
@@ -520,6 +523,11 @@
 
 	putbyte(outf, DVI_POSTPOST);
 	PutLong(outf, StartOfLastPage);	/* actually start of postamble */
+#ifdef	ASCIIPTEX
+	if(ptexdvi)
+		putbyte(outf, DVI_PTEXVERSION);
+	else
+#endif
 	putbyte(outf, DVI_VERSION);
 	putbyte(outf, DVI_FILLER);
 	putbyte(outf, DVI_FILLER);
@@ -708,6 +716,9 @@
 	        error(1, 0, "can't seek file");
 	}
 
+#ifdef	ASCIIPTEX
+	ptexdvi = 0;
+#endif
 	InputPageNumber = 0;
 	StartOfLastPage = -1;
 	HandlePreAmble();
@@ -914,7 +925,12 @@
 	0,			/* DVI_PRE */
 	0,			/* DVI_POST */
 	0,			/* DVI_POSTPOST */
+#ifdef	ASCIIPTEX
+	0, 0, 0, 0, 0,	 	/* 250 .. 254 */
+	0,			/* DVI_DIR */
+#else
 	0, 0, 0, 0, 0, 0,	/* 250 .. 255 */
+#endif
 };
 
 static int
@@ -1046,6 +1062,18 @@
 				HandleFontDef(p);
 				continue;
 
+#ifdef	ASCIIPTEX
+			case DT_DIR:
+				if (!UseThisPage)
+					continue;
+				ptexdvi = 1;
+
+				putbyte(outf, c);
+				putbyte(outf, p);
+				CurrentPosition += 2;
+				continue;
+#endif
+
 			default:
 				panic("HandleDVIFile DVI_DT(%d)=%d",
 				      c, DVI_DT(c));

Modified: trunk/Build/source/texk/seetexk/seetexk.test
===================================================================
--- trunk/Build/source/texk/seetexk/seetexk.test	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/seetexk.test	2017-06-19 13:53:02 UTC (rev 44637)
@@ -41,8 +41,30 @@
 	&& diff playsel.2 $srcdir/tests/playsel.2 \
 	|| exit 1
 
+rm -rf play*
+./dviselect =25 <$srcdir/tests/play.dvi >playsel.dvi \
+	2>playsel.2 \
+	&& exit 1
+	touch playnot.dvi \
+	&& diff playsel.dvi playnot.dvi \
+	&& diff playsel.2 $srcdir/tests/playnot.2 \
+	|| exit 1
+
+rm -rf play*
+./dviselect =5:15 <$srcdir/tests/play.dvi >playsel.dvi \
+	2>playsel.2 \
+	&& diff playsel.2 $srcdir/tests/playsel.2 \
+	|| exit 1
+
 echo dviselect with stdin and stdout tests OK
 
+./dviselect =5:15 $srcdir/tests/playtate.dvi playselt.dvi \
+	2>playsel.3 \
+	&& diff playsel.3 $srcdir/tests/playsel.3 \
+	|| exit 1
+
+echo dviselect pTeX tests OK
+
 ./dvibook -s4 playsel.dvi playbook.dvi \
 	2>playbook.2 \
 	&& diff playbook.2 $srcdir/tests/playbook.2 \
@@ -51,14 +73,31 @@
 echo dvibook tests OK
 
 rm -f playbook.2
-
 cat playsel.dvi | ./dvibook -s4 >playbook.dvi \
 	2>playbook.2 \
 	&& diff playbook.2 $srcdir/tests/playbook.2 \
 	|| exit 1
 
+rm -f playbook.2
+./dvibook -s4 <playsel.dvi >playbook.dvi \
+	2>playbook.2 \
+	&& diff playbook.2 $srcdir/tests/playbook.2 \
+	|| exit 1
+
 echo dvibook with stdin and stdout tests OK
 
+./dvibook -s4 playselt.dvi playbook.dvi \
+	2>playbook.3 \
+	&& diff playbook.3 $srcdir/tests/playbook.3 \
+	|| exit 1
+
+./dvibook -r -s4 playselt.dvi playbook.dvi \
+	2>playbook.4 \
+	&& diff playbook.4 $srcdir/tests/playbook.4 \
+	|| exit 1
+
+echo dvibook pTeX tests OK
+
 ./dviselect =5:7 $srcdir/tests/play.dvi playsel1.dvi \
 	2>playconc.2 \
 	&& ./dviselect 23:25 $srcdir/tests/play.dvi playsel2.dvi \
@@ -70,6 +109,17 @@
 
 echo dviconcat tests OK
 
+./dviselect =5:7 $srcdir/tests/playtate.dvi playsel1.dvi \
+	2>playconc.3 \
+	&& ./dviselect 23:25 $srcdir/tests/playtate.dvi playsel2.dvi \
+	2>>playconc.3 \
+	&& ./dviconcat -o playconc.dvi playsel2.dvi playsel1.dvi \
+	2>>playconc.3 \
+	&& diff playconc.3 $srcdir/tests/playconc.3 \
+	|| exit 1
+
+echo dviconcat pTeX tests OK
+
 ./dvitodvi '4:500 at 0+1(16.5cm,0)+2(0,28cm)+3(16.5cm,28cm)' playsel.dvi playdvi.dvi \
 	2>playdvi.2 \
 	&& diff playdvi.2 $srcdir/tests/playdvi.2 \
@@ -78,11 +128,23 @@
 echo dvitodvi tests OK
 
 rm -f playdvi.2
-
 cat playsel.dvi | ./dvitodvi '4:500 at 0+1(16.5cm,0)+2(0,28cm)+3(16.5cm,28cm)' -o playdvi.dvi \
 	2>playdvi.2 \
 	&& diff playdvi.2 $srcdir/tests/playdvi.2 \
 	|| exit 1
 
+rm -f playdvi.2
+./dvitodvi '4:500 at 0+1(16.5cm,0)+2(0,28cm)+3(16.5cm,28cm)' -o playdvi.dvi <playsel.dvi \
+	2>playdvi.2 \
+	&& diff playdvi.2 $srcdir/tests/playdvi.2 \
+	|| exit 1
+
 echo dvitodvi reading stdin tests OK
 
+./dvitodvi '4:500 at 0+1(16.5cm,0)+2(0,28cm)+3(16.5cm,28cm)' playselt.dvi playdvi.dvi \
+	2>playdvi.3 \
+	&& diff playdvi.3 $srcdir/tests/playdvi.3 \
+	|| exit 1
+
+echo dvitodvi pTeX tests OK
+

Added: trunk/Build/source/texk/seetexk/tests/playbook.3
===================================================================
--- trunk/Build/source/texk/seetexk/tests/playbook.3	                        (rev 0)
+++ trunk/Build/source/texk/seetexk/tests/playbook.3	2017-06-19 13:53:02 UTC (rev 44637)
@@ -0,0 +1,2 @@
+[18] [15] [16] [17] [22] [19] [20] [21] [*] [23] [24] [25]
+Wrote 12 pages, 1520 bytes


Property changes on: trunk/Build/source/texk/seetexk/tests/playbook.3
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/seetexk/tests/playbook.4
===================================================================
--- trunk/Build/source/texk/seetexk/tests/playbook.4	                        (rev 0)
+++ trunk/Build/source/texk/seetexk/tests/playbook.4	2017-06-19 13:53:02 UTC (rev 44637)
@@ -0,0 +1,2 @@
+[15] [18] [17] [16] [19] [22] [21] [20] [23] [*] [25] [24]
+Wrote 12 pages, 1520 bytes


Property changes on: trunk/Build/source/texk/seetexk/tests/playbook.4
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/seetexk/tests/playconc.3
===================================================================
--- trunk/Build/source/texk/seetexk/tests/playconc.3	                        (rev 0)
+++ trunk/Build/source/texk/seetexk/tests/playconc.3	2017-06-19 13:53:02 UTC (rev 44637)
@@ -0,0 +1,5 @@
+[15] [16] [17]
+Wrote 3 pages, 500 bytes
+[23] [24] [25]
+Wrote 3 pages, 512 bytes
+Wrote 6 pages, 844 bytes


Property changes on: trunk/Build/source/texk/seetexk/tests/playconc.3
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/seetexk/tests/playdvi.3
===================================================================
--- trunk/Build/source/texk/seetexk/tests/playdvi.3	                        (rev 0)
+++ trunk/Build/source/texk/seetexk/tests/playdvi.3	2017-06-19 13:53:02 UTC (rev 44637)
@@ -0,0 +1,2 @@
+[15] [19] [23]
+Wrote 3 pages, 1108 bytes


Property changes on: trunk/Build/source/texk/seetexk/tests/playdvi.3
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/seetexk/tests/playsel.3
===================================================================
--- trunk/Build/source/texk/seetexk/tests/playsel.3	                        (rev 0)
+++ trunk/Build/source/texk/seetexk/tests/playsel.3	2017-06-19 13:53:02 UTC (rev 44637)
@@ -0,0 +1,2 @@
+[15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]
+Wrote 11 pages, 1408 bytes


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

Index: trunk/Build/source/texk/seetexk/tests/playtate.dvi
===================================================================
--- trunk/Build/source/texk/seetexk/tests/playtate.dvi	2017-06-19 00:17:45 UTC (rev 44636)
+++ trunk/Build/source/texk/seetexk/tests/playtate.dvi	2017-06-19 13:53:02 UTC (rev 44637)

Property changes on: trunk/Build/source/texk/seetexk/tests/playtate.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property


More information about the tex-live-commits mailing list