summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mlib-mpf.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-09-17 10:09:54 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-09-17 10:09:54 +0200
commitd5e2ac5f857f2a003949fce54ed41eedc4fb9475 (patch)
tree5407199d3d6ec192cd4f0fa036cf797b0e29fdc4 /tex/context/base/mkiv/mlib-mpf.lua
parent51bc89e03d05e3329b2ef74de2720937f92aa81f (diff)
downloadcontext-d5e2ac5f857f2a003949fce54ed41eedc4fb9475.tar.gz
2021-09-17 10:01:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-mpf.lua')
-rw-r--r--tex/context/base/mkiv/mlib-mpf.lua19
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