From 9593fc545950782ed75f12f53238b07885559b2b Mon Sep 17 00:00:00 2001 From: William Casarin Date: Mon, 9 Jul 2018 22:28:25 -0700 Subject: remove ccan for now --- command.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 2f81eaa..f3b0e91 100644 --- a/command.c +++ b/command.c @@ -1,10 +1,8 @@ #include "command.h" -#include "ccan/tal/tal.h" -#include "ccan/tal/str/str.h" -#include "ccan/str/str.h" #include +#include #include #include @@ -24,13 +22,13 @@ command_exec(struct command *cmd) { int command_num_children(struct command *cmd) { - return tal_count(cmd) || cmd->nchildren; + return cmd->nchildren; } struct command * command_lookup(struct command *cmd, int ncmds, const char *binding) { for (int i = 0; i < ncmds; ++i) { - if (streq(binding, cmd[i].bind)) + if (strcmp(binding, cmd[i].bind) == 0) return &cmd[i]; } @@ -41,19 +39,3 @@ command_lookup(struct command *cmd, int ncmds, const char *binding) { /* { .bind = "d", .name = "emacs-dev", .nchildren = 0, .children = NULL }, */ /* }; */ -struct command * -test_root_commands(tal_t *ctx, const struct command *commands, int ncmds) { - int i; - struct command *cmds = NULL; - - cmds = tal_arr(ctx, struct command, ncmds); - - for (i = 0; i < ncmds; ++i) { - cmds[i].children = commands[i].children; - cmds[i].name = commands[i].name; - cmds[i].bind = commands[i].bind; - cmds[i].nchildren = commands[i].nchildren; - } - - return cmds; -} -- cgit v1.2.3