diff options
Diffstat (limited to 'Build/source/texk/ptexenc')
-rw-r--r-- | Build/source/texk/ptexenc/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/ptexenc.c | 10 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/ptexenc/ptexenc.h | 1 |
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); |