forked from external/yambar
module: const:ify ‘module’ argument to module->description()
This commit is contained in:
parent
6794193791
commit
3ca274759a
22 changed files with 26 additions and 26 deletions
2
module.h
2
module.h
|
@ -27,7 +27,7 @@ struct module {
|
||||||
* specified number of milliseconds */
|
* specified number of milliseconds */
|
||||||
bool (*refresh_in)(struct module *mod, long milli_seconds);
|
bool (*refresh_in)(struct module *mod, long milli_seconds);
|
||||||
|
|
||||||
const char *(*description)(struct module *mod);
|
const char *(*description)(const struct module *mod);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct module *module_common_new(void);
|
struct module *module_common_new(void);
|
||||||
|
|
|
@ -84,10 +84,10 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
static char desc[32];
|
static char desc[32];
|
||||||
struct private *m = mod->private;
|
const struct private *m = mod->private;
|
||||||
snprintf(desc, sizeof(desc), "alsa(%s)", m->card);
|
snprintf(desc, sizeof(desc), "alsa(%s)", m->card);
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "backlight";
|
return "backlight";
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,10 +58,10 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
static char desc[32];
|
static char desc[32];
|
||||||
struct private *m = mod->private;
|
const struct private *m = mod->private;
|
||||||
snprintf(desc, sizeof(desc), "bat(%s)", m->battery);
|
snprintf(desc, sizeof(desc), "bat(%s)", m->battery);
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "clock";
|
return "clock";
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "cpu";
|
return "cpu";
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "disk-io";
|
return "disk-io";
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ destroy(struct module *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
static char const *
|
static char const *
|
||||||
description(struct module *module)
|
description(const struct module *module)
|
||||||
{
|
{
|
||||||
return "dwl";
|
return "dwl";
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "toplevel";
|
return "toplevel";
|
||||||
}
|
}
|
||||||
|
|
|
@ -760,7 +760,7 @@ ws_content_for_name(struct private *m, const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "i3/sway";
|
return "i3/sway";
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "label";
|
return "label";
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "mem";
|
return "mem";
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "mpd";
|
return "mpd";
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,10 +107,10 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
static char desc[32];
|
static char desc[32];
|
||||||
struct private *m = mod->private;
|
const struct private *m = mod->private;
|
||||||
|
|
||||||
snprintf(desc, sizeof(desc), "net(%s)", m->iface);
|
snprintf(desc, sizeof(desc), "net(%s)", m->iface);
|
||||||
return desc;
|
return desc;
|
||||||
|
|
|
@ -818,7 +818,7 @@ destroy(struct module *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
static char const *
|
static char const *
|
||||||
description(struct module *module)
|
description(const struct module *module)
|
||||||
{
|
{
|
||||||
return "pipewire";
|
return "pipewire";
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "pulse";
|
return "pulse";
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "removables";
|
return "removables";
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "river";
|
return "river";
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,10 +60,10 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
static char desc[32];
|
static char desc[32];
|
||||||
struct private *m = mod->private;
|
const struct private *m = mod->private;
|
||||||
|
|
||||||
char *path = strdup(m->path);
|
char *path = strdup(m->path);
|
||||||
snprintf(desc, sizeof(desc), "script(%s)", basename(path));
|
snprintf(desc, sizeof(desc), "script(%s)", basename(path));
|
||||||
|
|
|
@ -55,7 +55,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "sway-xkb";
|
return "sway-xkb";
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ destroy(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "xkb";
|
return "xkb";
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ struct private {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
description(struct module *mod)
|
description(const struct module *mod)
|
||||||
{
|
{
|
||||||
return "xwindow";
|
return "xwindow";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue