From: Zach W. <zw...@us...> - 2009-11-13 22:32:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ef746e27c55c14b7a4f6381c490e5c175e409c0b (commit) via 98723c4ecdbe06f90c66f3abec27b792c3b38e34 (commit) from d16968e24f5d9e436ae4e136cd27652c4c948203 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ef746e27c55c14b7a4f6381c490e5c175e409c0b Author: Zachary T Welch <zw...@su...> Date: Fri Nov 13 13:30:50 2009 -0800 command_t -> struct command Remove misleading typedef and redundant suffix from struct command. diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c index 4459364..ad45bd5 100644 --- a/src/flash/at91sam3.c +++ b/src/flash/at91sam3.c @@ -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) { diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 18cfb98..e0b83d5 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -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", diff --git a/src/flash/avrf.c b/src/flash/avrf.c index ea9f083..e41093d 100644 --- a/src/flash/avrf.c +++ b/src/flash/avrf.c @@ -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", diff --git a/src/flash/cfi.c b/src/flash/cfi.c index d49ddf3..17f5c32 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -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, diff --git a/src/flash/flash.c b/src/flash/flash.c index 32c1f49..20efa50 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -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) diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c index f3d7e5b..df1f082 100644 --- a/src/flash/lpc2000.c +++ b/src/flash/lpc2000.c @@ -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", diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c index 4cf2092..739ac43 100644 --- a/src/flash/lpc2900.c +++ b/src/flash/lpc2900.c @@ -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( diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/lpc3180_nand_controller.c index ffa5055..3589e8b 100644 --- a/src/flash/lpc3180_nand_controller.c +++ b/src/flash/lpc3180_nand_controller.c @@ -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)"); diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 029178d..c2d04ca 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -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; diff --git a/src/flash/nand.c b/src/flash/nand.c index 4094eff..be3a669 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -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 * diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c index bb3d69c..b6c4c44 100644 --- a/src/flash/pic32mx.c +++ b/src/flash/pic32mx.c @@ -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", diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index 910d047..56762d1 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -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", diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c index abbf6cb..7ac06a6 100644 --- a/src/flash/stm32x.c +++ b/src/flash/stm32x.c @@ -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", diff --git a/src/flash/str7x.c b/src/flash/str7x.c index 8307013..71709bb 100644 --- a/src/flash/str7x.c +++ b/src/flash/str7x.c @@ -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", diff --git a/src/flash/str9x.c b/src/flash/str9x.c index a06bd1e..1506cb5 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -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", diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c index 03a8ea2..d1b02c5 100644 --- a/src/flash/str9xpec.c +++ b/src/flash/str9xpec.c @@ -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", diff --git a/src/flash/tms470.c b/src/flash/tms470.c index a5f2f36..b71e9ed 100644 --- a/src/flash/tms470.c +++ b/src/flash/tms470.c @@ -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>"); diff --git a/src/hello.c b/src/hello.c index 267cc28..275150a 100644 --- a/src/hello.c +++ b/src/hello.c @@ -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; diff --git a/src/helper/command.c b/src/helper/command.c index 60a4a26..41af035 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -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))) diff --git a/src/helper/command.h b/src/helper/command.h index 169852e..94d9816 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -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); diff --git a/src/jtag/minidummy/minidummy.c b/src/jtag/minidummy/minidummy.c index b01f593..67919e4 100644 --- a/src/jtag/minidummy/minidummy.c +++ b/src/jtag/minidummy/minidummy.c @@ -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) { diff --git a/src/jtag/rlink/rlink.c b/src/jtag/rlink/rlink.c index 8f2f26f..8aa0342 100644 --- a/src/jtag/rlink/rlink.c +++ b/src/jtag/rlink/rlink.c @@ -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; diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 1edf57f..526914a 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -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) { diff --git a/src/pld/pld.c b/src/pld/pld.c index f5f3303..fdb276f 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -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) { diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index 24bcd34..ea9ee0c 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -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", diff --git a/src/target/arm11.c b/src/target/arm11.c index feaa17b..24c6b8f 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -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); diff --git a/src/target/arm720t.c b/src/target/arm720t.c index bdbc8dd..145c8d1 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -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); diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 87a6434..ce2d4f0 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -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"); diff --git a/src/target/arm920t.c b/src/target/arm920t.c index cd63d7b..dd742ca 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -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); diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index 47a20cb..c7609c4 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -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); diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 6db7d79..61f9ae5 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -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", diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index b910447..147c090 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -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", diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index f7d5d16..6e3eff6 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -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, diff --git a/src/target/armv7a.c b/src/target/armv7a.c index e40e8fd..0474a56 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -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, diff --git a/src/target/armv7m.c b/src/target/armv7m.c index a740584..f339645 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -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, diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 6c61363..730cd33 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -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); diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index bb0b0c4..e236df2 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -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); diff --git a/src/target/etb.c b/src/target/etb.c index 903951f..2e8e7ca 100644 --- a/src/target/etb.c +++ b/src/target/etb.c @@ -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", diff --git a/src/target/etm.c b/src/target/etm.c index ee064eb..43158b5 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -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 diff --git a/src/target/etm_dummy.c b/src/target/etm_dummy.c index 8301fb0..b0ab1fb 100644 --- a/src/target/etm_dummy.c +++ b/src/target/etm_dummy.c @@ -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"); diff --git a/src/target/oocd_trace.c b/src/target/oocd_trace.c index c2e1361..cad4977 100644 --- a/src/target/oocd_trace.c +++ b/src/target/oocd_trace.c @@ -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"); diff --git a/src/target/target_request.c b/src/target/target_request.c index 1f02be6..283ce55 100644 --- a/src/target/target_request.c +++ b/src/target/target_request.c @@ -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) diff --git a/src/target/trace.c b/src/target/trace.c index aa8fb29..6ec08d6 100644 --- a/src/target/trace.c +++ b/src/target/trace.c @@ -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, diff --git a/src/target/xscale.c b/src/target/xscale.c index 73c1ba1..ca3ea2a 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -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"); commit 98723c4ecdbe06f90c66f3abec27b792c3b38e34 Author: Zachary T Welch <zw...@su...> Date: Fri Nov 13 13:25:47 2009 -0800 command_context_t -> struct command_context Remove misleading typedef and redundant suffix from struct command_context. diff --git a/src/ecosboard.c b/src/ecosboard.c index 455c93c..38f3252 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -229,7 +229,7 @@ void reboot_port(void) cyg_thread_resume(zylinjtag_reboot_port_thread_handle); } -int configuration_output_handler(struct command_context_s *context, +int configuration_output_handler(struct command_context *context, const char* line) { diag_printf("%s", line); @@ -237,7 +237,7 @@ int configuration_output_handler(struct command_context_s *context, return ERROR_OK; } -int zy1000_configuration_output_handler_log(struct command_context_s *context, +int zy1000_configuration_output_handler_log(struct command_context *context, const char* line) { LOG_USER_N("%s", line); @@ -247,7 +247,7 @@ int zy1000_configuration_output_handler_log(struct command_context_s *context, #ifdef CYGPKG_PROFILE_GPROF -int eCosBoard_handle_eCosBoard_profile_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +int eCosBoard_handle_eCosBoard_profile_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc) { command_print(cmd_ctx, "Profiling started"); start_profile(); @@ -258,7 +258,7 @@ int eCosBoard_handle_eCosBoard_profile_command(struct command_context_s *cmd_ctx externC void phi_init_all_network_interfaces(void); -command_context_t *cmd_ctx; +struct command_context *cmd_ctx; static bool webRunning = false; @@ -840,7 +840,7 @@ void startUart(void) cyg_thread_resume(zylinjtag_uart_thread_handle); } -int handle_uart_command(struct command_context_s *cmd_ctx, char *cmd, +int handle_uart_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc) { static int current_baud = 38400; @@ -924,7 +924,7 @@ bool logAllToSerial = false; int boolParam(char *var); -command_context_t *setup_command_handler(void); +struct command_context *setup_command_handler(void); static const char *zylin_config_dir="/config/settings"; @@ -936,7 +936,7 @@ static int add_default_dirs(void) return ERROR_OK; } -int ioutil_init(struct command_context_s *cmd_ctx); +int ioutil_init(struct command_context *cmd_ctx); int main(int argc, char *argv[]) { @@ -1068,7 +1068,7 @@ int main(int argc, char *argv[]) add_default_dirs(); /* initialize commandline interface */ - command_context_t * cmd_ctx; + struct command_context * cmd_ctx; cmd_ctx = setup_command_handler(); command_set_output_handler(cmd_ctx, configuration_output_handler, NULL); command_context_mode(cmd_ctx, COMMAND_CONFIG); diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c index b756e48..4459364 100644 --- a/src/flash/at91sam3.c +++ b/src/flash/at91sam3.c @@ -231,7 +231,7 @@ struct sam3_reg_list { static struct sam3_chip *all_sam3_chips; static struct sam3_chip * -get_current_sam3(struct command_context_s *cmd_ctx) +get_current_sam3(struct command_context *cmd_ctx) { struct target *t; static struct sam3_chip *p; @@ -2472,7 +2472,7 @@ COMMAND_HANDLER(sam3_handle_slowclk_command) static int sam3_registered; static int -sam3_register_commands(struct command_context_s *cmd_ctx) +sam3_register_commands(struct command_context *cmd_ctx) { command_t *pCmd; diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 8f870bc..18cfb98 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -1178,7 +1178,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) return ERROR_OK; } -static int at91sam7_register_commands(struct command_context_s *cmd_ctx) +static int at91sam7_register_commands(struct command_context *cmd_ctx) { command_t *at91sam7_cmd = register_command(cmd_ctx, NULL, "at91sam7", NULL, COMMAND_ANY, NULL); diff --git a/src/flash/avrf.c b/src/flash/avrf.c index 9df254e..ea9f083 100644 --- a/src/flash/avrf.c +++ b/src/flash/avrf.c @@ -449,7 +449,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command) return ERROR_OK; } -static int avrf_register_commands(struct command_context_s *cmd_ctx) +static int avrf_register_commands(struct command_context *cmd_ctx) { command_t *avr_cmd = register_command(cmd_ctx, NULL, "avr", NULL, COMMAND_ANY, "avr flash specific commands"); diff --git a/src/flash/cfi.c b/src/flash/cfi.c index dd393de..d49ddf3 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -588,7 +588,7 @@ static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size) return ERROR_OK; } -static int cfi_register_commands(struct command_context_s *cmd_ctx) +static int cfi_register_commands(struct command_context *cmd_ctx) { /*command_t *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]"); diff --git a/src/flash/davinci_nand.c b/src/flash/davinci_nand.c index 4cef408..413bcda 100644 --- a/src/flash/davinci_nand.c +++ b/src/flash/davinci_nand.c @@ -78,7 +78,7 @@ static int halted(struct target *target, const char *label) return false; } -static int davinci_register_commands(struct command_context_s *cmd_ctx) +static int davinci_register_commands(struct command_context *cmd_ctx) { return ERROR_OK; } diff --git a/src/flash/ecos.c b/src/flash/ecos.c index da35407..0525fbe 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -30,7 +30,7 @@ static uint32_t ecosflash_get_flash_status(struct flash_bank *bank); static void ecosflash_set_flash_mode(struct flash_bank *bank,int mode); static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout); -static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); +static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc); #endif struct ecosflash_flash_bank @@ -334,7 +334,7 @@ static int ecosflash_probe(struct flash_bank *bank) return ERROR_OK; } -static int ecosflash_register_commands(struct command_context_s *cmd_ctx) +static int ecosflash_register_commands(struct command_context *cmd_ctx) { register_command(cmd_ctx, NULL, "ecosflash", NULL, COMMAND_ANY, NULL); @@ -429,7 +429,7 @@ static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t wai return ERROR_OK; } -static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc) { return ERROR_OK; } diff --git a/src/flash/faux.c b/src/flash/faux.c index 55e9892..b048fcb 100644 --- a/src/flash/faux.c +++ b/src/flash/faux.c @@ -87,7 +87,7 @@ FLASH_BANK_COMMAND_HANDLER(faux_flash_bank_command) return ERROR_OK; } -static int faux_register_commands(struct command_context_s *cmd_ctx) +static int faux_register_commands(struct command_context *cmd_ctx) { return ERROR_OK; } diff --git a/src/flash/flash.c b/src/flash/flash.c index 96c63d5..32c1f49 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -199,7 +199,7 @@ struct flash_bank *get_flash_bank_by_num(int num) } int flash_command_get_bank_by_num( - struct command_context_s *cmd_ctx, const char *str, struct flash_bank **bank) + struct command_context *cmd_ctx, const char *str, struct flash_bank **bank) { unsigned bank_num; COMMAND_PARSE_NUMBER(uint, str, bank_num); @@ -511,7 +511,7 @@ COMMAND_HANDLER(handle_flash_protect_check_command) return ERROR_OK; } -static int flash_check_sector_parameters(struct command_context_s *cmd_ctx, +static int flash_check_sector_parameters(struct command_context *cmd_ctx, uint32_t first, uint32_t last, uint32_t num_sectors) { if (!(first <= last)) { @@ -1217,7 +1217,7 @@ int default_flash_blank_check(struct flash_bank *bank) return ERROR_OK; } -int flash_init_drivers(struct command_context_s *cmd_ctx) +int flash_init_drivers(struct command_context *cmd_ctx) { register_jim(cmd_ctx, "ocd_flash_banks", jim_flash_banks, "return information about the flash banks"); @@ -1267,7 +1267,7 @@ int flash_init_drivers(struct command_context_s *cmd_ctx) return ERROR_OK; } -int flash_register_commands(struct command_context_s *cmd_ctx) +int flash_register_commands(struct command_context *cmd_ctx) { flash_cmd = register_command(cmd_ctx, NULL, "flash", NULL, COMMAND_ANY, NULL); diff --git a/src/flash/flash.h b/src/flash/flash.h index 202a5e5..4651fc3 100644 --- a/src/flash/flash.h +++ b/src/flash/flash.h @@ -97,7 +97,7 @@ struct flash_driver * * @returns ERROR_OK if successful; otherwise, an error code. */ - int (*register_commands)(struct command_context_s *cmd_ctx); + int (*register_commands)(struct command_context *cmd_ctx); /** * Finish the "flash bank" command for @a bank. The @@ -265,9 +265,9 @@ struct flash_bank }; /// Registers the 'flash' subsystem commands -int flash_register_commands(struct command_context_s *cmd_ctx); +int flash_register_commands(struct command_context *cmd_ctx); /// Initializes the 'flash' subsystem drivers -int flash_init_drivers(struct command_context_s *cmd_ctx); +int flash_init_drivers(struct command_context *cmd_ctx); /** * Erases @a length bytes in the @a target flash, starting at @a addr. @@ -323,7 +323,7 @@ struct flash_bank *get_flash_bank_by_num(int num); * @param bank On output, contians a pointer to the bank or NULL. * @returns ERROR_OK on success, or an error indicating the problem. */ -int flash_command_get_bank_by_num(struct command_context_s *cmd_ctx, +int flash_command_get_bank_by_num(struct command_context *cmd_ctx, const char *str, struct flash_bank **bank); /** * Returns the flash bank like get_flash_bank_by_num(), without probing. diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c index 36ebc0e..f3d7e5b 100644 --- a/src/flash/lpc2000.c +++ b/src/flash/lpc2000.c @@ -776,7 +776,7 @@ COMMAND_HANDLER(lpc2000_handle_part_id_command) return ERROR_OK; } -static int lpc2000_register_commands(struct command_context_s *cmd_ctx) +static int lpc2000_register_commands(struct command_context *cmd_ctx) { command_t *lpc2000_cmd = register_command(cmd_ctx, NULL, "lpc2000", NULL, COMMAND_ANY, NULL); diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c index d385a30..4cf2092 100644 --- a/src/flash/lpc2900.c +++ b/src/flash/lpc2900.c @@ -952,7 +952,7 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command) /** * Register private command handlers. */ -static int lpc2900_register_commands(struct command_context_s *cmd_ctx) +static int lpc2900_register_commands(struct command_context *cmd_ctx) { command_t *lpc2900_cmd = register_command(cmd_ctx, NULL, "lpc2900", NULL, COMMAND_ANY, NULL); diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/lpc3180_nand_controller.c index 4a15e36..ffa5055 100644 --- a/src/flash/lpc3180_nand_controller.c +++ b/src/flash/lpc3180_nand_controller.c @@ -873,7 +873,7 @@ COMMAND_HANDLER(handle_lpc3180_select_command) return ERROR_OK; } -static int lpc3180_register_commands(struct command_context_s *cmd_ctx) +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"); diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 698cd16..029178d 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -1265,7 +1265,7 @@ COMMAND_HANDLER(mg_config_cmd) } } -int mflash_init_drivers(struct command_context_s *cmd_ctx) +int mflash_init_drivers(struct command_context *cmd_ctx) { if (mflash_bank) { register_command(cmd_ctx, mflash_cmd, "probe", mg_probe_cmd, COMMAND_EXEC, NULL); @@ -1320,7 +1320,7 @@ COMMAND_HANDLER(mg_bank_cmd) return ERROR_OK; } -int mflash_register_commands(struct command_context_s *cmd_ctx) +int mflash_register_commands(struct command_context *cmd_ctx) { mflash_cmd = register_command(cmd_ctx, NULL, "mflash", NULL, COMMAND_ANY, NULL); register_command(cmd_ctx, mflash_cmd, "bank", mg_bank_cmd, COMMAND_CONFIG, diff --git a/src/flash/mflash.h b/src/flash/mflash.h index a2bd5b3..ed4a2cd 100644 --- a/src/flash/mflash.h +++ b/src/flash/mflash.h @@ -141,8 +141,8 @@ struct mflash_bank struct mg_drv_info *drv_info; }; -int mflash_register_commands(struct command_context_s *cmd_ctx); -int mflash_init_drivers(struct command_context_s *cmd_ctx); +int mflash_register_commands(struct command_context *cmd_ctx); +int mflash_init_drivers(struct command_context *cmd_ctx); #define MG_MFLASH_SECTOR_SIZE (0x200) /* 512Bytes = 2^9 */ #define MG_MFLASH_SECTOR_SIZE_MASK (0x200-1) diff --git a/src/flash/mx3_nand.c b/src/flash/mx3_nand.c index 6c69917..45d2a32 100644 --- a/src/flash/mx3_nand.c +++ b/src/flash/mx3_nand.c @@ -315,7 +315,7 @@ static int imx31_nand_ready (struct nand_device *nand, int timeout) return imx31_controller_ready (nand, timeout); } -static int imx31_register_commands (struct command_context_s *cmd_ctx) +static int imx31_register_commands (struct command_context *cmd_ctx) { return ERROR_OK; } diff --git a/src/flash/nand.c b/src/flash/nand.c index 48f6520..4094eff 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -279,7 +279,7 @@ COMMAND_HANDLER(handle_nand_device_command) return ERROR_OK; } -int nand_register_commands(struct command_context_s *cmd_ctx) +int nand_register_commands(struct command_context *cmd_ctx) { nand_cmd = register_command(cmd_ctx, NULL, "nand", NULL, COMMAND_ANY, "NAND specific commands"); @@ -304,7 +304,7 @@ struct nand_device *get_nand_device_by_num(int num) return NULL; } -int nand_command_get_device_by_num(struct command_context_s *cmd_ctx, +int nand_command_get_device_by_num(struct command_context *cmd_ctx, const char *str, struct nand_device **nand) { unsigned num; @@ -1602,7 +1602,7 @@ COMMAND_HANDLER(handle_nand_raw_access_command) return ERROR_OK; } -int nand_init(struct command_context_s *cmd_ctx) +int nand_init(struct command_context *cmd_ctx) { if (!nand_devices) return ERROR_OK; diff --git a/src/flash/nand.h b/src/flash/nand.h index 8096309..afec9a7 100644 --- a/src/flash/nand.h +++ b/src/flash/nand.h @@ -36,7 +36,7 @@ struct nand_flash_controller { char *name; __NAND_DEVICE_COMMAND((*nand_device_command)); - int (*register_commands)(struct command_context_s *cmd_ctx); + int (*register_commands)(struct command_context *cmd_ctx); int (*init)(struct nand_device *nand); int (*reset)(struct nand_device *nand); int (*command)(struct nand_device *nand, uint8_t command); @@ -226,11 +226,11 @@ int nand_calculate_ecc(struct nand_device *nand, int nand_calculate_ecc_kw(struct nand_device *nand, const uint8_t *dat, uint8_t *ecc_code); -int nand_register_commands(struct command_context_s *cmd_ctx); -int nand_init(struct command_context_s *cmd_ctx); +int nand_register_commands(struct command_context *cmd_ctx); +int nand_init(struct command_context *cmd_ctx); /// helper for parsing a nand device command argument string -int nand_command_get_device_by_num(struct command_context_s *cmd_ctx, +int nand_command_get_device_by_num(struct command_context *cmd_ctx, const char *str, struct nand_device **nand); diff --git a/src/flash/orion_nand.c b/src/flash/orion_nand.c index 0d4e1ea..4235b08 100644 --- a/src/flash/orion_nand.c +++ b/src/flash/orion_nand.c @@ -120,7 +120,7 @@ static int orion_nand_controller_ready(struct nand_device *nand, int timeout) return 1; } -static int orion_nand_register_commands(struct command_context_s *cmd_ctx) +static int orion_nand_register_commands(struct command_context *cmd_ctx) { return ERROR_OK; } diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c index e19ee95..bb3d69c 100644 --- a/src/flash/pic32mx.c +++ b/src/flash/pic32mx.c @@ -883,7 +883,7 @@ COMMAND_HANDLER(pic32mx_handle_pgm_word_command) return ERROR_OK; } -static int pic32mx_register_commands(struct command_context_s *cmd_ctx) +static int pic32mx_register_commands(struct command_context *cmd_ctx) { command_t *pic32mx_cmd = register_command(cmd_ctx, NULL, "pic32mx", NULL, COMMAND_ANY, "pic32mx flash specific commands"); diff --git a/src/flash/s3c24xx_nand.c b/src/flash/s3c24xx_nand.c index 5b2d191..75b8700 100644 --- a/src/flash/s3c24xx_nand.c +++ b/src/flash/s3c24xx_nand.c @@ -52,7 +52,7 @@ S3C24XX_DEVICE_COMMAND() return ERROR_OK; } -int s3c24xx_register_commands(struct command_context_s *cmd_ctx) +int s3c24xx_register_commands(struct command_context *cmd_ctx) { return ERROR_OK; } diff --git a/src/flash/s3c24xx_nand.h b/src/flash/s3c24xx_nand.h index 41c95f5..4829c7c 100644 --- a/src/flash/s3c24xx_nand.h +++ b/src/flash/s3c24xx_nand.h @@ -59,7 +59,7 @@ S3C24XX_DEVICE_COMMAND(); return retval; \ } while (0) -int s3c24xx_register_commands(struct command_context_s *cmd_ctx); +int s3c24xx_register_commands(struct command_context *cmd_ctx); int s3c24xx_reset(struct nand_device *nand); diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index efda859..910d047 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -1160,7 +1160,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command) return ERROR_OK; } -static int stellaris_register_commands(struct command_context_s *cmd_ctx) +static int stellaris_register_commands(struct command_context *cmd_ctx) { command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris", NULL, COMMAND_ANY, "stellaris flash specific commands"); diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c index cf842fc..abbf6cb 100644 --- a/src/flash/stm32x.c +++ b/src/flash/stm32x.c @@ -1181,7 +1181,7 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command) return ERROR_OK; } -static int stm32x_register_commands(struct command_context_s *cmd_ctx) +static int stm32x_register_commands(struct command_context *cmd_ctx) { command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stm32x", NULL, COMMAND_ANY, "stm32x flash specific commands"); diff --git a/src/flash/str7x.c b/src/flash/str7x.c index fa23550..8307013 100644 --- a/src/flash/str7x.c +++ b/src/flash/str7x.c @@ -671,7 +671,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command) return ERROR_OK; } -static int str7x_register_commands(struct command_context_s *cmd_ctx) +static int str7x_register_commands(struct command_context *cmd_ctx) { command_t *str7x_cmd = register_command(cmd_ctx, NULL, "str7x", NULL, COMMAND_ANY, "str7x flash specific commands"); diff --git a/src/flash/str9x.c b/src/flash/str9x.c index b3e8dff..a06bd1e 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -675,7 +675,7 @@ COMMAND_HANDLER(str9x_handle_flash_config_command) return ERROR_OK; } -static int str9x_register_commands(struct command_context_s *cmd_ctx) +static int str9x_register_commands(struct command_context *cmd_ctx) { command_t *str9x_cmd = register_command(cmd_ctx, NULL, "str9x", NULL, COMMAND_ANY, "str9x flash commands"); diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c index 6c42ce3..03a8ea2 100644 --- a/src/flash/str9xpec.c +++ b/src/flash/str9xpec.c @@ -1163,7 +1163,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command) return ERROR_OK; } -static int str9xpec_register_commands(struct command_context_s *cmd_ctx) +static int str9xpec_register_commands(struct command_context *cmd_ctx) { command_t *str9xpec_cmd = register_command(cmd_ctx, NULL, "str9xpec", NULL, COMMAND_ANY, "str9xpec flash specific commands"); diff --git a/src/flash/tms470.c b/src/flash/tms470.c index 6e1516f..a5f2f36 100644 --- a/src/flash/tms470.c +++ b/src/flash/tms470.c @@ -817,7 +817,7 @@ static int tms470_erase_sector(struct flash_bank *bank, int sector) Implementation of Flash Driver Interfaces ---------------------------------------------------------------------- */ -static int tms470_register_commands(struct command_context_s *cmd_ctx) +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"); diff --git a/src/hello.c b/src/hello.c index 8a4f701..267cc28 100644 --- a/src/hello.c +++ b/src/hello.c @@ -48,7 +48,7 @@ COMMAND_HANDLER(handle_hello_command) return retval; } -int hello_register_commands(struct command_context_s *cmd_ctx) +int hello_register_commands(struct command_context *cmd_ctx) { struct command_s *cmd = register_command(cmd_ctx, NULL, "hello", &handle_hello_command, COMMAND_ANY, diff --git a/src/helper/command.c b/src/helper/command.c index 3cd11d2..60a4a26 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -47,7 +47,7 @@ int fast_and_dangerous = 0; Jim_Interp *interp = NULL; -static int run_command(command_context_t *context, +static int run_command(struct command_context *context, command_t *c, const char *words[], unsigned num_words); static void tcl_output(void *privData, const char *file, unsigned line, @@ -57,7 +57,7 @@ static void tcl_output(void *privData, const char *file, unsigned line, Jim_AppendString(interp, tclOutput, string, strlen(string)); } -extern command_context_t *global_cmd_ctx; +extern struct command_context *global_cmd_ctx; void script_debug(Jim_Interp *interp, const char *name, unsigned argc, Jim_Obj *const *argv) @@ -80,7 +80,7 @@ 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; - command_context_t *context; + struct command_context *context; int retval; int i; int nwords; @@ -226,7 +226,7 @@ static void command_add_child(struct command_s **head, struct command_s *c) cc->next = c; } -command_t* register_command(command_context_t *context, +command_t* register_command(struct command_context *context, command_t *parent, char *name, command_handler_t handler, enum command_mode mode, char *help) { @@ -274,7 +274,7 @@ command_t* register_command(command_context_t *context, return c; } -int unregister_all_commands(command_context_t *context) +int unregister_all_commands(struct command_context *context) { command_t *c, *c2; @@ -306,7 +306,7 @@ int unregister_all_commands(command_context_t *context) return ERROR_OK; } -int unregister_command(command_context_t *context, char *name) +int unregister_command(struct command_context *context, char *name) { command_t *c, *p = NULL, *c2; @@ -358,14 +358,14 @@ int unregister_command(command_context_t *context, char *name) return ERROR_OK; } -void command_output_text(command_context_t *context, const char *data) +void command_output_text(struct command_context *context, const char *data) { if (context && context->output_handler && data) { context->output_handler(context, data); } } -void command_print_sameline(command_context_t *context, const char *format, ...) +void command_print_sameline(struct command_context *context, const char *format, ...) { char *string; @@ -389,7 +389,7 @@ void command_print_sameline(command_context_t *context, const char *format, ...) va_end(ap); } -void command_print(command_context_t *context, const char *format, ...) +void command_print(struct command_context *context, const char *format, ...) { char *string; @@ -436,7 +436,7 @@ char *command_name(struct command_s *c, char delim) return __command_name(c, delim, 0); } -static int run_command(command_context_t *context, +static int run_command(struct command_context *context, command_t *c, const char *words[], unsigned num_words) { int start_word = 0; @@ -475,7 +475,7 @@ static int run_command(command_context_t *context, return retval; } -int command_run_line(command_context_t *context, char *line) +int command_run_line(struct command_context *context, char *line) { /* all the parent commands have been registered with the interpreter * so, can just evaluate the line as a script and check for @@ -545,7 +545,7 @@ int command_run_line(command_context_t *context, char *line) return retval; } -int command_run_linef(command_context_t *context, const char *format, ...) +int command_run_linef(struct command_context *context, const char *format, ...) { int retval = ERROR_FAIL; char *string; @@ -560,23 +560,23 @@ int command_run_linef(command_context_t *context, const char *format, ...) return retval; } -void command_set_output_handler(command_context_t* context, +void command_set_output_handler(struct command_context* context, command_output_handler_t output_handler, void *priv) { context->output_handler = output_handler; context->output_handler_priv = priv; } -command_context_t* copy_command_context(command_context_t* context) +struct command_context* copy_command_context(struct command_context* context) { - command_context_t* copy_context = malloc(sizeof(command_context_t)); + struct command_context* copy_context = malloc(sizeof(struct command_context)); *copy_context = *context; return copy_context; } -int command_done(command_context_t *context) +int command_done(struct command_context *context) { free(context); context = NULL; @@ -764,9 +764,9 @@ COMMAND_HANDLER(handle_fast_command) } -command_context_t* command_init() +struct command_context* command_init() { - command_context_t* context = malloc(sizeof(command_context_t)); + struct command_context* context = malloc(sizeof(struct command_context)); extern const char startup_tcl[]; const char *HostOs; @@ -846,7 +846,7 @@ command_context_t* command_init() return context; } -int command_context_mode(command_context_t *cmd_ctx, enum command_mode mode) +int command_context_mode(struct command_context *cmd_ctx, enum command_mode mode) { if (!cmd_ctx) return ERROR_INVALID_ARGUMENTS; @@ -869,7 +869,7 @@ void process_jim_events(void) #endif } -void register_jim(struct command_context_s *cmd_ctx, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help) +void register_jim(struct command_context *cmd_ctx, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help) { Jim_CreateCommand(interp, name, cmd, NULL, NULL); diff --git a/src/helper/command.h b/src/helper/command.h index bddb053..169852e 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -51,13 +51,13 @@ enum command_mode COMMAND_ANY, }; -struct command_context_s; +struct command_context; /// The type signature for command context's output handler. -typedef int (*command_output_handler_t)(struct command_context_s *context, +typedef int (*command_output_handler_t)(struct command_context *context, const char* line); -typedef struct command_context_s +struct command_context { enum command_mode mode; struct command_s *commands; @@ -78,7 +78,7 @@ typedef struct command_context_s */ command_output_handler_t output_handler; void *output_handler_priv; -} command_context_t; +}; /** @@ -87,7 +87,7 @@ typedef struct command_context_s * defining all such derivative types using this macro. */ #define __COMMAND_HANDLER(name, extra...) \ - int name(struct command_context_s *cmd_ctx, \ + int name(struct command_context *cmd_ctx, \ const char *args[], unsigned argc, ##extra) /** @@ -151,31 +151,31 @@ typedef struct command_s */ char *command_name(struct command_s *c, char delim); -command_t* register_command(command_context_t *context, +command_t* register_command(struct command_context *context, command_t *parent, char *name, command_handler_t handler, enum command_mode mode, char *help); -int unregister_command(command_context_t *context, char *name); -int unregister_all_commands(command_context_t *context); +int unregister_command(struct command_context *context, char *name); +int unregister_all_commands(struct command_context *context); -void command_set_output_handler(command_context_t* context, +void command_set_output_handler(struct command_context* context, command_output_handler_t output_handler, void *priv); -command_context_t* copy_command_context(command_context_t* context); +struct command_context* copy_command_context(struct command_context* context); -int command_context_mode(command_context_t *context, enum command_mode mode); +int command_context_mode(struct command_context *context, enum command_mode mode); -command_context_t* command_init(void); -int command_done(command_context_t *context); +struct command_context* command_init(void); +int command_done(struct command_context *context); -void command_print(command_context_t *context, const char *format, ...) +void command_print(struct command_context *context, const char *format, ...) __attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3))); -void command_print_sameline(command_context_t *context, const char *format, ...) +void command_print_sameline(struct command_context *context, const char *format, ...) __attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3))); -int command_run_line(command_context_t *context, char *line); -int command_run_linef(command_context_t *context, const char *format, ...) +int command_run_line(struct command_context *context, char *line); +int command_run_linef(struct command_context *context, const char *format, ...) __attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3))); -void command_output_text(command_context_t *context, const char *data); +void command_output_text(struct command_context *context, const char *data); void process_jim_events(void); @@ -190,7 +190,7 @@ extern int fast_and_dangerous; extern Jim_Interp *interp; -void register_jim(command_context_t *context, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help); +void register_jim(struct command_context *context, const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help); long jim_global_long(const char *variable); diff --git a/src/helper/configuration.c b/src/helper/configuration.c index 3c44d6d..1f7240d 100644 --- a/src/helper/configuration.c +++ b/src/helper/configuration.c @@ -103,7 +103,7 @@ FILE *open_file_from_path (char *file, char *mode) } } -int parse_config_file(struct command_context_s *cmd_ctx) +int parse_config_file(struct command_context *cmd_ctx) { int retval; char **cfg; diff --git a/src/helper/configuration.h b/src/helper/configuration.h index 5d60148..9b77a25 100644 --- a/src/helper/configuration.h +++ b/src/helper/configuration.h @@ -25,15 +25,15 @@ #include "command.h" -int parse_cmdline_args(struct command_context_s *cmd_ctx, +int parse_cmdline_args(struct command_context *cmd_ctx, int argc, char *argv[]); -int parse_config_file(struct command_context_s *cmd_ctx); +int parse_config_file(struct command_context *cmd_ctx); void add_config_command(const char *cfg); void add_script_search_dir(const char *dir); -int configuration_output_handler(struct command_context_s *cmd_ctx, +int configuration_output_handler(struct command_context *cmd_ctx, const char *line); FILE *open_file_from_path(char *file, char *mode); diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c index 3a62961..a9474a6 100644 --- a/src/helper/ioutil.c +++ b/src/helper/ioutil.c @@ -645,7 +645,7 @@ static int zylinjtag_Jim_Command_mac(Jim_Interp *interp, int argc, -int ioutil_init(struct command_context_s *cmd_ctx) +int ioutil_init(struct command_context *cmd_ctx) { register_command(cmd_ctx, NULL, "rm", handle_rm_command, COMMAND_ANY, "remove file"); diff --git a/src/helper/log.c b/src/helper/log.c index 1724bec..c690654 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -317,7 +317,7 @@ COMMAND_HANDLER(handle_log_output_command) return ERROR_OK; } -int log_register_commands(struct command_context_s *cmd_ctx) +int log_register_commands(struct command_context *cmd_ctx) { start = timeval_ms(); register_command(cmd_ctx, NULL, "log_output", handle_log_output_command, @@ -328,7 +328,7 @@ int log_register_commands(struct command_context_s *cmd_ctx) return ERROR_OK; } -int log_init(struct command_context_s *cmd_ctx) +int log_init(struct command_context *cmd_ctx) { /* set defaults for daemon configuration, ... [truncated message content] |