command_t -> struct command

Remove misleading typedef and redundant suffix from struct command.
This commit is contained in:
Zachary T Welch 2009-11-13 13:30:50 -08:00
parent 98723c4ecd
commit ef746e27c5
44 changed files with 72 additions and 72 deletions

View File

@ -2474,7 +2474,7 @@ static int sam3_registered;
static int
sam3_register_commands(struct command_context *cmd_ctx)
{
command_t *pCmd;
struct command *pCmd;
// only register once
if (!sam3_registered) {

View File

@ -1180,7 +1180,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
static int at91sam7_register_commands(struct command_context *cmd_ctx)
{
command_t *at91sam7_cmd = register_command(cmd_ctx, NULL, "at91sam7",
struct command *at91sam7_cmd = register_command(cmd_ctx, NULL, "at91sam7",
NULL, COMMAND_ANY, NULL);
register_command(cmd_ctx, at91sam7_cmd, "gpnvm",

View File

@ -451,7 +451,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command)
static int avrf_register_commands(struct command_context *cmd_ctx)
{
command_t *avr_cmd = register_command(cmd_ctx, NULL, "avr",
struct command *avr_cmd = register_command(cmd_ctx, NULL, "avr",
NULL, COMMAND_ANY, "avr flash specific commands");
register_command(cmd_ctx, avr_cmd, "mass_erase",

View File

@ -590,7 +590,7 @@ static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size)
static int cfi_register_commands(struct command_context *cmd_ctx)
{
/*command_t *cfi_cmd = */
/*struct command *cfi_cmd = */
register_command(cmd_ctx, NULL, "cfi", NULL, COMMAND_ANY, "flash bank cfi <base> <size> <chip_width> <bus_width> <targetNum> [jedec_probe/x16_as_x8]");
/*
register_command(cmd_ctx, cfi_cmd, "part_id", cfi_handle_part_id_command, COMMAND_EXEC,

View File

@ -77,7 +77,7 @@ struct flash_driver *flash_drivers[] = {
};
struct flash_bank *flash_banks;
static command_t *flash_cmd;
static struct command *flash_cmd;
/* wafer thin wrapper for invoking the flash driver */
static int flash_driver_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)

View File

@ -778,7 +778,7 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command)
static int lpc2000_register_commands(struct command_context *cmd_ctx)
{
command_t *lpc2000_cmd = register_command(cmd_ctx, NULL, "lpc2000",
struct command *lpc2000_cmd = register_command(cmd_ctx, NULL, "lpc2000",
NULL, COMMAND_ANY, NULL);
register_command(cmd_ctx, lpc2000_cmd, "part_id",

View File

@ -954,7 +954,7 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
*/
static int lpc2900_register_commands(struct command_context *cmd_ctx)
{
command_t *lpc2900_cmd = register_command(cmd_ctx, NULL, "lpc2900",
struct command *lpc2900_cmd = register_command(cmd_ctx, NULL, "lpc2900",
NULL, COMMAND_ANY, NULL);
register_command(

View File

@ -875,7 +875,7 @@ COMMAND_HANDLER(handle_lpc3180_select_command)
static int lpc3180_register_commands(struct command_context *cmd_ctx)
{
command_t *lpc3180_cmd = register_command(cmd_ctx, NULL, "lpc3180", NULL, COMMAND_ANY, "commands specific to the LPC3180 NAND flash controllers");
struct command *lpc3180_cmd = register_command(cmd_ctx, NULL, "lpc3180", NULL, COMMAND_ANY, "commands specific to the LPC3180 NAND flash controllers");
register_command(cmd_ctx, lpc3180_cmd, "select", handle_lpc3180_select_command, COMMAND_EXEC, "select <'mlc'|'slc'> controller (default is mlc)");

View File

@ -32,7 +32,7 @@ static int s3c2440_set_gpio_output_val (struct mflash_gpio_num gpio, uint8_t val
static int pxa270_set_gpio_to_output (struct mflash_gpio_num gpio);
static int pxa270_set_gpio_output_val (struct mflash_gpio_num gpio, uint8_t val);
static command_t *mflash_cmd;
static struct command *mflash_cmd;
static struct mflash_bank *mflash_bank;

View File

@ -62,7 +62,7 @@ static struct nand_flash_controller *nand_flash_controllers[] =
/* configured NAND devices and NAND Flash command handler */
static struct nand_device *nand_devices = NULL;
static command_t *nand_cmd;
static struct command *nand_cmd;
/* Chip ID list
*

View File

@ -885,7 +885,7 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command)
static int pic32mx_register_commands(struct command_context *cmd_ctx)
{
command_t *pic32mx_cmd = register_command(cmd_ctx, NULL, "pic32mx",
struct command *pic32mx_cmd = register_command(cmd_ctx, NULL, "pic32mx",
NULL, COMMAND_ANY, "pic32mx flash specific commands");
#if 0
register_command(cmd_ctx, pic32mx_cmd, "lock",

View File

@ -1162,7 +1162,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
static int stellaris_register_commands(struct command_context *cmd_ctx)
{
command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris",
struct command *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris",
NULL, COMMAND_ANY, "stellaris flash specific commands");
register_command(cmd_ctx, stm32x_cmd, "mass_erase",

View File

@ -1183,7 +1183,7 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
static int stm32x_register_commands(struct command_context *cmd_ctx)
{
command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stm32x",
struct command *stm32x_cmd = register_command(cmd_ctx, NULL, "stm32x",
NULL, COMMAND_ANY, "stm32x flash specific commands");
register_command(cmd_ctx, stm32x_cmd, "lock",

View File

@ -673,7 +673,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command)
static int str7x_register_commands(struct command_context *cmd_ctx)
{
command_t *str7x_cmd = register_command(cmd_ctx, NULL, "str7x",
struct command *str7x_cmd = register_command(cmd_ctx, NULL, "str7x",
NULL, COMMAND_ANY, "str7x flash specific commands");
register_command(cmd_ctx, str7x_cmd, "disable_jtag",

View File

@ -677,7 +677,7 @@ COMMAND_HANDLER(str9x_handle_flash_config_command)
static int str9x_register_commands(struct command_context *cmd_ctx)
{
command_t *str9x_cmd = register_command(cmd_ctx, NULL, "str9x",
struct command *str9x_cmd = register_command(cmd_ctx, NULL, "str9x",
NULL, COMMAND_ANY, "str9x flash commands");
register_command(cmd_ctx, str9x_cmd, "flash_config",

View File

@ -1165,7 +1165,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
static int str9xpec_register_commands(struct command_context *cmd_ctx)
{
command_t *str9xpec_cmd = register_command(cmd_ctx, NULL, "str9xpec",
struct command *str9xpec_cmd = register_command(cmd_ctx, NULL, "str9xpec",
NULL, COMMAND_ANY, "str9xpec flash specific commands");
register_command(cmd_ctx, str9xpec_cmd, "enable_turbo",

View File

@ -819,7 +819,7 @@ static int tms470_erase_sector(struct flash_bank *bank, int sector)
static int tms470_register_commands(struct command_context *cmd_ctx)
{
command_t *tms470_cmd = register_command(cmd_ctx, NULL, "tms470", NULL, COMMAND_ANY, "applies to TI tms470 family");
struct command *tms470_cmd = register_command(cmd_ctx, NULL, "tms470", NULL, COMMAND_ANY, "applies to TI tms470 family");
register_command(cmd_ctx, tms470_cmd, "flash_keyset", tms470_handle_flash_keyset_command, COMMAND_ANY, "tms470 flash_keyset <key0> <key1> <key2> <key3>");
register_command(cmd_ctx, tms470_cmd, "osc_megahertz", tms470_handle_osc_megahertz_command, COMMAND_ANY, "tms470 osc_megahertz <MHz>");

View File

@ -50,7 +50,7 @@ COMMAND_HANDLER(handle_hello_command)
int hello_register_commands(struct command_context *cmd_ctx)
{
struct command_s *cmd = register_command(cmd_ctx, NULL, "hello",
struct command *cmd = register_command(cmd_ctx, NULL, "hello",
&handle_hello_command, COMMAND_ANY,
"option");
return cmd ? ERROR_OK : -ENOMEM;

View File

@ -48,7 +48,7 @@ int fast_and_dangerous = 0;
Jim_Interp *interp = NULL;
static int run_command(struct command_context *context,
command_t *c, const char *words[], unsigned num_words);
struct command *c, const char *words[], unsigned num_words);
static void tcl_output(void *privData, const char *file, unsigned line,
const char *function, const char *string)
@ -79,7 +79,7 @@ void script_debug(Jim_Interp *interp, const char *name,
static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
/* the private data is stashed in the interp structure */
command_t *c;
struct command *c;
struct command_context *context;
int retval;
int i;
@ -164,7 +164,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return (retval == ERROR_OK)?JIM_OK:JIM_ERR;
}
static Jim_Obj *command_name_list(struct command_s *c)
static Jim_Obj *command_name_list(struct command *c)
{
Jim_Obj *cmd_list = c->parent ?
command_name_list(c->parent) :
@ -197,10 +197,10 @@ static void command_helptext_add(Jim_Obj *cmd_list, const char *help)
* Find a command by name from a list of commands.
* @returns The named command if found, or NULL.
*/
static struct command_s *command_find(struct command_s **head, const char *name)
static struct command *command_find(struct command **head, const char *name)
{
assert(head);
for (struct command_s *cc = *head; cc; cc = cc->next)
for (struct command *cc = *head; cc; cc = cc->next)
{
if (strcmp(cc->name, name) == 0)
return cc;
@ -213,7 +213,7 @@ static struct command_s *command_find(struct command_s **head, const char *name)
* @returns Returns false if the named command already exists in the list.
* Returns true otherwise.
*/
static void command_add_child(struct command_s **head, struct command_s *c)
static void command_add_child(struct command **head, struct command *c)
{
assert(head);
if (NULL == *head)
@ -221,24 +221,24 @@ static void command_add_child(struct command_s **head, struct command_s *c)
*head = c;
return;
}
struct command_s *cc = *head;
struct command *cc = *head;
while (cc->next) cc = cc->next;
cc->next = c;
}
command_t* register_command(struct command_context *context,
command_t *parent, char *name, command_handler_t handler,
struct command* register_command(struct command_context *context,
struct command *parent, char *name, command_handler_t handler,
enum command_mode mode, char *help)
{
if (!context || !name)
return NULL;
struct command_s **head = parent ? &parent->children : &context->commands;
struct command_s *c = command_find(head, name);
struct command **head = parent ? &parent->children : &context->commands;
struct command *c = command_find(head, name);
if (NULL != c)
return c;
c = malloc(sizeof(command_t));
c = malloc(sizeof(struct command));
c->name = strdup(name);
c->parent = parent;
@ -276,7 +276,7 @@ command_t* register_command(struct command_context *context,
int unregister_all_commands(struct command_context *context)
{
command_t *c, *c2;
struct command *c, *c2;
if (context == NULL)
return ERROR_OK;
@ -308,7 +308,7 @@ int unregister_all_commands(struct command_context *context)
int unregister_command(struct command_context *context, char *name)
{
command_t *c, *p = NULL, *c2;
struct command *c, *p = NULL, *c2;
if ((!context) || (!name))
return ERROR_INVALID_ARGUMENTS;
@ -414,7 +414,7 @@ void command_print(struct command_context *context, const char *format, ...)
va_end(ap);
}
static char *__command_name(struct command_s *c, char delim, unsigned extra)
static char *__command_name(struct command *c, char delim, unsigned extra)
{
char *name;
unsigned len = strlen(c->name);
@ -431,13 +431,13 @@ static char *__command_name(struct command_s *c, char delim, unsigned extra)
}
return name;
}
char *command_name(struct command_s *c, char delim)
char *command_name(struct command *c, char delim)
{
return __command_name(c, delim, 0);
}
static int run_command(struct command_context *context,
command_t *c, const char *words[], unsigned num_words)
struct command *c, const char *words[], unsigned num_words)
{
int start_word = 0;
if (!((context->mode == COMMAND_CONFIG) || (c->mode == COMMAND_ANY) || (c->mode == context->mode)))

View File

@ -60,7 +60,7 @@ typedef int (*command_output_handler_t)(struct command_context *context,
struct command_context
{
enum command_mode mode;
struct command_s *commands;
struct command *commands;
int current_target;
/* Execute a command.
*
@ -131,15 +131,15 @@ struct command_context
/// The type signature for commands' handler functions.
typedef __COMMAND_HANDLER((*command_handler_t));
typedef struct command_s
struct command
{
char *name;
struct command_s *parent;
struct command_s *children;
struct command *parent;
struct command *children;
command_handler_t handler;
enum command_mode mode;
struct command_s *next;
} command_t;
struct command *next;
};
/**
* @param c The command to be named.
@ -149,10 +149,10 @@ typedef struct command_s
* are separated by single spaces. The caller must free() the string
* when done with it.
*/
char *command_name(struct command_s *c, char delim);
char *command_name(struct command *c, char delim);
command_t* register_command(struct command_context *context,
command_t *parent, char *name, command_handler_t handler,
struct command* register_command(struct command_context *context,
struct command *parent, char *name, command_handler_t handler,
enum command_mode mode, char *help);
int unregister_command(struct command_context *context, char *name);

View File

@ -78,7 +78,7 @@ int interface_jtag_add_plain_ir_scan(int num_fields, const struct scan_field *fi
return ERROR_OK;
}
/*extern jtag_command_t **jtag_get_last_command_p(void);*/
/*extern jtag_struct command **jtag_get_last_command_p(void);*/
int interface_jtag_add_dr_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
{

View File

@ -578,7 +578,7 @@ dtc_run_download(
struct dtc_reply_queue_entry {
struct dtc_reply_queue_entry_s *next;
jtag_command_t *cmd; /* the command that resulted in this entry */
jtag_struct command *cmd; /* the command that resulted in this entry */
struct {
uint8_t *buffer; /* the scan buffer */
@ -637,7 +637,7 @@ dtc_queue_enqueue_reply(
int size,
int offset,
int length,
jtag_command_t *cmd
jtag_struct command *cmd
) {
struct dtc_reply_queue_entry *rq_entry;
@ -1090,7 +1090,7 @@ void rlink_reset(int trst, int srst)
static
int
rlink_scan(
jtag_command_t *cmd,
jtag_struct command *cmd,
enum scan_type type,
uint8_t *buffer,
int scan_size
@ -1378,7 +1378,7 @@ rlink_scan(
static
int rlink_execute_queue(void)
{
jtag_command_t *cmd = jtag_command_queue; /* currently processed command */
jtag_struct command *cmd = jtag_command_queue; /* currently processed command */
int scan_size;
enum scan_type type;
uint8_t *buffer;

View File

@ -595,7 +595,7 @@ int interface_jtag_add_plain_ir_scan(int num_fields, const struct scan_field *fi
return ERROR_OK;
}
/*extern jtag_command_t **jtag_get_last_command_p(void);*/
/*extern jtag_struct command **jtag_get_last_command_p(void);*/
int interface_jtag_add_dr_scan(int num_fields, const struct scan_field *fields, tap_state_t state)
{

View File

@ -37,7 +37,7 @@ static struct pld_driver *pld_drivers[] =
};
static struct pld_device *pld_devices;
static command_t *pld_cmd;
static struct command *pld_cmd;
struct pld_device *get_pld_device_by_num(int num)
{

View File

@ -235,7 +235,7 @@ PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command)
static int virtex2_register_commands(struct command_context *cmd_ctx)
{
command_t *virtex2_cmd = register_command(cmd_ctx, NULL, "virtex2",
struct command *virtex2_cmd = register_command(cmd_ctx, NULL, "virtex2",
NULL, COMMAND_ANY, "virtex2 specific commands");
register_command(cmd_ctx, virtex2_cmd, "read_stat",

View File

@ -2243,7 +2243,7 @@ int arm11_register_commands(struct command_context *cmd_ctx)
{
FNC_INFO;
command_t *top_cmd, *mw_cmd;
struct command *top_cmd, *mw_cmd;
top_cmd = register_command(cmd_ctx, NULL, "arm11",
NULL, COMMAND_ANY, NULL);

View File

@ -493,7 +493,7 @@ static int arm720t_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t
static int arm720t_register_commands(struct command_context *cmd_ctx)
{
int retval;
command_t *arm720t_cmd;
struct command *arm720t_cmd;
retval = arm7_9_register_commands(cmd_ctx);

View File

@ -3121,7 +3121,7 @@ int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9)
int arm7_9_register_commands(struct command_context *cmd_ctx)
{
command_t *arm7_9_cmd;
struct command *arm7_9_cmd;
arm7_9_cmd = register_command(cmd_ctx, NULL, "arm7_9",
NULL, COMMAND_ANY, "arm7/9 specific commands");

View File

@ -1351,7 +1351,7 @@ static int arm920t_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t
int arm920t_register_commands(struct command_context *cmd_ctx)
{
int retval;
command_t *arm920t_cmd;
struct command *arm920t_cmd;
retval = arm9tdmi_register_commands(cmd_ctx);

View File

@ -821,7 +821,7 @@ static int arm926ejs_mmu(struct target *target, int *enabled)
int arm926ejs_register_commands(struct command_context *cmd_ctx)
{
int retval;
command_t *arm926ejs_cmd;
struct command *arm926ejs_cmd;
retval = arm9tdmi_register_commands(cmd_ctx);

View File

@ -219,7 +219,7 @@ COMMAND_HANDLER(arm966e_handle_cp15_command)
int arm966e_register_commands(struct command_context *cmd_ctx)
{
int retval;
command_t *arm966e_cmd;
struct command *arm966e_cmd;
retval = arm9tdmi_register_commands(cmd_ctx);
arm966e_cmd = register_command(cmd_ctx, NULL, "arm966e",

View File

@ -939,7 +939,7 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
int arm9tdmi_register_commands(struct command_context *cmd_ctx)
{
int retval;
command_t *arm9tdmi_cmd;
struct command *arm9tdmi_cmd;
retval = arm7_9_register_commands(cmd_ctx);
arm9tdmi_cmd = register_command(cmd_ctx, NULL, "arm9",

View File

@ -464,7 +464,7 @@ usage:
int armv4_5_register_commands(struct command_context *cmd_ctx)
{
command_t *armv4_5_cmd;
struct command *armv4_5_cmd;
armv4_5_cmd = register_command(cmd_ctx, NULL, "armv4_5",
NULL, COMMAND_ANY,

View File

@ -363,8 +363,8 @@ usage:
int armv7a_register_commands(struct command_context *cmd_ctx)
{
command_t *arm_adi_v5_dap_cmd;
command_t *armv7a_cmd;
struct command *arm_adi_v5_dap_cmd;
struct command *armv7a_cmd;
arm_adi_v5_dap_cmd = register_command(cmd_ctx, NULL, "dap",
NULL, COMMAND_ANY,

View File

@ -834,7 +834,7 @@ COMMAND_HANDLER(handle_dap_info_command)
/** Registers commands used to access DAP resources. */
int armv7m_register_commands(struct command_context *cmd_ctx)
{
command_t *arm_adi_v5_dap_cmd;
struct command *arm_adi_v5_dap_cmd;
arm_adi_v5_dap_cmd = register_command(cmd_ctx, NULL, "dap",
NULL, COMMAND_ANY,

View File

@ -1548,7 +1548,7 @@ COMMAND_HANDLER(cortex_a8_handle_dbginit_command)
static int cortex_a8_register_commands(struct command_context *cmd_ctx)
{
command_t *cortex_a8_cmd;
struct command *cortex_a8_cmd;
int retval = ERROR_OK;
armv4_5_register_commands(cmd_ctx);

View File

@ -1931,7 +1931,7 @@ COMMAND_HANDLER(handle_cortex_m3_mask_interrupts_command)
static int cortex_m3_register_commands(struct command_context *cmd_ctx)
{
int retval;
command_t *cortex_m3_cmd;
struct command *cortex_m3_cmd;
retval = armv7m_register_commands(cmd_ctx);

View File

@ -405,7 +405,7 @@ COMMAND_HANDLER(handle_etb_config_command)
static int etb_register_commands(struct command_context *cmd_ctx)
{
command_t *etb_cmd = register_command(cmd_ctx, NULL, "etb",
struct command *etb_cmd = register_command(cmd_ctx, NULL, "etb",
NULL, COMMAND_ANY, "Embedded Trace Buffer");
register_command(cmd_ctx, etb_cmd, "config",

View File

@ -223,7 +223,7 @@ static int etm_register_user_commands(struct command_context *cmd_ctx);
static int etm_set_reg_w_exec(struct reg *reg, uint8_t *buf);
static int etm_write_reg(struct reg *reg, uint32_t value);
static command_t *etm_cmd;
static struct command *etm_cmd;
/* Look up register by ID ... most ETM instances only

View File

@ -60,7 +60,7 @@ COMMAND_HANDLER(handle_etm_dummy_config_command)
static int etm_dummy_register_commands(struct command_context *cmd_ctx)
{
command_t *etm_dummy_cmd;
struct command *etm_dummy_cmd;
etm_dummy_cmd = register_command(cmd_ctx, NULL, "etm_dummy", NULL, COMMAND_ANY, "Dummy ETM capture driver");

View File

@ -409,7 +409,7 @@ COMMAND_HANDLER(handle_oocd_trace_resync_command)
int oocd_trace_register_commands(struct command_context *cmd_ctx)
{
command_t *oocd_trace_cmd;
struct command *oocd_trace_cmd;
oocd_trace_cmd = register_command(cmd_ctx, NULL, "oocd_trace", NULL, COMMAND_ANY, "OpenOCD + trace");

View File

@ -34,7 +34,7 @@
#include "log.h"
static command_t *target_request_cmd = NULL;
static struct command *target_request_cmd = NULL;
static int charmsg_mode = 0;
static int target_asciimsg(struct target *target, uint32_t length)

View File

@ -158,7 +158,7 @@ COMMAND_HANDLER(handle_trace_history_command)
int trace_register_commands(struct command_context *cmd_ctx)
{
command_t *trace_cmd =
struct command *trace_cmd =
register_command(cmd_ctx, NULL, "trace", NULL, COMMAND_ANY, "trace commands");
register_command(cmd_ctx, trace_cmd, "history", handle_trace_history_command,

View File

@ -3577,7 +3577,7 @@ COMMAND_HANDLER(xscale_handle_cp15)
static int xscale_register_commands(struct command_context *cmd_ctx)
{
command_t *xscale_cmd;
struct command *xscale_cmd;
xscale_cmd = register_command(cmd_ctx, NULL, "xscale", NULL, COMMAND_ANY, "xscale specific commands");