summaryrefslogtreecommitdiff
path: root/src/command.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-02-21 22:26:36 +0100
committerAlbert Cervin <albert@acervin.com>2023-02-21 22:26:36 +0100
commit44fd8cde61e3e89e5f83c98900a403e922073727 (patch)
tree22ed65a8b3c766fa21c35fe4d567399e3810454a /src/command.h
parentd7bf8702bf32720d93c4e690937bc8b683926be1 (diff)
downloaddged-44fd8cde61e3e89e5f83c98900a403e922073727.tar.gz
dged-44fd8cde61e3e89e5f83c98900a403e922073727.tar.xz
dged-44fd8cde61e3e89e5f83c98900a403e922073727.zip
Implement support for settings
Settings are a flat "dictionary" containing paths to settings on the format: <category>.<sub-category>.<setting>.
Diffstat (limited to 'src/command.h')
-rw-r--r--src/command.h11
1 files changed, 11 insertions, 0 deletions
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