cb->lua_function_name = strdup(function_name);
pthread_mutex_init(&cb->lock, NULL);
cb->lua_function_name = strdup(function_name);
pthread_mutex_init(&cb->lock, NULL);
int status = plugin_register_complex_read(/* group = */ "lua",
/* name = */ function_name,
/* callback = */ clua_read,
int status = plugin_register_complex_read(/* group = */ "lua",
/* name = */ function_name,
/* callback = */ clua_read,
cb->lua_function_name = strdup(function_name);
pthread_mutex_init(&cb->lock, NULL);
cb->lua_function_name = strdup(function_name);
pthread_mutex_init(&cb->lock, NULL);
- user_data_t ud = {
- .data = cb
- };
-
- int status = plugin_register_write(/* name = */ function_name,
- /* callback = */ clua_write,
- /* user_data = */ &ud);
+ int status =
+ plugin_register_write(/* name = */ function_name,
+ /* callback = */ clua_write, &(user_data_t){
+ .data = cb,
+ });
if (status != 0)
return luaL_error(L, "%s", "plugin_register_write failed");
return 0;
} /* }}} int lua_cb_register_write */
if (status != 0)
return luaL_error(L, "%s", "plugin_register_write failed");
return 0;
} /* }}} int lua_cb_register_write */
{"log_debug", lua_cb_log_debug},
{"log_error", lua_cb_log_error},
{"log_info", lua_cb_log_info},
{"log_debug", lua_cb_log_debug},
{"log_error", lua_cb_log_error},
{"log_info", lua_cb_log_info},
{"dispatch_values", lua_cb_dispatch_values},
{"register_read", lua_cb_register_read},
{"register_write", lua_cb_register_write},
{"dispatch_values", lua_cb_dispatch_values},
{"register_read", lua_cb_register_read},
{"register_write", lua_cb_register_write},
#if LUA_VERSION_NUM < 502
lua_pushcfunction(script->lua_state, open_collectd);
lua_pushstring(script->lua_state, "collectd");
#if LUA_VERSION_NUM < 502
lua_pushcfunction(script->lua_state, open_collectd);
lua_pushstring(script->lua_state, "collectd");
plugin_register_complex_config("lua", lua_config);
plugin_register_shutdown("lua", lua_shutdown);
}
plugin_register_complex_config("lua", lua_config);
plugin_register_shutdown("lua", lua_shutdown);
}