version 1.67, 2019/05/20 11:46:06 |
version 1.68, 2019/05/23 11:13:30 |
|
|
free(item); |
free(item); |
} |
} |
|
|
/* Set command group. */ |
|
static u_int |
|
cmdq_next_group(void) |
|
{ |
|
static u_int group; |
|
|
|
return (++group); |
|
} |
|
|
|
/* Remove all subsequent items that match this item's group. */ |
/* Remove all subsequent items that match this item's group. */ |
static void |
static void |
cmdq_remove_group(struct cmdq_item *item) |
cmdq_remove_group(struct cmdq_item *item) |
|
|
{ |
{ |
struct cmdq_item *item, *first = NULL, *last = NULL; |
struct cmdq_item *item, *first = NULL, *last = NULL; |
struct cmd *cmd; |
struct cmd *cmd; |
u_int group = cmdq_next_group(); |
|
struct cmdq_shared *shared; |
struct cmdq_shared *shared; |
|
|
shared = xcalloc(1, sizeof *shared); |
shared = xcalloc(1, sizeof *shared); |
|
|
xasprintf(&item->name, "[%s/%p]", cmd->entry->name, item); |
xasprintf(&item->name, "[%s/%p]", cmd->entry->name, item); |
item->type = CMDQ_COMMAND; |
item->type = CMDQ_COMMAND; |
|
|
item->group = group; |
item->group = cmd->group; |
item->flags = flags; |
item->flags = flags; |
|
|
item->shared = shared; |
item->shared = shared; |
item->cmdlist = cmdlist; |
item->cmdlist = cmdlist; |
item->cmd = cmd; |
item->cmd = cmd; |
|
|
|
log_debug("%s: %s group %u", __func__, item->name, item->group); |
|
|
shared->references++; |
shared->references++; |
cmdlist->references++; |
cmdlist->references++; |