From d5e2ac5f857f2a003949fce54ed41eedc4fb9475 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 17 Sep 2021 10:09:54 +0200 Subject: 2021-09-17 10:01:00 --- tex/context/base/mkiv/mlib-mpf.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tex/context/base/mkiv/mlib-mpf.lua') 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 -- cgit v1.2.3