Convert most of remaining bits.

This commit is contained in:
Nicholas Marriott
2026-06-30 18:19:26 +01:00
parent b3bb8bbd9f
commit 54f5c82500
7 changed files with 52 additions and 90 deletions

View File

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