diff options
Diffstat (limited to 'tex/context/base/mkiv/mlib-mpf.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-mpf.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/mlib-mpf.lua b/tex/context/base/mkiv/mlib-mpf.lua index 7e2a01ffb..5e61cf4e1 100644 --- a/tex/context/base/mkiv/mlib-mpf.lua +++ b/tex/context/base/mkiv/mlib-mpf.lua @@ -133,6 +133,25 @@ do n = 1 end + function metapost.getbuffer() + local b = { } + for i=1,n do + b[i] = buffer + end + return b, n + end + + function metapost.setbuffer(b, s) + n = 0 + for i=1,(s or #b) do + local bi = b[i] + if bi then + n = n + 1 + buffer[n] = tostring(bi) + end + end + end + function metapost.runscript(code) nesting = nesting + 1 runs = runs + 1 |