From 44fd8cde61e3e89e5f83c98900a403e922073727 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Tue, 21 Feb 2023 22:26:36 +0100 Subject: Implement support for settings Settings are a flat "dictionary" containing paths to settings on the format: ... --- src/command.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/command.h') diff --git a/src/command.h b/src/command.h index 35467e7..b151eb8 100644 --- a/src/command.h +++ b/src/command.h @@ -1,3 +1,6 @@ +#ifndef _COMMAND_H +#define _COMMAND_H + /** @file command.h * Commands and command registries */ @@ -40,6 +43,10 @@ struct command_ctx { * User data set up by the command currently being executed. */ void *userdata; + + const char *saved_argv[64]; + + int saved_argc; }; /** A command function callback which holds the implementation of a command */ @@ -165,6 +172,9 @@ struct command *lookup_command(struct commands *commands, const char *name); struct command *lookup_command_by_hash(struct commands *commands, uint32_t hash); +void command_ctx_push_arg(struct command_ctx *ctx, const char *argv); +void command_ctx_free(struct command_ctx *ctx); + /** * @defgroup common-commands Implementation of common commands * @{ @@ -191,3 +201,4 @@ int32_t run_interactive(struct command_ctx ctx, int argc, const char *argv[]); int32_t switch_buffer(struct command_ctx ctx, int argc, const char *argv[]); /**@}*/ +#endif -- cgit v1.2.3