summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/libs-imp-foreign.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/libs-imp-foreign.lmt')
-rw-r--r--tex/context/base/mkxl/libs-imp-foreign.lmt58
1 files changed, 2 insertions, 56 deletions
diff --git a/tex/context/base/mkxl/libs-imp-foreign.lmt b/tex/context/base/mkxl/libs-imp-foreign.lmt
index 7e4ec9239..7b1773078 100644
--- a/tex/context/base/mkxl/libs-imp-foreign.lmt
+++ b/tex/context/base/mkxl/libs-imp-foreign.lmt
@@ -43,6 +43,8 @@ local foreign = {
types = libforeign.types,
abivalues = libforeign.abivalues,
totable = libforeign.totable,
+ newbuffer = libforeign.newbuffer,
+ getbuffer = libforeign.getbuffer,
load = function(name)
if okay() then
local fullname = resolvers.findlib(name)
@@ -61,59 +63,3 @@ package .loaded[libname] = foreign
optional.loaded[libname] = foreign
return foreign
-
--- A simple test:
-
--- \setupbodyfont[dejavu,10pt]
---
--- \starttext
---
--- \registerctxluafile{libs-imp-foreign}{autosuffix}
---
--- \startluacode
---
--- local foreign = optional.loaded.foreign
---
--- local kplib = (os.platform == "win64" and "kpathsea*w64")
--- or (os.platform == "win32" and "kpathsea*w32")
--- or "libkpathsea"
---
--- local kpse = foreign.load(kplib)
---
--- local set_program_name = kpse.kpse_set_program_name
--- local find_file = kpse.kpse_find_file
---
--- set_program_name:types { "string", "string" }
--- find_file :types { ret = "string", "string", "int", "int" }
---
--- set_program_name("pdftex","pdftex")
---
--- local function lookup(filename,filetype,n)
--- local c = os.clock()
--- for i=1,n do
--- if find_file(filename,filetype,0) then
--- -- okay
--- end
--- end
--- c = os.clock() - c
---
--- local NC, BC, NR = context.NC, context.BC, context.NR
---
--- context.starttabulate()
--- BC() context("asked") NC() context.type(filename) NC() NR()
--- BC() context("found") NC() context.type(find_file(filename,filetype,0)) NC() NR()
--- if n > 0 then
--- BC() context("times") NC() context(n) NC() NR()
--- BC() context("seconds") NC() context(" %0.3f",c) NC() NR()
--- BC() context("lookup") NC() context(" %0.6f",c/n) NC() NR()
--- end
--- context.stoptabulate()
--- end
---
--- lookup("oeps.tex", 26,10000)
--- lookup("metafun.mp", 16, 5000)
--- lookup("logo10.afm", 4, 2500)
---
--- \stopluacode
---
--- \stoptext