mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-16 08:15:40 +02:00
plugins: export a const function pointer interface struct
This commit is contained in:
parent
37266ae419
commit
452c4b6015
22 changed files with 255 additions and 230 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "../bar.h"
|
||||
#include "../config.h"
|
||||
#include "../config-verify.h"
|
||||
#include "../plugin.h"
|
||||
#include "../xcb.h"
|
||||
|
||||
struct private {
|
||||
|
@ -334,15 +335,15 @@ xwindow_new(struct particle *label)
|
|||
return mod;
|
||||
}
|
||||
|
||||
struct module *
|
||||
xwindow_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 *c = yml_get_value(node, "content");
|
||||
return xwindow_new(conf_to_particle(c, inherited));
|
||||
}
|
||||
|
||||
bool
|
||||
xwindow_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[] = {
|
||||
{"content", true, &conf_verify_particle},
|
||||
|
@ -353,11 +354,11 @@ xwindow_verify_conf(keychain_t *chain, const struct yml_node *node)
|
|||
return conf_verify_dict(chain, node, attrs);
|
||||
}
|
||||
|
||||
const struct module_iface module_xwindow_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("xwindow_verify_conf")));
|
||||
struct deco *from_conf(const struct yml_node *node, struct conf_inherit inherited)
|
||||
__attribute__((weak, alias("xwindow_from_conf")));
|
||||
|
||||
extern const struct module_iface iface __attribute__((weak, alias("module_xwindow_iface")));
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue