- -- filename: WITHOUT suffix '.lua'
- function load_cache (filename, outdate)
- local kpsefound = find_file(filename .. '.lua')
+ save_cache_luc = function (filename, t, serialized)
+ local fullpath = savepath .. '/' .. filename .. luc_suffix
+ local s = serialized or serialize(t, 'return', false)
+ if s then
+ local sa = load(s)
+ local f = io.open(fullpath, 'wb')
+ if f and sa then
+ f:write(string.dump(sa, true))
+ texio.write('(save cache: ' .. fullpath .. ')')
+ end
+ f:close()
+ end
+ end
+
+ save_cache = function (filename, t)
+ local fullpath = savepath .. '/' .. filename .. '.lua'
+ local s = serialize(t, 'return', false)
+ if s then
+ local f = io.open(fullpath, 'w')
+ if f then
+ f:write(s)
+ texio.write('(save cache: ' .. fullpath .. ')')
+ end
+ f:close()
+ save_cache_luc(filename, t, s)
+ end
+ end
+
+ local function load_cache_a (filename, outdate)