diff options
| author | Albert Cervin <albert@acervin.com> | 2023-02-25 21:37:48 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2023-02-25 21:38:59 +0100 |
| commit | 40db61eb7a2019ced97f09a9687139f35749f4e0 (patch) | |
| tree | 9291e44eb82721732d04146b5042545e1b9e91f9 /src/command.h | |
| parent | 44fd8cde61e3e89e5f83c98900a403e922073727 (diff) | |
| download | dged-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.h | 7 |
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; }; /** |
