summaryrefslogtreecommitdiff
path: root/src/helper/command.h
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-10 22:29:36 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-13 10:55:00 -0800
commita585bdf7269ce5c861c83ee3294ba1f074e9c877 (patch)
tree0b50307192186d4516609e9043be1be1dd3ebc2d /src/helper/command.h
parent5b6df55a1e5e4c0f531bc336691bc7c9a6a0df87 (diff)
downloadopenocd+libswd-a585bdf7269ce5c861c83ee3294ba1f074e9c877.tar.gz
openocd+libswd-a585bdf7269ce5c861c83ee3294ba1f074e9c877.tar.bz2
openocd+libswd-a585bdf7269ce5c861c83ee3294ba1f074e9c877.tar.xz
openocd+libswd-a585bdf7269ce5c861c83ee3294ba1f074e9c877.zip
add CMD_NAME macro for command handlers
By introducing the CMD_NAME macro, this parameter may be integrated as args[-1] in command.[ch], without touching any other call sites.
Diffstat (limited to 'src/helper/command.h')
-rw-r--r--src/helper/command.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/helper/command.h b/src/helper/command.h
index aec066d0..74c6f367 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -121,6 +121,12 @@ typedef struct command_context_s
*/
#define COMMAND_HELPER(name, extra...) __COMMAND_HANDLER(name, extra)
+/**
+ * Use this macro to access the name of the command being handled,
+ * rather than accessing the variable directly. It may be moved.
+ */
+#define CMD_NAME cmd
+
/// The type signature for commands' handler functions.
typedef __COMMAND_HANDLER((*command_handler_t));