summaryrefslogtreecommitdiff
path: root/src/con_.c
diff options
context:
space:
mode:
authorGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-06-17 20:18:48 +0100
committerGravatar Michael Smith <mikesmiffy128@gmail.com> 2025-06-21 14:50:00 +0100
commitac7e7d0f21978afc70fe3ef76db69d575742b974 (patch)
tree6fd25c7ded6cfeba7c55b1c26abc82a28878a14e /src/con_.c
parent1f2d9ce197eafd16803de087cc5b6f8b8f4345a6 (diff)
downloadsst-ac7e7d0f21978afc70fe3ef76db69d575742b974.tar.gz
sst-ac7e7d0f21978afc70fe3ef76db69d575742b974.zip
Separate our command callbacks from Source's
This improves the ergonomics of a few different things, and sets us up somewhat for the fact OE had a different interface for commands too (it was v1 only and had a separate API call for getting the args).
Diffstat (limited to 'src/con_.c')
-rw-r--r--src/con_.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/con_.c b/src/con_.c
index ddebf78..b2d7e29 100644
--- a/src/con_.c
+++ b/src/con_.c
@@ -136,8 +136,7 @@ bool VCALLCONV CanAutoComplete(struct con_cmd *this) {
return false;
}
void VCALLCONV Dispatch(struct con_cmd *this, const struct con_cmdargs *args) {
- // just assuming we *always* define a (V2) callback, per the DEF_CCMD macros
- this->cb(args);
+ this->cb(args->argc, args->argv);
}
static void VCALLCONV ChangeStringValue(struct con_var *this, const char *s,
@@ -484,8 +483,8 @@ SETTER(float, vtidx_SetValue_f, con_setvarf)
SETTER(int, vtidx_SetValue_i, con_setvari)
#undef SETTER
-con_cmdcb con_getcmdcb(const struct con_cmd *cmd) {
- return !cmd->use_newcmdiface && cmd->use_newcb ? cmd->cb : 0;
+con_cmdcbv2 con_getcmdcbv2(const struct con_cmd *cmd) {
+ return !cmd->use_newcmdiface && cmd->use_newcb ? cmd->cb_v2 : 0;
}
con_cmdcbv1 con_getcmdcbv1(const struct con_cmd *cmd) {