OpenOCD
|
Go to the source code of this file.
Functions | |
const char * | jim_debug_argv_string (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
Debug: convert argc/argv into a printable string for printf() debug. More... | |
int | jim_get_nvp (Jim_Interp *interp, Jim_Obj *objptr, const struct jim_nvp *nvp_table, const struct jim_nvp **result) |
void | jim_getopt_debug (struct jim_getopt_info *p) |
Debug - Dump parameters to stderr. More... | |
int | jim_getopt_double (struct jim_getopt_info *goi, double *puthere) |
Remove argv[0] as double. More... | |
int | jim_getopt_enum (struct jim_getopt_info *goi, const char *const *lookup, int *puthere) |
Remove argv[0] as Enum. More... | |
int | jim_getopt_nvp (struct jim_getopt_info *goi, const struct jim_nvp *nvp, struct jim_nvp **puthere) |
Remove argv[0] as NVP. More... | |
void | jim_getopt_nvp_unknown (struct jim_getopt_info *goi, const struct jim_nvp *nvptable, int hadprefix) |
Create an appropriate error message for an NVP. More... | |
int | jim_getopt_obj (struct jim_getopt_info *goi, Jim_Obj **puthere) |
Remove argv[0] from the list. More... | |
int | jim_getopt_setup (struct jim_getopt_info *p, Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
GetOpt - how to. More... | |
int | jim_getopt_string (struct jim_getopt_info *goi, const char **puthere, int *len) |
Remove argv[0] as string. More... | |
int | jim_getopt_wide (struct jim_getopt_info *goi, jim_wide *puthere) |
Remove argv[0] as wide. More... | |
int | jim_nvp_name2value (Jim_Interp *interp, const struct jim_nvp *_p, const char *name, struct jim_nvp **result) |
int | jim_nvp_name2value_nocase (Jim_Interp *interp, const struct jim_nvp *_p, const char *name, struct jim_nvp **puthere) |
struct jim_nvp * | jim_nvp_name2value_nocase_simple (const struct jim_nvp *p, const char *name) |
int | jim_nvp_name2value_obj (Jim_Interp *interp, const struct jim_nvp *p, Jim_Obj *o, struct jim_nvp **result) |
int | jim_nvp_name2value_obj_nocase (Jim_Interp *interp, const struct jim_nvp *p, Jim_Obj *o, struct jim_nvp **puthere) |
struct jim_nvp * | jim_nvp_name2value_simple (const struct jim_nvp *p, const char *name) |
int | jim_nvp_value2name (Jim_Interp *interp, const struct jim_nvp *_p, int value, struct jim_nvp **result) |
int | jim_nvp_value2name_obj (Jim_Interp *interp, const struct jim_nvp *p, Jim_Obj *o, struct jim_nvp **result) |
struct jim_nvp * | jim_nvp_value2name_simple (const struct jim_nvp *p, int value) |
void | jim_set_result_nvp_unknown (Jim_Interp *interp, Jim_Obj *param_name, Jim_Obj *param_value, const struct jim_nvp *nvp) |
prints a nice 'unknown' parameter error message to the 'result' More... | |
const char* jim_debug_argv_string | ( | Jim_Interp * | interp, |
int | argc, | ||
Jim_Obj *const * | argv | ||
) |
Debug: convert argc/argv into a printable string for printf() debug.
interp | - the interpreter |
argc | - arg count |
argv | - the objects |
Note, next call to this function will free the old (last) string.
For example might want do this:
Definition at line 300 of file jim-nvp.c.
References NULL.
int jim_get_nvp | ( | Jim_Interp * | interp, |
Jim_Obj * | objptr, | ||
const struct jim_nvp * | nvp_table, | ||
const struct jim_nvp ** | result | ||
) |
Definition at line 26 of file jim-nvp.c.
References jim_nvp_name2value_obj(), and jim_nvp::name.
void jim_getopt_debug | ( | struct jim_getopt_info * | goi | ) |
Debug - Dump parameters to stderr.
goi | - current parameters |
Definition at line 158 of file jim-nvp.c.
References jim_getopt_info::argc, and jim_getopt_info::argv.
int jim_getopt_double | ( | struct jim_getopt_info * | goi, |
double * | puthere | ||
) |
Remove argv[0] as double.
goi | - get opt info |
puthere | - where param is put. |
Definition at line 203 of file jim-nvp.c.
References jim_getopt_info::interp, and jim_getopt_obj().
int jim_getopt_enum | ( | struct jim_getopt_info * | goi, |
const char *const * | lookup, | ||
int * | puthere | ||
) |
Remove argv[0] as Enum.
goi | - get opt info |
lookup | - lookup table. |
puthere | - where param is put. |
Definition at line 260 of file jim-nvp.c.
References jim_getopt_info::interp, and jim_getopt_obj().
int jim_getopt_nvp | ( | struct jim_getopt_info * | goi, |
const struct jim_nvp * | lookup, | ||
struct jim_nvp ** | puthere | ||
) |
Remove argv[0] as NVP.
goi | - get opt info |
lookup | - nvp lookup table |
puthere | - where param is put. |
Definition at line 236 of file jim-nvp.c.
References jim_getopt_info::interp, jim_getopt_obj(), and jim_nvp_name2value_obj().
Referenced by arm_tpiu_swo_configure(), dap_configure(), jim_aice_newtap_cmd(), jim_arc_add_reg(), jim_arc_add_reg_type_flags(), jim_arc_add_reg_type_struct(), jim_hl_newtap_cmd(), jim_newtap_cmd(), jim_target_invoke_event(), jim_target_reset(), jim_target_wait_state(), jtag_tap_configure_cmd(), jtag_tap_configure_event(), and target_configure().
void jim_getopt_nvp_unknown | ( | struct jim_getopt_info * | goi, |
const struct jim_nvp * | lookup, | ||
int | hadprefix | ||
) |
Create an appropriate error message for an NVP.
goi | - options info |
lookup | - the NVP table that was used. |
hadprefix | - 0 or 1 if the option had a prefix. |
This function will set the "interp->result" to a human readable error message listing the available options.
This function assumes the previous option argv[-1] is the unknown string.
If this option had some prefix, then pass "hadprefix = 1" else pass "hadprefix = 0"
Example:
Definition at line 252 of file jim-nvp.c.
References jim_getopt_info::argv, jim_getopt_info::interp, jim_set_result_nvp_unknown(), and NULL.
Referenced by arm_tpiu_swo_configure(), dap_configure(), jim_aice_newtap_cmd(), jim_arc_add_reg(), jim_arc_add_reg_type_flags(), jim_arc_add_reg_type_struct(), jim_hl_newtap_cmd(), jim_newtap_cmd(), jim_target_invoke_event(), jim_target_reset(), jim_target_wait_state(), jtag_tap_configure_cmd(), jtag_tap_configure_event(), and target_configure().
int jim_getopt_obj | ( | struct jim_getopt_info * | goi, |
Jim_Obj ** | puthere | ||
) |
Remove argv[0] from the list.
goi | - get opt info |
puthere | - where param is put |
Definition at line 168 of file jim-nvp.c.
References jim_getopt_info::argc, jim_getopt_info::argv, and NULL.
Referenced by aarch64_jim_configure(), adiv5_jim_spot_configure(), arm_tpiu_swo_configure(), cti_create(), dap_configure(), dap_create(), jim_arm_tpiu_swo_create(), jim_getopt_double(), jim_getopt_enum(), jim_getopt_nvp(), jim_getopt_string(), jim_getopt_wide(), jim_jtag_configure(), jim_target_examine(), jtag_tap_configure_event(), target_configure(), and target_create().
int jim_getopt_setup | ( | struct jim_getopt_info * | goi, |
Jim_Interp * | interp, | ||
int | argc, | ||
Jim_Obj *const * | argv | ||
) |
GetOpt - how to.
Example (short and incomplete):
Setup GETOPT
goi | - get opt info to be initialized |
interp | - jim interp |
argc | - argc count. |
argv | - argv (will be copied) |
Definition at line 148 of file jim-nvp.c.
References jim_getopt_info::argc, jim_getopt_info::argv, and jim_getopt_info::interp.
Referenced by jim_adapter_name(), jim_aice_arp_init_reset(), jim_aice_newtap(), jim_arc_add_reg(), jim_arc_add_reg_type_flags(), jim_arc_add_reg_type_struct(), jim_arc_get_aux_reg(), jim_arc_get_core_reg(), jim_arc_get_reg_field(), jim_arc_set_aux_reg(), jim_arm_tpiu_swo_configure(), jim_arm_tpiu_swo_create(), jim_cti_create(), jim_dap_create(), jim_hl_newtap(), jim_jtag_arp_init(), jim_jtag_arp_init_reset(), jim_jtag_configure(), jim_jtag_names(), jim_jtag_newtap(), jim_jtag_tap_enabler(), jim_nds32_bulk_read(), jim_nds32_bulk_write(), jim_nds32_multi_write(), jim_nds32_read_edm_sr(), jim_nds32_write_edm_sr(), jim_target_configure(), jim_target_create(), jim_target_examine(), jim_target_invoke_event(), jim_target_reset(), and jim_target_wait_state().
int jim_getopt_string | ( | struct jim_getopt_info * | goi, |
const char ** | puthere, | ||
int * | len | ||
) |
Remove argv[0] as string.
goi | - get opt info |
puthere | - where param is put |
len | - return its length |
Definition at line 187 of file jim-nvp.c.
References jim_getopt_obj().
Referenced by arm_tpiu_swo_configure(), jim_aice_newtap_cmd(), jim_arc_get_reg_field(), jim_arc_read_reg_name_field(), jim_arc_read_reg_type_field(), jim_hl_newtap_cmd(), jim_nds32_read_edm_sr(), jim_nds32_write_edm_sr(), jim_newtap_cmd(), rtos_create(), stm8_jim_configure(), target_configure(), and target_create().
int jim_getopt_wide | ( | struct jim_getopt_info * | goi, |
jim_wide * | puthere | ||
) |
Remove argv[0] as wide.
goi | - get opt info |
puthere | - where param is put. |
Definition at line 221 of file jim-nvp.c.
References jim_getopt_info::interp, and jim_getopt_obj().
Referenced by adiv5_jim_spot_configure(), arc_cmd_jim_get_uint32(), arm_tpiu_swo_configure(), dap_configure(), jim_arc_add_reg(), jim_arc_read_reg_type_field(), jim_hl_newtap_cmd(), jim_nds32_bulk_read(), jim_nds32_bulk_write(), jim_nds32_multi_write(), jim_nds32_write_edm_sr(), jim_newtap_expected_id(), jim_newtap_ir_param(), jim_target_reset(), jim_target_wait_state(), stm8_jim_configure(), and target_configure().
int jim_nvp_name2value | ( | Jim_Interp * | interp, |
const struct jim_nvp * | _p, | ||
const char * | name, | ||
struct jim_nvp ** | result | ||
) |
Definition at line 70 of file jim-nvp.c.
References jim_nvp_name2value_simple(), jim_nvp::name, and name.
Referenced by jim_nvp_name2value_obj().
int jim_nvp_name2value_nocase | ( | Jim_Interp * | interp, |
const struct jim_nvp * | _p, | ||
const char * | name, | ||
struct jim_nvp ** | puthere | ||
) |
Definition at line 95 of file jim-nvp.c.
References jim_nvp_name2value_nocase_simple(), jim_nvp::name, and name.
Referenced by jim_nvp_name2value_obj_nocase().
Definition at line 55 of file jim-nvp.c.
References jim_nvp::name, and name.
Referenced by jim_nvp_name2value_nocase().
int jim_nvp_name2value_obj | ( | Jim_Interp * | interp, |
const struct jim_nvp * | p, | ||
Jim_Obj * | o, | ||
struct jim_nvp ** | result | ||
) |
Definition at line 65 of file jim-nvp.c.
References jim_nvp_name2value().
Referenced by aarch64_jim_configure(), adiv5_jim_spot_configure(), jim_get_nvp(), and jim_getopt_nvp().
int jim_nvp_name2value_obj_nocase | ( | Jim_Interp * | interp, |
const struct jim_nvp * | p, | ||
Jim_Obj * | o, | ||
struct jim_nvp ** | puthere | ||
) |
Definition at line 87 of file jim-nvp.c.
References jim_nvp_name2value_nocase().
Definition at line 45 of file jim-nvp.c.
References jim_nvp::name, and name.
Referenced by COMMAND_HANDLER(), and jim_nvp_name2value().
int jim_nvp_value2name | ( | Jim_Interp * | interp, |
const struct jim_nvp * | _p, | ||
int | value, | ||
struct jim_nvp ** | result | ||
) |
Definition at line 133 of file jim-nvp.c.
References jim_nvp_value2name_simple(), jim_nvp::name, and jim_nvp::value.
Referenced by arm_tpiu_swo_configure(), jim_arm_tpiu_swo_enable(), and jim_nvp_value2name_obj().
int jim_nvp_value2name_obj | ( | Jim_Interp * | interp, |
const struct jim_nvp * | p, | ||
Jim_Obj * | o, | ||
struct jim_nvp ** | result | ||
) |
Definition at line 111 of file jim-nvp.c.
References jim_nvp_value2name().
Definition at line 123 of file jim-nvp.c.
References jim_nvp::name, and jim_nvp::value.
Referenced by arm_tpiu_swo_handle_event(), COMMAND_HANDLER(), debug_reason_name(), jim_nvp_value2name(), jtag_tap_handle_event(), target_call_reset_callbacks(), target_configure(), target_event_name(), target_process_reset(), target_reset_mode_name(), target_state_name(), and target_wait_state().
void jim_set_result_nvp_unknown | ( | Jim_Interp * | interp, |
Jim_Obj * | param_name, | ||
Jim_Obj * | param_value, | ||
const struct jim_nvp * | nvp | ||
) |
prints a nice 'unknown' parameter error message to the 'result'
Definition at line 274 of file jim-nvp.c.
References jim_nvp::name, name, and NULL.
Referenced by jim_getopt_nvp_unknown().