lua plugin: A first and very simple take at read callbacks.
Apparently it's not possible to export a pointer to a Lua
function to C. We therefore use the "registry" to store the
callbacks there. They are fetched in "clua_read()" using
lua_pushstring (l, function_name);
lua_gettable (l, LUA_REGISTRYINDEX);
It is now possible to register read callbacks using:
collectd_register_read (function ()
-- do some work here
return 0;
end);
As a special case, global functions can be registered using
function names, too. In that case they are looked up in the
"globals" table.