From 690786504fce73edea78c7ec13b34771771e4caf Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 21 Dec 2022 15:29:21 +0100 Subject: wip render rework --- src/command.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/command.c') diff --git a/src/command.c b/src/command.c index fcf53e2..a667750 100644 --- a/src/command.c +++ b/src/command.c @@ -2,7 +2,7 @@ #include -struct commands command_list_create(uint32_t capacity) { +struct commands command_registry_create(uint32_t capacity) { return (struct commands){ .commands = calloc(capacity, sizeof(struct hashed_command)), .ncommands = 0, @@ -10,7 +10,7 @@ struct commands command_list_create(uint32_t capacity) { }; } -void command_list_destroy(struct commands *commands) { +void command_registry_destroy(struct commands *commands) { free(commands->commands); commands->ncommands = 0; commands->capacity = 0; @@ -68,10 +68,7 @@ struct command *lookup_command_by_hash(struct commands *commands, int32_t execute_command(struct command *command, struct buffer *current_buffer, int argc, const char *argv[]) { - command->fn((struct command_ctx){.current_buffer = current_buffer, - .userdata = command->userdata}, - argc, argv); - - // TODO - return 0; + return command->fn((struct command_ctx){.current_buffer = current_buffer, + .userdata = command->userdata}, + argc, argv); } -- cgit v1.2.3