mirror of
https://github.com/tmux/tmux.git
synced 2026-10-10 04:04:27 +00:00
Convert most of remaining bits.
This commit is contained in:
26
notify.c
26
notify.c
@@ -62,6 +62,8 @@ notify_insert_hook(struct cmdq_item *item, struct notify_entry *ne)
|
||||
struct options_entry *o;
|
||||
struct options_array_item *a;
|
||||
struct cmd_parse_tree *tree;
|
||||
const char *value;
|
||||
char *cause;
|
||||
|
||||
log_debug("%s: inserting hook %s", __func__, ne->name);
|
||||
|
||||
@@ -93,26 +95,16 @@ notify_insert_hook(struct cmdq_item *item, struct notify_entry *ne)
|
||||
cmdq_add_formats(state, ne->formats);
|
||||
|
||||
if (*ne->name == '@') {
|
||||
#if 0 /* XXX: command parser conversion */
|
||||
struct cmd_parse_result *pr;
|
||||
const char *value;
|
||||
|
||||
value = options_get_string(oo, ne->name);
|
||||
pr = cmd_parse_from_string(value, NULL);
|
||||
switch (pr->status) {
|
||||
case CMD_PARSE_ERROR:
|
||||
tree = cmd_parse_from_string(value, NULL, &cause);
|
||||
if (tree == NULL) {
|
||||
log_debug("%s: can't parse hook %s: %s", __func__,
|
||||
ne->name, pr->error);
|
||||
free(pr->error);
|
||||
break;
|
||||
case CMD_PARSE_SUCCESS:
|
||||
notify_insert_one_hook(item, ne, pr->cmdlist, state);
|
||||
break;
|
||||
ne->name, cause);
|
||||
free(cause);
|
||||
} else {
|
||||
item = notify_insert_one_hook(item, ne, tree, state);
|
||||
cmd_parse_free(tree);
|
||||
}
|
||||
#else
|
||||
log_debug("%s: command parser conversion not done for hook %s",
|
||||
__func__, ne->name);
|
||||
#endif
|
||||
} else {
|
||||
a = options_array_first(o);
|
||||
while (a != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user