summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luamplib/luamplib-createmem.lua
blob: 7d3d611110ce1536b71c1fb6f17dd98ccf1279b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- 
--  This is file `luamplib-createmem.lua',
--  generated with the docstrip utility.
-- 
--  The original source files were:
-- 
--  luamplib.dtx  (with options: `gen-lua')
--  This is a generated file.
--  
--  Copyright (C) 2008-2009 by Hans Hagen, Taco Hoekwater and Elie Roux
--  <elie.roux@telecom-bretagne.eu>.
--  
--  This work is under the CC0 license.
--  
--  This Current Maintainer of this work is Elie Roux.
--  
--  This work consists of the main source file luamplib.dtx
--  and the derived files
--     luamplib.sty, luamplib.lua, luamplib-createmem.lua and luamplib.pdf.
--  

kpse.set_program_name("kpsewhich")

function finder (name, mode, ftype)
    if mode == "w" then
        return name
    else
        local result = kpse.find_file(name,ftype)
        return result
    end
end

local preamble = [[
input %s ; dump ;
]]


makeformat = function (name, mem_name)
    local mpx = mplib.new {
        ini_version = true,
        find_file = finder,
        job_name =  mem_name,
        }
    if mpx then
        local result
        result = mpx:execute(string.format(preamble,name))
        print(string.format("dumping format %s in %s", name, mem_name))
        mpx:finish()
    end
end

makeformat("plain", "luatex-plain.mem")

-- 
--  End of File `luamplib-createmem.lua'.