diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-07-09 09:58:58 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-07-09 09:58:58 +0000 |
commit | 6aa42e9542ae53019b0b01f7190cbf5e65968a98 (patch) | |
tree | 3b1c268ed6e999ecafa288d182fceaf419d8d4a6 /Build/source/texk/web2c/lib | |
parent | df15ab91475b7cbb2c100dd94e990e5e85fea546 (diff) |
XeTeX: Added \pdfmdfivesum, Version 0.99993
git-svn-id: svn://tug.org/texlive/trunk@37818 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/lib')
-rw-r--r-- | Build/source/texk/web2c/lib/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 37 |
2 files changed, 35 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 2bb8387c24f..cbebfb2ef62 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,7 @@ +2015-07-09 Akira Kakuto <kakuto@fuk.kinidai.ac.jp> + + * texmfmp.c: Add \pdfmdfivesum to XeTeX. + 2015-07-02 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp> * texmfmp.c: Moved convertStringToHexString() and getmd5sum() diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index bbe10eb376a..865db7b77e9 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -2832,8 +2832,8 @@ makesrcspecial (strnumber srcfilename, int lineno) return (oldpoolptr); } -/* pdfTeX routines also used for e-pTeX and e-upTeX */ -#if defined (pdfTeX) || defined (epTeX) || defined (eupTeX) +/* pdfTeX routines also used for e-pTeX, e-upTeX, and XeTeX */ +#if defined (pdfTeX) || defined (epTeX) || defined (eupTeX) || defined(XeTeX) #include <kpathsea/c-stat.h> #include "md5.h" @@ -2888,6 +2888,7 @@ void pdftex_fail(const char *fmt, ...) } #endif /* not pdfTeX */ +#if !defined(XeTeX) static time_t start_time = 0; #define TIME_STR_SIZE 30 char start_time_str[TIME_STR_SIZE]; @@ -3136,7 +3137,7 @@ void getfiledump(integer s, int offset, int length) } xfree(file_name); } - +#endif /* not XeTeX */ /* Converts any given string in into an allowed PDF string which is * hexadecimal encoded; @@ -3166,13 +3167,24 @@ void getmd5sum(strnumber s, boolean file) md5_byte_t digest[DIGEST_SIZE]; char outbuf[2 * DIGEST_SIZE + 1]; int len = 2 * DIGEST_SIZE; +#if defined(XeTeX) + unsigned char *xname; + int i; +#endif if (file) { char file_buf[FILE_BUF_SIZE]; int read = 0; FILE *f; + char *file_name; - char *file_name = kpse_find_tex(makecfilename(s)); +#if defined(XeTeX) + xname = gettexstring (s); + file_name = kpse_find_tex (xname); + xfree (xname); +#else + file_name = kpse_find_tex(makecfilename(s)); +#endif if (file_name == NULL) { return; /* empty string */ } @@ -3196,9 +3208,17 @@ void getmd5sum(strnumber s, boolean file) } else { /* s contains the data */ md5_init(&state); +#if defined(XeTeX) + xname = gettexstring (s); + md5_append(&state, + (md5_byte_t *) xname, + strlen (xname)); + xfree (xname); +#else md5_append(&state, - (const md5_byte_t *) &strpool[strstart[s]], + (md5_byte_t *) &strpool[strstart[s]], strstart[s + 1] - strstart[s]); +#endif md5_finish(&state, digest); } @@ -3207,11 +3227,16 @@ void getmd5sum(strnumber s, boolean file) return; } convertStringToHexString((char *) digest, outbuf, DIGEST_SIZE); +#if defined(XeTeX) + for (i = 0; i < 2 * DIGEST_SIZE; i++) + strpool[poolptr++] = (uint16_t)outbuf[i]; +#else memcpy(&strpool[poolptr], outbuf, len); poolptr += len; +#endif } -#endif /* pdfTeX or e-pTeX or e-upTeX */ +#endif /* pdfTeX or e-pTeX or e-upTeX or XeTeX */ #endif /* TeX */ /* Metafont/MetaPost fraction routines. Replaced either by assembler or C. |