mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-26 07:57:59 -04:00
config: rename str_to_spawn_template() -> value_to_spawn_template()
This commit is contained in:
parent
70aec2068a
commit
958ef9dd3b
1 changed files with 11 additions and 20 deletions
31
config.c
31
config.c
|
|
@ -680,19 +680,20 @@ spawn_template_clone(struct config_spawn_template *dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool NOINLINE
|
static bool NOINLINE
|
||||||
str_to_spawn_template(struct config *conf,
|
value_to_spawn_template(struct context *ctx,
|
||||||
const char *s, struct config_spawn_template *template,
|
struct config_spawn_template *template)
|
||||||
const char *path, int lineno, const char *section,
|
|
||||||
const char *key)
|
|
||||||
{
|
{
|
||||||
|
/* TODO: remove */
|
||||||
|
struct config *conf = ctx->conf;
|
||||||
|
|
||||||
spawn_template_free(template);
|
spawn_template_free(template);
|
||||||
|
|
||||||
char **argv = NULL;
|
char **argv = NULL;
|
||||||
|
|
||||||
if (!tokenize_cmdline(s, &argv)) {
|
if (!tokenize_cmdline(ctx->value, &argv)) {
|
||||||
LOG_AND_NOTIFY_ERR(
|
LOG_AND_NOTIFY_ERR(
|
||||||
"%s:%d: [%s].%s: %s: syntax error in command line",
|
"%s:%d: [%s].%s: %s: syntax error in command line",
|
||||||
path, lineno, section, key, s);
|
ctx->path, ctx->lineno, ctx->section, ctx->key, ctx->value);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1013,11 +1014,8 @@ parse_section_main(struct context *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(key, "notify") == 0) {
|
else if (strcmp(key, "notify") == 0) {
|
||||||
if (!str_to_spawn_template(conf, value, &conf->notify, path, lineno,
|
if (!value_to_spawn_template(ctx, &conf->notify))
|
||||||
"main", "notify"))
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(key, "notify-focus-inhibit") == 0) {
|
else if (strcmp(key, "notify-focus-inhibit") == 0) {
|
||||||
|
|
@ -1028,11 +1026,8 @@ parse_section_main(struct context *ctx)
|
||||||
deprecated_url_option(
|
deprecated_url_option(
|
||||||
conf, "url-launch", "launch", path, lineno);
|
conf, "url-launch", "launch", path, lineno);
|
||||||
|
|
||||||
if (!str_to_spawn_template(conf, value, &conf->url.launch, path, lineno,
|
if (!value_to_spawn_template(ctx, &conf->url.launch))
|
||||||
"main", "url-launch"))
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(key, "selection-target") == 0) {
|
else if (strcmp(key, "selection-target") == 0) {
|
||||||
|
|
@ -1090,7 +1085,6 @@ parse_section_bell(struct context *ctx)
|
||||||
{
|
{
|
||||||
struct config *conf = ctx->conf;
|
struct config *conf = ctx->conf;
|
||||||
const char *key = ctx->key;
|
const char *key = ctx->key;
|
||||||
const char *value = ctx->value;
|
|
||||||
const char *path = ctx->path;
|
const char *path = ctx->path;
|
||||||
unsigned lineno = ctx->lineno;
|
unsigned lineno = ctx->lineno;
|
||||||
|
|
||||||
|
|
@ -1099,7 +1093,7 @@ parse_section_bell(struct context *ctx)
|
||||||
else if (strcmp(key, "notify") == 0)
|
else if (strcmp(key, "notify") == 0)
|
||||||
conf->bell.notify = value_to_bool(ctx);
|
conf->bell.notify = value_to_bool(ctx);
|
||||||
else if (strcmp(key, "command") == 0) {
|
else if (strcmp(key, "command") == 0) {
|
||||||
if (!str_to_spawn_template(conf, value, &conf->bell.command, path, lineno, "bell", key))
|
if (!value_to_spawn_template(ctx, &conf->bell.command))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (strcmp(key, "command-focused") == 0)
|
else if (strcmp(key, "command-focused") == 0)
|
||||||
|
|
@ -1204,11 +1198,8 @@ parse_section_url(struct context *ctx)
|
||||||
unsigned lineno = ctx->lineno;
|
unsigned lineno = ctx->lineno;
|
||||||
|
|
||||||
if (strcmp(key, "launch") == 0) {
|
if (strcmp(key, "launch") == 0) {
|
||||||
if (!str_to_spawn_template(conf, value, &conf->url.launch, path, lineno,
|
if (!value_to_spawn_template(ctx, &conf->url.launch))
|
||||||
"url", "launch"))
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(key, "label-letters") == 0) {
|
else if (strcmp(key, "label-letters") == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue