remove more useless declarations

Removes forward declarations by moving command registration after
defintion of the command handlers.
This commit is contained in:
Zachary T Welch
2009-11-09 23:20:34 -08:00
parent e997431602
commit 39ab1c1a41
5 changed files with 62 additions and 97 deletions

View File

@@ -39,26 +39,6 @@ static pld_driver_t *pld_drivers[] =
static pld_device_t *pld_devices;
static command_t *pld_cmd;
static int handle_pld_devices_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc);
static int handle_pld_device_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc);
static int handle_pld_load_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc);
int pld_init(struct command_context_s *cmd_ctx)
{
if (pld_devices)
{
register_command(cmd_ctx, pld_cmd, "devices", handle_pld_devices_command, COMMAND_EXEC,
"list configured pld devices");
register_command(cmd_ctx, pld_cmd, "load", handle_pld_load_command, COMMAND_EXEC,
"load configuration <file> into programmable logic device");
}
return ERROR_OK;
}
pld_device_t *get_pld_device_by_num(int num)
{
pld_device_t *p;
@@ -206,6 +186,21 @@ static int handle_pld_load_command(struct command_context_s *cmd_ctx,
return ERROR_OK;
}
int pld_init(struct command_context_s *cmd_ctx)
{
if (!pld_devices)
return ERROR_OK;
register_command(cmd_ctx, pld_cmd, "devices",
handle_pld_devices_command, COMMAND_EXEC,
"list configured pld devices");
register_command(cmd_ctx, pld_cmd, "load",
handle_pld_load_command, COMMAND_EXEC,
"load configuration <file> into programmable logic device");
return ERROR_OK;
}
int pld_register_commands(struct command_context_s *cmd_ctx)
{
pld_cmd = register_command(cmd_ctx, NULL, "pld", NULL, COMMAND_ANY, "programmable logic device commands");