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.
This commit is contained in:
Zachary T Welch 2009-11-20 11:30:00 -08:00
parent 47cb10217a
commit f7e1f2df74
1 changed files with 4 additions and 0 deletions

View File

@ -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.