From e0fb2aed88184c9e02b1e022efd0287d787e2aa3 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Thu, 2 Feb 2017 21:19:36 +0000 Subject: mfluajitdir, mfluadir: sync with the upstream git-svn-id: svn://tug.org/texlive/trunk@43120 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/mfluadir/mf-lua.ch | 6 + Build/source/texk/web2c/mfluadir/mflua.defines | 4 + Build/source/texk/web2c/mfluadir/mfluac.c | 180 +++++++++++++++++++++ Build/source/texk/web2c/mfluadir/mfluac.h | 5 + .../source/texk/web2c/mfluajitdir/mfluajit.defines | 4 + 5 files changed, 199 insertions(+) (limited to 'Build/source/texk') diff --git a/Build/source/texk/web2c/mfluadir/mf-lua.ch b/Build/source/texk/web2c/mfluadir/mf-lua.ch index 46f03757e83..14c60b5b7c5 100644 --- a/Build/source/texk/web2c/mfluadir/mf-lua.ch +++ b/Build/source/texk/web2c/mfluadir/mf-lua.ch @@ -402,6 +402,8 @@ mfluaPOST_make_choices(p); @z @x [44.1064] MFLua + cur_wt:=w; rhs:=make_spec(rhs,max_offset(cur_pen),internal[tracing_specs]); + @; if max_offset(cur_pen)=0 then fill_spec(rhs) else fill_envelope(rhs); if lhs<>null then @@ -411,11 +413,15 @@ mfluaPOST_make_choices(p); if max_offset(cur_pen)=0 then fill_spec(lhs) else fill_envelope(lhs); @y + cur_wt:=w; mfluaPRE_make_spec_rhs(rhs); rhs:=make_spec(rhs,max_offset(cur_pen),internal[tracing_specs]);mfluaPOST_make_spec_rhs(rhs); + @; if max_offset(cur_pen)=0 then begin mfluaPRE_fill_spec_rhs(rhs); fill_spec(rhs); mfluaPOST_fill_spec_rhs(rhs);end else begin mfluaPRE_fill_envelope_rhs(rhs); fill_envelope(rhs); mfluaPOST_fill_envelope_rhs(rhs); end ; if lhs<>null then begin rev_turns:=true; + mfluaPRE_make_spec_lhs(lhs); lhs:=make_spec(lhs,max_offset(cur_pen),internal[tracing_specs]); + mfluaPOST_make_spec_lhs(lhs); rev_turns:=false; if max_offset(cur_pen)=0 then begin mfluaPRE_fill_spec_lhs(lhs); fill_spec(lhs); mfluaPOST_fill_spec_lhs(lhs); end else begin mfluaPRE_fill_envelope_lhs(lhs); fill_envelope(lhs); mfluaPOST_fill_envelope_lhs(lhs); end; diff --git a/Build/source/texk/web2c/mfluadir/mflua.defines b/Build/source/texk/web2c/mfluadir/mflua.defines index 383f1def95b..f142ef4c5b1 100644 --- a/Build/source/texk/web2c/mfluadir/mflua.defines +++ b/Build/source/texk/web2c/mfluadir/mflua.defines @@ -9,6 +9,10 @@ @define procedure mfluaPOSTfillenveloperhs(); @define procedure mfluaPREfillenvelopelhs(); @define procedure mfluaPOSTfillenvelopelhs(); +@define procedure mfluaPREmakespecrhs(); +@define procedure mfluaPOSTmakespecrhs(); +@define procedure mfluaPREmakespeclhs(); +@define procedure mfluaPOSTmakespeclhs(); @define procedure mfluaPREfillspecrhs(); @define procedure mfluaPOSTfillspecrhs(); @define procedure mfluaPREfillspeclhs(); diff --git a/Build/source/texk/web2c/mfluadir/mfluac.c b/Build/source/texk/web2c/mfluadir/mfluac.c index a60f56885e4..f98323bf267 100644 --- a/Build/source/texk/web2c/mfluadir/mfluac.c +++ b/Build/source/texk/web2c/mfluadir/mfluac.c @@ -982,6 +982,186 @@ int mfluaPOSToffsetprep(halfword c, halfword h) } +int mfluaPREmakespecrhs(halfword rhs) +{ + lua_State *L; + char* luafile; + int res; + + L = Luas[0]; + luafile = kpse_find_file("do_add_to.lua", kpse_lua_format, 0); + if (luafile==NULL) { + res = 1; + lua_pushstring(L,"do_add_to.lua not found"); + priv_lua_reporterrors(L, res); + return 0; + } + priv_lua_writemessage(L,"(",luafile,")",1); + res = luaL_loadfile(L, luafile); + free (luafile); + if ( res==0 ){ + res = lua_pcall(L, 0, 0, 0); + if (res==0){ + lua_getglobal(L, "PRE_make_spec_rhs"); /* function to be called */ + lua_pushnumber(L, rhs); /* push 1st argument */ + /* do the call (1 arguments, 1 result) */ + res = lua_pcall(L, 1, 1, 0) ; + if (res==0) { + /* retrieve result */ + int z = 0; + if (!lua_isnumber(L, -1)){ + fprintf(stderr,"\n! Error:function `PRE_make_spec_rhs' must return a number called with %s\n",lua_tostring(L, -1)); + lua_pop(L, 1); /* pop returned value */ + return z; + }else { + z = lua_tonumber(L, -1); + lua_pop(L, 1); /* pop returned value */ + return z; + } + } + } + } + /*stackdump_g(L);*/ + priv_lua_reporterrors(L, res); + return 0; +} + + +int mfluaPOSTmakespecrhs(halfword rhs) +{ + lua_State *L; + char* luafile; + int res; + + L = Luas[0]; + luafile = kpse_find_file("do_add_to.lua", kpse_lua_format, 0); + if (luafile==NULL) { + res = 1; + lua_pushstring(L,"do_add_to.lua not found"); + priv_lua_reporterrors(L, res); + return 0; + } + priv_lua_writemessage(L,"(",luafile,")",1); + res = luaL_loadfile(L, luafile); + free (luafile); + if ( res==0 ){ + res = lua_pcall(L, 0, 0, 0); + if (res==0){ + lua_getglobal(L, "POST_make_spec_rhs"); /* function to be called */ + lua_pushnumber(L, rhs); /* push 1st argument */ + /* do the call (1 arguments, 1 result) */ + res = lua_pcall(L, 1, 1, 0) ; + if (res==0) { + /* retrieve result */ + int z = 0; + if (!lua_isnumber(L, -1)){ + fprintf(stderr,"\n! Error:function `POST_make_spec_rhs' must return a number called with %s\n",lua_tostring(L, -1)); + lua_pop(L, 1); /* pop returned value */ + return z; + }else { + z = lua_tonumber(L, -1); + lua_pop(L, 1); /* pop returned value */ + return z; + } + } + } + } + /*stackdump_g(L);*/ + priv_lua_reporterrors(L, res); + return 0; +} + + +int mfluaPREmakespeclhs(halfword lhs) +{ + lua_State *L; + char* luafile; + int res; + + L = Luas[0]; + luafile = kpse_find_file("do_add_to.lua", kpse_lua_format, 0); + if (luafile==NULL) { + res = 1; + lua_pushstring(L,"do_add_to.lua not found"); + priv_lua_reporterrors(L, res); + return 0; + } + priv_lua_writemessage(L,"(",luafile,")",1); + res = luaL_loadfile(L, luafile); + free (luafile); + if ( res==0 ){ + res = lua_pcall(L, 0, 0, 0); + if (res==0){ + lua_getglobal(L, "PRE_make_spec_lhs"); /* function to be called */ + lua_pushnumber(L, lhs); /* push 1st argument */ + /* do the call (1 arguments, 1 result) */ + res = lua_pcall(L, 1, 1, 0) ; + if (res==0) { + /* retrieve result */ + int z = 0; + if (!lua_isnumber(L, -1)){ + fprintf(stderr,"\n! Error:function `PRE_make_spec_lhs' must return a number called with %s\n",lua_tostring(L, -1)); + lua_pop(L, 1); /* pop returned value */ + return z; + }else { + z = lua_tonumber(L, -1); + lua_pop(L, 1); /* pop returned value */ + return z; + } + } + } + } + /*stackdump_g(L);*/ + priv_lua_reporterrors(L, res); + return 0; +} + + +int mfluaPOSTmakespeclhs(halfword lhs) +{ + lua_State *L; + char* luafile; + int res; + + L = Luas[0]; + luafile = kpse_find_file("do_add_to.lua", kpse_lua_format, 0); + if (luafile==NULL) { + res = 1; + lua_pushstring(L,"do_add_to.lua not found"); + priv_lua_reporterrors(L, res); + return 0; + } + priv_lua_writemessage(L,"(",luafile,")",1); + res = luaL_loadfile(L, luafile); + free (luafile); + if ( res==0 ){ + res = lua_pcall(L, 0, 0, 0); + if (res==0){ + lua_getglobal(L, "POST_make_spec_lhs"); /* function to be called */ + lua_pushnumber(L, lhs); /* push 1st argument */ + /* do the call (1 arguments, 1 result) */ + res = lua_pcall(L, 1, 1, 0) ; + if (res==0) { + /* retrieve result */ + int z = 0; + if (!lua_isnumber(L, -1)){ + fprintf(stderr,"\n! Error:function `POST_make_spec_lhs' must return a number called with %s\n",lua_tostring(L, -1)); + lua_pop(L, 1); /* pop returned value */ + return z; + }else { + z = lua_tonumber(L, -1); + lua_pop(L, 1); /* pop returned value */ + return z; + } + } + } + } + /*stackdump_g(L);*/ + priv_lua_reporterrors(L, res); + return 0; +} + + int mfluaPREfillenveloperhs(halfword rhs) { diff --git a/Build/source/texk/web2c/mfluadir/mfluac.h b/Build/source/texk/web2c/mfluadir/mfluac.h index 80e2e7a0235..eb0f6a1a14d 100644 --- a/Build/source/texk/web2c/mfluadir/mfluac.h +++ b/Build/source/texk/web2c/mfluadir/mfluac.h @@ -21,6 +21,11 @@ extern int mfluaPOSTfillenveloperhs(halfword); extern int mfluaPREfillenvelopelhs(halfword); extern int mfluaPOSTfillenvelopelhs(halfword); +extern int mfluaPREmakespecrhs(halfword); +extern int mfluaPOSTmakespecrhs(halfword); +extern int mfluaPREmakespeclhs(halfword); +extern int mfluaPOSTmakespeclhs(halfword); + extern int mfluaPREfillspecrhs(halfword); extern int mfluaPOSTfillspecrhs(halfword); extern int mfluaPREfillspeclhs(halfword); diff --git a/Build/source/texk/web2c/mfluajitdir/mfluajit.defines b/Build/source/texk/web2c/mfluajitdir/mfluajit.defines index 5889c31e803..3c63c846bc5 100644 --- a/Build/source/texk/web2c/mfluajitdir/mfluajit.defines +++ b/Build/source/texk/web2c/mfluajitdir/mfluajit.defines @@ -9,6 +9,10 @@ @define procedure mfluaPOSTfillenveloperhs(); @define procedure mfluaPREfillenvelopelhs(); @define procedure mfluaPOSTfillenvelopelhs(); +@define procedure mfluaPREmakespecrhs(); +@define procedure mfluaPOSTmakespecrhs(); +@define procedure mfluaPREmakespeclhs(); +@define procedure mfluaPOSTmakespeclhs(); @define procedure mfluaPREfillspecrhs(); @define procedure mfluaPOSTfillspecrhs(); @define procedure mfluaPREfillspeclhs(); -- cgit v1.2.3