* object, but it will bitch about a shared object not having a
* ``module_register'' symbol..
*/
-static int plugin_load_file (char *file, modreg_e load)
+static int plugin_load_file (char *file)
{
lt_dlhandle dlh;
- void (*reg_handle) (modreg_e mr);
+ void (*reg_handle) (void);
DEBUG ("file = %s", file);
return (1);
}
- if ((reg_handle = (void (*) (modreg_e)) lt_dlsym (dlh, "module_register")) == NULL)
+ if ((reg_handle = (void (*) (void)) lt_dlsym (dlh, "module_register")) == NULL)
{
WARNING ("Couldn't find symbol ``module_register'' in ``%s'': %s\n",
file, lt_dlerror ());
return (-1);
}
- (*reg_handle) (load);
+ (*reg_handle) ();
return (0);
}
if (status != 0)
{
+ if (rf->wait_time < interval_g)
+ rf->wait_time = interval_g;
rf->wait_left = rf->wait_time;
rf->wait_time = rf->wait_time * 2;
if (rf->wait_time > 86400)
{
ERROR ("plugin: stop_threads: pthread_join failed.");
}
- read_threads[i] = -1;
+ read_threads[i] = (pthread_t) 0;
}
sfree (read_threads);
read_threads_num = 0;
}
#define BUFSIZE 512
-int plugin_load (const char *type, modreg_e mr)
+int plugin_load (const char *type)
{
DIR *dh;
const char *dir;
continue;
}
- if (plugin_load_file (filename, mr) == 0)
+ if (plugin_load_file (filename) == 0)
{
/* success */
ret = 0;
int plugin_unregister_read (const char *name)
{
- return (plugin_unregister (list_read, name));
llentry_t *e;
e = llist_search (list_read, name);
le = llist_head (list_init);
while (le != NULL)
{
- callback = le->value;
+ callback = (int (*) (void)) le->value;
status = (*callback) ();
if (status != 0)
{
ERROR ("Initialization of plugin `%s' "
"failed with status %i. "
- "Plugin will be unloaded. TODO!",
+ "Plugin will be unloaded.",
le->key, status);
+ /* FIXME: Unload _all_ functions */
plugin_unregister_read (le->key);
}
rf = (read_func_t *) le->value;
if (rf->needs_read != DONE)
+ {
+ le = le->next;
continue;
+ }
if (rf->wait_left > 0)
rf->wait_left -= interval_g;
le = llist_head (list_shutdown);
while (le != NULL)
{
- callback = le->value;
+ callback = (int (*) (void)) le->value;
(*callback) ();
le = le->next;
le = llist_head (list_write);
while (le != NULL)
{
- callback = le->value;
+ callback = (int (*) (const data_set_t *, const value_list_t *)) le->value;
(*callback) (ds, vl);
le = le->next;
le = llist_head (list_log);
while (le != NULL)
{
- callback = le->value;
+ callback = (void (*) (int, const char *)) le->value;
(*callback) (level, msg);
le = le->next;