summaryrefslogtreecommitdiff
path: root/src/hello.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-20 11:26:35 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:29 -0800
commit833e7f5248778bcb31b4db1a1b91160995415203 (patch)
tree7d5d5fa143b74f4989cc3226a0958e983cb1d2b5 /src/hello.c
parentf7e1f2df74b599903a6fb2d2ace94c3f1ef06097 (diff)
downloadopenocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.gz
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.bz2
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.xz
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.zip
use COMMAND_REGISTER macro
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
Diffstat (limited to 'src/hello.c')
-rw-r--r--src/hello.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hello.c b/src/hello.c
index 2ab7eb50..8c97a401 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -56,17 +56,17 @@ COMMAND_HANDLER(handle_flag_command)
int foo_register_commands(struct command_context *cmd_ctx)
{
// register several commands under the foo command
- struct command *cmd = register_command(cmd_ctx, NULL, "foo",
+ struct command *cmd = COMMAND_REGISTER(cmd_ctx, NULL, "foo",
NULL, COMMAND_ANY, "foo: command handler skeleton");
- register_command(cmd_ctx, cmd, "bar",
+ COMMAND_REGISTER(cmd_ctx, cmd, "bar",
&handle_foo_command, COMMAND_ANY,
"<address> [enable|disable] - an example command");
- register_command(cmd_ctx, cmd, "baz",
+ COMMAND_REGISTER(cmd_ctx, cmd, "baz",
&handle_foo_command, COMMAND_ANY,
"<address> [enable|disable] - a sample command");
- register_command(cmd_ctx, cmd, "flag",
+ COMMAND_REGISTER(cmd_ctx, cmd, "flag",
&handle_flag_command, COMMAND_ANY,
"[on|off] - set a flag");
@@ -103,7 +103,7 @@ int hello_register_commands(struct command_context *cmd_ctx)
{
foo_register_commands(cmd_ctx);
- struct command *cmd = register_command(cmd_ctx, NULL, "hello",
+ struct command *cmd = COMMAND_REGISTER(cmd_ctx, NULL, "hello",
&handle_hello_command, COMMAND_ANY,
"[<name>] - prints a warm welcome");
return cmd ? ERROR_OK : -ENOMEM;