forked from external/yambar
Put each module in its own subdirectory
This commit is contained in:
parent
75bdd2ad3c
commit
8809cbb481
24 changed files with 73 additions and 71 deletions
|
@ -1,47 +0,0 @@
|
|||
#include "label.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <poll.h>
|
||||
|
||||
struct private {
|
||||
struct particle *label;
|
||||
};
|
||||
|
||||
static void
|
||||
destroy(struct module *mod)
|
||||
{
|
||||
struct private *m = mod->private;
|
||||
m->label->destroy(m->label);
|
||||
free(m);
|
||||
module_default_destroy(mod);
|
||||
}
|
||||
|
||||
static struct exposable *
|
||||
content(struct module *mod)
|
||||
{
|
||||
const struct private *m = mod->private;
|
||||
return m->label->instantiate(m->label, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
run(struct module_run_context *ctx)
|
||||
{
|
||||
module_signal_ready(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct module *
|
||||
module_label(struct particle *label)
|
||||
{
|
||||
struct private *m = malloc(sizeof(*m));
|
||||
m->label = label;
|
||||
|
||||
struct module *mod = module_common_new();
|
||||
mod->private = m;
|
||||
mod->run = &run;
|
||||
mod->destroy = &destroy;
|
||||
mod->content = &content;
|
||||
return mod;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue