1 local function getfield (t, f)
2 for w in string.gfind(f, "[%w_]+") do
3 if not t then return nil end
9 function test_lib (libname)
10 local ok, err = pcall (require, libname)
12 cgilua.put ("Library <tt><b>"..libname.."</b></tt> not found<br>\n"..
15 cgilua.put ("Library <tt><b>"..libname.."</b></tt><br>\n")
16 local t = getfield (_G, libname)
17 if type(t) ~= "table" then
18 cgilua.put (tostring(t))
20 for i, v in pairs (t) do
21 cgilua.put (" "..tostring(i).." = "..tostring(v).."<br>\n")
25 cgilua.put ("\n<p>\n")
29 for _, lib in ipairs { "lfs", "socket", "luasql.postgres", "luasql", "lxp", "lxp.lom", "lualdap", "htk", "xmlrpc", "xmlrpc.http" } do