summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-itm.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-07-14 13:40:13 +0300
committerMarius <mariausol@gmail.com>2011-07-14 13:40:13 +0300
commit06c7a7fdaac34512cdc3ff250dec5b1a7ab3052a (patch)
treeaabadf8b346592b5c67f69c799c929b9c04720c5 /tex/context/base/strc-itm.lua
parent3dd416f677074c27a248e3433695a6fe8c13ef69 (diff)
downloadcontext-06c7a7fdaac34512cdc3ff250dec5b1a7ab3052a.tar.gz
beta 2011.07.14 12:19
Diffstat (limited to 'tex/context/base/strc-itm.lua')
-rw-r--r--tex/context/base/strc-itm.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/tex/context/base/strc-itm.lua b/tex/context/base/strc-itm.lua
index 1c7c2adb5..8a745f356 100644
--- a/tex/context/base/strc-itm.lua
+++ b/tex/context/base/strc-itm.lua
@@ -10,14 +10,29 @@ local structures = structures
local itemgroups = structures.itemgroups
local jobpasses = job.passes
+local setfield = jobpasses.save
+local getfield = jobpasses.getfield
+
function itemgroups.register(name,nofitems,maxwidth)
- jobpasses.savedata("itemgroup", { nofitems, maxwidth })
+ setfield("itemgroup", { nofitems, maxwidth })
end
function itemgroups.nofitems(name,index)
- jobpasses.getfield("itemgroup", index, 1, 0)
+ return getfield("itemgroup", index, 1, 0)
end
function itemgroups.maxwidth(name,index)
- jobpasses.getfield("itemgroup", index, 2, 0)
+ return getfield("itemgroup", index, 2, 0)
+end
+
+-- interface (might become counter/dimension)
+
+commands.registeritemgroup = itemgroups.register
+
+function commands.nofitems(name,index)
+ context(getfield("itemgroup", index, 1, 0))
+end
+
+function commands.maxitemwidth(name,index)
+ context(getfield("itemgroup", index, 2, 0))
end