From 769fbfa058946e1581d5f9ad75d17947d1ee9ff1 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Sun, 22 Nov 2009 01:48:55 -0800 Subject: add public API for locating commands Allow other modules to find a command, primarily for the purpose of registering and unregistering subcommands. --- src/helper/command.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/helper/command.c') diff --git a/src/helper/command.c b/src/helper/command.c index af481cd4..54bfb964 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -193,6 +193,16 @@ static struct command *command_find(struct command *head, const char *name) } return NULL; } +struct command *command_find_in_context(struct command_context *cmd_ctx, + const char *name) +{ + return command_find(cmd_ctx->commands, name); +} +struct command *command_find_in_parent(struct command *parent, + const char *name) +{ + return command_find(parent->children, name); +} /** * Add the command into the linked list, sorted by name. -- cgit v1.2.3