diff options
author | Hans Hagen <pragma@wxs.nl> | 2016-11-24 12:55:35 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-11-24 12:55:35 +0100 |
commit | f4d0ad2ba2c4ca5bfae469650e535fd46749b3f4 (patch) | |
tree | 71f81a4992ab89b86a054bd608e49d9093389481 /tex/context/base/mkiv/mlib-lua.lua | |
parent | f4ff686750ca9405662c7615e9c4b04685b5be5c (diff) | |
download | context-f4d0ad2ba2c4ca5bfae469650e535fd46749b3f4.tar.gz |
2016-11-24 12:10:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-lua.lua | 30 |
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 |