summaryrefslogtreecommitdiff
path: root/Build/source/texk/ptexenc
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2017-09-09 17:17:10 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2017-09-09 17:17:10 +0000
commit1f88188d33aa368bed61fd2195622cd0649659b4 (patch)
tree54faf990b5f1af6e960128ec6b606f41d5d5c63f /Build/source/texk/ptexenc
parent9ca200015531cf14e5df3bad6c7eef4d539601bc (diff)
\epTeXinputencoding works also with the terminal (H. Kitagawa and N. Abe)
git-svn-id: svn://tug.org/texlive/trunk@45249 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ptexenc')
-rw-r--r--Build/source/texk/ptexenc/ChangeLog5
-rw-r--r--Build/source/texk/ptexenc/ptexenc.c10
-rw-r--r--Build/source/texk/ptexenc/ptexenc/ptexenc.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog
index 6b9328f3494..4be1dd3272e 100644
--- a/Build/source/texk/ptexenc/ChangeLog
+++ b/Build/source/texk/ptexenc/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-09 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * ptexenc.c, ptexenc/ptexenc.h: Add a new function setstdinenc() for the
+ primitive \epTeXinputencoding in e-(u)pTeX.
+
2017-03-18 Karl Berry <karl@tug.org>
* version.ac (ptexenc_version): 1.3.5dev => 1.3.5 for TL17.
diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c
index 92e6b866853..83842ccdaaa 100644
--- a/Build/source/texk/ptexenc/ptexenc.c
+++ b/Build/source/texk/ptexenc/ptexenc.c
@@ -840,6 +840,7 @@ long input_line2(FILE *fp, unsigned char *buff, long pos,
return last;
}
+// set encode of stdin if fp = NULL
boolean setinfileenc(FILE *fp, const char *str)
{
int enc;
@@ -849,6 +850,15 @@ boolean setinfileenc(FILE *fp, const char *str)
return true;
}
+boolean setstdinenc(const char *str)
+{
+ int enc;
+ enc = string_to_enc(str);
+ if (enc < 0) return false;
+ infile_enc[fileno(stdin)] = enc;
+ return true;
+}
+
#ifdef WIN32
void clear_infile_enc(FILE *fp)
{
diff --git a/Build/source/texk/ptexenc/ptexenc/ptexenc.h b/Build/source/texk/ptexenc/ptexenc/ptexenc.h
index db5410e7f98..b42d050f156 100644
--- a/Build/source/texk/ptexenc/ptexenc/ptexenc.h
+++ b/Build/source/texk/ptexenc/ptexenc/ptexenc.h
@@ -83,6 +83,7 @@ extern PTENCDLL long input_line2(FILE *fp, unsigned char *buff, long pos,
/* set current encoding */
extern PTENCDLL boolean setinfileenc(FILE *fp, const char *str);
+extern PTENCDLL boolean setstdinenc(const char *str);
#ifdef WIN32
extern PTENCDLL void clear_infile_enc(FILE *fp);