action: make action_arg_add_bool() static

This commit is contained in:
Johan Malm 2023-03-26 22:01:17 +01:00 committed by Johan Malm
parent 839179aafd
commit 440f7bd760
2 changed files with 25 additions and 25 deletions

View file

@ -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);

View file

@ -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);
}