summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-01-11 13:32:26 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-01-11 13:32:26 +0000
commit453a9f4421fd7a166fa69189572f11c70a1acf4b (patch)
tree25b5af72cb4b07fe4fc78a0f71d155489c9df263 /Build
parent4e25170b7c9bc4a0790412e731d36ed28106df66 (diff)
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@39348 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexlib.c16
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c46
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.h1
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfgen.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdftables.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/extensions.w4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texfileio.w9
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.w43
8 files changed, 52 insertions, 71 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
index 63abd0a4824..97d754a152b 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
@@ -2666,20 +2666,22 @@ static int tex_show_context(lua_State * L)
static int tex_save_box_resource(lua_State * L)
{
halfword boxdata;
- int index, attributes, resources;
+ int index = null;
+ int attributes = null;
+ int resources = null;
+ boolean immediate = false;
/* box attributes resources */
halfword boxnumber = lua_tointeger(L,1);
if (lua_type(L,2) == LUA_TSTRING) {
lua_pushvalue(L, 2);
attributes = luaL_ref(L, LUA_REGISTRYINDEX);
- } else {
- attributes = null;
}
if (lua_type(L,3) == LUA_TSTRING) {
lua_pushvalue(L, 3);
resources = luaL_ref(L, LUA_REGISTRYINDEX);
- } else {
- resources = null;
+ }
+ if (lua_type(L,4) == LUA_TBOOLEAN) {
+ immediate = lua_toboolean(L, 4);
}
/* more or less same as scanner variant */
boxdata = box(boxnumber);
@@ -2699,6 +2701,10 @@ static int tex_save_box_resource(lua_State * L)
box(boxnumber) = null;
last_saved_box_index = index;
lua_pushinteger(L, index);
+ if (immediate) {
+ pdf_cur_form = last_saved_box_index;
+ ship_out(static_pdf, obj_xform_box(static_pdf, last_saved_box_index), SHIPPING_FORM);
+ }
return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index b4735243870..f434524c821 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -29,9 +29,9 @@
#define TeX
int luatex_version = 87; /* \.{\\luatexversion} */
-int luatex_revision = '1'; /* \.{\\luatexrevision} */
-int luatex_date_info = 2015122000; /* the compile date is now hardwired */
-const char *luatex_version_string = "beta-0.87.1";
+int luatex_revision = '2'; /* \.{\\luatexrevision} */
+int luatex_date_info = 2016011100; /* the compile date is now hardwired */
+const char *luatex_version_string = "beta-0.87.2";
const char *engine_name = my_name; /* the name of this engine */
#include <kpathsea/c-ctype.h>
@@ -410,46 +410,6 @@ int shell_cmd_is_allowed(const char *cmd, char **safecmd, char **cmdname)
return allow;
}
-/* We should only be called with shellenabledp == 1.
- Return value:
- -1 if a quotation syntax error.
- 0 if CMD is not allowed; given shellenabledp==1, this is because
- shell escapes are restricted and CMD is not allowed.
- 1 if shell escapes are not restricted, hence any command is allowed.
- 2 if shell escapes are restricted and CMD is allowed. */
-
-int runsystem(const char *cmd)
-{
- int allow = 0;
- char *safecmd = NULL;
- char *cmdname = NULL;
- int status = 0;
- if (shellenabledp <= 0) {
- return 0;
- }
-
- /* If restrictedshell == 0, any command is allowed. */
- if (restrictedshell == 0)
- allow = 1;
- else
- allow = shell_cmd_is_allowed(cmd, &safecmd, &cmdname);
-
- if (allow == 1)
- status = system(cmd);
- else if (allow == 2)
- status = system(safecmd);
- /* Not really meaningful, but we have to manage the return value of system. */
- if (status==-1)
- fprintf(stderr,"system returned with code -1\n");
-
- if (safecmd)
- free(safecmd);
- if (cmdname)
- free(cmdname);
-
- return allow;
-}
-
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luatex.h b/Build/source/texk/web2c/luatexdir/luatex.h
index 0631a1a5b8e..8b1254dcbff 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.h
+++ b/Build/source/texk/web2c/luatexdir/luatex.h
@@ -73,7 +73,6 @@ extern void mk_shellcmdlist(char *);
extern void init_shell_escape(void);
extern int shell_cmd_is_allowed(const char *cmd, char **safecmd,
char **cmdname);
-extern int runsystem(const char *cmd);
#if defined(WIN32) && !defined(__MINGW32__) && defined(DLLPROC)
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
index a072b192b4e..db8a0e7ea3b 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w
@@ -1629,7 +1629,7 @@ void pdf_begin_page(PDF pdf)
{
pdffloat f;
int xform_attributes;
- scaled form_margin = 0; /* was one_bp until SVN4066 */
+ scaled form_margin = pdf_xform_margin; /* was one_bp until SVN4066 */
ensure_output_state(pdf, ST_HEADER_WRITTEN);
init_pdf_pagecalculations(pdf);
if (pdf->page_resources == NULL) {
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
index f08195b4e04..badc6b2fd70 100644
--- a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h
@@ -138,6 +138,7 @@ typedef enum {
d_pdf_thread_margin,
d_pdf_dest_margin,
d_pdf_link_margin,
+ d_pdf_xform_margin,
} pdf_backend_dimensions ;
typedef enum {
@@ -176,6 +177,7 @@ extern int pdf_retval;
# define pdf_thread_margin get_tex_extension_dimen_register(d_pdf_thread_margin)
# define pdf_dest_margin get_tex_extension_dimen_register(d_pdf_dest_margin)
# define pdf_link_margin get_tex_extension_dimen_register(d_pdf_link_margin)
+# define pdf_xform_margin get_tex_extension_dimen_register(d_pdf_xform_margin)
# define pdf_page_attr get_tex_extension_toks_register(t_pdf_page_attr)
# define pdf_page_resources get_tex_extension_toks_register(t_pdf_page_resources)
diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.w b/Build/source/texk/web2c/luatexdir/tex/extensions.w
index 0e178f01516..a6161dcf243 100644
--- a/Build/source/texk/web2c/luatexdir/tex/extensions.w
+++ b/Build/source/texk/web2c/luatexdir/tex/extensions.w
@@ -423,10 +423,10 @@ void do_extension(int immediate)
case save_image_resource_code:
switch (get_o_mode()) {
case OMODE_DVI:
- do_resource_dvi(0,cur_chr);
+ do_resource_dvi(immediate,cur_chr);
break;
case OMODE_PDF:
- do_resource_pdf(0,cur_chr);
+ do_resource_pdf(immediate,cur_chr);
break;
default:
break;
diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.w b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
index d274f6d3439..e04bf991afb 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texfileio.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
@@ -1220,11 +1220,10 @@ int readbinfile(FILE * f, unsigned char **tfm_buffer, int *tfm_size)
return 0;
}
-
-@ Like |runsystem()|, the |runpopen()| function is called only when
- |shellenabledp == 1|. Unlike |runsystem()|, here we write errors to
- stderr, since we have nowhere better to use; and of course we return
- a file handle (or NULL) instead of a status indicator.
+@ Like |os.execute()|, the |runpopen()| function is called only when
+|shellenabledp == 1|. Unlike |os.execute()| we write errors to stderr, since we
+have nowhere better to use; and of course we return a file handle (or NULL)
+instead of a status indicator.
@c
static FILE *runpopen(char *cmd, const char *mode)
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w
index 0c11bb0f290..996e3cf2303 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.w
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w
@@ -2317,6 +2317,7 @@ static int do_variable_pdf(halfword c)
else if (scan_keyword("threadmargin")) { do_variable_backend_dimen(d_pdf_thread_margin); }
else if (scan_keyword("destmargin")) { do_variable_backend_dimen(d_pdf_dest_margin); }
else if (scan_keyword("linkmargin")) { do_variable_backend_dimen(d_pdf_link_margin); }
+ else if (scan_keyword("xformmargin")) { do_variable_backend_dimen(d_pdf_xform_margin); }
else if (scan_keyword("pageattr")) { do_variable_backend_toks(t_pdf_page_attr); }
else if (scan_keyword("pageresources")) { do_variable_backend_toks(t_pdf_page_resources); }
@@ -2792,24 +2793,34 @@ void do_feedback(void)
int done = 1;
switch (c) {
case dvi_feedback_code:
- if (get_o_mode() == OMODE_DVI)
+ if (get_o_mode() == OMODE_DVI) {
done = do_feedback_dvi(c);
- else
- done = 0;
- if (done==0)
+ } else {
tex_error("unexpected use of \\dvifeedback",null);
- else if (done==2)
+ return ;
+ }
+ if (done==0) {
+ /* we recover */
+ normal_warning("dvi backend","unexpected use of \\dvifeedback");
return;
+ } else if (done==2) {
+ return;
+ }
break;
case pdf_feedback_code:
- if (get_o_mode() == OMODE_PDF)
+ if (get_o_mode() == OMODE_PDF) {
done = do_feedback_pdf(c);
- else
- done = 0;
- if (done==0)
+ } else {
tex_error("unexpected use of \\pdffeedback",null);
- else if (done==2)
+ return ;
+ }
+ if (done==0) {
+ /* we recover */
+ normal_warning("pdf backend","unexpected use of \\pdffeedback");
+ return;
+ } else if (done==2) {
return;
+ }
break;
default:
confusion("feedback");
@@ -2828,14 +2839,18 @@ void do_variable(void)
switch (c) {
case dvi_variable_code:
done = do_variable_dvi(c);
- if (done==0)
- tex_error("unexpected use of \\dvivariable",null);
+ if (done==0) {
+ /* we recover */
+ normal_warning("dvi backend","unexpected use of \\dvivariable");
+ }
return;
break;
case pdf_variable_code:
done = do_variable_pdf(c);
- if (done==0)
- tex_error("unexpected use of \\pdfvariable",null);
+ if (done==0) {
+ /* we recover */
+ normal_warning("pdf backend","unexpected use of \\pdfvariable");
+ }
return;
break;
default: