summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mlib-lua.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/mlib-lua.lua')
-rw-r--r--tex/context/base/mkiv/mlib-lua.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua
index 93ae74244..c5893ee90 100644
--- a/tex/context/base/mkiv/mlib-lua.lua
+++ b/tex/context/base/mkiv/mlib-lua.lua
@@ -419,3 +419,33 @@ function mp.report(a,b)
report_message("%s : %s","message",a)
end
end
+
+--
+
+local hashes = { }
+
+function mp.newhash()
+ for i=1,#hashes+1 do
+ if not hashes[i] then
+ hashes[i] = { }
+ mpprint(i)
+ return
+ end
+ end
+end
+
+function mp.disposehash(n)
+ hashes[n] = nil
+end
+
+function mp.inhash(n,key)
+ local h = hashes[n]
+ mpprint(h and h[key] or false)
+end
+
+function mp.tohash(n,key)
+ local h = hashes[n]
+ if h then
+ h[key] = true
+ end
+end