particles: get rid of struct particle_info

Since this struct only contained function pointers, make all particles
export those functions directly.

The plugin manager now defines a particle interface struct, and fills
it it by dlsym:ing the functions that used to be in particle_info.
This commit is contained in:
Daniel Eklöf 2019-01-13 17:01:45 +01:00
parent d35695e98a
commit 07b1615a41
11 changed files with 63 additions and 80 deletions

View file

@ -284,18 +284,17 @@ conf_verify_particle_dictionary(keychain_t *chain, const struct yml_node *node)
return false;
}
const struct particle_info *info = plugin_load_particle(particle_name);
if (info == NULL) {
LOG_ERR(
"%s: invalid particle name: %s",
conf_err_prefix(chain, particle), particle_name);
const struct particle_iface *iface = plugin_load_particle(particle_name);
if (iface == NULL) {
LOG_ERR("%s: invalid particle name: %s",
conf_err_prefix(chain, particle), particle_name);
return false;
}
assert(info->verify_conf != NULL);
assert(iface->verify_conf != NULL);
chain_push(chain, particle_name);
if (!info->verify_conf(chain, values))
if (!iface->verify_conf(chain, values))
return false;
chain_pop(chain);