plugins: export a const function pointer interface struct

This commit is contained in:
Daniel Eklöf 2019-01-26 18:32:04 +01:00
parent 37266ae419
commit 452c4b6015
22 changed files with 255 additions and 230 deletions

View file

@ -19,6 +19,7 @@
#include "../config.h"
#include "../config-verify.h"
#include "../particles/dynlist.h"
#include "../plugin.h"
#include "../tllist.h"
typedef tll(char *) mount_point_list_t;
@ -558,8 +559,8 @@ removables_new(struct particle *label, int left_spacing, int right_spacing)
return mod;
}
struct module *
removables_from_conf(const struct yml_node *node, struct conf_inherit inherited)
static struct module *
from_conf(const struct yml_node *node, struct conf_inherit inherited)
{
const struct yml_node *content = yml_get_value(node, "content");
const struct yml_node *spacing = yml_get_value(node, "spacing");
@ -574,8 +575,8 @@ removables_from_conf(const struct yml_node *node, struct conf_inherit inherited)
return removables_new(conf_to_particle(content, inherited), left, right);
}
bool
removables_verify_conf(keychain_t *chain, const struct yml_node *node)
static bool
verify_conf(keychain_t *chain, const struct yml_node *node)
{
static const struct attr_info attrs[] = {
{"spacing", false, &conf_verify_int},
@ -589,11 +590,11 @@ removables_verify_conf(keychain_t *chain, const struct yml_node *node)
return conf_verify_dict(chain, node, attrs);
}
const struct module_iface module_removables_iface = {
.verify_conf = &verify_conf,
.from_conf = &from_conf,
};
#if defined(CORE_PLUGINS_AS_SHARED_LIBRARIES)
bool verify_conf(keychain_t *chain, const struct yml_node *node)
__attribute__((weak, alias("removables_verify_conf")));
struct deco *from_conf(const struct yml_node *node, struct conf_inherit inherited)
__attribute__((weak, alias("removables_from_conf")));
extern const struct module_iface iface __attribute__((weak, alias("module_removables_iface")));
#endif