summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-20 11:30:00 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:29 -0800
commitf7e1f2df74b599903a6fb2d2ace94c3f1ef06097 (patch)
treef3fa0c2bdacada88f38ad2dcfbc97b5ec932f6dc
parent47cb10217a7bc4b97fa169a821db05f40bc2e51d (diff)
downloadopenocd+libswd-f7e1f2df74b599903a6fb2d2ace94c3f1ef06097.tar.gz
openocd+libswd-f7e1f2df74b599903a6fb2d2ace94c3f1ef06097.tar.bz2
openocd+libswd-f7e1f2df74b599903a6fb2d2ace94c3f1ef06097.tar.xz
openocd+libswd-f7e1f2df74b599903a6fb2d2ace94c3f1ef06097.zip
add COMMAND_REGISTER macro
Provides a migration path for the widely used register_command API, which needs to be updated to provide new functionality. This macro allows the API to change without having to update all of its callers at the same time.
-rw-r--r--src/helper/command.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/helper/command.h b/src/helper/command.h
index 837b4bdd..25c05011 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -207,6 +207,10 @@ struct command* register_command(struct command_context *cmd_ctx,
command_handler_t handler, enum command_mode mode,
const char *help);
+// provide a simple shim, for now; allows parameters to be migrated
+#define COMMAND_REGISTER(_cmd_ctx, _parent, _name, _handler, _mode, _help) \
+ register_command(_cmd_ctx, _parent, _name, _handler, _mode, _help)
+
/**
* Unregisters command @c name from the given context, @c cmd_ctx.
* @param cmd_ctx The context of the registered command.