diff options
-rw-r--r-- | Build/source/texk/ptexenc/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/ptexenc.c | 8 | ||||
-rw-r--r-- | Build/source/texk/ptexenc/ptexenc/ptexenc.h | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/ChangeLog | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex.defines | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex.ech | 52 | ||||
-rw-r--r-- | Build/source/texk/web2c/eptexdir/eptex_version.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/euptexdir/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/euptexdir/euptex.defines | 2 |
9 files changed, 85 insertions, 2 deletions
diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog index 0daf361f908..a03524a0872 100644 --- a/Build/source/texk/ptexenc/ChangeLog +++ b/Build/source/texk/ptexenc/ChangeLog @@ -1,3 +1,8 @@ +2016-02-01 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * ptexenc.c, ptexenc/ptexenc.h: Add a function setinfileenc() for a new + primitive \epTeXinputencoding in e-(u)pTeX. (from N. Abe). + 2016-01-25 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * ptexenc.c: Fix a bug, reported by N. Abe, in isUTF8Nstream(). diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c index 23b9ea4f052..4ad5bc6b186 100644 --- a/Build/source/texk/ptexenc/ptexenc.c +++ b/Build/source/texk/ptexenc/ptexenc.c @@ -840,6 +840,14 @@ long input_line2(FILE *fp, unsigned char *buff, long pos, return last; } +boolean setinfileenc(FILE *fp, const char *str){ + int enc; + enc = string_to_enc(str); + if (enc < 0) return false; + infile_enc[fileno(fp)] = 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 a4cbeb327f9..db5410e7f98 100644 --- a/Build/source/texk/ptexenc/ptexenc/ptexenc.h +++ b/Build/source/texk/ptexenc/ptexenc/ptexenc.h @@ -81,6 +81,9 @@ extern PTENCDLL int fputs2(const char *s, FILE *fp); extern PTENCDLL long input_line2(FILE *fp, unsigned char *buff, long pos, const long buffsize, int *lastchar); +/* set current encoding */ +extern PTENCDLL boolean setinfileenc(FILE *fp, const char *str); + #ifdef WIN32 extern PTENCDLL void clear_infile_enc(FILE *fp); #else diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog index d44b509263c..739e0239b7b 100644 --- a/Build/source/texk/web2c/eptexdir/ChangeLog +++ b/Build/source/texk/web2c/eptexdir/ChangeLog @@ -1,3 +1,11 @@ +2016-02-01 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * eptex.ech: Add a new primitive \epTeXinputencoding. (from N. Abe). + Change version to 160201 (H. Kitagawa). + * eptex.defines: Add a new function setinfileenc() for a new primitive + \epTeXinputencoding. (from N. Abe). + * eptex_version.h: Change version to 160201 (H. Kitagawa). + 2015-09-22 Peter Breitenlohner <peb@mppmu.mpg.de> * eptriptest.test: Also check tripos.tex and etrip.out. diff --git a/Build/source/texk/web2c/eptexdir/eptex.defines b/Build/source/texk/web2c/eptexdir/eptex.defines index 8b4e16e0a95..1878238fd56 100644 --- a/Build/source/texk/web2c/eptexdir/eptex.defines +++ b/Build/source/texk/web2c/eptexdir/eptex.defines @@ -19,6 +19,8 @@ @define function putc2 (); @define function inputline2 (); +@define function setinfileenc (); + @define function fromJIS (); @define function fromEUC (); @define function fromSJIS (); diff --git a/Build/source/texk/web2c/eptexdir/eptex.ech b/Build/source/texk/web2c/eptexdir/eptex.ech index 9e79348030c..c2e41e7d9d7 100644 --- a/Build/source/texk/web2c/eptexdir/eptex.ech +++ b/Build/source/texk/web2c/eptexdir/eptex.ech @@ -19,7 +19,7 @@ @y @d eTeX_version_string=='-2.6' {current \eTeX\ version} @# -@d epTeX_version_string=='-150805' +@d epTeX_version_string=='-160201' @z @x e-pTeX: banner @@ -306,6 +306,56 @@ if fm>0 then {drop \.{\\beginM} \.{\\endM} pair} @z @x +@d set_language_code=5 {command modifier for \.{\\setlanguage}} +@y +@d set_language_code=5 {command modifier for \.{\\setlanguage}} +@d epTeX_input_encoding_code=7 {command modifier for \.{\\epTeXinputencoding}} +@z + +@x +primitive("setlanguage",extension,set_language_code);@/ +@!@:set_language_}{\.{\\setlanguage} primitive@> +@y +primitive("setlanguage",extension,set_language_code);@/ +@!@:set_language_}{\.{\\setlanguage} primitive@> +primitive("epTeXinputencoding",extension,epTeX_input_encoding_code);@/ +@!@:epTeX_input_encoding_}{\.{\\epTeXinputencoding} primitive@> +@z + +@x + set_language_code:print_esc("setlanguage"); +@y + set_language_code:print_esc("setlanguage"); + epTeX_input_encoding_code:print_esc("epTeXinputencoding"); +@z + +@x +set_language_code:@<Implement \.{\\setlanguage}@>; +@y +set_language_code:@<Implement \.{\\setlanguage}@>; +epTeX_input_encoding_code:@<Implement \.{\\epTeXinputencoding}@>; +@z + +@x +@ @<Finish the extensions@>= +@y +@ @<Implement \.{\\epTeXinputencoding}@>= + begin + scan_file_name; + pack_cur_name; + if setinfileenc(cur_file,stringcast(name_of_file+1)) = false then + begin + wlog_cr; + wlog('Unknown encoding `'); + fputs(stringcast(name_of_file + 1), log_file); + wlog(''''); + end + end + +@ @<Finish the extensions@>= +@z + +@x primitive("lastnodetype",last_item,last_node_type_code); @!@:last_node_type_}{\.{\\lastnodetype} primitive@> @y diff --git a/Build/source/texk/web2c/eptexdir/eptex_version.h b/Build/source/texk/web2c/eptexdir/eptex_version.h index 50372eced9c..1d2fcdbb37d 100644 --- a/Build/source/texk/web2c/eptexdir/eptex_version.h +++ b/Build/source/texk/web2c/eptexdir/eptex_version.h @@ -1 +1 @@ -#define EPTEX_VERSION "150805" +#define EPTEX_VERSION "160201" diff --git a/Build/source/texk/web2c/euptexdir/ChangeLog b/Build/source/texk/web2c/euptexdir/ChangeLog index d66af63f447..fb606a24232 100644 --- a/Build/source/texk/web2c/euptexdir/ChangeLog +++ b/Build/source/texk/web2c/euptexdir/ChangeLog @@ -1,3 +1,8 @@ +2016-02-01 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * euptex.defines: Add a new function setinfileenc() for a new primitive + \epTeXinputencoding. (from N. Abe). + 2015-09-22 Peter Breitenlohner <peb@mppmu.mpg.de> * euptriptest.test: Also check tripos.tex and etrip.out. diff --git a/Build/source/texk/web2c/euptexdir/euptex.defines b/Build/source/texk/web2c/euptexdir/euptex.defines index 84b3f0a9949..5b11961f557 100644 --- a/Build/source/texk/web2c/euptexdir/euptex.defines +++ b/Build/source/texk/web2c/euptexdir/euptex.defines @@ -24,6 +24,8 @@ @define function putc2 (); @define function inputline2 (); +@define function setinfileenc (); + @define function fromJIS (); @define function fromEUC (); @define function fromSJIS (); |