summaryrefslogtreecommitdiff
path: root/src/commands.h
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-20 20:11:19 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-20 20:11:19 +0200
commit8351fa7752bb8341ef405a37ff7c73142715e981 (patch)
treedde603d313f4f26934f2ce20a22dfd9b69324cf0 /src/commands.h
parentbeafdbe0d64340387d619c38554976410129f05b (diff)
downloadbokf-8351fa7752bb8341ef405a37ff7c73142715e981.tar.gz
bokf-8351fa7752bb8341ef405a37ff7c73142715e981.zip
commands: split the command table by domain
Diffstat (limited to 'src/commands.h')
-rw-r--r--src/commands.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/commands.h b/src/commands.h
index e3168a5..e7e71f6 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -37,10 +37,15 @@ struct command {
size_t nargs;
};
+struct cmd_table {
+ const struct command *cmds;
+ size_t n;
+};
+
#define CMD_ARGS(a) (a), (sizeof (a) / sizeof (a)[0])
-extern const struct command g_commands[];
-extern const size_t g_commands_count;
+extern const struct cmd_table *const g_command_tables[];
+extern const size_t g_command_tables_count;
int command_validate_args(const struct command *cmd, yyjson_val *args,
char *err, size_t errlen);