From 82e002633513b0b73099d293aba30fb14360fa9a Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Tue, 23 Aug 2011 10:17:01 +0000 Subject: more upTeX and e-upTeX git-svn-id: svn://tug.org/texlive/trunk@23652 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ptexenc/ChangeLog | 14 + Build/source/texk/ptexenc/c-auto.in | 3 - Build/source/texk/ptexenc/configure | 33 --- Build/source/texk/ptexenc/configure.ac | 17 -- Build/source/texk/ptexenc/ptexenc.c | 145 ++++++++-- Build/source/texk/ptexenc/ptexenc/kanjicnv.h | 14 +- Build/source/texk/ptexenc/ptexenc/ptexenc.h | 22 +- Build/source/texk/ptexenc/ptexenc/unicode.h | 7 +- Build/source/texk/ptexenc/unicode.c | 23 +- Build/source/texk/web2c/ChangeLog | 10 +- Build/source/texk/web2c/Makefile.in | 153 +++++++++-- Build/source/texk/web2c/eptexdir/ChangeLog | 1 + Build/source/texk/web2c/eptexdir/am/eptex.am | 1 + Build/source/texk/web2c/euptexdir/am/euptex.am | 1 + Build/source/texk/web2c/help.h | 86 +++--- Build/source/texk/web2c/lib/ChangeLog | 4 + Build/source/texk/web2c/lib/texmfmp.c | 3 - Build/source/texk/web2c/ptexdir/ChangeLog | 36 +++ Build/source/texk/web2c/ptexdir/am/ptex.am | 6 + Build/source/texk/web2c/ptexdir/kanji.c | 26 +- Build/source/texk/web2c/ptexdir/kanji.h | 7 +- Build/source/texk/web2c/ptexdir/pbibtex.ch | 61 ++--- Build/source/texk/web2c/ptexdir/pdvitype.ch | 6 +- Build/source/texk/web2c/ptexdir/ppltotf.ch | 57 ++-- Build/source/texk/web2c/ptexdir/ptex.defines | 2 +- Build/source/texk/web2c/ptexdir/ptftopl.ch | 56 +--- Build/source/texk/web2c/texmfmem.h | 6 +- Build/source/texk/web2c/uptexdir/am/uptex.am | 56 +++- Build/source/texk/web2c/uptexdir/kanji.c | 32 ++- Build/source/texk/web2c/uptexdir/kanji.h | 16 +- Build/source/texk/web2c/uptexdir/upbibtex.ch | 366 +++++++++++++++++++++++++ Build/source/texk/web2c/uptexdir/updvitype.ch | 2 +- Build/source/texk/web2c/uptexdir/uppltotf.ch | 98 +++++++ Build/source/texk/web2c/uptexdir/uptex.defines | 4 +- Build/source/texk/web2c/uptexdir/uptftopl.ch | 85 ++++++ 35 files changed, 1129 insertions(+), 330 deletions(-) create mode 100644 Build/source/texk/web2c/uptexdir/upbibtex.ch create mode 100644 Build/source/texk/web2c/uptexdir/uppltotf.ch create mode 100644 Build/source/texk/web2c/uptexdir/uptftopl.ch (limited to 'Build/source/texk') diff --git a/Build/source/texk/ptexenc/ChangeLog b/Build/source/texk/ptexenc/ChangeLog index bc2329487f3..292921c2fc7 100644 --- a/Build/source/texk/ptexenc/ChangeLog +++ b/Build/source/texk/ptexenc/ChangeLog @@ -1,3 +1,17 @@ +2011-08-22 Peter Breitenlohner + + More support for upTeX and e-upTeX. + * ptexenc.c, ptexenc/ptexenc.h: Add is_internalEUC(), + is_internalUPTEX(), ismultichr(), and ismultichr(). + + * ptexenc/unicode.h, unicode.c: Add UCStoUPTEX(), UPTEXtoUCS(). + + * ptexenc/kanjicnv.h, ptexenc/ptexenc.h, ptexenc/unicode.h: + Use prototypes as in ptexenc/ from W32TeX. + + * ptexenc.c: Handle default encoding with/without uptex. + * configure.ac: Remove option '--with-ptexenc-enc' configure. + 2011-08-18 Peter Breitenlohner * version.ac: Update version number 1.2.0 => 1.3.0dev. diff --git a/Build/source/texk/ptexenc/c-auto.in b/Build/source/texk/ptexenc/c-auto.in index 02381398008..3038dc32b22 100644 --- a/Build/source/texk/ptexenc/c-auto.in +++ b/Build/source/texk/ptexenc/c-auto.in @@ -11,9 +11,6 @@ /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID -/* Default kanji encoding. */ -#undef DEFAULT_KANJI_ENC - /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H diff --git a/Build/source/texk/ptexenc/configure b/Build/source/texk/ptexenc/configure index c58d72e9a07..86808049f1f 100755 --- a/Build/source/texk/ptexenc/configure +++ b/Build/source/texk/ptexenc/configure @@ -751,7 +751,6 @@ enable_compiler_warnings with_system_kpathsea with_kpathsea_includes with_kpathsea_libdir -with_ptexenc_enc enable_kanji_iconv ' ac_precious_vars='build_alias @@ -1411,8 +1410,6 @@ Optional Packages: kpathsea headers installed in DIR --with-kpathsea-libdir=DIR kpathsea library installed in DIR - --with-ptexenc-enc=ENC Default pTeX character encoding - (ENC=JIS/EUC/SJIS/UTF8, default UTF8) Some influential environment variables: CC C compiler command @@ -13998,36 +13995,6 @@ if test "x$kpse_cv_kpse_debug" != xyes; then : fi - -# Check whether --with-ptexenc-enc was given. -if test "${with_ptexenc_enc+set}" = set; then : - withval=$with_ptexenc_enc; -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default pTeX character encoding" >&5 -$as_echo_n "checking default pTeX character encoding... " >&6; } -case $with_ptexenc_enc in #( - jis|JIS) : - DEFAULT_KANJI_ENC=ENC_JIS ;; #( - euc|EUC) : - DEFAULT_KANJI_ENC=ENC_EUC ;; #( - sjis|SJIS) : - DEFAULT_KANJI_ENC=ENC_SJIS ;; #( - ''|utf8|UTF8) : - DEFAULT_KANJI_ENC=ENC_UTF8 ;; #( - *) : - DEFAULT_KANJI_ENC=ENC_UTF8 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown character encoding \`$with_ptexenc_enc'" >&5 -$as_echo "$as_me: WARNING: Unknown character encoding \`$with_ptexenc_enc'" >&2;} ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_KANJI_ENC" >&5 -$as_echo "$DEFAULT_KANJI_ENC" >&6; } - -cat >>confdefs.h <<_ACEOF -#define DEFAULT_KANJI_ENC $DEFAULT_KANJI_ENC -_ACEOF - - # Check whether --enable-kanji-iconv was given. if test "${enable_kanji_iconv+set}" = set; then : enableval=$enable_kanji_iconv; diff --git a/Build/source/texk/ptexenc/configure.ac b/Build/source/texk/ptexenc/configure.ac index 5f5065f824e..feef29b29c1 100644 --- a/Build/source/texk/ptexenc/configure.ac +++ b/Build/source/texk/ptexenc/configure.ac @@ -22,23 +22,6 @@ KPSE_COMMON([ptexenc]) KPSE_KPATHSEA_FLAGS -dnl Default pTeX character encoding. -AC_ARG_WITH([ptexenc-enc], - AS_HELP_STRING([--with-ptexenc-enc=ENC], - [Default pTeX character encoding - (ENC=JIS/EUC/SJIS/UTF8, default UTF8)])) -AC_MSG_CHECKING([default pTeX character encoding]) -AS_CASE([$with_ptexenc_enc], - [jis|JIS], [DEFAULT_KANJI_ENC=ENC_JIS], - [euc|EUC], [DEFAULT_KANJI_ENC=ENC_EUC], - [sjis|SJIS], [DEFAULT_KANJI_ENC=ENC_SJIS], - [''|utf8|UTF8], [DEFAULT_KANJI_ENC=ENC_UTF8], - [DEFAULT_KANJI_ENC=ENC_UTF8 - AC_MSG_WARN([Unknown character encoding \`$with_ptexenc_enc'])]) -AC_MSG_RESULT([$DEFAULT_KANJI_ENC]) -AC_DEFINE_UNQUOTED([DEFAULT_KANJI_ENC], [$DEFAULT_KANJI_ENC], - [Default kanji encoding.]) - dnl Using iconv for kanji <=> unicode conversion AC_ARG_ENABLE([kanji-iconv], AS_HELP_STRING([--enable-kanji-iconv], diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c index c58863ff498..386c36cb477 100644 --- a/Build/source/texk/ptexenc/ptexenc.c +++ b/Build/source/texk/ptexenc/ptexenc.c @@ -21,6 +21,10 @@ #define ENC_EUC 2 #define ENC_SJIS 3 #define ENC_UTF8 4 +#define ENC_UPTEX 5 + +static int default_kanji_enc = ENC_UTF8; +static boolean UPTEX_enabled; #define ESC '\033' @@ -43,7 +47,6 @@ static int file_enc = ENC_UNKNOWN; static int internal_enc = ENC_UNKNOWN; static int terminal_enc = ENC_UNKNOWN; - static const_string enc_to_string(int enc) { switch (enc) { @@ -51,6 +54,7 @@ static const_string enc_to_string(int enc) case ENC_EUC: return "euc"; case ENC_SJIS: return "sjis"; case ENC_UTF8: return "utf8"; + case ENC_UPTEX: if (UPTEX_enabled) return "uptex"; default: return "?"; } } @@ -58,11 +62,18 @@ static const_string enc_to_string(int enc) static int string_to_enc(const_string str) { if (str == NULL) return ENC_UNKNOWN; - if (strcasecmp(str, "default")== 0) return DEFAULT_KANJI_ENC; + if (strcasecmp(str, "default")== 0) return default_kanji_enc; if (strcasecmp(str, "jis") == 0) return ENC_JIS; if (strcasecmp(str, "euc") == 0) return ENC_EUC; if (strcasecmp(str, "sjis") == 0) return ENC_SJIS; if (strcasecmp(str, "utf8") == 0) return ENC_UTF8; + if (UPTEX_enabled && strcasecmp(str, "uptex") == 0) return ENC_UPTEX; + + if (strcasecmp(str, "BINARY") == 0) return ENC_JIS; + if (strcasecmp(str, "ISO-2022-JP") == 0) return ENC_JIS; + if (strcasecmp(str, "EUC-JP") == 0) return ENC_EUC; + if (strcasecmp(str, "Shift_JIS") == 0) return ENC_SJIS; + if (strcasecmp(str, "UTF-8") == 0) return ENC_UTF8; return -1; /* error */ } @@ -79,17 +90,19 @@ static int get_default_enc(void) } else if (enc != ENC_UNKNOWN) { return enc; } - return DEFAULT_KANJI_ENC; + return default_kanji_enc; } static void set_file_enc(int enc) { - file_enc = enc; + if (enc == ENC_UPTEX) file_enc = ENC_UTF8; + else /* rest */ file_enc = enc; } static void set_internal_enc(int enc) { if (enc == ENC_SJIS) internal_enc = ENC_SJIS; + else if (UPTEX_enabled && enc == ENC_UPTEX) internal_enc = ENC_UPTEX; else /* EUC, JIS, UTF8 */ internal_enc = ENC_EUC; } @@ -133,7 +146,14 @@ static int get_terminal_enc(void) /* enable/disable UPTEX */ void enable_UPTEX (boolean enable) { - (void) enable; + UPTEX_enabled = enable; + if (enable) + default_kanji_enc = ENC_UPTEX; + else { + default_kanji_enc = ENC_UTF8; + if (internal_enc == ENC_UPTEX) + internal_enc = ENC_EUC; + } } const_string get_enc_string(void) @@ -172,10 +192,43 @@ boolean is_internalSJIS(void) return (internal_enc == ENC_SJIS); } +boolean is_internalEUC(void) +{ + return (internal_enc == ENC_EUC); +} + +boolean is_internalUPTEX(void) +{ + return (internal_enc == ENC_UPTEX); +} + + +/* check char range */ +boolean ismultichr (int length, int nth, int c) +{ + if (is_internalUPTEX()) return isUTF8(length, nth, c); + if (length == 2) { + if (nth == 1) { + if (is_internalSJIS()) return isSJISkanji1(c); + /* EUC */ return isEUCkanji1(c); + } else if (nth == 2) { + if (is_internalSJIS()) return isSJISkanji2(c); + /* EUC */ return isEUCkanji2(c); + } + } + if ((length == 3 || length == 4) && + (0 < nth && nth <= length)) return false; + fprintf(stderr, "ismultichr: unexpected param length=%d, nth=%d\n", + length, nth); + return false; +} /* check char range (kanji 1st) */ boolean iskanji1(int c) { + if (is_internalUPTEX()) return (isUTF8(2,1,c) || + isUTF8(3,1,c) || + isUTF8(4,1,c)); if (is_internalSJIS()) return isSJISkanji1(c); /* EUC */ return isEUCkanji1(c); } @@ -188,9 +241,14 @@ boolean iskanji2(int c) } /* multi-byte char length in s[pos] */ -int multistrlen(string s, int len, int pos) +int multistrlen(unsigned char *s, int len, int pos) { s += pos; len -= pos; + if (is_internalUPTEX()) { + int ret = UTF8Slength(s, len); + if (ret < 0) return 1; + return ret; + } if (len < 2) return 1; if (is_internalSJIS()) { if (isSJISkanji1(s[0]) && isSJISkanji2(s[1])) return 2; @@ -200,10 +258,27 @@ int multistrlen(string s, int len, int pos) return 1; } -/* buffer (EUC/SJIS/UTF-8) to internal (EUC/SJIS) code conversion */ -long fromBUFF(string s, int len, int pos) +/* with not so strict range check */ +int multibytelen (int first_byte) +{ + if (is_internalUPTEX()) { + return UTF8length(first_byte); + } else if (is_internalSJIS()) { + if (isSJISkanji1(first_byte)) return 2; + } else { /* EUC */ + if (isEUCkanji1(first_byte)) return 2; + } + return 1; +} + +/* buffer (EUC/SJIS/UTF-8) to internal (EUC/SJIS/UPTEX) code conversion */ +long fromBUFF(unsigned char *s, int len, int pos) { s += pos; len -= pos; + if (is_internalUPTEX()) { + if (UTF8Slength(s, len) < 0) return s[0]; + return UCStoUPTEX(UTF8StoUCS(s)); + } if (len < 2) return s[0]; if (is_internalSJIS()) { if (isSJISkanji1(s[0]) && isSJISkanji2(s[1])) return HILO(s[0], s[1]); @@ -213,85 +288,95 @@ long fromBUFF(string s, int len, int pos) return s[0]; } -/* internal (EUC/SJIS) to buffer (EUC/SJIS) code conversion */ +/* internal (EUC/SJIS/UPTEX) to buffer (EUC/SJIS/UTF-8) code conversion */ long toBUFF(long kcode) { + if (is_internalUPTEX()) kcode = UCStoUTF8(UPTEXtoUCS(kcode)); return kcode; } -/* JIS to internal (EUC/SJIS) code conversion */ +/* JIS to internal (EUC/SJIS/UPTEX) code conversion */ long fromJIS(long kcode) { + if (is_internalUPTEX()) return UCStoUPTEX(JIStoUCS2(kcode)); if (is_internalSJIS()) return JIStoSJIS(kcode); /* EUC */ return JIStoEUC(kcode); } -/* internal (EUC/SJIS) to JIS code conversion */ +/* internal (EUC/SJIS/UPTEX) to JIS code conversion */ long toJIS(long kcode) { + if (is_internalUPTEX()) return UCS2toJIS(UPTEXtoUCS(kcode)); if (is_internalSJIS()) return SJIStoJIS(kcode); /* EUC */ return EUCtoJIS(kcode); } -/* EUC to internal (EUC/SJIS) code conversion */ +/* EUC to internal (EUC/SJIS/UPTEX) code conversion */ long fromEUC(long kcode) { - if (is_internalSJIS()) return fromJIS(EUCtoJIS(kcode)); - /* EUC */ return kcode; + if (!is_internalUPTEX() && !is_internalSJIS()) return kcode; + return fromJIS(EUCtoJIS(kcode)); } -/* internal (EUC/SJIS) to EUC code conversion */ +/* internal (EUC/SJIS/UPTEX) to EUC code conversion */ static long toEUC(long kcode) { - if (is_internalSJIS()) return JIStoEUC(toJIS(kcode)); - /* EUC */ return kcode; - + if (!is_internalUPTEX() && !is_internalSJIS()) return kcode; + return JIStoEUC(toJIS(kcode)); } -/* SJIS to internal (EUC/SJIS) code conversion */ +/* SJIS to internal (EUC/SJIS/UPTEX) code conversion */ long fromSJIS(long kcode) { if (is_internalSJIS()) return kcode; - /* EUC */ return fromJIS(SJIStoJIS(kcode)); + return fromJIS(SJIStoJIS(kcode)); } -/* internal (EUC/SJIS) to SJIS code conversion */ +/* internal (EUC/SJIS/UPTEX) to SJIS code conversion */ static long toSJIS(long kcode) { if (is_internalSJIS()) return kcode; - /* EUC */ return JIStoSJIS(toJIS(kcode)); + return JIStoSJIS(toJIS(kcode)); } -/* KUTEN to internal (EUC/SJIS) code conversion */ +/* KUTEN to internal (EUC/SJIS/UPTEX) code conversion */ long fromKUTEN(long kcode) { return fromJIS(KUTENtoJIS(kcode)); } -/* UCS to internal (EUC/SJIS) code conversion */ +/* UCS to internal (EUC/SJIS/UPTEX) code conversion */ long fromUCS(long kcode) { + if (is_internalUPTEX()) return UCStoUPTEX(kcode); kcode = UCS2toJIS(kcode); if (kcode == 0) return 0; return fromJIS(kcode); } -/* internal (EUC/SJIS) to UCS code conversion */ +/* internal (EUC/SJIS/UPTEX) to UCS code conversion */ long toUCS(long kcode) { + if (is_internalUPTEX()) return UPTEXtoUCS(kcode); return JIStoUCS2(toJIS(kcode)); } -/* internal (EUC/SJIS) to 'enc' code conversion */ +/* internal (EUC/SJIS/UPTEX) to UTF-8 code conversion */ +static long toUTF8 (long kcode) +{ + return UCStoUTF8(toUCS(kcode)); +} + +/* internal (EUC/SJIS/UPTEX) to 'enc' code conversion */ static long toENC(long kcode, int enc) { switch (enc) { - case ENC_UTF8: return UCStoUTF8(toUCS(kcode)); + case ENC_UTF8: return toUTF8(kcode); case ENC_JIS: return toJIS(kcode); case ENC_EUC: return toEUC(kcode); case ENC_SJIS: return toSJIS(kcode); @@ -379,7 +464,7 @@ static int ungetc4(int c, FILE *fp) } -static string buffer; +static unsigned char *buffer; static long first, last; static boolean combin_voiced_sound(boolean semi) { @@ -521,8 +606,8 @@ static int infile_enc[NOFILE]; /* ENC_UNKNOWN (=0): not determined other: determined */ /* input line with encoding conversion */ -long input_line2(FILE *fp, string buff, long pos, - const long buffsize, int *lastchar) +long input_line2(FILE *fp, unsigned char *buff, long pos, + const long buffsize, int *lastchar) { long i; static boolean injis = false; diff --git a/Build/source/texk/ptexenc/ptexenc/kanjicnv.h b/Build/source/texk/ptexenc/ptexenc/kanjicnv.h index 7eb71355f0e..3ca732d5159 100644 --- a/Build/source/texk/ptexenc/ptexenc/kanjicnv.h +++ b/Build/source/texk/ptexenc/ptexenc/kanjicnv.h @@ -18,18 +18,18 @@ extern boolean isSJISkanji1(int c); extern boolean isSJISkanji2(int c); /* EUC <=> JIS X 0208 code conversion */ -extern int EUCtoJIS(int); -extern int JIStoEUC(int); +extern int EUCtoJIS(int c); +extern int JIStoEUC(int c); /* Shift JIS <=> JIS Kanji code conversion */ -extern int SJIStoJIS(int); -extern int JIStoSJIS(int); +extern int SJIStoJIS(int c); +extern int JIStoSJIS(int c); /* Shift JIS <=> EUC Kanji code conversion */ -extern int SJIStoEUC(int); -extern int EUCtoSJIS(int); +extern int SJIStoEUC(int c); +extern int EUCtoSJIS(int c); /* KUTEN => JIS kanji code conversion */ -extern int KUTENtoJIS(int); +extern int KUTENtoJIS(int c); #endif /* PTEXENC_KANJICNV_H */ diff --git a/Build/source/texk/ptexenc/ptexenc/ptexenc.h b/Build/source/texk/ptexenc/ptexenc/ptexenc.h index 05955ea1279..2863f6e0574 100644 --- a/Build/source/texk/ptexenc/ptexenc/ptexenc.h +++ b/Build/source/texk/ptexenc/ptexenc/ptexenc.h @@ -34,28 +34,34 @@ extern PTENCDLL void enable_UPTEX (boolean enable); /* get/set Kanji encoding by string */ extern PTENCDLL const_string get_enc_string(void); -extern PTENCDLL int set_enc_string(const_string file, const_string inter); +extern PTENCDLL int set_enc_string(const_string file, const_string inter); #define getencstring get_enc_string #define setencstring set_enc_string -/* decide if internal Kanji encode is SJIS or not */ +/* decide if internal Kanji encode is SJIS/UPTEX or not */ extern PTENCDLL boolean is_internalSJIS(void); +extern PTENCDLL boolean is_internalEUC(void); +extern PTENCDLL boolean is_internalUPTEX(void); #define isinternalSJIS is_internalSJIS +#define isinternalEUC is_internalEUC +#define isinternalUPTEX is_internalUPTEX /* check char range */ +extern PTENCDLL boolean ismultichr (int length, int nth, int c); extern PTENCDLL boolean iskanji1(int c); extern PTENCDLL boolean iskanji2(int c); -/* internal (EUC/SJIS) from/to buffer (EUC/SJIS/UTF-8) code conversion */ -extern PTENCDLL int multistrlen(string s, int len, int pos); -extern PTENCDLL long fromBUFF(string s, int len, int pos); +/* internal (EUC/SJIS/UPTEX) from/to buffer (EUC/SJIS/UTF-8) code conversion */ +extern PTENCDLL int multistrlen(unsigned char *s, int len, int pos); +extern PTENCDLL int multibytelen (int first_byte); +extern PTENCDLL long fromBUFF(unsigned char *s, int len, int pos); extern PTENCDLL long toBUFF(long inter); -/* internal (EUC/SJIS) from/to DVI (JIS) code conversion */ +/* internal (EUC/SJIS/UPTEX) from/to DVI (JIS) code conversion */ #define fromDVI fromJIS #define toDVI toJIS -/* JIS/EUC/SJIS/KUTN/UCS to internal (EUC/SJIS) code conversion */ +/* JIS/EUC/SJIS/KUTN/UCS to internal (EUC/SJIS/UPTEX) code conversion */ /* (only for \euc primitive, etc.) */ extern PTENCDLL long toJIS(long kcode); extern PTENCDLL long fromJIS(long jis); @@ -70,7 +76,7 @@ extern PTENCDLL int putc2(int c, FILE *fp); extern PTENCDLL int fputs2(const char *s, FILE *fp); /* input line with encoding conversion */ -extern PTENCDLL long input_line2(FILE *fp, string buff, long pos, +extern PTENCDLL long input_line2(FILE *fp, unsigned char *buff, long pos, const long buffsize, int *lastchar); /* open/close through nkf */ diff --git a/Build/source/texk/ptexenc/ptexenc/unicode.h b/Build/source/texk/ptexenc/ptexenc/unicode.h index 45ceee9f9d5..13e1567a714 100644 --- a/Build/source/texk/ptexenc/ptexenc/unicode.h +++ b/Build/source/texk/ptexenc/ptexenc/unicode.h @@ -13,10 +13,13 @@ extern boolean isUTF8(int length, int nth, int c); extern int UTF8length(int first_byte); -extern int UTF8Slength(string buff, int buff_len); -extern long UTF8StoUCS(string s); +extern int UTF8Slength(unsigned char *buff, int buff_len); +extern long UTF8StoUCS(unsigned char *s); extern long PTENCDLL UCStoUTF8(long ucs); +extern long UCStoUPTEX(long ucs); +extern long UPTEXtoUCS(long uptex); + #define LONG(a,b,c,d) ( ((long)(a)<<24) | ((long)(b)<<16) | ((c)<<8) | (d) ) #define BYTE1(x) (((x)>>24) & 0xff) #define BYTE2(x) (((x)>>16) & 0xff) diff --git a/Build/source/texk/ptexenc/unicode.c b/Build/source/texk/ptexenc/unicode.c index 275ebd75d40..be8768964e3 100644 --- a/Build/source/texk/ptexenc/unicode.c +++ b/Build/source/texk/ptexenc/unicode.c @@ -43,7 +43,7 @@ int UTF8length(int first_byte) /* with strict range check */ -int UTF8Slength(string buff, int buff_len) +int UTF8Slength(unsigned char *buff, int buff_len) { int i, len; @@ -58,7 +58,7 @@ int UTF8Slength(string buff, int buff_len) /* WITHOUT strict range check */ -long UTF8StoUCS(string s) +long UTF8StoUCS(unsigned char *s) { switch (UTF8length(s[0])) { case 1: return s[0]; @@ -70,7 +70,7 @@ long UTF8StoUCS(string s) } #if 0 /* not used */ -int UCStoUTF8S(long ucs, string s) +int UCStoUTF8S(long ucs, unsigned char *s) { if (ucs < 0x80) { *s = ucs; @@ -112,3 +112,20 @@ long UCStoUTF8(long ucs) UCStoUTF8D4(ucs)); return 0; /* unsupported */ } + + +#define UCS_MAX 0x110000L + +/* using over U+10.FFFF Area */ +long UCStoUPTEX (long ucs) +{ + if (0x7F < ucs && ucs < 0x1000) ucs += UCS_MAX; + return ucs; +} + +/* using over U+10.FFFF Area */ +long UPTEXtoUCS (long uptex) +{ + if (UCS_MAX + 0x7F < uptex && uptex < UCS_MAX + 0x1000) uptex -= UCS_MAX; + return uptex; +} diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index b7249e71d60..cc593ffb2b3 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,11 @@ +2011-08-20 Akira Kakuto + + * texmfmem.h: upTeX uses Aleph-type memory words. + +2011-08-19 Peter Breitenlohner + + * help.h (UPBIBTEXHELP): Add "-kanji-internal". + 2011-08-17 Peter Breitenlohner * help.h (PBIBTEXHELP, PDVITYPEHELP, PPLTOTFHELP, PTFTOPLHELP): @@ -176,7 +184,7 @@ * texmfmp-help.h: Modernize PTEXHELP and add EPTEXHELP. Avoid to include TEXHELP for all TeX-like engines. - * texmfmem.h: ep-TeX uses Aleph-type memory words. + * texmfmem.h: e-pTeX uses Aleph-type memory words. 2011-01-08 Peter Breitenlohner diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index 5c268e0d52f..2e64b9bd8af 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -595,7 +595,8 @@ am__EXEEXT_1 = bibtex$(EXEEXT) dvicopy$(EXEEXT) dvitype$(EXEEXT) \ vftovp$(EXEEXT) vptovf$(EXEEXT) weave$(EXEEXT) am__EXEEXT_2 = pbibtex$(EXEEXT) pdvitype$(EXEEXT) ppltotf$(EXEEXT) \ ptftopl$(EXEEXT) -am__EXEEXT_3 = updvitype$(EXEEXT) +am__EXEEXT_3 = upbibtex$(EXEEXT) updvitype$(EXEEXT) uppltotf$(EXEEXT) \ + uptftopl$(EXEEXT) am__EXEEXT_4 = odvicopy$(EXEEXT) odvitype$(EXEEXT) otangle$(EXEEXT) am__EXEEXT_5 = ofm2opl$(EXEEXT) opl2ofm$(EXEEXT) ovf2ovp$(EXEEXT) \ ovp2ovf$(EXEEXT) @@ -688,9 +689,6 @@ am__objects_12 = eptex-eptexini.$(OBJEXT) eptex-eptex0.$(OBJEXT) nodist_eptex_OBJECTS = $(am__objects_12) eptex-eptex-pool.$(OBJEXT) eptex_OBJECTS = $(dist_eptex_OBJECTS) $(nodist_eptex_OBJECTS) @EPTEX_SYNCTEX_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) -eptex_DEPENDENCIES = libkanji.a $(pproglib) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_3) am__dist_etex_SOURCES_DIST = etexdir/etexextra.c etexdir/etexextra.h \ synctexdir/synctex.c synctexdir/synctex.h \ synctexdir/synctex-common.h synctexdir/synctex-etex.h @@ -712,9 +710,6 @@ am__objects_16 = euptex-euptexini.$(OBJEXT) euptex-euptex0.$(OBJEXT) nodist_euptex_OBJECTS = $(am__objects_16) euptex-euptex-pool.$(OBJEXT) euptex_OBJECTS = $(dist_euptex_OBJECTS) $(nodist_euptex_OBJECTS) @EUPTEX_SYNCTEX_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) -euptex_DEPENDENCIES = libukanji.a $(pproglib) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_5) am_gftodvi_OBJECTS = nodist_gftodvi_OBJECTS = gftodvi.$(OBJEXT) gftodvi_OBJECTS = $(am_gftodvi_OBJECTS) $(nodist_gftodvi_OBJECTS) @@ -801,7 +796,6 @@ nodist_pbibtex_OBJECTS = pbibtex-pbibtex.$(OBJEXT) pbibtex_OBJECTS = $(am_pbibtex_OBJECTS) $(nodist_pbibtex_OBJECTS) am__DEPENDENCIES_8 = libkanji.a $(pproglib) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) -pbibtex_DEPENDENCIES = $(am__DEPENDENCIES_8) am__dist_pdftex_SOURCES_DIST = pdftexdir/pdftexextra.c \ pdftexdir/pdftexextra.h synctexdir/synctex.c \ synctexdir/synctex.h synctexdir/synctex-common.h \ @@ -824,7 +818,6 @@ pdftosrc_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ am_pdvitype_OBJECTS = nodist_pdvitype_OBJECTS = pdvitype-pdvitype.$(OBJEXT) pdvitype_OBJECTS = $(am_pdvitype_OBJECTS) $(nodist_pdvitype_OBJECTS) -pdvitype_DEPENDENCIES = $(am__DEPENDENCIES_8) nodist_pktogf_OBJECTS = pktogf.$(OBJEXT) pktogf_OBJECTS = $(nodist_pktogf_OBJECTS) pktogf_LDADD = $(LDADD) @@ -844,7 +837,6 @@ pooltype_DEPENDENCIES = $(proglib) $(am__DEPENDENCIES_1) am_ppltotf_OBJECTS = nodist_ppltotf_OBJECTS = ppltotf-ppltotf.$(OBJEXT) ppltotf_OBJECTS = $(am_ppltotf_OBJECTS) $(nodist_ppltotf_OBJECTS) -ppltotf_DEPENDENCIES = $(am__DEPENDENCIES_8) am__dist_ptex_SOURCES_DIST = ptexdir/ptexextra.c ptexdir/ptexextra.h \ synctexdir/synctex.c synctexdir/synctex.h \ synctexdir/synctex-common.h synctexdir/synctex-ptex.h @@ -854,12 +846,9 @@ am__objects_21 = ptex-ptexini.$(OBJEXT) ptex-ptex0.$(OBJEXT) nodist_ptex_OBJECTS = $(am__objects_21) ptex-ptex-pool.$(OBJEXT) ptex_OBJECTS = $(dist_ptex_OBJECTS) $(nodist_ptex_OBJECTS) @PTEX_SYNCTEX_TRUE@am__DEPENDENCIES_10 = $(am__DEPENDENCIES_1) -ptex_DEPENDENCIES = $(am__DEPENDENCIES_8) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_10) am_ptftopl_OBJECTS = nodist_ptftopl_OBJECTS = ptftopl-ptftopl.$(OBJEXT) ptftopl_OBJECTS = $(am_ptftopl_OBJECTS) $(nodist_ptftopl_OBJECTS) -ptftopl_DEPENDENCIES = $(am__DEPENDENCIES_8) am_synctex_OBJECTS = synctex-synctex_main.$(OBJEXT) \ synctex-synctex_parser.$(OBJEXT) \ synctex-synctex_parser_utils.$(OBJEXT) @@ -896,13 +885,18 @@ ttf2afm_OBJECTS = $(am_ttf2afm_OBJECTS) ttf2afm_LDADD = $(LDADD) nodist_txt2zlib_OBJECTS = txt2zlib-txt2zlib.$(OBJEXT) txt2zlib_OBJECTS = $(nodist_txt2zlib_OBJECTS) +am_upbibtex_OBJECTS = +nodist_upbibtex_OBJECTS = upbibtex-upbibtex.$(OBJEXT) +upbibtex_OBJECTS = $(am_upbibtex_OBJECTS) $(nodist_upbibtex_OBJECTS) +am__DEPENDENCIES_12 = libukanji.a $(pproglib) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) am_updvitype_OBJECTS = nodist_updvitype_OBJECTS = updvitype-updvitype.$(OBJEXT) updvitype_OBJECTS = $(am_updvitype_OBJECTS) \ $(nodist_updvitype_OBJECTS) -am__DEPENDENCIES_12 = libukanji.a $(pproglib) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_2) -updvitype_DEPENDENCIES = $(am__DEPENDENCIES_12) +am_uppltotf_OBJECTS = +nodist_uppltotf_OBJECTS = uppltotf-uppltotf.$(OBJEXT) +uppltotf_OBJECTS = $(am_uppltotf_OBJECTS) $(nodist_uppltotf_OBJECTS) am__dist_uptex_SOURCES_DIST = uptexdir/uptexextra.c \ uptexdir/uptexextra.h synctexdir/synctex.c \ synctexdir/synctex.h synctexdir/synctex-common.h \ @@ -913,8 +907,9 @@ am__objects_25 = uptex-uptexini.$(OBJEXT) uptex-uptex0.$(OBJEXT) nodist_uptex_OBJECTS = $(am__objects_25) uptex-uptex-pool.$(OBJEXT) uptex_OBJECTS = $(dist_uptex_OBJECTS) $(nodist_uptex_OBJECTS) @UPTEX_SYNCTEX_TRUE@am__DEPENDENCIES_13 = $(am__DEPENDENCIES_1) -uptex_DEPENDENCIES = $(am__DEPENDENCIES_12) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_13) +am_uptftopl_OBJECTS = +nodist_uptftopl_OBJECTS = uptftopl-uptftopl.$(OBJEXT) +uptftopl_OBJECTS = $(am_uptftopl_OBJECTS) $(nodist_uptftopl_OBJECTS) nodist_vftovp_OBJECTS = vftovp.$(OBJEXT) vftovp_OBJECTS = $(nodist_vftovp_OBJECTS) vftovp_LDADD = $(LDADD) @@ -1011,9 +1006,12 @@ SOURCES = $(libff_a_SOURCES) $(libkanji_a_SOURCES) \ $(dist_tex_SOURCES) $(nodist_tex_SOURCES) \ $(nodist_tftopl_SOURCES) $(nodist_tie_SOURCES) \ $(ttf2afm_SOURCES) $(EXTRA_ttf2afm_SOURCES) \ - $(nodist_txt2zlib_SOURCES) $(updvitype_SOURCES) \ - $(nodist_updvitype_SOURCES) $(dist_uptex_SOURCES) \ - $(nodist_uptex_SOURCES) $(nodist_vftovp_SOURCES) \ + $(nodist_txt2zlib_SOURCES) $(upbibtex_SOURCES) \ + $(nodist_upbibtex_SOURCES) $(updvitype_SOURCES) \ + $(nodist_updvitype_SOURCES) $(uppltotf_SOURCES) \ + $(nodist_uppltotf_SOURCES) $(dist_uptex_SOURCES) \ + $(nodist_uptex_SOURCES) $(uptftopl_SOURCES) \ + $(nodist_uptftopl_SOURCES) $(nodist_vftovp_SOURCES) \ $(nodist_vptovf_SOURCES) $(nodist_weave_SOURCES) \ $(dist_xetex_SOURCES) $(nodist_xetex_SOURCES) \ $(nodist_EXTRA_xetex_SOURCES) @@ -1035,7 +1033,8 @@ DIST_SOURCES = $(libff_a_SOURCES) $(libkanji_a_SOURCES) \ $(am__dist_ptex_SOURCES_DIST) $(ptftopl_SOURCES) \ $(synctex_SOURCES) $(am__dist_tex_SOURCES_DIST) \ $(ttf2afm_SOURCES) $(EXTRA_ttf2afm_SOURCES) \ - $(updvitype_SOURCES) $(am__dist_uptex_SOURCES_DIST) \ + $(upbibtex_SOURCES) $(updvitype_SOURCES) $(uppltotf_SOURCES) \ + $(am__dist_uptex_SOURCES_DIST) $(uptftopl_SOURCES) \ $(am__dist_xetex_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ @@ -1399,7 +1398,9 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \ eptexdir/eptrip/eptrip.diffs eptexdir/eptrip/etrip.log \ eptexdir/eptrip/etrip.tex eptexdir/eptrip/texmf.cnf \ $(uptex_web_srcs) $(uptex_ch_srcs) uptexdir/uptex.defines \ - ptexdir/pdvitype.ch uptexdir/updvitype.ch $(euptex_web_srcs) \ + ptexdir/pbibtex.ch uptexdir/upbibtex.ch ptexdir/pdvitype.ch \ + uptexdir/updvitype.ch ptexdir/ppltotf.ch uptexdir/uppltotf.ch \ + ptexdir/ptftopl.ch uptexdir/uptftopl.ch $(euptex_web_srcs) \ $(euptex_ch_srcs) euptexdir/euptex.defines $(pdftex_ch_srcs) \ etexdir/etex.ch pdftexdir/pdftex.defines pdftexdir/pdftex.h \ pdftexdir/ChangeLog pdftexdir/NEWS pdftexdir/README \ @@ -1802,6 +1803,7 @@ etex_ch_srcs = \ etex_tests = etexdir/etrip.test ptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) ptex_ldadd = libkanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) +ptex_dependencies = libkanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) p_tangle = WEBINPUTS=.:$(srcdir)/ptexdir:$(srcdir) $(buildenv) $(TANGLE) pweb_programs = pbibtex pdvitype ppltotf ptftopl @@ -1820,6 +1822,7 @@ ptex_CPPFLAGS = $(ptex_cppflags) $(am__append_84) # With --enable-ipc, pTeX may need to link with -lsocket. ptex_LDADD = $(ptex_ldadd) $(ipc_socketlibs) $(am__append_85) +ptex_DEPENDENCIES = $(ptex_dependencies) # pTeX C sources ptex_c_h = ptexini.c ptex0.c ptexcoerce.h ptexd.h @@ -1842,18 +1845,22 @@ nodist_pbibtex_SOURCES = pbibtex.c pbibtex.h pbibtex_SOURCES = ptexdir/kanji.h pbibtex_CPPFLAGS = $(ptex_cppflags) pbibtex_LDADD = $(ptex_ldadd) +pbibtex_DEPENDENCIES = $(ptex_dependencies) nodist_pdvitype_SOURCES = pdvitype.c pdvitype.h pdvitype_SOURCES = ptexdir/kanji.h pdvitype_CPPFLAGS = $(ptex_cppflags) -DDHEX_CHAR_CODE pdvitype_LDADD = $(ptex_ldadd) +pdvitype_DEPENDENCIES = $(ptex_dependencies) nodist_ppltotf_SOURCES = ppltotf.c ppltotf.h ppltotf_SOURCES = ptexdir/kanji.h ppltotf_CPPFLAGS = $(ptex_cppflags) -DPRESERVE_PUTC ppltotf_LDADD = $(ptex_ldadd) +ppltotf_DEPENDENCIES = $(ptex_dependencies) nodist_ptftopl_SOURCES = ptftopl.c ptftopl.h ptftopl_SOURCES = ptexdir/kanji.h ptftopl_CPPFLAGS = $(ptex_cppflags) ptftopl_LDADD = $(ptex_ldadd) +ptftopl_DEPENDENCIES = $(ptex_dependencies) # e-pTeX Tests # @@ -1863,6 +1870,7 @@ eptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) $(am__append_92) # With --enable-ipc, e-pTeX may need to link with -lsocket. eptex_LDADD = libkanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) \ $(ipc_socketlibs) $(am__append_93) +eptex_DEPENDENCIES = libkanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) # e-pTeX C sources eptex_c_h = eptexini.c eptex0.c eptexcoerce.h eptexd.h @@ -1895,14 +1903,16 @@ eptex_ch_srcs = \ uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) uptex_ldadd = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) +uptex_dependencies = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) up_tangle = WEBINPUTS=.:$(srcdir)/uptexdir:$(srcdir) $(buildenv) $(TANGLE) -upweb_programs = updvitype +upweb_programs = upbibtex updvitype uppltotf uptftopl libukanji_a_SOURCES = uptexdir/kanji.c uptexdir/kanji.h libukanji_a_CPPFLAGS = $(uptex_cppflags) uptex_CPPFLAGS = $(uptex_cppflags) $(am__append_88) # With --enable-ipc, upTeX may need to link with -lsocket. uptex_LDADD = $(uptex_ldadd) $(ipc_socketlibs) $(am__append_89) +uptex_DEPENDENCIES = $(uptex_dependencies) # upTeX C sources uptex_c_h = uptexini.c uptex0.c uptexcoerce.h uptexd.h @@ -1923,15 +1933,32 @@ uptex_ch_srcs = \ $(uptex_ch_synctex) \ tex-binpool.ch +nodist_upbibtex_SOURCES = upbibtex.c upbibtex.h +upbibtex_SOURCES = uptexdir/kanji.h +upbibtex_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE +upbibtex_LDADD = $(uptex_ldadd) +upbibtex_DEPENDENCIES = $(uptex_dependencies) nodist_updvitype_SOURCES = updvitype.c updvitype.h updvitype_SOURCES = uptexdir/kanji.h updvitype_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE updvitype_LDADD = $(uptex_ldadd) +updvitype_DEPENDENCIES = $(uptex_dependencies) +nodist_uppltotf_SOURCES = uppltotf.c uppltotf.h +uppltotf_SOURCES = uptexdir/kanji.h +uppltotf_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE +uppltotf_LDADD = $(uptex_ldadd) +uppltotf_DEPENDENCIES = $(uptex_dependencies) +nodist_uptftopl_SOURCES = uptftopl.c uptftopl.h +uptftopl_SOURCES = uptexdir/kanji.h +uptftopl_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE +uptftopl_LDADD = $(uptex_ldadd) +uptftopl_DEPENDENCIES = $(uptex_dependencies) euptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) $(am__append_96) # With --enable-ipc, e-upTeX may need to link with -lsocket. euptex_LDADD = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) \ $(ipc_socketlibs) $(am__append_97) +euptex_DEPENDENCIES = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) # e-upTeX C sources euptex_c_h = euptexini.c euptex0.c euptexcoerce.h euptexd.h @@ -3031,12 +3058,21 @@ ttf2afm$(EXEEXT): $(ttf2afm_OBJECTS) $(ttf2afm_DEPENDENCIES) txt2zlib$(EXEEXT): $(txt2zlib_OBJECTS) $(txt2zlib_DEPENDENCIES) @rm -f txt2zlib$(EXEEXT) $(LINK) $(txt2zlib_OBJECTS) $(txt2zlib_LDADD) $(LIBS) +upbibtex$(EXEEXT): $(upbibtex_OBJECTS) $(upbibtex_DEPENDENCIES) + @rm -f upbibtex$(EXEEXT) + $(LINK) $(upbibtex_OBJECTS) $(upbibtex_LDADD) $(LIBS) updvitype$(EXEEXT): $(updvitype_OBJECTS) $(updvitype_DEPENDENCIES) @rm -f updvitype$(EXEEXT) $(LINK) $(updvitype_OBJECTS) $(updvitype_LDADD) $(LIBS) +uppltotf$(EXEEXT): $(uppltotf_OBJECTS) $(uppltotf_DEPENDENCIES) + @rm -f uppltotf$(EXEEXT) + $(LINK) $(uppltotf_OBJECTS) $(uppltotf_LDADD) $(LIBS) uptex$(EXEEXT): $(uptex_OBJECTS) $(uptex_DEPENDENCIES) @rm -f uptex$(EXEEXT) $(LINK) $(uptex_OBJECTS) $(uptex_LDADD) $(LIBS) +uptftopl$(EXEEXT): $(uptftopl_OBJECTS) $(uptftopl_DEPENDENCIES) + @rm -f uptftopl$(EXEEXT) + $(LINK) $(uptftopl_OBJECTS) $(uptftopl_LDADD) $(LIBS) vftovp$(EXEEXT): $(vftovp_OBJECTS) $(vftovp_DEPENDENCIES) @rm -f vftovp$(EXEEXT) $(LINK) $(vftovp_OBJECTS) $(vftovp_LDADD) $(LIBS) @@ -3433,12 +3469,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttf2afm-macnames.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttf2afm-ttf2afm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/txt2zlib-txt2zlib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upbibtex-upbibtex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/updvitype-updvitype.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uppltotf-uppltotf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptex-synctex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptex-uptex-pool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptex-uptex0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptex-uptexextra.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptex-uptexini.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptftopl-uptftopl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vftovp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vptovf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weave.Po@am__quote@ @@ -8020,6 +8059,20 @@ txt2zlib-txt2zlib.obj: txt2zlib.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(txt2zlib_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o txt2zlib-txt2zlib.obj `if test -f 'txt2zlib.c'; then $(CYGPATH_W) 'txt2zlib.c'; else $(CYGPATH_W) '$(srcdir)/txt2zlib.c'; fi` +upbibtex-upbibtex.o: upbibtex.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(upbibtex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT upbibtex-upbibtex.o -MD -MP -MF $(DEPDIR)/upbibtex-upbibtex.Tpo -c -o upbibtex-upbibtex.o `test -f 'upbibtex.c' || echo '$(srcdir)/'`upbibtex.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/upbibtex-upbibtex.Tpo $(DEPDIR)/upbibtex-upbibtex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='upbibtex.c' object='upbibtex-upbibtex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(upbibtex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o upbibtex-upbibtex.o `test -f 'upbibtex.c' || echo '$(srcdir)/'`upbibtex.c + +upbibtex-upbibtex.obj: upbibtex.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(upbibtex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT upbibtex-upbibtex.obj -MD -MP -MF $(DEPDIR)/upbibtex-upbibtex.Tpo -c -o upbibtex-upbibtex.obj `if test -f 'upbibtex.c'; then $(CYGPATH_W) 'upbibtex.c'; else $(CYGPATH_W) '$(srcdir)/upbibtex.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/upbibtex-upbibtex.Tpo $(DEPDIR)/upbibtex-upbibtex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='upbibtex.c' object='upbibtex-upbibtex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(upbibtex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o upbibtex-upbibtex.obj `if test -f 'upbibtex.c'; then $(CYGPATH_W) 'upbibtex.c'; else $(CYGPATH_W) '$(srcdir)/upbibtex.c'; fi` + updvitype-updvitype.o: updvitype.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(updvitype_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT updvitype-updvitype.o -MD -MP -MF $(DEPDIR)/updvitype-updvitype.Tpo -c -o updvitype-updvitype.o `test -f 'updvitype.c' || echo '$(srcdir)/'`updvitype.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/updvitype-updvitype.Tpo $(DEPDIR)/updvitype-updvitype.Po @@ -8034,6 +8087,20 @@ updvitype-updvitype.obj: updvitype.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(updvitype_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o updvitype-updvitype.obj `if test -f 'updvitype.c'; then $(CYGPATH_W) 'updvitype.c'; else $(CYGPATH_W) '$(srcdir)/updvitype.c'; fi` +uppltotf-uppltotf.o: uppltotf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uppltotf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uppltotf-uppltotf.o -MD -MP -MF $(DEPDIR)/uppltotf-uppltotf.Tpo -c -o uppltotf-uppltotf.o `test -f 'uppltotf.c' || echo '$(srcdir)/'`uppltotf.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uppltotf-uppltotf.Tpo $(DEPDIR)/uppltotf-uppltotf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uppltotf.c' object='uppltotf-uppltotf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uppltotf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uppltotf-uppltotf.o `test -f 'uppltotf.c' || echo '$(srcdir)/'`uppltotf.c + +uppltotf-uppltotf.obj: uppltotf.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uppltotf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uppltotf-uppltotf.obj -MD -MP -MF $(DEPDIR)/uppltotf-uppltotf.Tpo -c -o uppltotf-uppltotf.obj `if test -f 'uppltotf.c'; then $(CYGPATH_W) 'uppltotf.c'; else $(CYGPATH_W) '$(srcdir)/uppltotf.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uppltotf-uppltotf.Tpo $(DEPDIR)/uppltotf-uppltotf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uppltotf.c' object='uppltotf-uppltotf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uppltotf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uppltotf-uppltotf.obj `if test -f 'uppltotf.c'; then $(CYGPATH_W) 'uppltotf.c'; else $(CYGPATH_W) '$(srcdir)/uppltotf.c'; fi` + uptex-uptexextra.o: uptexdir/uptexextra.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uptex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uptex-uptexextra.o -MD -MP -MF $(DEPDIR)/uptex-uptexextra.Tpo -c -o uptex-uptexextra.o `test -f 'uptexdir/uptexextra.c' || echo '$(srcdir)/'`uptexdir/uptexextra.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uptex-uptexextra.Tpo $(DEPDIR)/uptex-uptexextra.Po @@ -8104,6 +8171,20 @@ uptex-uptex-pool.obj: uptex-pool.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uptex_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uptex-uptex-pool.obj `if test -f 'uptex-pool.c'; then $(CYGPATH_W) 'uptex-pool.c'; else $(CYGPATH_W) '$(srcdir)/uptex-pool.c'; fi` +uptftopl-uptftopl.o: uptftopl.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uptftopl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uptftopl-uptftopl.o -MD -MP -MF $(DEPDIR)/uptftopl-uptftopl.Tpo -c -o uptftopl-uptftopl.o `test -f 'uptftopl.c' || echo '$(srcdir)/'`uptftopl.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uptftopl-uptftopl.Tpo $(DEPDIR)/uptftopl-uptftopl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uptftopl.c' object='uptftopl-uptftopl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uptftopl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uptftopl-uptftopl.o `test -f 'uptftopl.c' || echo '$(srcdir)/'`uptftopl.c + +uptftopl-uptftopl.obj: uptftopl.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uptftopl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uptftopl-uptftopl.obj -MD -MP -MF $(DEPDIR)/uptftopl-uptftopl.Tpo -c -o uptftopl-uptftopl.obj `if test -f 'uptftopl.c'; then $(CYGPATH_W) 'uptftopl.c'; else $(CYGPATH_W) '$(srcdir)/uptftopl.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/uptftopl-uptftopl.Tpo $(DEPDIR)/uptftopl-uptftopl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uptftopl.c' object='uptftopl-uptftopl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uptftopl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uptftopl-uptftopl.obj `if test -f 'uptftopl.c'; then $(CYGPATH_W) 'uptftopl.c'; else $(CYGPATH_W) '$(srcdir)/uptftopl.c'; fi` + xetex-xetexextra.o: xetexdir/xetexextra.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xetex_CPPFLAGS) $(CPPFLAGS) $(xetex_CFLAGS) $(CFLAGS) -MT xetex-xetexextra.o -MD -MP -MF $(DEPDIR)/xetex-xetexextra.Tpo -c -o xetex-xetexextra.o `test -f 'xetexdir/xetexextra.c' || echo '$(srcdir)/'`xetexdir/xetexextra.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xetex-xetexextra.Tpo $(DEPDIR)/xetex-xetexextra.Po @@ -9703,6 +9784,14 @@ uptex.web: tie$(EXEEXT) $(uptex_web_srcs) # Generate uptex.ch uptex.ch: tie$(EXEEXT) uptex.web $(uptex_ch_srcs) $(tie) -c uptex.ch uptex.web $(uptex_ch_srcs) +upbibtex.c upbibtex.h: upbibtex-web2c + $(web2c) upbibtex +upbibtex-web2c: upbibtex.p $(web2c_depend) uptexdir/uptex.defines + $(web2c) upbibtex +upbibtex.p: tangle$(EXEEXT) upbibtex.web uptexdir/upbibtex.ch + $(up_tangle) upbibtex upbibtex +upbibtex.web: tie$(EXEEXT) bibtex.web bibtex.ch ptexdir/pbibtex.ch + $(tie) -m upbibtex.web bibtex.web bibtex.ch ptexdir/pbibtex.ch updvitype.c updvitype.h: updvitype-web2c $(web2c) updvitype updvitype-web2c: updvitype.p $(web2c_depend) uptexdir/uptex.defines @@ -9711,6 +9800,22 @@ updvitype.p: tangle$(EXEEXT) updvitype.web uptexdir/updvitype.ch $(up_tangle) updvitype updvitype updvitype.web: tie$(EXEEXT) dvitype.web dvitype.ch ptexdir/pdvitype.ch $(tie) -m updvitype.web dvitype.web dvitype.ch ptexdir/pdvitype.ch +uppltotf.c uppltotf.h: uppltotf-web2c + $(web2c) uppltotf +uppltotf-web2c: uppltotf.p $(web2c_depend) uptexdir/uptex.defines + $(web2c) uppltotf +uppltotf.p: tangle$(EXEEXT) uppltotf.web uptexdir/uppltotf.ch + $(up_tangle) uppltotf uppltotf +uppltotf.web: tie$(EXEEXT) pltotf.web pltotf.ch ptexdir/ppltotf.ch + $(tie) -m uppltotf.web pltotf.web pltotf.ch ptexdir/ppltotf.ch +uptftopl.c uptftopl.h: uptftopl-web2c + $(web2c) uptftopl +uptftopl-web2c: uptftopl.p $(web2c_depend) uptexdir/uptex.defines + $(web2c) uptftopl +uptftopl.p: tangle$(EXEEXT) uptftopl.web uptexdir/uptftopl.ch + $(up_tangle) uptftopl uptftopl +uptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch ptexdir/ptftopl.ch + $(tie) -m uptftopl.web tftopl.web tftopl.ch ptexdir/ptftopl.ch $(euptex_OBJECTS): $(euptex_prereq) $(euptex_c_h): euptex-web2c diff --git a/Build/source/texk/web2c/eptexdir/ChangeLog b/Build/source/texk/web2c/eptexdir/ChangeLog index 572244bc6bb..1df293c25e5 100644 --- a/Build/source/texk/web2c/eptexdir/ChangeLog +++ b/Build/source/texk/web2c/eptexdir/ChangeLog @@ -2,6 +2,7 @@ Renamed ChangeLog => Changes.txt, ChangeLog.TL => ChangeLog. * am/eptex.am (EXTRA_DIST): Adapted. + * am/eptex.am (eptex_DEPENDENCIES): Define proper dependencies. 2011-08-12 Peter Breitenlohner diff --git a/Build/source/texk/web2c/eptexdir/am/eptex.am b/Build/source/texk/web2c/eptexdir/am/eptex.am index 7d16707132b..92c5b58afcd 100644 --- a/Build/source/texk/web2c/eptexdir/am/eptex.am +++ b/Build/source/texk/web2c/eptexdir/am/eptex.am @@ -20,6 +20,7 @@ eptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) # With --enable-ipc, e-pTeX may need to link with -lsocket. eptex_LDADD = libkanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ipc_socketlibs) +eptex_DEPENDENCIES = libkanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) # e-pTeX C sources eptex_c_h = eptexini.c eptex0.c eptexcoerce.h eptexd.h diff --git a/Build/source/texk/web2c/euptexdir/am/euptex.am b/Build/source/texk/web2c/euptexdir/am/euptex.am index 862cc44a611..f69b15b7bcf 100644 --- a/Build/source/texk/web2c/euptexdir/am/euptex.am +++ b/Build/source/texk/web2c/euptexdir/am/euptex.am @@ -14,6 +14,7 @@ euptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) # With --enable-ipc, e-upTeX may need to link with -lsocket. euptex_LDADD = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ipc_socketlibs) +euptex_DEPENDENCIES = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) # e-upTeX C sources euptex_c_h = euptexini.c euptex0.c euptexcoerce.h euptexd.h diff --git a/Build/source/texk/web2c/help.h b/Build/source/texk/web2c/help.h index fb25e80f0bf..037be8d9c04 100644 --- a/Build/source/texk/web2c/help.h +++ b/Build/source/texk/web2c/help.h @@ -317,14 +317,14 @@ const_string PBIBTEXHELP[] = { " Write bibliography for entries in AUXFILE to AUXFILE.bbl,", " along with a log file AUXFILE.blg." "", - "-kanji={jis|euc|sjis|utf8} kanji code for output-file.", - "-min-crossrefs=NUMBER include item after NUMBER cross-refs; default 2", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8)", + "-min-crossrefs=NUMBER include item after NUMBER cross-refs; default 2", #if defined(WIN32) - "-sjis-terminal always output to stdout and stderr by CP932", + "-sjis-terminal always output to stdout and stderr by CP932", #endif - "-terse do not print progress reports", - "-help display this help and exit", - "-version output version information and exit", + "-terse do not print progress reports", + "-help display this help and exit", + "-version output version information and exit", NULL }; #endif /* PBIBTEX */ @@ -337,8 +337,7 @@ const_string PDVITYPEHELP[] = { " written to standard output.", "", "-dpi=REAL set resolution to REAL pixels per inch; default 300.0", - "-kanji={jis|euc|sjis|utf8}", - " kanji code for output-file.", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8)", "-magnification=NUMBER override existing magnification with NUMBER", "-max-pages=NUMBER process NUMBER pages; default one million", "-output-level=NUMBER verbosity level, from 0 to 4; default 4", @@ -409,13 +408,13 @@ const_string PPLTOTFHELP[] = { " Translate the property list PLFILE to TFMFILE.", " Default TFMFILE is basename of PLFILE extended with `.tfm'.", "", - "-kanji={jis|euc|sjis|utf8} plfile kanji code.", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8)", #if defined(WIN32) - "-sjis-terminal always output to stdout and stderr by CP932", + "-sjis-terminal always output to stdout and stderr by CP932", #endif - "-help print this message and exit.", - "-verbose output progress reports.", - "-version print version information and exit.", + "-help print this message and exit.", + "-verbose output progress reports.", + "-version print version information and exit.", NULL }; #endif /* PPLTOTF */ @@ -427,16 +426,16 @@ const_string PTFTOPLHELP[] = { " Translate the font metrics TFMNAME to human-readable property list file", " PLFILE or standard output.", "", - "-charcode-format=TYPE output character codes according to TYPE,", - " either `octal' or `ascii'; default is ascii for", - " letters and digits, octal for all else", - "-kanji={jis|euc|sjis|utf8} plfile kanji code.", + "-charcode-format=TYPE output character codes according to TYPE,", + " either `octal' or `ascii'; default is ascii for", + " letters and digits, octal for all else", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8)", #if defined(WIN32) - "-sjis-terminal always output to stdout and stderr by CP932", + "-sjis-terminal always output to stdout and stderr by CP932", #endif - "-help display this help and exit", - "-verbose display progress reports", - "-version output version information and exit", + "-help display this help and exit", + "-verbose display progress reports", + "-version output version information and exit", NULL }; #endif /* PTFTOPL */ @@ -488,15 +487,15 @@ const_string UPBIBTEXHELP[] = { " Write bibliography for entries in AUXFILE to AUXFILE.bbl,", " along with a log file AUXFILE.blg." "", - "-kanji={jis|euc|sjis|utf8|uptex}", - " kanji code for output-file.", - "-min-crossrefs=NUMBER include item after NUMBER cross-refs; default 2", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8|uptex)", + "-kanji-internal=STRING set Japanese internal encoding (STRING=euc|uptex)", + "-min-crossrefs=NUMBER include item after NUMBER cross-refs; default 2", #if defined(WIN32) - "-sjis-terminal always output to stdout and stderr by CP932", + "-sjis-terminal always output to stdout and stderr by CP932", #endif - "-terse do not print progress reports", - "-help display this help and exit", - "-version output version information and exit", + "-terse do not print progress reports", + "-help display this help and exit", + "-version output version information and exit", NULL }; #endif /* UPBIBTEX */ @@ -509,8 +508,7 @@ const_string UPDVITYPEHELP[] = { " written to standard output.", "", "-dpi=REAL set resolution to REAL pixels per inch; default 300.0", - "-kanji={jis|euc|sjis|utf8|uptex}", - " kanji code for output-file.", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8|uptex)", "-magnification=NUMBER override existing magnification with NUMBER", "-max-pages=NUMBER process NUMBER pages; default one million", "-output-level=NUMBER verbosity level, from 0 to 4; default 4", @@ -532,14 +530,13 @@ const_string UPPLTOTFHELP[] = { " Translate the property list PLFILE to TFMFILE.", " Default TFMFILE is basename of PLFILE extended with `.tfm'.", "", - "-kanji={jis|euc|sjis|utf8|uptex}", - " plfile kanji code.", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8|uptex)", #if defined(WIN32) - "-sjis-terminal always output to stdout and stderr by CP932", + "-sjis-terminal always output to stdout and stderr by CP932", #endif - "-help print this message and exit.", - "-verbose output progress reports.", - "-version print version information and exit.", + "-help print this message and exit.", + "-verbose output progress reports.", + "-version print version information and exit.", NULL }; #endif /* UPPLTOTF */ @@ -551,17 +548,16 @@ const_string UPTFTOPLHELP[] = { " Translate the font metrics TFMNAME to human-readable property list file", " PLFILE or standard output.", "", - "-charcode-format=TYPE output character codes according to TYPE,", - " either `octal' or `ascii'; default is ascii for", - " letters and digits, octal for all else", - "-kanji={jis|euc|sjis|utf8|uptex}", - " plfile kanji code.", + "-charcode-format=TYPE output character codes according to TYPE,", + " either `octal' or `ascii'; default is ascii for", + " letters and digits, octal for all else", + "-kanji=STRING set Japanese encoding (STRING=euc|jis|sjis|utf8|uptex)", #if defined(WIN32) - "-sjis-terminal always output to stdout and stderr by CP932", + "-sjis-terminal always output to stdout and stderr by CP932", #endif - "-help display this help and exit", - "-verbose display progress reports", - "-version output version information and exit", + "-help display this help and exit", + "-verbose display progress reports", + "-version output version information and exit", NULL }; #endif /* UPTFTOPL */ diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 685024368ee..c308834f68d 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,7 @@ +2011-08-23 Peter Breitenlohner + + * texmfmp.c: Remove some (e-)pTeX cruft. + 2011-08-18 Peter Breitenlohner * texmfmp.c: Options for (e-)pTeX and (e-)upTeX. diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index e4e625e8eca..0f19d83b9dd 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -620,9 +620,6 @@ maininit (int ac, string *av) /* Must be initialized before options are parsed. */ interactionoption = 4; -#if defined(pTeX) || defined(epTeX) - set_enc_string (NULL, "default"); -#endif /* pTeX || epTeX */ /* Have things to record as we go along. */ kpse_record_input = recorder_record_input; diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog index d9e3e3ced05..fca40b0347e 100644 --- a/Build/source/texk/web2c/ptexdir/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/ChangeLog @@ -1,3 +1,39 @@ +2011-08-23 Peter Breitenlohner + + * pbibtex.ch, pdvitype.ch, ppltotf.ch, ptftopl.ch, ptex.defines: + Change init_default_kanji => init_kanji. + * kanji.[ch]: Map initdefaultkanji (for pTeX and e-pTeX) and + initkanji (for pBibTeX, pDVItype, pPLtoTF, and pTFtoPL) to + init_default_kanji() with two encoding string arguments. + +2011-08-22 Peter Breitenlohner + + * pbibtex.ch, pdvitype.ch, ppltotf.ch, ptftopl.ch: Change error + message text 'kanjicode encoding' => 'kanji encoding'. + * am/ptex.am (*_DEPENDENCIES): Define proper dependencies. + +2011-08-20 Peter Breitenlohner + + * pbibtex.ch, ppltotf.ch, ptftopl.ch: Stop parsing arguments at + "-version" and immediately call print_version_and_exit(). + +2011-08-19 Peter Breitenlohner + + * pbibtex.ch, pdvitype.ch, ppltotf.ch, ptftopl.ch: Add WIN32 + option "sjis-terminal" and init_default_kanji(). + * ptex.defines: Add sjisterminal and initdefaultkanji. + * kanji.[ch]: Add support for WIN32 option "sjis-terminal". + (check_kanji): Change return type boolean => int (for -1, 0, +1). + (initdefaultkanji): New function from W32TeX kanjiextra.c. + * am/ptex.am (*_LDADD): Use libkanji.a for all binaries. + + * pdvitype.ch: Change banner 'PDVItype' => 'pDVItype'. + * ppltotf.ch: Change banner 'Nihongo PLtoTF' => 'pPLtoTF'. + More fix usage ('progname'). Simplify kanji encoding output. + * ptftopl.ch: Change banner 'Nihongo TFtoPL' => 'pTFtoPL'. + More fix usage ('progname'). Simplify kanji encoding output. + * pbibtex.ch: Simplify kanji encoding output. + 2011-08-19 Akira Kakuto * ppltotf.ch, ptftopl.ch: fix usage ('progname'). diff --git a/Build/source/texk/web2c/ptexdir/am/ptex.am b/Build/source/texk/web2c/ptexdir/am/ptex.am index e9f3c835936..2b1523bbbc4 100644 --- a/Build/source/texk/web2c/ptexdir/am/ptex.am +++ b/Build/source/texk/web2c/ptexdir/am/ptex.am @@ -5,6 +5,7 @@ ptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) ptex_ldadd = libkanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) +ptex_dependencies = libkanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) p_tangle = WEBINPUTS=.:$(srcdir)/ptexdir:$(srcdir) $(buildenv) $(TANGLE) pweb_programs = pbibtex pdvitype ppltotf ptftopl @@ -51,6 +52,7 @@ ptex_CPPFLAGS = $(ptex_cppflags) # With --enable-ipc, pTeX may need to link with -lsocket. ptex_LDADD = $(ptex_ldadd) $(ipc_socketlibs) +ptex_DEPENDENCIES = $(ptex_dependencies) # pTeX C sources ptex_c_h = ptexini.c ptex0.c ptexcoerce.h ptexd.h @@ -107,6 +109,7 @@ nodist_pbibtex_SOURCES = pbibtex.c pbibtex.h pbibtex_SOURCES = ptexdir/kanji.h pbibtex_CPPFLAGS = $(ptex_cppflags) pbibtex_LDADD = $(ptex_ldadd) +pbibtex_DEPENDENCIES = $(ptex_dependencies) pbibtex.c pbibtex.h: pbibtex-web2c $(web2c) pbibtex pbibtex-web2c: pbibtex.p $(web2c_depend) ptexdir/ptex.defines web2c/cvtbib.sed @@ -126,6 +129,7 @@ nodist_pdvitype_SOURCES = pdvitype.c pdvitype.h pdvitype_SOURCES = ptexdir/kanji.h pdvitype_CPPFLAGS = $(ptex_cppflags) -DDHEX_CHAR_CODE pdvitype_LDADD = $(ptex_ldadd) +pdvitype_DEPENDENCIES = $(ptex_dependencies) pdvitype.c pdvitype.h: pdvitype-web2c $(web2c) pdvitype pdvitype-web2c: pdvitype.p $(web2c_depend) ptexdir/ptex.defines @@ -144,6 +148,7 @@ nodist_ppltotf_SOURCES = ppltotf.c ppltotf.h ppltotf_SOURCES = ptexdir/kanji.h ppltotf_CPPFLAGS = $(ptex_cppflags) -DPRESERVE_PUTC ppltotf_LDADD = $(ptex_ldadd) +ppltotf_DEPENDENCIES = $(ptex_dependencies) ppltotf.c ppltotf.h: ppltotf-web2c $(web2c) ppltotf ppltotf-web2c: ppltotf.p $(web2c_depend) ptexdir/ptex.defines @@ -160,6 +165,7 @@ nodist_ptftopl_SOURCES = ptftopl.c ptftopl.h ptftopl_SOURCES = ptexdir/kanji.h ptftopl_CPPFLAGS = $(ptex_cppflags) ptftopl_LDADD = $(ptex_ldadd) +ptftopl_DEPENDENCIES = $(ptex_dependencies) ptftopl.c ptftopl.h: ptftopl-web2c $(web2c) ptftopl ptftopl-web2c: ptftopl.p $(web2c_depend) ptexdir/ptex.defines diff --git a/Build/source/texk/web2c/ptexdir/kanji.c b/Build/source/texk/web2c/ptexdir/kanji.c index 5852be396e1..d0a3766c25f 100644 --- a/Build/source/texk/web2c/ptexdir/kanji.c +++ b/Build/source/texk/web2c/ptexdir/kanji.c @@ -81,7 +81,31 @@ integer kcatcodekey(integer c) return Hi(toDVI(c)); } -void initdefaultkanji (void) +void init_default_kanji (const_string file_str, const_string internal_str) { + char *p; + enable_UPTEX (false); /* disable */ + + p = getenv ("PTEX_KANJI_ENC"); + if (p) { + if (!set_enc_string (p, NULL)) + fprintf (stderr, "Ignoring bad kanji encoding \"%s\".\n", p); + } + +#ifdef WIN32 + p = kpse_var_value ("guess_input_kanji_encoding"); + if (p) { + if (*p == '1' || *p == 'y' || *p == 't') + infile_enc_auto = 1; + free(p); + } +#endif + + if (!set_enc_string (file_str, internal_str)) { + fprintf (stderr, "Bad kanji encoding \"%s\" or \"%s\".\n", + file_str ? file_str : "NULL", + internal_str ? internal_str : "NULL"); + uexit(1); + } } diff --git a/Build/source/texk/web2c/ptexdir/kanji.h b/Build/source/texk/web2c/ptexdir/kanji.h index 67a3d18f05b..5d33b97d9fa 100644 --- a/Build/source/texk/web2c/ptexdir/kanji.h +++ b/Build/source/texk/web2c/ptexdir/kanji.h @@ -33,7 +33,12 @@ extern boolean ismultiprn (integer c); extern integer calc_pos (integer c); #define calcpos calc_pos extern integer kcatcodekey (integer c); -extern void initdefaultkanji (void); + +extern void init_default_kanji (const_string file_str, const_string internal_str); +/* for pTeX and e-pTeX */ +#define initdefaultkanji() init_default_kanji(NULL, "euc") +/* for pBibTeX, pDVItype, pPLtoTF, and pTFtoPL */ +#define initkanji() init_default_kanji(NULL, "euc") #ifndef PRESERVE_PUTC #undef putc diff --git a/Build/source/texk/web2c/ptexdir/pbibtex.ch b/Build/source/texk/web2c/ptexdir/pbibtex.ch index fd55579304b..95ec3d47b91 100644 --- a/Build/source/texk/web2c/ptexdir/pbibtex.ch +++ b/Build/source/texk/web2c/ptexdir/pbibtex.ch @@ -52,9 +52,7 @@ print (banner); @y print (banner); - print (' ('); - print (conststringcast(get_enc_string)); - print (')'); + print (' (', conststringcast(get_enc_string), ')'); @z @x Changes for JBibTeX by Shouichi Matsui [27] @@ -229,7 +227,7 @@ begin @x parse_arguments; @y -init_default_kanji; +init_kanji; parse_arguments; @z @@ -335,11 +333,11 @@ if (ex_buf_ptr < ex_buf_length) then {remove the ``and''} ex_buf_ptr := ex_buf_ptr - 4; @y if (ex_buf_ptr < ex_buf_length) then {remove the ``and'', or Zenkau comma} - begin + begin if( (ex_buf[ex_buf_ptr-1]=zen_comma) or (ex_buf[ex_buf_ptr-1]=zen_kuten) ) then ex_buf_ptr := ex_buf_ptr - 2 else ex_buf_ptr := ex_buf_ptr - 4; - end; + end; @z @x Changes for JBibTeX by Shouichi Matsui for Zenkaku comma @@ -456,12 +454,13 @@ while (sp_ptr < sp_end) do {shift the substring} @y { 2 bytes Kanji code break check } tps:=str_start[pop_lit3]; -while (tps < sp_ptr ) do +while (tps < sp_ptr) do begin if str_pool[tps] > 127 then tps := tps + 2 else incr(tps); +end; tpe:=tps; -while (tpe < sp_end ) do begin +while (tpe < sp_end) do begin if str_pool[tpe] > 127 then tpe := tpe+2 else incr(tpe); @@ -485,7 +484,8 @@ while (sp_ptr < sp_end) do {shift the substring} append_char (str_pool[sp_ptr]); incr(sp_ptr); end else begin - append_char (str_pool[sp_ptr]); incr(sp_ptr); end; + append_char (str_pool[sp_ptr]); incr(sp_ptr); + end; end; @z @@ -504,9 +504,10 @@ while (sp_ptr < sp_end) do {shift the substring} if (sp_brace_level > 0) then decr(sp_brace_level); end - else if (str_pool[sp_xptr1-1]>127) then begin {kanji char} + else if (str_pool[sp_xptr1-1]>127) then + begin {kanji char} incr(sp_xptr1); num_text_chars:=num_text_chars+2; - end + end else incr(num_text_chars); end; @@ -514,22 +515,8 @@ while (sp_ptr < sp_end) do {shift the substring} @x const n_options = 4; {Pascal won't count array lengths for us.} -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; -begin - @; @y const n_options = 6; {Pascal won't count array lengths for us.} -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; - @!version_switch: boolean; -begin - @; - version_switch := false; @z @x @@ -545,28 +532,19 @@ begin @z @x - print_version_and_exit (banner, 'Oren Patashnik', nil, nil); + end; {Else it was a flag; |getopt| has already done the assignment.} @y - version_switch := true; - end else if argument_is ('kanji') then begin - @; -@z + if (not set_enc_string(optarg, 0)) then + write_ln('Bad kanji encoding "', stringcast(optarg), '".'); -@x - until getopt_return_val = -1; -@y - until getopt_return_val = -1; - if (version_switch) then - print_version_and_exit (banner, 'Oren Patashnik', nil, nil); + end; {Else it was a flag; |getopt| has already done the assignment.} @z @x - if (optind + 1 <> argc) then begin write_ln (stderr, 'bibtex: Need exactly one file argument.'); usage ('bibtex'); @y - if (optind + 1 <> argc) then begin write_ln (stderr, 'pbibtex: Need exactly one file argument.'); usage ('pbibtex'); @z @@ -577,7 +555,6 @@ long_options[current_option].has_arg := 0; long_options[current_option].flag := 0; long_options[current_option].val := 0; incr (current_option); - @y long_options[current_option].name := 'version'; long_options[current_option].has_arg := 0; @@ -612,7 +589,6 @@ begin kpse_set_program_name (argv[0], 'bibtex'); begin kpse_set_program_name (argv[0], 'pbibtex'); @z - @x until j_prime; incr (k); @@ -653,9 +629,4 @@ begin push_lit_stk(0,stk_int); end; exit:end; - -@ @= - if (not set_enc_string(optarg, 0)) then begin - write_ln('Bad kanjicode encoding "', stringcast(optarg), '".'); - end; @z diff --git a/Build/source/texk/web2c/ptexdir/pdvitype.ch b/Build/source/texk/web2c/ptexdir/pdvitype.ch index 143377709a6..7a30e85d560 100644 --- a/Build/source/texk/web2c/ptexdir/pdvitype.ch +++ b/Build/source/texk/web2c/ptexdir/pdvitype.ch @@ -5,14 +5,14 @@ @x @d banner=='This is DVItype, Version 3.6' {printed when the program starts} @y -@d banner=='This is PDVItype, Version 3.6-p0.4' +@d banner=='This is pDVItype, Version 3.6-p0.4' {printed when the program starts} @z @x parse_arguments; @y - init_default_kanji; + init_kanji; parse_arguments; @z @@ -505,7 +505,7 @@ const n_options = 10; {Pascal won't count array lengths for us.} @y end else if argument_is ('kanji') then begin if (not set_enc_string(optarg,optarg)) then begin - write_ln('Bad kanjicode encoding "', stringcast(optarg), '".'); + write_ln('Bad kanji encoding "', stringcast(optarg), '".'); end; end; {Else it was a flag; |getopt| has already done the assignment.} diff --git a/Build/source/texk/web2c/ptexdir/ppltotf.ch b/Build/source/texk/web2c/ptexdir/ppltotf.ch index c6480da3387..da930c7ad22 100644 --- a/Build/source/texk/web2c/ptexdir/ppltotf.ch +++ b/Build/source/texk/web2c/ptexdir/ppltotf.ch @@ -13,14 +13,14 @@ @x [2] l.69 - pTeX: @d banner=='This is PLtoTF, Version 3.5' {printed when the program starts} @y -@d banner=='This is Nihongo PLtoTF, Version 3.5-p1.8' +@d banner=='This is pPLtoTF, Version 3.5-p1.8' {printed when the program starts} @z @x parse_arguments; @y - init_default_kanji; + init_kanji; parse_arguments; @z @@ -28,9 +28,7 @@ print_ln (version_string); @y print_ln (version_string); - print ('process kanji code is '); - fputs(get_enc_string, stdout); - print_ln ('.'); + print_ln ('process kanji code is ', conststringcast(get_enc_string), '.'); @z @x [18] l.495 - pTeX: @@ -355,23 +353,6 @@ const n_options = 3; {Pascal won't count array lengths for us.} @y const n_options = 5; {Pascal won't count array lengths for us.} @z -@x -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; -begin - @; -@y -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; - @!version_switch: boolean; -begin - @; - version_switch := false; -@z @x usage ('pltotf'); @@ -384,23 +365,23 @@ begin @y usage_help (PPLTOTF_HELP, nil); @z -@x - end else if argument_is ('version') then begin - print_version_and_exit (banner, nil, 'D.E. Knuth', nil); +@x end; {Else it was a flag; |getopt| has already done the assignment.} - until getopt_return_val = -1; @y - end else if argument_is ('version') then begin - version_switch := true; - end else if argument_is ('kanji') then begin - @; + if (not set_enc_string(optarg,optarg)) then + print_ln('Bad kanji encoding "', stringcast(optarg), '".'); end; {Else it was a flag; |getopt| has already done the assignment.} - until getopt_return_val = -1; - if (version_switch) then - print_version_and_exit (banner, nil, 'D.E. Knuth', nil); +@z + +@x + write_ln (stderr, 'pltotf: Need one or two file arguments.'); + usage ('pltotf'); +@y + write_ln (stderr, 'ppltotf: Need one or two file arguments.'); + usage ('ppltotf'); @z @x @@ -697,10 +678,10 @@ for i:=0 to 3 do end; end; @# -function valid_jis_code(jis:integer):boolean; +function valid_jis_code(cx:integer):boolean; var @!first_byte,@!second_byte:integer; { jis code bytes } begin valid_jis_code:=true; -first_byte:=jis div @'400; second_byte:=jis mod @'400; +first_byte:=cx div @'400; second_byte:=cx mod @'400; if (first_byte<@"21) or((first_byte>@"28)and(first_byte<@"30)) or(first_byte>@"74) then valid_jis_code:=false; @@ -722,7 +703,7 @@ function index_to_jis(ix:integer):integer; begin if ix<=8*94-1 then index_to_jis:=(ix div 94 +@"21)*@'400+(ix mod 94 +@"21) else - index_to_jis:=((ix+7*94) div 94 +@"21)*@'400+((ix+7*94) mod 94 +@"21) + index_to_jis:=((ix+7*94) div 94 +@"21)*@'400+((ix+7*94) mod 94 +@"21); end; @# function get_kanji:integer; {get kanji character code} @@ -753,9 +734,5 @@ else jis_code:=-1; get_kanji:=jis_code; end; -@ @= - if (not set_enc_string(optarg,optarg)) then - print_ln('Bad kanjicode encoding "', stringcast(optarg), '".'); - @* Index. @z diff --git a/Build/source/texk/web2c/ptexdir/ptex.defines b/Build/source/texk/web2c/ptexdir/ptex.defines index a591012d1c2..b7680c84c7c 100644 --- a/Build/source/texk/web2c/ptexdir/ptex.defines +++ b/Build/source/texk/web2c/ptexdir/ptex.defines @@ -28,6 +28,6 @@ @define function calcpos (); @define function kcatcodekey (); -@define procedure initdefaultkanji; +@define procedure initkanji; @define var sjisterminal; diff --git a/Build/source/texk/web2c/ptexdir/ptftopl.ch b/Build/source/texk/web2c/ptexdir/ptftopl.ch index f5bd13a1a54..a4e0937c723 100644 --- a/Build/source/texk/web2c/ptexdir/ptftopl.ch +++ b/Build/source/texk/web2c/ptexdir/ptftopl.ch @@ -12,7 +12,7 @@ @x [2] l.64 - pTeX: @d banner=='This is TFtoPL, Version 3.2' {printed when the program starts} @y -@d banner=='This is Nihongo TFtoPL, Version 3.2-p1.7' +@d banner=='This is pTFtoPL, Version 3.2-p1.7' {printed when the program starts} @z @@ -32,7 +32,7 @@ var @!k:integer; {all-purpose initiallization index} @x parse_arguments; @y - init_default_kanji; + init_kanji; parse_arguments; @z @@ -40,9 +40,7 @@ var @!k:integer; {all-purpose initiallization index} print_ln (version_string); @y print_ln (version_string); - print ('process kanji code is '); - print (conststringcast(get_enc_string)); - print_ln('.'); + print_ln ('process kanji code is ', conststringcast(get_enc_string), '.'); @z @x [18.20] l.438 - pTeX: @@ -352,23 +350,6 @@ const n_options = 4; {Pascal won't count array lengths for us.} @y const n_options = 6; {Pascal won't count array lengths for us.} @z -@x -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; -begin - @; -@y -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; - @!version_switch: boolean; -begin - @; - version_switch := false; -@z @x usage ('tftopl'); @@ -381,24 +362,23 @@ begin @y usage_help (PTFTOPL_HELP, nil); @z + @x - end else if argument_is ('version') then begin - print_version_and_exit (banner, nil, 'D.E. Knuth', nil); + end; {Else it was a flag; |getopt| has already done the assignment.} @y - end else if argument_is ('version') then begin - version_switch := true; - end else if argument_is ('kanji') then begin - @; + if (not set_enc_string(optarg,optarg)) then + print_ln('Bad kanji encoding "', stringcast(optarg), '".'); + + end; {Else it was a flag; |getopt| has already done the assignment.} @z + @x - end; {Else it was a flag; |getopt| has already done the assignment.} - until getopt_return_val = -1; + print_ln ('tftopl: Need one or two file arguments.'); + usage ('tftopl'); @y - end; {Else it was a flag; |getopt| has already done the assignment.} - until getopt_return_val = -1; - if (version_switch) then - print_version_and_exit (banner, nil, 'D.E. Knuth', nil); + print_ln ('ptftopl: Need one or two file arguments.'); + usage ('ptftopl'); @z @x @@ -553,7 +533,7 @@ begin if ix<=8*94-1 then index_to_jis:=(ix div 94 + @"21) * @'400 + (ix mod 94 + @"21) else - index_to_jis:=((ix+7 * 94) div 94 + @"21) * @'400 + ((ix+7*94) mod 94 + @"21) + index_to_jis:=((ix+7 * 94) div 94 + @"21) * @'400 + ((ix+7*94) mod 94 + @"21); end; @ @= @@ -568,11 +548,5 @@ else jis_to_index:=(first_byte-7)*94+second_byte; end -@ output kanji code. - -@ @= - if (not set_enc_string(optarg,optarg)) then - print_ln('Bad kanjicode encoding "', stringcast(optarg), '".'); - @* Index. @z diff --git a/Build/source/texk/web2c/texmfmem.h b/Build/source/texk/web2c/texmfmem.h index a53025f1925..cbe0ae95470 100644 --- a/Build/source/texk/web2c/texmfmem.h +++ b/Build/source/texk/web2c/texmfmem.h @@ -63,7 +63,7 @@ */ /* Aleph is sufficiently different to separate the definition. */ -#if !defined(Aleph) && !defined(epTeX) && !defined(eupTeX) +#if !defined(Aleph) && !defined(epTeX) && !defined(eupTeX) && !defined(upTeX) typedef union { @@ -181,7 +181,7 @@ typedef union #define qqqq v.QQQQ #endif -#else /* Aleph || epTeX || eupTeX */ +#else /* Aleph || epTeX || eupTeX || upTeX */ typedef union { @@ -257,4 +257,4 @@ typedef union #define gr gg.GLUE -#endif /* Aleph || epTeX || eupTeX */ +#endif /* Aleph || epTeX || eupTeX || upTeX */ diff --git a/Build/source/texk/web2c/uptexdir/am/uptex.am b/Build/source/texk/web2c/uptexdir/am/uptex.am index 58c2f479b05..541f69547e6 100644 --- a/Build/source/texk/web2c/uptexdir/am/uptex.am +++ b/Build/source/texk/web2c/uptexdir/am/uptex.am @@ -5,9 +5,10 @@ uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) uptex_ldadd = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) +uptex_dependencies = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies) up_tangle = WEBINPUTS=.:$(srcdir)/uptexdir:$(srcdir) $(buildenv) $(TANGLE) -upweb_programs = updvitype +upweb_programs = upbibtex updvitype uppltotf uptftopl ## libukanji.a for upTeX and e-upTeX ## @@ -29,6 +30,7 @@ uptex_CPPFLAGS = $(uptex_cppflags) # With --enable-ipc, upTeX may need to link with -lsocket. uptex_LDADD = $(uptex_ldadd) $(ipc_socketlibs) +uptex_DEPENDENCIES = $(uptex_dependencies) # upTeX C sources uptex_c_h = uptexini.c uptex0.c uptexcoerce.h uptexd.h @@ -86,12 +88,30 @@ EXTRA_DIST += $(uptex_web_srcs) $(uptex_ch_srcs) uptexdir/uptex.defines DISTCLEANFILES += $(nodist_uptex_SOURCES) uptex.web uptex.ch uptex-web2c \ uptex.p uptex.pool uptex-tangle +## upBibTeX +## +nodist_upbibtex_SOURCES = upbibtex.c upbibtex.h +upbibtex_SOURCES = uptexdir/kanji.h +upbibtex_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE +upbibtex_LDADD = $(uptex_ldadd) +upbibtex_DEPENDENCIES = $(uptex_dependencies) +upbibtex.c upbibtex.h: upbibtex-web2c + $(web2c) upbibtex +upbibtex-web2c: upbibtex.p $(web2c_depend) uptexdir/uptex.defines + $(web2c) upbibtex +upbibtex.p: tangle$(EXEEXT) upbibtex.web uptexdir/upbibtex.ch + $(up_tangle) upbibtex upbibtex +upbibtex.web: tie$(EXEEXT) bibtex.web bibtex.ch ptexdir/pbibtex.ch + $(tie) -m upbibtex.web bibtex.web bibtex.ch ptexdir/pbibtex.ch +EXTRA_DIST += ptexdir/pbibtex.ch uptexdir/upbibtex.ch + ## upDVItype ## nodist_updvitype_SOURCES = updvitype.c updvitype.h updvitype_SOURCES = uptexdir/kanji.h updvitype_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE updvitype_LDADD = $(uptex_ldadd) +updvitype_DEPENDENCIES = $(uptex_dependencies) updvitype.c updvitype.h: updvitype-web2c $(web2c) updvitype updvitype-web2c: updvitype.p $(web2c_depend) uptexdir/uptex.defines @@ -102,3 +122,37 @@ updvitype.web: tie$(EXEEXT) dvitype.web dvitype.ch ptexdir/pdvitype.ch $(tie) -m updvitype.web dvitype.web dvitype.ch ptexdir/pdvitype.ch EXTRA_DIST += ptexdir/pdvitype.ch uptexdir/updvitype.ch +## upPLtoTF +## +nodist_uppltotf_SOURCES = uppltotf.c uppltotf.h +uppltotf_SOURCES = uptexdir/kanji.h +uppltotf_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE +uppltotf_LDADD = $(uptex_ldadd) +uppltotf_DEPENDENCIES = $(uptex_dependencies) +uppltotf.c uppltotf.h: uppltotf-web2c + $(web2c) uppltotf +uppltotf-web2c: uppltotf.p $(web2c_depend) uptexdir/uptex.defines + $(web2c) uppltotf +uppltotf.p: tangle$(EXEEXT) uppltotf.web uptexdir/uppltotf.ch + $(up_tangle) uppltotf uppltotf +uppltotf.web: tie$(EXEEXT) pltotf.web pltotf.ch ptexdir/ppltotf.ch + $(tie) -m uppltotf.web pltotf.web pltotf.ch ptexdir/ppltotf.ch +EXTRA_DIST += ptexdir/ppltotf.ch uptexdir/uppltotf.ch + +## upTFtoPL +## +nodist_uptftopl_SOURCES = uptftopl.c uptftopl.h +uptftopl_SOURCES = uptexdir/kanji.h +uptftopl_CPPFLAGS = $(uptex_cppflags) -DDHEX_CHAR_CODE +uptftopl_LDADD = $(uptex_ldadd) +uptftopl_DEPENDENCIES = $(uptex_dependencies) +uptftopl.c uptftopl.h: uptftopl-web2c + $(web2c) uptftopl +uptftopl-web2c: uptftopl.p $(web2c_depend) uptexdir/uptex.defines + $(web2c) uptftopl +uptftopl.p: tangle$(EXEEXT) uptftopl.web uptexdir/uptftopl.ch + $(up_tangle) uptftopl uptftopl +uptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch ptexdir/ptftopl.ch + $(tie) -m uptftopl.web tftopl.web tftopl.ch ptexdir/ptftopl.ch +EXTRA_DIST += ptexdir/ptftopl.ch uptexdir/uptftopl.ch + diff --git a/Build/source/texk/web2c/uptexdir/kanji.c b/Build/source/texk/web2c/uptexdir/kanji.c index b6dd47edd55..533785ccaeb 100644 --- a/Build/source/texk/web2c/uptexdir/kanji.c +++ b/Build/source/texk/web2c/uptexdir/kanji.c @@ -361,13 +361,31 @@ integer multilenbuffchar(integer c) return 0; } -/* FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME */ -/* Temporary fix for functions still missing in the ptexenc library. */ -boolean is_internalUPTEX(void) { return false; } -boolean ismultichr (int length, int nth, int c) { return false; } -/* FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME */ - -void initdefaultkanji (void) +void init_default_kanji (const_string file_str, const_string internal_str) { + char *p; + enable_UPTEX (true); /* enable */ + + p = getenv ("PTEX_KANJI_ENC"); + if (p) { + if (!set_enc_string (p, NULL)) + fprintf (stderr, "Ignoring bad kanji encoding \"%s\".\n", p); + } + +#ifdef WIN32 + p = kpse_var_value ("guess_input_kanji_encoding"); + if (p) { + if (*p == '1' || *p == 'y' || *p == 't') + infile_enc_auto = 1; + free(p); + } +#endif + + if (!set_enc_string (file_str, internal_str)) { + fprintf (stderr, "Bad kanji encoding \"%s\" or \"%s\".\n", + file_str ? file_str : "NULL", + internal_str ? internal_str : "NULL"); + uexit(1); + } } diff --git a/Build/source/texk/web2c/uptexdir/kanji.h b/Build/source/texk/web2c/uptexdir/kanji.h index 630fb5ccdde..71faa43f3e0 100644 --- a/Build/source/texk/web2c/uptexdir/kanji.h +++ b/Build/source/texk/web2c/uptexdir/kanji.h @@ -36,7 +36,12 @@ extern integer calc_pos (integer c); #define calcpos calc_pos extern integer kcatcodekey (integer c); extern integer multilenbuffchar (integer c); -extern void initdefaultkanji (void); + +extern void init_default_kanji (const_string file_str, const_string internal_str); +/* for upTeX and e-upTeX */ +#define initdefaultkanji() init_default_kanji("utf8", "uptex") +/* for upBibTeX, upDVItype, upPLtoTF, and upTFtoPL */ +#define initkanji() init_default_kanji("utf8", "uptex") #define setptexencuptex() set_enc_string("utf8", "uptex"); @@ -48,17 +53,10 @@ extern void initdefaultkanji (void); #define putc(c,fp) putc2(c,fp) #endif /* !PRESERVE_PUTC */ -#if defined(UPBIBTEX) || defined(BIBTEX) +#ifdef UPBIBTEX #define inputline2(fp,buff,pos,size,ptr) input_line2(fp,buff,pos,size,ptr) #else #define inputline2(fp,buff,pos,size) input_line2(fp,buff,pos,size,NULL) #endif -/* FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME */ -/* Temporary fix for functions still missing in the ptexenc library. */ -extern boolean is_internalUPTEX(void); -#define isinternalUPTEX is_internalUPTEX -extern boolean ismultichr (int length, int nth, int c); -/* FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME */ - #endif /* not KANJI_H */ diff --git a/Build/source/texk/web2c/uptexdir/upbibtex.ch b/Build/source/texk/web2c/uptexdir/upbibtex.ch new file mode 100644 index 00000000000..efa8a9b389b --- /dev/null +++ b/Build/source/texk/web2c/uptexdir/upbibtex.ch @@ -0,0 +1,366 @@ +@x +@d banner=='This is pBibTeX, Version 0.99d-j0.33' +@y +@d banner=='This is upBibTeX, Version 0.99d-j0.33-u0.30' +@z + +@x +for i:=@'200 to @'237 do xchr[i]:=chr(i-@'200); +for i:=@'240 to 255 do xchr[i]:=chr(i); +@y +for i:=@'200 to 255 do xchr[i]:=chr(i); +@z + +@x +for i:=@'200 to @'237 do xord[i]:= i-@'200; +for i:=@'240 to 255 do xord[i]:=i; +@y +for i:=@'200 to 255 do xord[i]:=i; +@z + +@x +@d zen_pun_first = 161 {Zenkaku punctuation first byte; in EUC} +@d zen_space = 161 {Zenkaku space first, second byte; in EUC} +@d zen_kuten = 162 {Zenkaku kuten second byte; in EUC} +@d zen_ten = 163 {Zenkaku ten second byte; in EUC} +@d zen_comma = 164 {Zenkaku comman second byte; in EUC} +@d zen_period = 165 {Zenkaku period second byte; in EUC} +@d zen_question = 169 {Zenkaku question mark second byte; in EUC} +@d zen_exclamation = 170 {Zenkaku exclamation mark second byte; in EUC} +@y +@d e_ss3 = @"8F {single shift three in EUC} +@d e_pun_first = @"A1 {Zenkaku punctuation first byte; in EUC} +@d e_space = @"A1A1 {Zenkaku space; in EUC} +@d e_toten = @"A1A2 {Zenkaku kuten; in EUC} +@d e_kuten = @"A1A3 {Zenkaku toten; in EUC} +@d e_comma = @"A1A4 {Zenkaku comman; in EUC} +@d e_period = @"A1A5 {Zenkaku period; in EUC} +@d e_question = @"A1A9 {Zenkaku question mark; in EUC} +@d e_exclamation =@"A1AA {Zenkaku exclamation mark; in EUC} +@d u_pun_first1 = @"E3 {Zenkaku punctuation first byte(1); in UTF-8} +@d u_pun_first2 = @"EF {Zenkaku punctuation first byte(2); in UTF-8} +@d u_space = @"3000 {Zenkaku space; in UCS} +@d u_toten = @"3001 {Zenkaku toten; in UCS} +@d u_kuten = @"3002 {Zenkaku kuten; in UCS} +@d u_comma = @"FF0C {Zenkaku comman; in UCS} +@d u_period = @"FF0E {Zenkaku period; in UCS} +@d u_question = @"FF1F {Zenkaku question mark; in UCS} +@d u_exclamation = @"FF01 {Zenkaku exclamation mark; in UCS} +@d u_double_question = @"2047 {Zenkaku double question mark; in UCS} +@d u_double_exclam = @"203C {Zenkaku double exclamation mark; in UCS} +@d u_question_exclam = @"2048 {Zenkaku question exclamation mark; in UCS} +@d u_exclam_question = @"2049 {Zenkaku exclamation question mark; in UCS} +@z + +@x +for i:=@'200 to @'237 do lex_class[i] := illegal; +for i:=@'240 to 255 do lex_class[i] := alpha; +lex_class[@'33]:=alpha; +@y +@z + +@x +for i:=@'200 to @'237 do id_class[i] := illegal_id_char; +@y +@z + +@x +for i:=@'240 to 254 do char_width[i]:=514; +@y +@z + +@x procedure get_the_top_level_aux_file_name +label aux_found,@!aux_not_found; +@y +label aux_found,@!aux_not_found; +var i:0..last_text_char; {this is the first one declared} +@z +@x + @ +@y + @ + @ +@z + +@x + zen_ten, + zen_period, + zen_question, + zen_exclamation: + if( str_pool[sp_ptr-1] = zen_pun_first ) then + repush_string + else + @; + othercases + @ +@y + othercases + begin + if (is_internalEUC) then + begin + case (fromBUFF(str_pool, sp_ptr+1, sp_ptr-1)) of + e_kuten, + e_period, + e_question, + e_exclamation: + if (str_pool[sp_ptr-2]<>e_ss3) then + repush_string + else + @; + othercases + @; + endcases; + end; + if (is_internalUPTEX) then + begin + case (fromBUFF(str_pool, sp_ptr+1, sp_ptr-2)) of + u_kuten, + u_period, + u_question, + u_exclamation, + u_double_question, + u_double_exclam, + u_question_exclam, + u_exclam_question: + repush_string; + othercases + @; + endcases; + end; + end; +@z + +@x + if(str_pool[str_start[pop_lit1]]>127) then { a KANJI char is 2byte long } +@y + if(str_pool[str_start[pop_lit1]]>127) then { a KANJI char is |2..4|byte long } +@z + +@x + if( (ex_buf[ex_buf_ptr-1]=zen_comma) or (ex_buf[ex_buf_ptr-1]=zen_kuten) ) + then ex_buf_ptr := ex_buf_ptr - 2 + else ex_buf_ptr := ex_buf_ptr - 4; +@y + if (is_internalEUC) then + if((fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr-2) = e_comma) or + (fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr-2) = e_toten)) + then ex_buf_ptr := ex_buf_ptr - 2 + else ex_buf_ptr := ex_buf_ptr - 4; + if (is_internalUPTEX) then + if((fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr-3) = u_comma) or + (fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr-3) = u_toten)) + then ex_buf_ptr := ex_buf_ptr - 3 + else ex_buf_ptr := ex_buf_ptr - 4; +@z + +@x + zen_pun_first: + begin + if((ex_buf[ex_buf_ptr+1]=zen_comma) or + (ex_buf[ex_buf_ptr+1]=zen_kuten) ) then +@y + e_pun_first: + if (is_internalEUC) then + begin + if ((fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr) = e_comma) or + (fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr) = e_toten)) then +@z +@x + else if(ex_buf[ex_buf_ptr+1]=zen_space) then +@y + else if (fromBUFF(ex_buf,ex_buf_length,ex_buf_ptr) = e_space) then +@z +@x + end; +@y + end else begin + ex_buf_ptr := ex_buf_ptr + multibytelen(ex_buf[ex_buf_ptr]); + preceding_white := false; + end; + u_pun_first1, + u_pun_first2: + if (is_internalUPTEX) then + begin + if ((fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr) = u_comma) or + (fromBUFF(ex_buf, ex_buf_length, ex_buf_ptr) = u_toten)) then + begin + preceding_white := false; + and_found := true + end + else if (fromBUFF(ex_buf,ex_buf_length,ex_buf_ptr) = u_space) then + begin + ex_buf[ex_buf_ptr] := space; + ex_buf[ex_buf_ptr+1] := space; + ex_buf[ex_buf_ptr+2] := space; + preceding_white := true; + end; + ex_buf_ptr := ex_buf_ptr + 3; + end else begin + ex_buf_ptr := ex_buf_ptr + multibytelen(ex_buf[ex_buf_ptr]); + preceding_white := false; + end; +@z + +@x + if( ex_buf[ex_buf_ptr] > 127 ) then + ex_buf_ptr := ex_buf_ptr +2 + else + incr(ex_buf_ptr); +@y + ex_buf_ptr := ex_buf_ptr + multibytelen(ex_buf[ex_buf_ptr]); +@z + +@x + if name_buf[name_bf_ptr]>127 then begin + append_ex_buf_char_and_check (name_buf[name_bf_ptr]); + incr(name_bf_ptr); + append_ex_buf_char_and_check (name_buf[name_bf_ptr]); + end + else + append_ex_buf_char_and_check (name_buf[name_bf_ptr]); +@y + append_ex_buf_char_and_check (name_buf[name_bf_ptr]); + if multibytelen(name_buf[name_bf_ptr]) > 1 then + append_ex_buf_char_and_check (name_buf[name_bf_ptr+1]); + if multibytelen(name_buf[name_bf_ptr]) > 2 then + append_ex_buf_char_and_check (name_buf[name_bf_ptr+2]); + if multibytelen(name_buf[name_bf_ptr]) > 3 then + append_ex_buf_char_and_check (name_buf[name_bf_ptr+3]); + name_bf_ptr := name_bf_ptr + multibytelen(name_buf[name_bf_ptr])-1; +@z + +@x +{ 2 bytes Kanji code break check } +@y +{ |2..4| bytes Kanji code break check } +@z +@x + if str_pool[tps] > 127 + then tps := tps + 2 + else incr(tps); +@y + tps := tps + multibytelen(str_pool[tps]); +@z +@x + if str_pool[tpe] > 127 + then tpe := tpe+2 + else incr(tpe); +@y + tpe := tpe + multibytelen(str_pool[tpe]); +@z + +@x + if str_pool[sp_ptr] >127 then begin + append_char (str_pool[sp_ptr]); incr(sp_ptr); + append_char (str_pool[sp_ptr]); incr(sp_ptr); + end + else begin + append_char (str_pool[sp_ptr]); incr(sp_ptr); + end; +@y + append_char (str_pool[sp_ptr]); + if multibytelen(str_pool[sp_ptr]) > 1 then + append_char (str_pool[sp_ptr+1]); + if multibytelen(str_pool[sp_ptr]) > 2 then + append_char (str_pool[sp_ptr+2]); + if multibytelen(str_pool[sp_ptr]) > 3 then + append_char (str_pool[sp_ptr+3]); + if multibytelen(str_pool[sp_ptr]) > 0 then + sp_ptr := sp_ptr + multibytelen(str_pool[sp_ptr]) + else + incr(sp_ptr); +@z + +@x + incr(sp_xptr1); num_text_chars:=num_text_chars+2; +@y + num_text_chars := num_text_chars + multibytelen(str_pool[sp_xptr1-1]); + sp_xptr1 := sp_xptr1-1 + multibytelen(str_pool[sp_xptr1-1]); +@z + +@x +const n_options = 6; {Pascal won't count array lengths for us.} +@y +const n_options = 7; {Pascal won't count array lengths for us.} +@z + +@x + usage ('pbibtex'); +@y + usage ('upbibtex'); +@z + +@x + usage_help (PBIBTEX_HELP, nil); +@y + usage_help (UPBIBTEX_HELP, nil); +@z + +@x + end; {Else it was a flag; |getopt| has already done the assignment.} +@y + end else if argument_is ('kanji-internal') then begin + if (not (set_enc_string(0,optarg) and + (is_internalEUC or is_internalUPTEX))) then + write_ln('Bad internal kanji encoding "', stringcast(optarg), '".'); + + end; {Else it was a flag; |getopt| has already done the assignment.} +@z + +@x + write_ln (stderr, 'pbibtex: Need exactly one file argument.'); + usage ('pbibtex'); +@y + write_ln (stderr, 'upbibtex: Need exactly one file argument.'); + usage ('upbibtex'); +@z + +@x +@ An element with all zeros always ends the list. +@y +@ Kanji-internal option. +@.-kanji-internal@> + +@ = +long_options[current_option].name := 'kanji-internal'; +long_options[current_option].has_arg := 1; +long_options[current_option].flag := 0; +long_options[current_option].val := 0; +incr(current_option); + +@ An element with all zeros always ends the list. +@z + +@x +exit:end; +@y +exit:end; + +@ @= +if (is_internalUPTEX) then + begin + for i:=@"80 to @"BF do lex_class[i] := alpha; { trail bytes } + for i:=@"C0 to @"C1 do lex_class[i] := illegal; + for i:=@"C2 to @"F4 do lex_class[i] := alpha; { lead bytes } + for i:=@"F5 to @"FF do lex_class[i] := illegal; + for i:=@"C0 to @"C1 do id_class[i] := illegal_id_char; + for i:=@"F5 to @"FF do id_class[i] := illegal_id_char; + for i:=@"80 to @"BF do char_width[i]:=257; { trail bytes } + for i:=@"C2 to @"DF do char_width[i]:=771; { lead bytes (2bytes) } + for i:=@"E0 to @"EF do char_width[i]:=514; { lead bytes (3bytes) } + for i:=@"F0 to @"F4 do char_width[i]:=257; { lead bytes (4bytes) } + end +else + begin { is_internalEUC } + for i:=@'200 to @'240 do lex_class[i] := illegal; + for i:=@'241 to 254 do lex_class[i] := alpha; + lex_class[255]:=illegal; + for i:=@'200 to @'240 do id_class[i] := illegal_id_char; + id_class[255]:=illegal_id_char; + lex_class[@'33]:=alpha; + lex_class[e_ss3]:=alpha; + for i:=@'241 to 254 do char_width[i]:=514; + char_width[e_ss3]:=0; + end; +@z + diff --git a/Build/source/texk/web2c/uptexdir/updvitype.ch b/Build/source/texk/web2c/uptexdir/updvitype.ch index 84f56f1d2d9..47297de8a29 100644 --- a/Build/source/texk/web2c/uptexdir/updvitype.ch +++ b/Build/source/texk/web2c/uptexdir/updvitype.ch @@ -1,5 +1,5 @@ @x -@d banner=='This is PDVItype, Version 3.6-p0.4' +@d banner=='This is pDVItype, Version 3.6-p0.4' @y @d banner=='This is upDVItype, Version 3.6-p0.4-u0.28' @z diff --git a/Build/source/texk/web2c/uptexdir/uppltotf.ch b/Build/source/texk/web2c/uptexdir/uppltotf.ch new file mode 100644 index 00000000000..61326987d0a --- /dev/null +++ b/Build/source/texk/web2c/uptexdir/uppltotf.ch @@ -0,0 +1,98 @@ +@x +@d banner=='This is pPLtoTF, Version 3.5-p1.8' +@y +@d banner=='This is upPLtoTF, Version 3.5-p1.8-u0.30' +@z + +@x + usage ('ppltotf'); +@y + usage ('uppltotf'); +@z + +@x + usage_help (PPLTOTF_HELP, nil); +@y + usage_help (UPPLTOTF_HELP, nil); +@z + +@x + write_ln (stderr, 'ppltotf: Need one or two file arguments.'); + usage ('ppltotf'); +@y + write_ln (stderr, 'uppltotf: Need one or two file arguments.'); + usage ('uppltotf'); +@z + +@x +max_kanji=7237; { maximam number of 2byte characters } +@y +max_kanji=65535; { maximam number of 2byte characters } +@z + +@x function get_next_raw +if multistrlen(stringcast(buffer),loc+2,loc)=2 then cur_char:=" " +@y +if multistrlen(stringcast(buffer),loc+3,loc)>1 then cur_char:=" " +@z + +@x function valid_jis_code +var @!first_byte,@!second_byte:integer; { jis code bytes } +begin valid_jis_code:=true; +first_byte:=cx div @'400; second_byte:=cx mod @'400; +if (first_byte<@"21) + or((first_byte>@"28)and(first_byte<@"30)) + or(first_byte>@"74) then valid_jis_code:=false; +if (second_byte<@"21)or(second_byte>@"7E) then valid_jis_code:=false; +@y +begin valid_jis_code:=true; +if (cx>@"FFFF)or(check_kanji(fromDVI(cx),0)<>1) + or(toDVI(fromDVI(cx))<>cx) then valid_jis_code:=false; +@z + +@x function jis_to_index +var @!first_byte,@!second_byte:integer; { jis code bytes } +begin +first_byte:=jis div @'400 -@"21; +second_byte:=jis mod @'400 -@"21; +if first_byte<8 then + jis_to_index:=first_byte*94+second_byte +else { next |first_byte| start 16 } + jis_to_index:=(first_byte-7)*94+second_byte; +@y +begin +jis_to_index:=jis; +@z + +@x function index_to_jis +begin if ix<=8*94-1 then + index_to_jis:=(ix div 94 +@"21)*@'400+(ix mod 94 +@"21) +else + index_to_jis:=((ix+7*94) div 94 +@"21)*@'400+((ix+7*94) mod 94 +@"21); +@y +begin +index_to_jis:=ix; +@z + +@x function get_kanji +else if multistrlen(stringcast(buffer), loc+2, loc)=2 then + begin jis_code:=toDVI(fromBUFF(stringcast(buffer), loc+2, loc)); + incr(loc); cur_char:=" "; +@y +else if (ch='U')or(ch='u') then + begin repeat ch:=get_next_raw; until ch<>' '; + cx:=todig(xord[ch])*@"1000; + incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch)*@"100; + incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch)*@"10; + incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch); + jis_code:=toDVI(fromUCS(cx)); + cur_char:=ch; + if not valid_jis_code(jis_code) then + err_print('jis code ', jis_code:1, ' is invalid'); + end +else if multistrlen(stringcast(buffer), loc+4, loc)>1 then + begin cur_char:=" "; + jis_code:=toDVI(fromBUFF(stringcast(buffer), loc+4, loc)); + loc:=loc+multistrlen(stringcast(buffer), loc+4, loc)-1; +@z + diff --git a/Build/source/texk/web2c/uptexdir/uptex.defines b/Build/source/texk/web2c/uptexdir/uptex.defines index d32c67bca64..635039307ea 100644 --- a/Build/source/texk/web2c/uptexdir/uptex.defines +++ b/Build/source/texk/web2c/uptexdir/uptex.defines @@ -10,6 +10,7 @@ @define function setencstring (); @define procedure setpriorfileenc; @define function isinternalUPTEX; +@define function isinternalEUC; @define procedure setptexencuptex; @define function iskanji1 (); @@ -17,6 +18,7 @@ @define function ismultichr (); @define function multistrlen (); +@define function multibytelen (); @define function fromBUFF (); @define function toBUFF (); @@ -41,6 +43,6 @@ @define function multilenbuffchar (); @define function nrestmultichr (); -@define procedure initdefaultkanji; +@define procedure initkanji; @define var sjisterminal; diff --git a/Build/source/texk/web2c/uptexdir/uptftopl.ch b/Build/source/texk/web2c/uptexdir/uptftopl.ch new file mode 100644 index 00000000000..a3b6b23ba6e --- /dev/null +++ b/Build/source/texk/web2c/uptexdir/uptftopl.ch @@ -0,0 +1,85 @@ +@x +@d banner=='This is pTFtoPL, Version 3.2-p1.7' +@y +@d banner=='This is upTFtoPL, Version 3.2-p1.7-u0.30' +@z + +@x + usage ('ptftopl'); +@y + usage ('uptftopl'); +@z + +@x + usage_help (PTFTOPL_HELP, nil); +@y + usage_help (UPTFTOPL_HELP, nil); +@z + +@x + print_ln ('ptftopl: Need one or two file arguments.'); + usage ('ptftopl'); +@y + print_ln ('uptftopl: Need one or two file arguments.'); + usage ('uptftopl'); +@z + +@x +@d max_kanji=7237 {number of the kanji characters - 1} +@y +@d max_kanji=65535 {number of the kanji characters - 1} +@z + +@x procedure out_kanji + begin cx:=jis_code; out('J '); {specify jiscode format} +@y + begin cx:=jis_code; + if (isinternalUPTEX) then out(' U ') + else out(' J '); {specify jiscode format} +@z +@x + out(xchr[Hi(cx)]); out(xchr[Lo(cx)]); +@y + if BYTE1(cx)<>0 then out(xchr[BYTE1(cx)]); + if BYTE2(cx)<>0 then out(xchr[BYTE2(cx)]); + if BYTE3(cx)<>0 then out(xchr[BYTE3(cx)]); + out(xchr[BYTE4(cx)]); +@z + +@x function valid_jis_code +var first_byte, second_byte:integer; { jis code bytes } +begin valid_jis_code:=true; +first_byte:=cx div @'400; second_byte:=cx mod @'400; +if (first_byte<@"21) + or((first_byte>@"28)and(first_byte<@"30)) + or(first_byte>@"74) then valid_jis_code:=false; +if (second_byte<@"21)or(second_byte>@"7E) then valid_jis_code:=false; +@y +begin valid_jis_code:=true; +if (cx>@"FFFF)or(check_kanji(fromDVI(cx),0)<>1) + or(toDVI(fromDVI(cx))<>cx) then valid_jis_code:=false; +@z + +@x function index_to_jis +if ix<=8*94-1 then + index_to_jis:=(ix div 94 + @"21) * @'400 + (ix mod 94 + @"21) +else + index_to_jis:=((ix+7 * 94) div 94 + @"21) * @'400 + ((ix+7*94) mod 94 + @"21); +@y +index_to_jis:=ix; +@z + +@x function jis_to_index +var first_byte,second_byte:integer; { jis code bytes } +begin +first_byte:=cx div @'400 - @"21; +second_byte:=cx mod @'400 - @"21; +if first_byte<8 then + jis_to_index:=first_byte*94+second_byte +else + jis_to_index:=(first_byte-7)*94+second_byte; +@y +begin +jis_to_index:=cx; +@z + -- cgit v1.2.3