From 440f7bd760a8ad4fe41e699e59e391b3448357d0 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Sun, 26 Mar 2023 22:01:17 +0100 Subject: [PATCH] action: make action_arg_add_bool() static --- include/action.h | 1 - src/action.c | 49 ++++++++++++++++++++++++------------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/action.h b/include/action.h index c26f15a8..3f466e45 100644 --- a/include/action.h +++ b/include/action.h @@ -21,7 +21,6 @@ struct action { struct action *action_create(const char *action_name); void action_arg_add_str(struct action *action, char *key, const char *value); -void action_arg_add_bool(struct action *action, char *key, bool value); void action_arg_from_xml_node(struct action *action, char *nodename, char *content); diff --git a/src/action.c b/src/action.c index a6bcfa9a..3f7042ca 100644 --- a/src/action.c +++ b/src/action.c @@ -104,6 +104,31 @@ const char *action_names[] = { NULL }; +void +action_arg_add_str(struct action *action, char *key, const char *value) +{ + assert(value && "Tried to add NULL action string argument"); + struct action_arg_str *arg = znew(*arg); + arg->base.type = LAB_ACTION_ARG_STR; + if (key) { + arg->base.key = xstrdup(key); + } + arg->value = xstrdup(value); + wl_list_append(&action->args, &arg->base.link); +} + +static void +action_arg_add_bool(struct action *action, char *key, bool value) +{ + struct action_arg_bool *arg = znew(*arg); + arg->base.type = LAB_ACTION_ARG_BOOL; + if (key) { + arg->base.key = xstrdup(key); + } + arg->value = value; + wl_list_append(&action->args, &arg->base.link); +} + void action_arg_from_xml_node(struct action *action, char *nodename, char *content) { @@ -538,27 +563,3 @@ actions_run(struct view *activator, struct server *server, } } -void -action_arg_add_str(struct action *action, char *key, const char *value) -{ - assert(value && "Tried to add NULL action string argument"); - struct action_arg_str *arg = znew(*arg); - arg->base.type = LAB_ACTION_ARG_STR; - if (key) { - arg->base.key = xstrdup(key); - } - arg->value = xstrdup(value); - wl_list_append(&action->args, &arg->base.link); -} - -void -action_arg_add_bool(struct action *action, char *key, bool value) -{ - struct action_arg_bool *arg = znew(*arg); - arg->base.type = LAB_ACTION_ARG_BOOL; - if (key) { - arg->base.key = xstrdup(key); - } - arg->value = value; - wl_list_append(&action->args, &arg->base.link); -}