summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-07-09 09:58:58 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-07-09 09:58:58 +0000
commit6aa42e9542ae53019b0b01f7190cbf5e65968a98 (patch)
tree3b1c268ed6e999ecafa288d182fceaf419d8d4a6 /Build/source/texk
parentdf15ab91475b7cbb2c100dd94e990e5e85fea546 (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')
-rw-r--r--Build/source/texk/web2c/ChangeLog4
-rw-r--r--Build/source/texk/web2c/Makefile.in9
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog4
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c37
-rw-r--r--Build/source/texk/web2c/texmfmp.h10
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/xetexdir/am/xetex.am3
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.defines2
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.web55
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex_version.h2
10 files changed, 112 insertions, 20 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 3f849bf8a64..4261f2d5d10 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-09 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * texmfmp.h: Add \pdfmdfivesum to XeTeX.
+
2015-07-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/web.am: Fix dependencies for 'make check'.
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 81b9d406a02..6649cbf38ce 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -1484,7 +1484,7 @@ am__DEPENDENCIES_18 = $(libxetex) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_17)
+ $(am__DEPENDENCIES_1) libmd5.a $(am__DEPENDENCIES_17)
xetex_DEPENDENCIES = $(am__DEPENDENCIES_18) $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_1)
xetex_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
@@ -3612,14 +3612,15 @@ libxetex = libxetex.a
xetex_cppflags = $(AM_CPPFLAGS) -I$(srcdir)/xetexdir $(ICU_INCLUDES) \
$(FREETYPE2_INCLUDES) $(TECKIT_INCLUDES) $(HARFBUZZ_INCLUDES) \
$(GRAPHITE2_INCLUDES) $(POPPLER_INCLUDES) $(LIBPNG_INCLUDES) \
- $(ZLIB_INCLUDES) $(am__append_110) $(am__append_111)
+ $(ZLIB_INCLUDES) -I$(srcdir)/libmd5 $(am__append_110) \
+ $(am__append_111)
xetex_ldadd = $(libxetex) $(HARFBUZZ_LIBS) $(GRAPHITE2_LIBS) \
$(ICU_LIBS) $(TECKIT_LIBS) $(POPPLER_LIBS) $(LIBPNG_LIBS) \
- $(FREETYPE2_LIBS) $(ZLIB_LIBS) $(am__append_112)
+ $(FREETYPE2_LIBS) $(ZLIB_LIBS) libmd5.a $(am__append_112)
xetex_dependencies = $(proglib) $(KPATHSEA_DEPEND) $(ICU_DEPEND) \
$(TECKIT_DEPEND) $(HARFBUZZ_DEPEND) $(GRAPHITE2_DEPEND) \
$(POPPLER_DEPEND) $(LIBPNG_DEPEND) $(FREETYPE2_DEPEND) \
- $(ZLIB_DEPEND)
+ $(ZLIB_DEPEND) libmd5.a
@XETEX_MACOSX_TRUE@xetex_LDFLAGS = -framework ApplicationServices -framework Cocoa
xetex_CPPFLAGS = $(xetex_cppflags) $(am__append_152)
xetex_CFLAGS = # $(WARNING_CFLAGS)
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.
diff --git a/Build/source/texk/web2c/texmfmp.h b/Build/source/texk/web2c/texmfmp.h
index 438dcb741e2..a0a39cf10d8 100644
--- a/Build/source/texk/web2c/texmfmp.h
+++ b/Build/source/texk/web2c/texmfmp.h
@@ -119,10 +119,13 @@ typedef void* voidpointer;
/* Hacks for TeX that are better not to #ifdef, see lib/openclose.c. */
extern int tfmtemp, texinputtype;
-/* pdfTeX routines also used for e-pTeX and e-upTeX */
-#if defined (pdfTeX) || defined (epTeX) || defined (eupTeX)
-extern char start_time_str[];
+/* pdfTeX routines also used for e-pTeX, e-upTeX, and XeTeX */
+#if defined (pdfTeX) || defined (epTeX) || defined (eupTeX) || defined(XeTeX)
+#if !defined (pdfTeX)
extern void pdftex_fail(const char *fmt, ...);
+#endif
+#if !defined(XeTeX)
+extern char start_time_str[];
extern void initstarttime(void);
extern char *makecstring(integer s);
extern char *makecfilename(integer s);
@@ -130,6 +133,7 @@ extern void getcreationdate(void);
extern void getfilemoddate(integer s);
extern void getfilesize(integer s);
extern void getfiledump(integer s, int offset, int length);
+#endif
extern void convertStringToHexString(const char *in, char *out, int lin);
extern void getmd5sum(integer s, int file);
#endif
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index 5a935d105ec..be9259a0e93 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-09 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * xetex.web: Added \pdfmdfivesum, version 0.99993.
+ * xetex.defines: Added getmd5sum().
+ * am/xetex.am: Added libmd5.
+
2015-06-22 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/xetex.am: Use $(tie_c).
diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am
index 0857f0c677e..246e2e6f2f1 100644
--- a/Build/source/texk/web2c/xetexdir/am/xetex.am
+++ b/Build/source/texk/web2c/xetexdir/am/xetex.am
@@ -29,6 +29,7 @@ xetex_cppflags += $(GRAPHITE2_INCLUDES)
xetex_cppflags += $(POPPLER_INCLUDES)
xetex_cppflags += $(LIBPNG_INCLUDES)
xetex_cppflags += $(ZLIB_INCLUDES)
+xetex_cppflags += -I$(srcdir)/libmd5
xetex_ldadd = $(libxetex)
xetex_ldadd += $(HARFBUZZ_LIBS)
xetex_ldadd += $(GRAPHITE2_LIBS)
@@ -38,6 +39,7 @@ xetex_ldadd += $(POPPLER_LIBS)
xetex_ldadd += $(LIBPNG_LIBS)
xetex_ldadd += $(FREETYPE2_LIBS)
xetex_ldadd += $(ZLIB_LIBS)
+xetex_ldadd += libmd5.a
xetex_dependencies = $(proglib)
xetex_dependencies += $(KPATHSEA_DEPEND)
xetex_dependencies += $(ICU_DEPEND)
@@ -48,6 +50,7 @@ xetex_dependencies += $(POPPLER_DEPEND)
xetex_dependencies += $(LIBPNG_DEPEND)
xetex_dependencies += $(FREETYPE2_DEPEND)
xetex_dependencies += $(ZLIB_DEPEND)
+xetex_dependencies += libmd5.a
if XETEX_MACOSX
diff --git a/Build/source/texk/web2c/xetexdir/xetex.defines b/Build/source/texk/web2c/xetexdir/xetex.defines
index efa4099a6bb..ef22d53c8db 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.defines
+++ b/Build/source/texk/web2c/xetexdir/xetex.defines
@@ -177,3 +177,5 @@ authorization from the copyright holders.
@define procedure setcpcode();
@define function getcpcode();
@define function getnativewordcp();
+
+@define procedure getmd5sum();
diff --git a/Build/source/texk/web2c/xetexdir/xetex.web b/Build/source/texk/web2c/xetexdir/xetex.web
index e49d6495c9e..317aab23738 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.web
+++ b/Build/source/texk/web2c/xetexdir/xetex.web
@@ -315,8 +315,8 @@ known as `\eTeX'.
@d eTeX_version_string=='-2.6' {current \eTeX\ version}
@#
@d XeTeX_version=0 { \.{\\XeTeXversion} }
-@d XeTeX_revision==".99992" { \.{\\XeTeXrevision} }
-@d XeTeX_version_string=='-0.99992' {current \XeTeX\ version}
+@d XeTeX_revision==".99993" { \.{\\XeTeXrevision} }
+@d XeTeX_version_string=='-0.99993' {current \XeTeX\ version}
@#
@d XeTeX_banner=='This is XeTeX, Version 3.14159265',eTeX_version_string,XeTeX_version_string
{printed when \XeTeX\ starts}
@@ -6061,7 +6061,7 @@ A global boolean variable called |no_new_control_sequence| is set to
@ Primitive support needs a few extra variables and definitions
-@d prim_size=480 {maximum number of primitives }
+@d prim_size=481 {maximum number of primitives }
@d prim_prime=409 {about 85\pct! of |primitive_size|}
@d prim_base=1
@d prim_next(#) == prim[#].lh {link for coalesced lists}
@@ -9492,12 +9492,13 @@ the codes for its extensions: |eTeX_version_code|, \dots\ .
@d pdf_last_x_pos_code = XeTeX_int+27
@d pdf_last_y_pos_code = XeTeX_int+28
@d pdf_strcmp_code = XeTeX_int+29
-@d pdf_shell_escape_code = XeTeX_int+30
+@d pdf_mdfive_sum_code = XeTeX_int+30
+@d pdf_shell_escape_code = XeTeX_int+31
-@d XeTeX_pdf_page_count_code = XeTeX_int+31
+@d XeTeX_pdf_page_count_code = XeTeX_int+32
@#
-@d XeTeX_dim=XeTeX_int+32 {first of \XeTeX\ codes for dimensions}
+@d XeTeX_dim=XeTeX_int+33 {first of \XeTeX\ codes for dimensions}
@d XeTeX_glyph_bounds_code = XeTeX_dim
@@ -10545,6 +10546,7 @@ convert: case chr_code of
meaning_code: print_esc("meaning");
font_name_code: print_esc("fontname");
pdf_strcmp_code: print_esc("strcmp");
+ pdf_mdfive_sum_code: print_esc("pdfmdfivesum");
left_margin_kern_code: print_esc("leftmarginkern");
right_margin_kern_code: print_esc("rightmarginkern");
@/@<Cases of |convert| for |print_cmd_chr|@>@/
@@ -10565,6 +10567,8 @@ we have to create a temporary string that is destroyed immediately after.
@p procedure conv_toks;
var old_setting:0..max_selector; {holds |selector| setting}
@!save_warning_index, @!save_def_ref:pointer;
+@!boolvar: boolean; {temp boolean}
+@!s: str_number;
@!u: str_number;
@!c:small_number; {desired type of conversion}
@!save_scanner_status:small_number; {|scanner_status| upon entry}
@@ -28776,6 +28780,11 @@ begin
tokens_to_string:=make_string;
end;
+procedure scan_pdf_ext_toks;
+begin
+ call_func(scan_toks(false, true)); {like \.{\\special}}
+end;
+
procedure compare_strings; {to implement \.{\\strcmp}}
label done;
var s1, s2: str_number;
@@ -29745,6 +29754,7 @@ primitive("XeTeXlastfontchar", last_item, XeTeX_last_char_code);
primitive("pdflastxpos",last_item,pdf_last_x_pos_code);
primitive("pdflastypos",last_item,pdf_last_y_pos_code);
primitive("strcmp",convert,pdf_strcmp_code);
+primitive("pdfmdfivesum",convert,pdf_mdfive_sum_code);
primitive("shellescape",last_item,pdf_shell_escape_code);
primitive("XeTeXpdfpagecount",last_item,XeTeX_pdf_page_count_code);
@@ -30081,6 +30091,39 @@ pdf_strcmp_code:
scanner_status:=save_scanner_status;
restore_cur_string;
end;
+
+pdf_mdfive_sum_code:
+ begin
+ save_scanner_status := scanner_status;
+ save_warning_index := warning_index;
+ save_def_ref := def_ref;
+ save_cur_string;
+ boolvar := scan_keyword("file");
+ scan_pdf_ext_toks;
+
+ if selector = new_string then
+ pdf_error("tokens", "tokens_to_string() called while selector = new_string");
+ old_setting:=selector; selector:=new_string;
+ show_token_list(link(def_ref),null,pool_size-pool_ptr);
+ selector:=old_setting;
+ s:=make_string;
+
+ delete_token_ref(def_ref);
+ def_ref := save_def_ref;
+ warning_index := save_warning_index;
+ scanner_status := save_scanner_status;
+ b := pool_ptr;
+ getmd5sum(s, boolvar);
+ link(garbage) := str_toks(b);
+
+ if flushable(s) then
+ flush_string;
+
+ ins_list(link(temp_head));
+ restore_cur_string;
+ return;
+ end;
+
XeTeX_revision_code: do_nothing;
XeTeX_variation_name_code:
diff --git a/Build/source/texk/web2c/xetexdir/xetex_version.h b/Build/source/texk/web2c/xetexdir/xetex_version.h
index 082800c34c9..115206efa1e 100644
--- a/Build/source/texk/web2c/xetexdir/xetex_version.h
+++ b/Build/source/texk/web2c/xetexdir/xetex_version.h
@@ -1 +1 @@
-#define XETEX_VERSION "0.99992"
+#define XETEX_VERSION "0.99993"