static const char *sieve_get_setting (void *context, const char *identifier) { const struct plugin_settings *set = (const struct plugin_settings *) context; return plugin_settings_get(set, identifier); }
int plugin_settings_getnum(const char *splg, const char *sname, int *idata, long *ldata, double *fdata) { double dvalue; char tbuffer[512]; if(plugin_settings_get(splg, sname, tbuffer, sizeof(tbuffer)) < 0)return -1; dvalue = atof(tbuffer); if(idata)*idata = (int)dvalue; if(ldata)*ldata = (long)dvalue; if(fdata)*fdata = dvalue; return 0; }