add public API for locating commands
authorZachary T Welch <zw@superlucidity.net>
Sun, 22 Nov 2009 09:48:55 +0000 (01:48 -0800)
committerZachary T Welch <zw@superlucidity.net>
Wed, 25 Nov 2009 05:37:30 +0000 (21:37 -0800)
Allow other modules to find a command, primarily for the purpose of
registering and unregistering subcommands.

src/helper/command.c
src/helper/command.h

index af481cd414f0e04b1eb7db0cadbdbf94af1c8118..54bfb964a982bb26f64fc4efaa13718147fc3dde 100644 (file)
@@ -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.
index 6e3e93afaec70253a3fffc969b31cbd08443d6bc..2edeca9190d005469c21fa2e3112757e478f7358 100644 (file)
@@ -281,6 +281,11 @@ int unregister_command(struct command_context *cmd_ctx,
 int unregister_all_commands(struct command_context *cmd_ctx,
                struct command *parent);
 
+struct command *command_find_in_context(struct command_context *cmd_ctx,
+               const char *name);
+struct command *command_find_in_parent(struct command *parent,
+               const char *name);
+
 void command_set_output_handler(struct command_context* context,
                command_output_handler_t output_handler, void *priv);
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)