diff --git a/src/plugin.c b/src/plugin.c
index a749d1e07b18502127406469471cd728fe9121bd..e87f6e269701cd2f99350d373e24714b979707c4 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
* object, but it will bitch about a shared object not having a
* ``module_register'' symbol..
*/
-static int plugin_load_file (char *file, uint32_t flags)
+static int plugin_load_file (char *file, uint32_t flags, plugin_loaddata_t *data)
{
lt_dlhandle dlh;
- void (*reg_handle) (void);
+ void (*reg_handle) (plugin_loaddata_t *);
lt_dlinit ();
lt_dlerror (); /* clear errors */
return (1);
}
- if ((reg_handle = (void (*) (void)) lt_dlsym (dlh, "module_register")) == NULL)
+ reg_handle = (void (*) (plugin_loaddata_t *)) lt_dlsym (dlh, "module_register");
+ if (reg_handle == NULL)
{
WARNING ("Couldn't find symbol \"module_register\" in \"%s\": %s\n",
file, lt_dlerror ());
return (-1);
}
- (*reg_handle) ();
+ (*reg_handle) (data);
return (0);
}
}
#define BUFSIZE 512
-int plugin_load (const char *type, uint32_t flags)
+int plugin_load (const char *type, uint32_t flags, plugin_loaddata_t *data)
{
DIR *dh;
const char *dir;
continue;
}
- if (plugin_load_file (filename, flags) == 0)
+ if (plugin_load_file (filename, flags, data) == 0)
{
/* success */
ret = 0;
} /* int plugin_insert_read */
int plugin_register_read (const char *name,
- int (*callback) (void))
+ int (*callback) (void), cdtime_t interval)
{
read_func_t *rf;
int status;
rf->rf_group[0] = '\0';
sstrncpy (rf->rf_name, name, sizeof (rf->rf_name));
rf->rf_type = RF_SIMPLE;
- rf->rf_interval.tv_sec = 0;
- rf->rf_interval.tv_nsec = 0;
+ CDTIME_T_TO_TIMESPEC (interval, &rf->rf_interval);
rf->rf_effective_interval = rf->rf_interval;
status = plugin_insert_read (rf);