[NTG-context] mplib
Wolfgang Werners-Lucchini
wwl at musensturm.de
Tue Apr 15 01:13:49 CEST 2008
On 13 Apr 2008 at 13:31, ntg-context-request at ntg.nl wrote:
Hallo Taco,
thank you for your example.
> % start low-level
> \startlua
> local function finder(name, mode, ftype)
> if mode=="w" then
> return name
> else
> return kpse.find_file(name,ftype)
> end
> end
> mp = mplib.new ( {
> hash_size = 100000,
> main_memory = 2000000,
> param_size = 100000,
> find_file = finder,
> ini_version = true
> } )
> if mp then
> res = mp:execute('plain')
> mp:finish()
> end
this first step runs with res=0, but there is no 'plain.mem' dumped.
(I have temporary appended 'dump;' to plain.mp)
this first step runs with res=0 with mp:execute('mpost'), but no
'mpost.mem'
the first step even runs with res=0 and mp:execute('\\plain; dump;'),
but no 'plain.mem'
after that I produced 'plain.mem' executing
'texmfstart texexec --make plain'
>
> mp = mplib.new ( {
> hash_size = 100000,
> main_memory = 2000000,
> param_size = 100000,
> find_file = finder,
> } )
>
> if mp then
> res = mp:execute(
> "\\beginfig(1) draw (0,0) .. (1,1) .. (2,1); endfig; bye;" )
> tex.print("[" .. tostring(res.status) .. "]")
> mp:finish()
> end
> \stoplua
> % stop low-level
>
this second step returns res=3.
Is there a find_file function necessary to find the mem-file given in
'mem_name' or is such a function only necessary for file-names in
'mp:execute'?
Wolfgang
--
Musensturm-Verlag -- Postfach 1249 -- 36126 Gersfeld
>>> http://www.musensturm.de
More information about the ntg-context
mailing list