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,
+ });
{"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");