mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
action: make action_arg_add_bool() static
This commit is contained in:
parent
839179aafd
commit
440f7bd760
2 changed files with 25 additions and 25 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
49
src/action.c
49
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue