summaryrefslogtreecommitdiff
path: root/Build/source/texk/seetexk/dviselect.c
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-19 13:53:02 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-19 13:53:02 +0000
commit47200cf750c5f351fe840f9d9b57bde6cc75167c (patch)
treec1d9986d76a5ebdf93b5d0fb3b86d507a2f491fa /Build/source/texk/seetexk/dviselect.c
parentbd2881589ba386c2275e3e32c304a63c49ff46f8 (diff)
texk/seetexk: Support pTeX dvi by H. Yamashita-san
git-svn-id: svn://tug.org/texlive/trunk@44637 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/seetexk/dviselect.c')
-rw-r--r--Build/source/texk/seetexk/dviselect.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/Build/source/texk/seetexk/dviselect.c b/Build/source/texk/seetexk/dviselect.c
index 5f8a79d9aa7..1f401072503 100644
--- a/Build/source/texk/seetexk/dviselect.c
+++ b/Build/source/texk/seetexk/dviselect.c
@@ -145,6 +145,9 @@ long StartOfLastPage; /* The file position just before we started
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 @@ HandlePostAmble(void)
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 @@ Usage: %s [-s] [-i infile] [-o outfile] pages [...] [infile [outfile]]\n",
StartOfLastPage = -1;
ReadPreAmble();
+#ifdef ASCIIPTEX
+ ptexdvi = 0;
+#endif /* ASCIIPTEX */
HandleDVIFile();
HandlePostAmble();
if (NumberOfOutputPages > 0) {
@@ -952,7 +963,12 @@ char oplen[128] = {
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 @@ HandleDVIFile(void)
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));