File: functable.lua

package info (click to toggle)
postgresql-pllua 1%3A2.0.10-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,316 kB
  • sloc: ansic: 14,369; sql: 2,181; makefile: 163; sh: 59; javascript: 38
file content (31 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- functable.lua

local funcnames = {}
local matchfuncs = {
	pllua_pushcfunction = true,
	pllua_cpcall = true,
	pllua_initial_protected_call = true,
	pllua_register_cfunc = true
}

for i,fn in ipairs{...} do
	for line in io.lines(fn) do
		for fn1,pos in line:gmatch("(pllua_[%w_]+)%(()") do
			if matchfuncs[fn1] then
				local fn2 = line:match("%s*[%w._]+%s*,%s*(pllua_[%w_]+)",pos)
				if fn2 ~= nil then
					funcnames[fn2] = true
				end
			end
		end
	end
end

local out = {}
for k,_ in pairs(funcnames) do
	out[1+#out] = k
end
table.sort(out)
for i,v in ipairs(out) do
	io.write("PLLUA_DECL_CFUNC(",v,")\n")
end