summaryrefslogtreecommitdiff
path: root/src/command.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-02-25 21:37:48 +0100
committerAlbert Cervin <albert@acervin.com>2023-02-25 21:38:59 +0100
commit40db61eb7a2019ced97f09a9687139f35749f4e0 (patch)
tree9291e44eb82721732d04146b5042545e1b9e91f9 /src/command.h
parent44fd8cde61e3e89e5f83c98900a403e922073727 (diff)
downloaddged-40db61eb7a2019ced97f09a9687139f35749f4e0.tar.gz
dged-40db61eb7a2019ced97f09a9687139f35749f4e0.tar.xz
dged-40db61eb7a2019ced97f09a9687139f35749f4e0.zip
Introduce vec and hashmap
Convenience macros for a hashmap and a growable vector.
Diffstat (limited to 'src/command.h')
-rw-r--r--src/command.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/command.h b/src/command.h
index b151eb8..7ece486 100644
--- a/src/command.h
+++ b/src/command.h
@@ -4,6 +4,7 @@
/** @file command.h
* Commands and command registries
*/
+#include "hashmap.h"
#include <stdint.h>
struct buffer;
@@ -78,10 +79,10 @@ struct command {
/**
* A command registry
*/
+HASHMAP_ENTRY_TYPE(command_entry, struct command);
+
struct commands {
- struct hashed_command *commands;
- uint32_t ncommands;
- uint32_t capacity;
+ HASHMAP(struct command_entry) commands;
};
/**