Allow simple commands to be fired.

This commit is contained in:
Your Name
2026-06-30 10:03:49 +01:00
parent 5f7a4b0f52
commit fcfa0b6db4
11 changed files with 76 additions and 19 deletions

12
cfg.c
View File

@@ -98,6 +98,7 @@ load_cfg(const char *path, struct cmdq_item *item,
{
FILE *f;
struct cmd_parse_input pi;
struct cmd_invoke_input ci;
struct cmd_parse_tree *tree;
struct cmdq_item *new_item0;
struct cmdq_state *state;
@@ -137,7 +138,10 @@ load_cfg(const char *path, struct cmdq_item *item,
state = cmdq_new_state(NULL, NULL, 0);
cmdq_add_format(state, "current_file", "%s", pi.file);
new_item0 = cmd_invoke_get(tree, state, 0, NULL);
memset(&ci, 0, sizeof ci);
ci.file = pi.file;
ci.flags = flags;
new_item0 = cmd_invoke_get(tree, state, &ci);
if (item != NULL)
new_item0 = cmdq_insert_after(item, new_item0);
else
@@ -156,6 +160,7 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
struct cmdq_item **new_item)
{
struct cmd_parse_input pi;
struct cmd_invoke_input ci;
struct cmd_parse_tree *tree;
struct cmdq_item *new_item0;
struct cmdq_state *state;
@@ -188,7 +193,10 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
state = cmdq_new_state(NULL, NULL, 0);
cmdq_add_format(state, "current_file", "%s", pi.file);
new_item0 = cmd_invoke_get(tree, state, 0, NULL);
memset(&ci, 0, sizeof ci);
ci.file = pi.file;
ci.flags = flags;
new_item0 = cmd_invoke_get(tree, state, &ci);
if (item != NULL)
new_item0 = cmdq_insert_after(item, new_item0);
else