From 40db61eb7a2019ced97f09a9687139f35749f4e0 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Sat, 25 Feb 2023 21:37:48 +0100 Subject: Introduce vec and hashmap Convenience macros for a hashmap and a growable vector. --- src/command.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/command.h') 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 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; }; /** -- cgit v1.2.3