helper/jim-nvp: comply with coding style [2/2] 84/6184/4
authorAntonio Borneo <borneo.antonio@gmail.com>
Sat, 24 Apr 2021 22:48:14 +0000 (00:48 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 4 Jun 2021 16:40:48 +0000 (17:40 +0100)
With the API fixed to comply with OpenOCD coding style, fix all
the references in the code.

Patch generated automatically with the script below.
The list is in reverse order to replace a common prefix after the
replacement of the symbols with the same prefix.

%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---
(cat << EOF
Jim_SetResult_NvpUnknown         jim_set_result_nvp_unknown
Jim_Nvp_value2name_simple        jim_nvp_value2name_simple
Jim_Nvp_value2name_obj           jim_nvp_value2name_obj
Jim_Nvp_value2name               jim_nvp_value2name
Jim_Nvp_name2value_simple        jim_nvp_name2value_simple
Jim_Nvp_name2value_obj_nocase    jim_nvp_name2value_obj_nocase
Jim_Nvp_name2value_obj           jim_nvp_name2value_obj
Jim_Nvp_name2value_nocase_simple jim_nvp_name2value_nocase_simple
Jim_Nvp_name2value_nocase        jim_nvp_name2value_nocase
Jim_Nvp_name2value               jim_nvp_name2value
Jim_Nvp                        struct jim_nvp
Jim_GetOpt_Wide                  jim_getopt_wide
Jim_GetOpt_String                jim_getopt_string
Jim_GetOpt_Setup                 jim_getopt_setup
Jim_GetOpt_Obj                   jim_getopt_obj
Jim_GetOpt_NvpUnknown            jim_getopt_nvp_unknown
Jim_GetOpt_Nvp                   jim_getopt_nvp
Jim_GetOpt_Enum                  jim_getopt_enum
Jim_GetOpt_Double                jim_getopt_double
Jim_GetOpt_Debug                 jim_getopt_debug
Jim_GetOptInfo                 struct jim_getopt_info
Jim_GetNvp                       jim_get_nvp
Jim_Debug_ArgvString             jim_debug_argv_string
EOF
) | while read a b; do
    sed -i "s/$a/$b/g" $(find src -type f ! -name jim-nvp.\? )
done
%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---

Change-Id: I10a12bd64bb8b17575fd9150482c989c92b298a2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6184
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
21 files changed:
src/jtag/adapter.c
src/jtag/aice/aice_transport.c
src/jtag/drivers/ftdi.c
src/jtag/hla/hla_tcl.c
src/jtag/tcl.c
src/rtos/rtos.c
src/rtos/rtos.h
src/target/aarch64.c
src/target/arc_cmd.c
src/target/arm_adi_v5.c
src/target/arm_adi_v5.h
src/target/arm_cti.c
src/target/arm_dap.c
src/target/arm_tpiu_swo.c
src/target/armv8.c
src/target/cortex_a.c
src/target/cortex_m.c
src/target/nds32_cmd.c
src/target/stm8.c
src/target/target.c
src/target/target_type.h

index 0dcb78fface9c6885918d0c7c3f9dfdd2e444902..03bb1a9c672c1609214c13adcca777fc4df2d5de 100644 (file)
@@ -51,8 +51,8 @@ const char * const jtag_only[] = { "jtag", NULL };
 
 static int jim_adapter_name(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc-1, argv + 1);
 
        /* return the name of the interface */
        /* TCL code might need to know the exact type... */
index c02a42f3b8a84f65fa390d21fcf7ec85e8824cbd..322d8ae5cda16570f7828150a00178af76208804 100644 (file)
 #include <string.h>
 
 /* */
-static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi,
                struct jtag_tap *pTap)
 {
        jim_wide w;
-       int e = Jim_GetOpt_Wide(goi, &w);
+       int e = jim_getopt_wide(goi, &w);
        if (e != JIM_OK) {
                Jim_SetResultFormatted(goi->interp, "option: %s bad parameter",
                                n->name);
@@ -63,14 +63,14 @@ static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
 #define NTAP_OPT_EXPECTED_ID 0
 
 /* */
-static int jim_aice_newtap_cmd(Jim_GetOptInfo *goi)
+static int jim_aice_newtap_cmd(struct jim_getopt_info *goi)
 {
        struct jtag_tap *pTap;
        int x;
        int e;
-       Jim_Nvp *n;
+       struct jim_nvp *n;
        char *cp;
-       const Jim_Nvp opts[] = {
+       const struct jim_nvp opts[] = {
                {.name = "-expected-id", .value = NTAP_OPT_EXPECTED_ID},
                {.name = NULL, .value = -1},
        };
@@ -92,10 +92,10 @@ static int jim_aice_newtap_cmd(Jim_GetOptInfo *goi)
        }
 
        const char *tmp;
-       Jim_GetOpt_String(goi, &tmp, NULL);
+       jim_getopt_string(goi, &tmp, NULL);
        pTap->chip = strdup(tmp);
 
-       Jim_GetOpt_String(goi, &tmp, NULL);
+       jim_getopt_string(goi, &tmp, NULL);
        pTap->tapname = strdup(tmp);
 
        /* name + dot + name + null */
@@ -108,9 +108,9 @@ static int jim_aice_newtap_cmd(Jim_GetOptInfo *goi)
                        pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc);
 
        while (goi->argc) {
-               e = Jim_GetOpt_Nvp(goi, opts, &n);
+               e = jim_getopt_nvp(goi, opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(goi, opts, 0);
+                       jim_getopt_nvp_unknown(goi, opts, 0);
                        free(cp);
                        free(pTap);
                        return e;
@@ -138,8 +138,8 @@ static int jim_aice_newtap_cmd(Jim_GetOptInfo *goi)
 /* */
 static int jim_aice_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        return jim_aice_newtap_cmd(&goi);
 }
 
@@ -246,8 +246,8 @@ static int aice_init_reset(struct command_context *cmd_ctx)
 static int jim_aice_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
        int e = ERROR_OK;
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc != 0) {
                Jim_WrongNumArgs(goi.interp, 1, goi.argv - 1, "(no params)");
                return JIM_ERR;
@@ -265,8 +265,8 @@ static int jim_aice_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj * const
 
 static int jim_aice_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc != 0) {
                Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
                return JIM_ERR;
index 210d0f796b077cae0245c33cb45054c1a4866f91..25406a4c2e0cbfb990e0502180cdfef1436adcdb 100644 (file)
@@ -926,22 +926,22 @@ COMMAND_HANDLER(ftdi_handle_vid_pid_command)
 
 COMMAND_HANDLER(ftdi_handle_tdo_sample_edge_command)
 {
-       Jim_Nvp *n;
-       static const Jim_Nvp nvp_ftdi_jtag_modes[] = {
+       struct jim_nvp *n;
+       static const struct jim_nvp nvp_ftdi_jtag_modes[] = {
                { .name = "rising", .value = JTAG_MODE },
                { .name = "falling", .value = JTAG_MODE_ALT },
                { .name = NULL, .value = -1 },
        };
 
        if (CMD_ARGC > 0) {
-               n = Jim_Nvp_name2value_simple(nvp_ftdi_jtag_modes, CMD_ARGV[0]);
+               n = jim_nvp_name2value_simple(nvp_ftdi_jtag_modes, CMD_ARGV[0]);
                if (n->name == NULL)
                        return ERROR_COMMAND_SYNTAX_ERROR;
                ftdi_jtag_mode = n->value;
 
        }
 
-       n = Jim_Nvp_value2name_simple(nvp_ftdi_jtag_modes, ftdi_jtag_mode);
+       n = jim_nvp_value2name_simple(nvp_ftdi_jtag_modes, ftdi_jtag_mode);
        command_print(CMD, "ftdi samples TDO on %s edge of TCK", n->name);
 
        return ERROR_OK;
index 73f78fc8a563563c04d9dab5e9f8d8db69832380..2998498be89c3e2e28a5765cf292df6703b0e456 100644 (file)
 #include <transport/transport.h>
 #include <helper/time_support.h>
 
-static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi,
                                  struct jtag_tap *pTap)
 {
        jim_wide w;
-       int e = Jim_GetOpt_Wide(goi, &w);
+       int e = jim_getopt_wide(goi, &w);
        if (e != JIM_OK) {
                Jim_SetResultFormatted(goi->interp, "option: %s bad parameter",
                                       n->name);
@@ -60,14 +60,14 @@ static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
 #define NTAP_OPT_EXPECTED_ID 5
 #define NTAP_OPT_VERSION   6
 
-static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
+static int jim_hl_newtap_cmd(struct jim_getopt_info *goi)
 {
        struct jtag_tap *pTap;
        int x;
        int e;
-       Jim_Nvp *n;
+       struct jim_nvp *n;
        char *cp;
-       const Jim_Nvp opts[] = {
+       const struct jim_nvp opts[] = {
                { .name = "-irlen",       .value = NTAP_OPT_IRLEN },
                { .name = "-irmask",       .value = NTAP_OPT_IRMASK },
                { .name = "-ircapture",       .value = NTAP_OPT_IRCAPTURE },
@@ -95,10 +95,10 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
        }
 
        const char *tmp;
-       Jim_GetOpt_String(goi, &tmp, NULL);
+       jim_getopt_string(goi, &tmp, NULL);
        pTap->chip = strdup(tmp);
 
-       Jim_GetOpt_String(goi, &tmp, NULL);
+       jim_getopt_string(goi, &tmp, NULL);
        pTap->tapname = strdup(tmp);
 
        /* name + dot + name + null */
@@ -111,9 +111,9 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
                  pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc);
 
        while (goi->argc) {
-               e = Jim_GetOpt_Nvp(goi, opts, &n);
+               e = jim_getopt_nvp(goi, opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(goi, opts, 0);
+                       jim_getopt_nvp_unknown(goi, opts, 0);
                        free(cp);
                        free(pTap);
                        return e;
@@ -132,7 +132,7 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
                case NTAP_OPT_IRMASK:
                case NTAP_OPT_IRCAPTURE:
                        /* dummy read to ignore the next argument */
-                       Jim_GetOpt_Wide(goi, NULL);
+                       jim_getopt_wide(goi, NULL);
                        break;
                }               /* switch (n->value) */
        }                       /* while (goi->argc) */
@@ -146,7 +146,7 @@ static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
 
 int jim_hl_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        return jim_hl_newtap_cmd(&goi);
 }
index 5dc2f14f678d931d6347d86665cd6b230e4d9a8e..970bd37eca663972e412fc9bca32e81954fdb1b4 100644 (file)
@@ -49,7 +49,7 @@
  * Holds support for accessing JTAG-specific mechanisms from TCl scripts.
  */
 
-static const Jim_Nvp nvp_jtag_tap_event[] = {
+static const struct jim_nvp nvp_jtag_tap_event[] = {
        { .value = JTAG_TRST_ASSERTED,          .name = "post-reset" },
        { .value = JTAG_TAP_EVENT_SETUP,        .name = "setup" },
        { .value = JTAG_TAP_EVENT_ENABLE,       .name = "tap-enable" },
@@ -310,24 +310,24 @@ enum jtag_tap_cfg_param {
        JCFG_IDCODE,
 };
 
-static Jim_Nvp nvp_config_opts[] = {
+static struct jim_nvp nvp_config_opts[] = {
        { .name = "-event",      .value = JCFG_EVENT },
        { .name = "-idcode",     .value = JCFG_IDCODE },
 
        { .name = NULL,          .value = -1 }
 };
 
-static int jtag_tap_configure_event(Jim_GetOptInfo *goi, struct jtag_tap *tap)
+static int jtag_tap_configure_event(struct jim_getopt_info *goi, struct jtag_tap *tap)
 {
        if (goi->argc == 0) {
                Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event <event-name> ...");
                return JIM_ERR;
        }
 
-       Jim_Nvp *n;
-       int e = Jim_GetOpt_Nvp(goi, nvp_jtag_tap_event, &n);
+       struct jim_nvp *n;
+       int e = jim_getopt_nvp(goi, nvp_jtag_tap_event, &n);
        if (e != JIM_OK) {
-               Jim_GetOpt_NvpUnknown(goi, nvp_jtag_tap_event, 1);
+               jim_getopt_nvp_unknown(goi, nvp_jtag_tap_event, 1);
                return e;
        }
 
@@ -369,7 +369,7 @@ static int jtag_tap_configure_event(Jim_GetOptInfo *goi, struct jtag_tap *tap)
                jteap->event = n->value;
 
                Jim_Obj *o;
-               Jim_GetOpt_Obj(goi, &o);
+               jim_getopt_obj(goi, &o);
                jteap->body = Jim_DuplicateObj(goi->interp, o);
                Jim_IncrRefCount(jteap->body);
 
@@ -386,16 +386,16 @@ static int jtag_tap_configure_event(Jim_GetOptInfo *goi, struct jtag_tap *tap)
        return JIM_OK;
 }
 
-static int jtag_tap_configure_cmd(Jim_GetOptInfo *goi, struct jtag_tap *tap)
+static int jtag_tap_configure_cmd(struct jim_getopt_info *goi, struct jtag_tap *tap)
 {
        /* parse config or cget options */
        while (goi->argc > 0) {
                Jim_SetEmptyResult(goi->interp);
 
-               Jim_Nvp *n;
-               int e = Jim_GetOpt_Nvp(goi, nvp_config_opts, &n);
+               struct jim_nvp *n;
+               int e = jim_getopt_nvp(goi, nvp_config_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0);
+                       jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
                        return e;
                }
 
@@ -439,11 +439,11 @@ static int is_bad_irval(int ir_length, jim_wide w)
        return (w & v) != 0;
 }
 
-static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi,
        struct jtag_tap *pTap)
 {
        jim_wide w;
-       int e = Jim_GetOpt_Wide(goi, &w);
+       int e = jim_getopt_wide(goi, &w);
        if (e != JIM_OK) {
                Jim_SetResultFormatted(goi->interp, "option: %s bad parameter", n->name);
                return e;
@@ -470,11 +470,11 @@ static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
 #define NTAP_OPT_EXPECTED_ID 5
 #define NTAP_OPT_VERSION   6
 
-static int jim_newtap_ir_param(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_ir_param(struct jim_nvp *n, struct jim_getopt_info *goi,
        struct jtag_tap *pTap)
 {
        jim_wide w;
-       int e = Jim_GetOpt_Wide(goi, &w);
+       int e = jim_getopt_wide(goi, &w);
        if (e != JIM_OK) {
                Jim_SetResultFormatted(goi->interp,
                        "option: %s bad parameter", n->name);
@@ -516,14 +516,14 @@ static int jim_newtap_ir_param(Jim_Nvp *n, Jim_GetOptInfo *goi,
        return JIM_OK;
 }
 
-static int jim_newtap_cmd(Jim_GetOptInfo *goi)
+static int jim_newtap_cmd(struct jim_getopt_info *goi)
 {
        struct jtag_tap *pTap;
        int x;
        int e;
-       Jim_Nvp *n;
+       struct jim_nvp *n;
        char *cp;
-       const Jim_Nvp opts[] = {
+       const struct jim_nvp opts[] = {
                { .name = "-irlen",       .value = NTAP_OPT_IRLEN },
                { .name = "-irmask",       .value = NTAP_OPT_IRMASK },
                { .name = "-ircapture",       .value = NTAP_OPT_IRCAPTURE },
@@ -550,10 +550,10 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
        }
 
        const char *tmp;
-       Jim_GetOpt_String(goi, &tmp, NULL);
+       jim_getopt_string(goi, &tmp, NULL);
        pTap->chip = strdup(tmp);
 
-       Jim_GetOpt_String(goi, &tmp, NULL);
+       jim_getopt_string(goi, &tmp, NULL);
        pTap->tapname = strdup(tmp);
 
        /* name + dot + name + null */
@@ -580,9 +580,9 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
        pTap->ir_capture_value = 0x01;
 
        while (goi->argc) {
-               e = Jim_GetOpt_Nvp(goi, opts, &n);
+               e = jim_getopt_nvp(goi, opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(goi, opts, 0);
+                       jim_getopt_nvp_unknown(goi, opts, 0);
                        free(cp);
                        free(pTap);
                        return e;
@@ -644,7 +644,7 @@ static void jtag_tap_handle_event(struct jtag_tap *tap, enum jtag_event e)
                if (jteap->event != e)
                        continue;
 
-               Jim_Nvp *nvp = Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e);
+               struct jim_nvp *nvp = jim_nvp_value2name_simple(nvp_jtag_tap_event, e);
                LOG_DEBUG("JTAG tap: %s event: %d (%s)\n\taction: %s",
                        tap->dotted_name, e, nvp->name,
                        Jim_GetString(jteap->body, NULL));
@@ -678,8 +678,8 @@ static void jtag_tap_handle_event(struct jtag_tap *tap, enum jtag_event e)
 
 static int jim_jtag_arp_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc-1, argv + 1);
        if (goi.argc != 0) {
                Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
                return JIM_ERR;
@@ -697,8 +697,8 @@ static int jim_jtag_arp_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
        int e = ERROR_OK;
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc-1, argv + 1);
        if (goi.argc != 0) {
                Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
                return JIM_ERR;
@@ -719,8 +719,8 @@ static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj *const
 
 int jim_jtag_newtap(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc-1, argv + 1);
        return jim_newtap_cmd(&goi);
 }
 
@@ -759,8 +759,8 @@ int jim_jtag_tap_enabler(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
        struct command *c = jim_to_command(interp);
        const char *cmd_name = c->name;
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc-1, argv + 1);
        if (goi.argc != 1) {
                Jim_SetResultFormatted(goi.interp, "usage: %s <name>", cmd_name);
                return JIM_ERR;
@@ -797,8 +797,8 @@ int jim_jtag_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
        struct command *c = jim_to_command(interp);
        const char *cmd_name = c->name;
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc-1, argv + 1);
        goi.isconfigure = !strcmp(cmd_name, "configure");
        if (goi.argc < 2 + goi.isconfigure) {
                Jim_WrongNumArgs(goi.interp, 0, NULL,
@@ -809,7 +809,7 @@ int jim_jtag_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        struct jtag_tap *t;
 
        Jim_Obj *o;
-       Jim_GetOpt_Obj(&goi, &o);
+       jim_getopt_obj(&goi, &o);
        t = jtag_tap_by_jim_obj(goi.interp, o);
        if (t == NULL)
                return JIM_ERR;
@@ -819,8 +819,8 @@ int jim_jtag_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
 static int jim_jtag_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc-1, argv + 1);
        if (goi.argc != 0) {
                Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
                return JIM_ERR;
index fdb3862d8ba74c241ce87ee38be5226466e0650d..0374e9b5bb42c139122287e8f42a7d51b5b15c64 100644 (file)
@@ -122,7 +122,7 @@ static int os_alloc_create(struct target *target, struct rtos_type *ostype)
        return ret;
 }
 
-int rtos_create(Jim_GetOptInfo *goi, struct target *target)
+int rtos_create(struct jim_getopt_info *goi, struct target *target)
 {
        int x;
        const char *cp;
@@ -136,7 +136,7 @@ int rtos_create(Jim_GetOptInfo *goi, struct target *target)
 
        os_free(target);
 
-       e = Jim_GetOpt_String(goi, &cp, NULL);
+       e = jim_getopt_string(goi, &cp, NULL);
        if (e != JIM_OK)
                return e;
 
index b3fd01fca2f7a58fee5b264ec740de9b086a6c22..20f7de775b48a96f7d3c383ebda1550fc05f8816 100644 (file)
@@ -110,7 +110,7 @@ struct rtos_register_stacking {
 
 #define GDB_THREAD_PACKET_NOT_CONSUMED (-40)
 
-int rtos_create(Jim_GetOptInfo *goi, struct target *target);
+int rtos_create(struct jim_getopt_info *goi, struct target *target);
 void rtos_destroy(struct target *target);
 int rtos_set_reg(struct connection *connection, int reg_num,
                uint8_t *reg_value);
index 612924f5a7b76b771313ea6897bd584413af1c97..ef00fd1311428fbdd357e70f72dadbd08149da26 100644 (file)
@@ -2785,15 +2785,15 @@ enum aarch64_cfg_param {
        CFG_CTI,
 };
 
-static const Jim_Nvp nvp_config_opts[] = {
+static const struct jim_nvp nvp_config_opts[] = {
        { .name = "-cti", .value = CFG_CTI },
        { .name = NULL, .value = -1 }
 };
 
-static int aarch64_jim_configure(struct target *target, Jim_GetOptInfo *goi)
+static int aarch64_jim_configure(struct target *target, struct jim_getopt_info *goi)
 {
        struct aarch64_private_config *pc;
-       Jim_Nvp *n;
+       struct jim_nvp *n;
        int e;
 
        pc = (struct aarch64_private_config *)target->private_config;
@@ -2824,12 +2824,12 @@ static int aarch64_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                Jim_SetEmptyResult(goi->interp);
 
                /* check first if topmost item is for us */
-               e = Jim_Nvp_name2value_obj(goi->interp, nvp_config_opts,
+               e = jim_nvp_name2value_obj(goi->interp, nvp_config_opts,
                                goi->argv[0], &n);
                if (e != JIM_OK)
                        return JIM_CONTINUE;
 
-               e = Jim_GetOpt_Obj(goi, NULL);
+               e = jim_getopt_obj(goi, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -2838,7 +2838,7 @@ static int aarch64_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        if (goi->isconfigure) {
                                Jim_Obj *o_cti;
                                struct arm_cti *cti;
-                               e = Jim_GetOpt_Obj(goi, &o_cti);
+                               e = jim_getopt_obj(goi, &o_cti);
                                if (e != JIM_OK)
                                        return e;
                                cti = cti_instance_by_jim_obj(goi->interp, o_cti);
@@ -2930,15 +2930,15 @@ COMMAND_HANDLER(aarch64_mask_interrupts_command)
        struct target *target = get_current_target(CMD_CTX);
        struct aarch64_common *aarch64 = target_to_aarch64(target);
 
-       static const Jim_Nvp nvp_maskisr_modes[] = {
+       static const struct jim_nvp nvp_maskisr_modes[] = {
                { .name = "off", .value = AARCH64_ISRMASK_OFF },
                { .name = "on", .value = AARCH64_ISRMASK_ON },
                { .name = NULL, .value = -1 },
        };
-       const Jim_Nvp *n;
+       const struct jim_nvp *n;
 
        if (CMD_ARGC > 0) {
-               n = Jim_Nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+               n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
                if (n->name == NULL) {
                        LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
                        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -2947,7 +2947,7 @@ COMMAND_HANDLER(aarch64_mask_interrupts_command)
                aarch64->isrmasking_mode = n->value;
        }
 
-       n = Jim_Nvp_value2name_simple(nvp_maskisr_modes, aarch64->isrmasking_mode);
+       n = jim_nvp_value2name_simple(nvp_maskisr_modes, aarch64->isrmasking_mode);
        command_print(CMD, "aarch64 interrupt mask %s", n->name);
 
        return ERROR_OK;
index 5c5247b8823f13f027b81d4f0f5133986baef122..26c67c6db73abd25f18a30555c5678e5a0092009 100644 (file)
  * ------------------------------------------------------------------------- */
 
 
-static int arc_cmd_jim_get_uint32(Jim_GetOptInfo *goi, uint32_t *value)
+static int arc_cmd_jim_get_uint32(struct jim_getopt_info *goi, uint32_t *value)
 {
        jim_wide value_wide;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Wide(goi, &value_wide));
+       JIM_CHECK_RETVAL(jim_getopt_wide(goi, &value_wide));
        *value = (uint32_t)value_wide;
        return JIM_OK;
 }
@@ -40,7 +40,7 @@ enum add_reg_type_flags {
        CFG_ADD_REG_TYPE_FLAGS_FLAG,
 };
 
-static Jim_Nvp nvp_add_reg_type_flags_opts[] = {
+static struct jim_nvp nvp_add_reg_type_flags_opts[] = {
        { .name = "-name",  .value = CFG_ADD_REG_TYPE_FLAGS_NAME },
        { .name = "-flag",  .value = CFG_ADD_REG_TYPE_FLAGS_FLAG },
        { .name = NULL,     .value = -1 }
@@ -64,7 +64,7 @@ static const char *validate_register(const struct arc_reg_desc * const reg, bool
 
 /* Helper function to read the name of register type or register from
  * configure files  */
-static int jim_arc_read_reg_name_field(Jim_GetOptInfo *goi,
+static int jim_arc_read_reg_name_field(struct jim_getopt_info *goi,
        const char **name, int *name_len)
 {
        int e = JIM_OK;
@@ -73,12 +73,12 @@ static int jim_arc_read_reg_name_field(Jim_GetOptInfo *goi,
                Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-name <name> ...");
                return JIM_ERR;
        }
-       e = Jim_GetOpt_String(goi, name, name_len);
+       e = jim_getopt_string(goi, name, name_len);
        return e;
 }
 
 /* Helper function to read bitfields/flags of register type. */
-static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_name, int *field_name_len,
+static int jim_arc_read_reg_type_field(struct jim_getopt_info *goi, const char **field_name, int *field_name_len,
         struct arc_reg_bitfield *bitfields, int cur_field, int type)
 {
                jim_wide start_pos, end_pos;
@@ -90,12 +90,12 @@ static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_n
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_String(goi, field_name, field_name_len);
+               e = jim_getopt_string(goi, field_name, field_name_len);
                if (e != JIM_OK)
                                        return e;
 
                /* read start position of bitfield/flag */
-               e = Jim_GetOpt_Wide(goi, &start_pos);
+               e = jim_getopt_wide(goi, &start_pos);
                if (e != JIM_OK)
                                        return e;
 
@@ -108,7 +108,7 @@ static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_n
                         * than bitfields[cur_field].end remains start */
                        if ((strcmp(Jim_String(goi->argv[0]), "-flag") && type == CFG_ADD_REG_TYPE_FLAG)
                                        || (type == CFG_ADD_REG_TYPE_STRUCT)) {
-                                                               e = Jim_GetOpt_Wide(goi, &end_pos);
+                                                               e = jim_getopt_wide(goi, &end_pos);
                                                                if (e != JIM_OK) {
                                                                        Jim_SetResultFormatted(goi->interp, "Error reading end position");
                                                                        return e;
@@ -125,8 +125,8 @@ static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_n
 static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
        Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        LOG_DEBUG("-");
 
@@ -179,10 +179,10 @@ static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
        flags->size = 4; /* For now ARC has only 32-bit registers */
 
        while (goi.argc > 0 && e == JIM_OK) {
-               Jim_Nvp *n;
-               e = Jim_GetOpt_Nvp(&goi, nvp_add_reg_type_flags_opts, &n);
+               struct jim_nvp *n;
+               e = jim_getopt_nvp(&goi, nvp_add_reg_type_flags_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(&goi, nvp_add_reg_type_flags_opts, 0);
+                       jim_getopt_nvp_unknown(&goi, nvp_add_reg_type_flags_opts, 0);
                        continue;
                }
 
@@ -272,7 +272,7 @@ enum add_reg_type_struct {
        CFG_ADD_REG_TYPE_STRUCT_BITFIELD,
 };
 
-static Jim_Nvp nvp_add_reg_type_struct_opts[] = {
+static struct jim_nvp nvp_add_reg_type_struct_opts[] = {
        { .name = "-name",     .value = CFG_ADD_REG_TYPE_STRUCT_NAME },
        { .name = "-bitfield", .value = CFG_ADD_REG_TYPE_STRUCT_BITFIELD },
        { .name = NULL,     .value = -1 }
@@ -286,8 +286,8 @@ static int jim_arc_set_aux_reg(Jim_Interp *interp, int argc, Jim_Obj * const *ar
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 2) {
                Jim_SetResultFormatted(goi.interp,
@@ -325,8 +325,8 @@ static int jim_arc_get_aux_reg(Jim_Interp *interp, int argc, Jim_Obj * const *ar
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 1) {
                Jim_SetResultFormatted(goi.interp,
@@ -362,8 +362,8 @@ static int jim_arc_get_core_reg(Jim_Interp *interp, int argc, Jim_Obj * const *a
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 1) {
                Jim_SetResultFormatted(goi.interp,
@@ -405,8 +405,8 @@ static int jim_arc_set_core_reg(Jim_Interp *interp, int argc, Jim_Obj * const *a
        uint32_t regnum;
        uint32_t value;
 
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        if (goi.argc != 2) {
                Jim_SetResultFormatted(goi.interp,
@@ -491,8 +491,8 @@ static const struct command_registration arc_jtag_command_group[] = {
 static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
        Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        LOG_DEBUG("-");
 
@@ -545,10 +545,10 @@ static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
        struct_type->size = 4; /* For now ARC has only 32-bit registers */
 
        while (goi.argc > 0 && e == JIM_OK) {
-               Jim_Nvp *n;
-               e = Jim_GetOpt_Nvp(&goi, nvp_add_reg_type_struct_opts, &n);
+               struct jim_nvp *n;
+               e = jim_getopt_nvp(&goi, nvp_add_reg_type_struct_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(&goi, nvp_add_reg_type_struct_opts, 0);
+                       jim_getopt_nvp_unknown(&goi, nvp_add_reg_type_struct_opts, 0);
                        continue;
                }
 
@@ -642,7 +642,7 @@ enum opts_add_reg {
        CFG_ADD_REG_GENERAL,
 };
 
-static Jim_Nvp opts_nvp_add_reg[] = {
+static struct jim_nvp opts_nvp_add_reg[] = {
        { .name = "-name",    .value = CFG_ADD_REG_NAME },
        { .name = "-num",     .value = CFG_ADD_REG_ARCH_NUM },
        { .name = "-core",    .value = CFG_ADD_REG_IS_CORE },
@@ -662,8 +662,8 @@ void free_reg_desc(struct arc_reg_desc *r)
 
 static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       struct jim_getopt_info goi;
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        struct arc_reg_desc *reg = calloc(1, sizeof(*reg));
        if (!reg) {
@@ -692,10 +692,10 @@ static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 
        /* Parse options. */
        while (goi.argc > 0) {
-               Jim_Nvp *n;
-               e = Jim_GetOpt_Nvp(&goi, opts_nvp_add_reg, &n);
+               struct jim_nvp *n;
+               e = jim_getopt_nvp(&goi, opts_nvp_add_reg, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(&goi, opts_nvp_add_reg, 0);
+                       jim_getopt_nvp_unknown(&goi, opts_nvp_add_reg, 0);
                        free_reg_desc(reg);
                        return e;
                }
@@ -732,7 +732,7 @@ static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
                                        return JIM_ERR;
                                }
 
-                               e = Jim_GetOpt_Wide(&goi, &archnum);
+                               e = jim_getopt_wide(&goi, &archnum);
                                if (e != JIM_OK) {
                                        free_reg_desc(reg);
                                        return e;
@@ -845,12 +845,12 @@ COMMAND_HANDLER(arc_set_reg_exists)
  * Reads struct type register field */
 static int jim_arc_get_reg_field(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
+       struct jim_getopt_info goi;
        const char *reg_name, *field_name;
        uint32_t value;
        int retval;
 
-       JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+       JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
 
        LOG_DEBUG("Reading register field");
        if (goi.argc != 2) {
@@ -863,8 +863,8 @@ static int jim_arc_get_reg_field(Jim_Interp *interp, int argc, Jim_Obj * const *
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       JIM_CHECK_RETVAL(Jim_GetOpt_String(&goi, &reg_name, NULL));
-       JIM_CHECK_RETVAL(Jim_GetOpt_String(&goi, &field_name, NULL));
+       JIM_CHECK_RETVAL(jim_getopt_string(&goi, &reg_name, NULL));
+       JIM_CHECK_RETVAL(jim_getopt_string(&goi, &field_name, NULL));
        assert(reg_name);
        assert(field_name);
 
@@ -932,8 +932,8 @@ COMMAND_HANDLER(arc_l2_cache_disable_auto_cmd)
 static int jim_handle_actionpoints_num(Jim_Interp *interp, int argc,
        Jim_Obj * const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        LOG_DEBUG("-");
 
index 6569fccfdf17b58e43157e3207d260f87901afa3..35d686e29577eebd3bd41c4ed13a3e985e6563e0 100644 (file)
@@ -1500,7 +1500,7 @@ enum adiv5_cfg_param {
        CFG_CTIBASE, /* DEPRECATED */
 };
 
-static const Jim_Nvp nvp_config_opts[] = {
+static const struct jim_nvp nvp_config_opts[] = {
        { .name = "-dap",       .value = CFG_DAP },
        { .name = "-ap-num",    .value = CFG_AP_NUM },
        { .name = "-baseaddr",  .value = CFG_BASEADDR },
@@ -1508,7 +1508,7 @@ static const Jim_Nvp nvp_config_opts[] = {
        { .name = NULL, .value = -1 }
 };
 
-static int adiv5_jim_spot_configure(Jim_GetOptInfo *goi,
+static int adiv5_jim_spot_configure(struct jim_getopt_info *goi,
                struct adiv5_dap **dap_p, int *ap_num_p, uint32_t *base_p)
 {
        if (!goi->argc)
@@ -1516,8 +1516,8 @@ static int adiv5_jim_spot_configure(Jim_GetOptInfo *goi,
 
        Jim_SetEmptyResult(goi->interp);
 
-       Jim_Nvp *n;
-       int e = Jim_Nvp_name2value_obj(goi->interp, nvp_config_opts,
+       struct jim_nvp *n;
+       int e = jim_nvp_name2value_obj(goi->interp, nvp_config_opts,
                                goi->argv[0], &n);
        if (e != JIM_OK)
                return JIM_CONTINUE;
@@ -1526,7 +1526,7 @@ static int adiv5_jim_spot_configure(Jim_GetOptInfo *goi,
        if (!base_p && (n->value == CFG_BASEADDR || n->value == CFG_CTIBASE))
                return JIM_CONTINUE;
 
-       e = Jim_GetOpt_Obj(goi, NULL);
+       e = jim_getopt_obj(goi, NULL);
        if (e != JIM_OK)
                return e;
 
@@ -1535,7 +1535,7 @@ static int adiv5_jim_spot_configure(Jim_GetOptInfo *goi,
                if (goi->isconfigure) {
                        Jim_Obj *o_t;
                        struct adiv5_dap *dap;
-                       e = Jim_GetOpt_Obj(goi, &o_t);
+                       e = jim_getopt_obj(goi, &o_t);
                        if (e != JIM_OK)
                                return e;
                        dap = dap_instance_by_jim_obj(goi->interp, o_t);
@@ -1563,7 +1563,7 @@ static int adiv5_jim_spot_configure(Jim_GetOptInfo *goi,
        case CFG_AP_NUM:
                if (goi->isconfigure) {
                        jim_wide ap_num;
-                       e = Jim_GetOpt_Wide(goi, &ap_num);
+                       e = jim_getopt_wide(goi, &ap_num);
                        if (e != JIM_OK)
                                return e;
                        if (ap_num < 0 || ap_num > DP_APSEL_MAX) {
@@ -1588,7 +1588,7 @@ static int adiv5_jim_spot_configure(Jim_GetOptInfo *goi,
        case CFG_BASEADDR:
                if (goi->isconfigure) {
                        jim_wide base;
-                       e = Jim_GetOpt_Wide(goi, &base);
+                       e = jim_getopt_wide(goi, &base);
                        if (e != JIM_OK)
                                return e;
                        *base_p = (uint32_t)base;
@@ -1607,7 +1607,7 @@ err_no_param:
        return JIM_ERR;
 }
 
-int adiv5_jim_configure(struct target *target, Jim_GetOptInfo *goi)
+int adiv5_jim_configure(struct target *target, struct jim_getopt_info *goi)
 {
        struct adiv5_private_config *pc;
        int e;
@@ -1651,7 +1651,7 @@ int adiv5_verify_config(struct adiv5_private_config *pc)
 }
 
 int adiv5_jim_mem_ap_spot_configure(struct adiv5_mem_ap_spot *cfg,
-               Jim_GetOptInfo *goi)
+               struct jim_getopt_info *goi)
 {
        return adiv5_jim_spot_configure(goi, &cfg->dap, &cfg->ap_num, &cfg->base);
 }
index 00e4ea2b25774f65fdefae3c403fdc4e5c54aa91..ce9155ae7fec663f180248a4f9b091b0960e1efa 100644 (file)
@@ -602,7 +602,7 @@ struct adiv5_private_config {
 };
 
 extern int adiv5_verify_config(struct adiv5_private_config *pc);
-extern int adiv5_jim_configure(struct target *target, Jim_GetOptInfo *goi);
+extern int adiv5_jim_configure(struct target *target, struct jim_getopt_info *goi);
 
 struct adiv5_mem_ap_spot {
        struct adiv5_dap *dap;
@@ -612,6 +612,6 @@ struct adiv5_mem_ap_spot {
 
 extern int adiv5_mem_ap_spot_init(struct adiv5_mem_ap_spot *p);
 extern int adiv5_jim_mem_ap_spot_configure(struct adiv5_mem_ap_spot *cfg,
-               Jim_GetOptInfo *goi);
+               struct jim_getopt_info *goi);
 
 #endif /* OPENOCD_TARGET_ARM_ADI_V5_H */
index ee9d8aafd40e920682d2a1e5384067ef4533d57f..30212cbf4e2867b57d0e5e0144b30617538965e5 100644 (file)
@@ -430,7 +430,7 @@ static const struct command_registration cti_instance_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-static int cti_configure(Jim_GetOptInfo *goi, struct arm_cti *cti)
+static int cti_configure(struct jim_getopt_info *goi, struct arm_cti *cti)
 {
        /* parse config or cget options ... */
        while (goi->argc > 0) {
@@ -446,7 +446,7 @@ static int cti_configure(Jim_GetOptInfo *goi, struct arm_cti *cti)
 
        return JIM_OK;
 }
-static int cti_create(Jim_GetOptInfo *goi)
+static int cti_create(struct jim_getopt_info *goi)
 {
        struct command_context *cmd_ctx;
        static struct arm_cti *cti;
@@ -463,7 +463,7 @@ static int cti_create(Jim_GetOptInfo *goi)
                return JIM_ERR;
        }
        /* COMMAND */
-       Jim_GetOpt_Obj(goi, &new_cmd);
+       jim_getopt_obj(goi, &new_cmd);
        /* does this command exist? */
        cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
        if (cmd) {
@@ -518,8 +518,8 @@ static int cti_create(Jim_GetOptInfo *goi)
 
 static int jim_cti_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc < 2) {
                Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
                        "<name> [<cti_options> ...]");
index a9277e79871a76975cbc95d88cc4fe7b17e89b04..747733dc948bb75cd34403aa0a9da326413d085f 100644 (file)
@@ -156,31 +156,31 @@ enum dap_cfg_param {
        CFG_IGNORE_SYSPWRUPACK,
 };
 
-static const Jim_Nvp nvp_config_opts[] = {
+static const struct jim_nvp nvp_config_opts[] = {
        { .name = "-chain-position",   .value = CFG_CHAIN_POSITION },
        { .name = "-ignore-syspwrupack", .value = CFG_IGNORE_SYSPWRUPACK },
        { .name = NULL, .value = -1 }
 };
 
-static int dap_configure(Jim_GetOptInfo *goi, struct arm_dap_object *dap)
+static int dap_configure(struct jim_getopt_info *goi, struct arm_dap_object *dap)
 {
        struct jtag_tap *tap = NULL;
-       Jim_Nvp *n;
+       struct jim_nvp *n;
        int e;
 
        /* parse config or cget options ... */
        while (goi->argc > 0) {
                Jim_SetEmptyResult(goi->interp);
 
-               e = Jim_GetOpt_Nvp(goi, nvp_config_opts, &n);
+               e = jim_getopt_nvp(goi, nvp_config_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0);
+                       jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
                        return e;
                }
                switch (n->value) {
                case CFG_CHAIN_POSITION: {
                        Jim_Obj *o_t;
-                       e = Jim_GetOpt_Obj(goi, &o_t);
+                       e = jim_getopt_obj(goi, &o_t);
                        if (e != JIM_OK)
                                return e;
                        tap = jtag_tap_by_jim_obj(goi->interp, o_t);
@@ -210,7 +210,7 @@ static int dap_configure(Jim_GetOptInfo *goi, struct arm_dap_object *dap)
        return JIM_OK;
 }
 
-static int dap_create(Jim_GetOptInfo *goi)
+static int dap_create(struct jim_getopt_info *goi)
 {
        struct command_context *cmd_ctx;
        static struct arm_dap_object *dap;
@@ -227,7 +227,7 @@ static int dap_create(Jim_GetOptInfo *goi)
                return JIM_ERR;
        }
        /* COMMAND */
-       Jim_GetOpt_Obj(goi, &new_cmd);
+       jim_getopt_obj(goi, &new_cmd);
        /* does this command exist? */
        cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
        if (cmd) {
@@ -276,8 +276,8 @@ static int dap_create(Jim_GetOptInfo *goi)
 
 static int jim_dap_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc < 2) {
                Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
                        "<name> [<dap_options> ...]");
index f93508622f38b1c521b008dc6f6ca79649ded5e7..6d1e94fa1d01d06d9473c3c0cfdea666966a0fff 100644 (file)
@@ -73,7 +73,7 @@ enum arm_tpiu_swo_event {
        TPIU_SWO_EVENT_POST_DISABLE,
 };
 
-static const Jim_Nvp nvp_arm_tpiu_swo_event[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_event[] = {
        { .value = TPIU_SWO_EVENT_PRE_ENABLE,   .name = "pre-enable" },
        { .value = TPIU_SWO_EVENT_POST_ENABLE,  .name = "post-enable" },
        { .value = TPIU_SWO_EVENT_PRE_DISABLE,  .name = "pre-disable" },
@@ -168,7 +168,7 @@ static void arm_tpiu_swo_handle_event(struct arm_tpiu_swo_object *obj, enum arm_
 
                LOG_DEBUG("TPIU/SWO: %s event: %s (%d) action : %s",
                        obj->name,
-                       Jim_Nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
+                       jim_nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
                        event,
                        Jim_GetString(ea->body, NULL));
 
@@ -185,7 +185,7 @@ static void arm_tpiu_swo_handle_event(struct arm_tpiu_swo_object *obj, enum arm_
 
                Jim_MakeErrorMessage(ea->interp);
                LOG_USER("Error executing event %s on TPIU/SWO %s:\n%s",
-                       Jim_Nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
+                       jim_nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
                        obj->name,
                        Jim_GetString(Jim_GetResult(ea->interp), NULL));
                /* clean both error code and stacktrace before return */
@@ -297,7 +297,7 @@ COMMAND_HANDLER(handle_arm_tpiu_swo_event_list)
                        "----------------------------------------");
 
        for (struct arm_tpiu_swo_event_action *ea = obj->event_action; ea; ea = ea->next) {
-               Jim_Nvp *opt = Jim_Nvp_value2name_simple(nvp_arm_tpiu_swo_event, ea->event);
+               struct jim_nvp *opt = jim_nvp_value2name_simple(nvp_arm_tpiu_swo_event, ea->event);
                command_print(CMD, "%-25s | %s",
                                opt->name, Jim_GetString(ea->body, NULL));
        }
@@ -315,7 +315,7 @@ enum arm_tpiu_swo_cfg_param {
        CFG_EVENT,
 };
 
-static const Jim_Nvp nvp_arm_tpiu_swo_config_opts[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_config_opts[] = {
        { .name = "-port-width",    .value = CFG_PORT_WIDTH },
        { .name = "-protocol",      .value = CFG_PROTOCOL },
        { .name = "-formatter",     .value = CFG_FORMATTER },
@@ -323,21 +323,21 @@ static const Jim_Nvp nvp_arm_tpiu_swo_config_opts[] = {
        { .name = "-pin-freq",      .value = CFG_BITRATE },
        { .name = "-output",        .value = CFG_OUTFILE },
        { .name = "-event",         .value = CFG_EVENT },
-       /* handled by mem_ap_spot, added for Jim_GetOpt_NvpUnknown() */
+       /* handled by mem_ap_spot, added for jim_getopt_nvp_unknown() */
        { .name = "-dap",           .value = -1 },
        { .name = "-ap-num",        .value = -1 },
        { .name = "-baseaddr",      .value = -1 },
        { .name = NULL,             .value = -1 },
 };
 
-static const Jim_Nvp nvp_arm_tpiu_swo_protocol_opts[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_protocol_opts[] = {
        { .name = "sync",           .value = TPIU_SPPR_PROTOCOL_SYNC },
        { .name = "uart",           .value = TPIU_SPPR_PROTOCOL_UART },
        { .name = "manchester",     .value = TPIU_SPPR_PROTOCOL_MANCHESTER },
        { .name = NULL,             .value = -1 },
 };
 
-static const Jim_Nvp nvp_arm_tpiu_swo_bool_opts[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_bool_opts[] = {
        { .name = "on",             .value = 1 },
        { .name = "yes",            .value = 1 },
        { .name = "1",              .value = 1 },
@@ -349,7 +349,7 @@ static const Jim_Nvp nvp_arm_tpiu_swo_bool_opts[] = {
        { .name = NULL,             .value = -1 },
 };
 
-static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_object *obj)
+static int arm_tpiu_swo_configure(struct jim_getopt_info *goi, struct arm_tpiu_swo_object *obj)
 {
        assert(obj != NULL);
 
@@ -368,10 +368,10 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                if (e == JIM_ERR)
                        return e;
 
-               Jim_Nvp *n;
-               e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_config_opts, &n);
+               struct jim_nvp *n;
+               e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_config_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(goi, nvp_arm_tpiu_swo_config_opts, 0);
+                       jim_getopt_nvp_unknown(goi, nvp_arm_tpiu_swo_config_opts, 0);
                        return e;
                }
 
@@ -379,7 +379,7 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                case CFG_PORT_WIDTH:
                        if (goi->isconfigure) {
                                jim_wide port_width;
-                               e = Jim_GetOpt_Wide(goi, &port_width);
+                               e = jim_getopt_wide(goi, &port_width);
                                if (e != JIM_OK)
                                        return e;
                                if (port_width < 1 || port_width > 32) {
@@ -395,16 +395,16 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                        break;
                case CFG_PROTOCOL:
                        if (goi->isconfigure) {
-                               Jim_Nvp *p;
-                               e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_protocol_opts, &p);
+                               struct jim_nvp *p;
+                               e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_protocol_opts, &p);
                                if (e != JIM_OK)
                                        return e;
                                obj->pin_protocol = p->value;
                        } else {
                                if (goi->argc)
                                        goto err_no_params;
-                               Jim_Nvp *p;
-                               e = Jim_Nvp_value2name(goi->interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
+                               struct jim_nvp *p;
+                               e = jim_nvp_value2name(goi->interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
                                if (e != JIM_OK) {
                                        Jim_SetResultString(goi->interp, "protocol error", -1);
                                        return JIM_ERR;
@@ -414,16 +414,16 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                        break;
                case CFG_FORMATTER:
                        if (goi->isconfigure) {
-                               Jim_Nvp *p;
-                               e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_bool_opts, &p);
+                               struct jim_nvp *p;
+                               e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_bool_opts, &p);
                                if (e != JIM_OK)
                                        return e;
                                obj->en_formatter = p->value;
                        } else {
                                if (goi->argc)
                                        goto err_no_params;
-                               Jim_Nvp *p;
-                               e = Jim_Nvp_value2name(goi->interp, nvp_arm_tpiu_swo_bool_opts, obj->en_formatter, &p);
+                               struct jim_nvp *p;
+                               e = jim_nvp_value2name(goi->interp, nvp_arm_tpiu_swo_bool_opts, obj->en_formatter, &p);
                                if (e != JIM_OK) {
                                        Jim_SetResultString(goi->interp, "formatter error", -1);
                                        return JIM_ERR;
@@ -434,7 +434,7 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                case CFG_TRACECLKIN:
                        if (goi->isconfigure) {
                                jim_wide clk;
-                               e = Jim_GetOpt_Wide(goi, &clk);
+                               e = jim_getopt_wide(goi, &clk);
                                if (e != JIM_OK)
                                        return e;
                                obj->traceclkin_freq = clk;
@@ -447,7 +447,7 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                case CFG_BITRATE:
                        if (goi->isconfigure) {
                                jim_wide clk;
-                               e = Jim_GetOpt_Wide(goi, &clk);
+                               e = jim_getopt_wide(goi, &clk);
                                if (e != JIM_OK)
                                        return e;
                                obj->swo_pin_freq = clk;
@@ -460,7 +460,7 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                case CFG_OUTFILE:
                        if (goi->isconfigure) {
                                const char *s;
-                               e = Jim_GetOpt_String(goi, &s, NULL);
+                               e = jim_getopt_string(goi, &s, NULL);
                                if (e != JIM_OK)
                                        return e;
                                if (s[0] == ':') {
@@ -498,13 +498,13 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                        }
 
                        {
-                               Jim_Nvp *p;
+                               struct jim_nvp *p;
                                Jim_Obj *o;
                                struct arm_tpiu_swo_event_action *ea = obj->event_action;
 
-                               e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_event, &p);
+                               e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_event, &p);
                                if (e != JIM_OK) {
-                                       Jim_GetOpt_NvpUnknown(goi, nvp_arm_tpiu_swo_event, 1);
+                                       jim_getopt_nvp_unknown(goi, nvp_arm_tpiu_swo_event, 1);
                                        return e;
                                }
 
@@ -529,7 +529,7 @@ static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_objec
                                                Jim_DecrRefCount(ea->interp, ea->body);
                                        ea->event = p->value;
                                        ea->interp = goi->interp;
-                                       Jim_GetOpt_Obj(goi, &o);
+                                       jim_getopt_obj(goi, &o);
                                        ea->body = Jim_DuplicateObj(goi->interp, o);
                                        Jim_IncrRefCount(ea->body);
                                } else {
@@ -551,9 +551,9 @@ err_no_params:
 static int jim_arm_tpiu_swo_configure(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
        struct command *c = jim_to_command(interp);
-       Jim_GetOptInfo goi;
+       struct jim_getopt_info goi;
 
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        goi.isconfigure = !strcmp(c->name, "configure");
        if (goi.argc < 1) {
                Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
@@ -670,8 +670,8 @@ static int jim_arm_tpiu_swo_enable(Jim_Interp *interp, int argc, Jim_Obj *const
                value = 0;
        }
        if (!value) {
-               Jim_Nvp *p;
-               Jim_Nvp_value2name(interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
+               struct jim_nvp *p;
+               jim_nvp_value2name(interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
                LOG_ERROR("%s does not support protocol %s", obj->name, p->name);
                return JIM_ERR;
        }
@@ -897,8 +897,8 @@ static int arm_tpiu_swo_create(Jim_Interp *interp, struct arm_tpiu_swo_object *o
 
 static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc < 1) {
                Jim_WrongNumArgs(goi.interp, 1, goi.argv, "?name? ..options...");
                return JIM_ERR;
@@ -915,7 +915,7 @@ static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const
        obj->port_width = 1;
 
        Jim_Obj *n;
-       Jim_GetOpt_Obj(&goi, &n);
+       jim_getopt_obj(&goi, &n);
        obj->name = strdup(Jim_GetString(n, NULL));
        if (!obj->name) {
                LOG_ERROR("Out of memory");
index 0c5cf346e566e02724438973f6682ffa583c06b1..6d60a1ce84c3f730fed37f849ca460a0c9206174 100644 (file)
@@ -1025,7 +1025,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
        unsigned int argp = 0;
        int retval;
 
-       static const Jim_Nvp nvp_ecatch_modes[] = {
+       static const struct jim_nvp nvp_ecatch_modes[] = {
                { .name = "off",       .value = 0 },
                { .name = "nsec_el1",  .value = (1 << 5) },
                { .name = "nsec_el2",  .value = (2 << 5) },
@@ -1035,7 +1035,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
                { .name = "sec_el13",  .value = (5 << 1) },
                { .name = NULL, .value = -1 },
        };
-       const Jim_Nvp *n;
+       const struct jim_nvp *n;
 
        if (CMD_ARGC == 0) {
                const char *sec = NULL, *nsec = NULL;
@@ -1045,11 +1045,11 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
                if (retval != ERROR_OK)
                        return retval;
 
-               n = Jim_Nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0x0f);
+               n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0x0f);
                if (n->name != NULL)
                        sec = n->name;
 
-               n = Jim_Nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0xf0);
+               n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0xf0);
                if (n->name != NULL)
                        nsec = n->name;
 
@@ -1063,7 +1063,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
        }
 
        while (CMD_ARGC > argp) {
-               n = Jim_Nvp_name2value_simple(nvp_ecatch_modes, CMD_ARGV[argp]);
+               n = jim_nvp_name2value_simple(nvp_ecatch_modes, CMD_ARGV[argp]);
                if (n->name == NULL) {
                        LOG_ERROR("Unknown option: %s", CMD_ARGV[argp]);
                        return ERROR_FAIL;
index 35f149970b3171efb98319bf887c2e08d1cc3493..6b76656b91e0c52c0211e11486e920367257e9d3 100644 (file)
@@ -3259,15 +3259,15 @@ COMMAND_HANDLER(handle_cortex_a_mask_interrupts_command)
        struct target *target = get_current_target(CMD_CTX);
        struct cortex_a_common *cortex_a = target_to_cortex_a(target);
 
-       static const Jim_Nvp nvp_maskisr_modes[] = {
+       static const struct jim_nvp nvp_maskisr_modes[] = {
                { .name = "off", .value = CORTEX_A_ISRMASK_OFF },
                { .name = "on", .value = CORTEX_A_ISRMASK_ON },
                { .name = NULL, .value = -1 },
        };
-       const Jim_Nvp *n;
+       const struct jim_nvp *n;
 
        if (CMD_ARGC > 0) {
-               n = Jim_Nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+               n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
                if (n->name == NULL) {
                        LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
                        return ERROR_COMMAND_SYNTAX_ERROR;
@@ -3276,7 +3276,7 @@ COMMAND_HANDLER(handle_cortex_a_mask_interrupts_command)
                cortex_a->isrmasking_mode = n->value;
        }
 
-       n = Jim_Nvp_value2name_simple(nvp_maskisr_modes, cortex_a->isrmasking_mode);
+       n = jim_nvp_value2name_simple(nvp_maskisr_modes, cortex_a->isrmasking_mode);
        command_print(CMD, "cortex_a interrupt mask %s", n->name);
 
        return ERROR_OK;
@@ -3287,22 +3287,22 @@ COMMAND_HANDLER(handle_cortex_a_dacrfixup_command)
        struct target *target = get_current_target(CMD_CTX);
        struct cortex_a_common *cortex_a = target_to_cortex_a(target);
 
-       static const Jim_Nvp nvp_dacrfixup_modes[] = {
+       static const struct jim_nvp nvp_dacrfixup_modes[] = {
                { .name = "off", .value = CORTEX_A_DACRFIXUP_OFF },
                { .name = "on", .value = CORTEX_A_DACRFIXUP_ON },
                { .name = NULL, .value = -1 },
        };
-       const Jim_Nvp *n;
+       const struct jim_nvp *n;
 
        if (CMD_ARGC > 0) {
-               n = Jim_Nvp_name2value_simple(nvp_dacrfixup_modes, CMD_ARGV[0]);
+               n = jim_nvp_name2value_simple(nvp_dacrfixup_modes, CMD_ARGV[0]);
                if (n->name == NULL)
                        return ERROR_COMMAND_SYNTAX_ERROR;
                cortex_a->dacrfixup_mode = n->value;
 
        }
 
-       n = Jim_Nvp_value2name_simple(nvp_dacrfixup_modes, cortex_a->dacrfixup_mode);
+       n = jim_nvp_value2name_simple(nvp_dacrfixup_modes, cortex_a->dacrfixup_mode);
        command_print(CMD, "cortex_a domain access control fixup %s", n->name);
 
        return ERROR_OK;
index 9f9bc0dd2ee70a4057e1feff479f698141f9aaa5..941fef16a1565735662159da6b924058e1b476b4 100644 (file)
@@ -2398,14 +2398,14 @@ COMMAND_HANDLER(handle_cortex_m_mask_interrupts_command)
        struct cortex_m_common *cortex_m = target_to_cm(target);
        int retval;
 
-       static const Jim_Nvp nvp_maskisr_modes[] = {
+       static const struct jim_nvp nvp_maskisr_modes[] = {
                { .name = "auto", .value = CORTEX_M_ISRMASK_AUTO },
                { .name = "off", .value = CORTEX_M_ISRMASK_OFF },
                { .name = "on", .value = CORTEX_M_ISRMASK_ON },
                { .name = "steponly", .value = CORTEX_M_ISRMASK_STEPONLY },
                { .name = NULL, .value = -1 },
        };
-       const Jim_Nvp *n;
+       const struct jim_nvp *n;
 
 
        retval = cortex_m_verify_pointer(CMD, cortex_m);
@@ -2418,14 +2418,14 @@ COMMAND_HANDLER(handle_cortex_m_mask_interrupts_command)
        }
 
        if (CMD_ARGC > 0) {
-               n = Jim_Nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+               n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
                if (n->name == NULL)
                        return ERROR_COMMAND_SYNTAX_ERROR;
                cortex_m->isrmasking_mode = n->value;
                cortex_m_set_maskints_for_halt(target);
        }
 
-       n = Jim_Nvp_value2name_simple(nvp_maskisr_modes, cortex_m->isrmasking_mode);
+       n = jim_nvp_value2name_simple(nvp_maskisr_modes, cortex_m->isrmasking_mode);
        command_print(CMD, "cortex_m interrupt mask %s", n->name);
 
        return ERROR_OK;
index 246dbd0344c0c4235a3646351565a75ef1ce34aa..f7647c385f2616ffd831402c3d7ece751aae59fd 100644 (file)
@@ -681,8 +681,8 @@ static int jim_nds32_bulk_write(Jim_Interp *interp, int argc, Jim_Obj * const *a
 {
        const char *cmd_name = Jim_GetString(argv[0], NULL);
 
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        if (goi.argc < 3) {
                Jim_SetResultFormatted(goi.interp,
@@ -692,12 +692,12 @@ static int jim_nds32_bulk_write(Jim_Interp *interp, int argc, Jim_Obj * const *a
 
        int e;
        jim_wide address;
-       e = Jim_GetOpt_Wide(&goi, &address);
+       e = jim_getopt_wide(&goi, &address);
        if (e != JIM_OK)
                return e;
 
        jim_wide count;
-       e = Jim_GetOpt_Wide(&goi, &count);
+       e = jim_getopt_wide(&goi, &count);
        if (e != JIM_OK)
                return e;
 
@@ -708,7 +708,7 @@ static int jim_nds32_bulk_write(Jim_Interp *interp, int argc, Jim_Obj * const *a
        jim_wide i;
        for (i = 0; i < count; i++) {
                jim_wide tmp;
-               e = Jim_GetOpt_Wide(&goi, &tmp);
+               e = jim_getopt_wide(&goi, &tmp);
                if (e != JIM_OK) {
                        free(data);
                        return e;
@@ -738,8 +738,8 @@ static int jim_nds32_multi_write(Jim_Interp *interp, int argc, Jim_Obj * const *
 {
        const char *cmd_name = Jim_GetString(argv[0], NULL);
 
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        if (goi.argc < 3) {
                Jim_SetResultFormatted(goi.interp,
@@ -749,7 +749,7 @@ static int jim_nds32_multi_write(Jim_Interp *interp, int argc, Jim_Obj * const *
 
        int e;
        jim_wide num_of_pairs;
-       e = Jim_GetOpt_Wide(&goi, &num_of_pairs);
+       e = jim_getopt_wide(&goi, &num_of_pairs);
        if (e != JIM_OK)
                return e;
 
@@ -765,12 +765,12 @@ static int jim_nds32_multi_write(Jim_Interp *interp, int argc, Jim_Obj * const *
        aice_set_command_mode(aice, AICE_COMMAND_MODE_PACK);
        for (i = 0; i < num_of_pairs; i++) {
                jim_wide tmp;
-               e = Jim_GetOpt_Wide(&goi, &tmp);
+               e = jim_getopt_wide(&goi, &tmp);
                if (e != JIM_OK)
                        break;
                address = (uint32_t)tmp;
 
-               e = Jim_GetOpt_Wide(&goi, &tmp);
+               e = jim_getopt_wide(&goi, &tmp);
                if (e != JIM_OK)
                        break;
                data = (uint32_t)tmp;
@@ -792,8 +792,8 @@ static int jim_nds32_bulk_read(Jim_Interp *interp, int argc, Jim_Obj * const *ar
 {
        const char *cmd_name = Jim_GetString(argv[0], NULL);
 
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        if (goi.argc < 2) {
                Jim_SetResultFormatted(goi.interp,
@@ -803,12 +803,12 @@ static int jim_nds32_bulk_read(Jim_Interp *interp, int argc, Jim_Obj * const *ar
 
        int e;
        jim_wide address;
-       e = Jim_GetOpt_Wide(&goi, &address);
+       e = jim_getopt_wide(&goi, &address);
        if (e != JIM_OK)
                return e;
 
        jim_wide count;
-       e = Jim_GetOpt_Wide(&goi, &count);
+       e = jim_getopt_wide(&goi, &count);
        if (e != JIM_OK)
                return e;
 
@@ -840,8 +840,8 @@ static int jim_nds32_read_edm_sr(Jim_Interp *interp, int argc, Jim_Obj * const *
 {
        const char *cmd_name = Jim_GetString(argv[0], NULL);
 
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        if (goi.argc < 1) {
                Jim_SetResultFormatted(goi.interp,
@@ -852,7 +852,7 @@ static int jim_nds32_read_edm_sr(Jim_Interp *interp, int argc, Jim_Obj * const *
        int e;
        const char *edm_sr_name;
        int edm_sr_name_len;
-       e = Jim_GetOpt_String(&goi, &edm_sr_name, &edm_sr_name_len);
+       e = jim_getopt_string(&goi, &edm_sr_name, &edm_sr_name_len);
        if (e != JIM_OK)
                return e;
 
@@ -888,8 +888,8 @@ static int jim_nds32_write_edm_sr(Jim_Interp *interp, int argc, Jim_Obj * const
 {
        const char *cmd_name = Jim_GetString(argv[0], NULL);
 
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        if (goi.argc < 2) {
                Jim_SetResultFormatted(goi.interp,
@@ -900,12 +900,12 @@ static int jim_nds32_write_edm_sr(Jim_Interp *interp, int argc, Jim_Obj * const
        int e;
        const char *edm_sr_name;
        int edm_sr_name_len;
-       e = Jim_GetOpt_String(&goi, &edm_sr_name, &edm_sr_name_len);
+       e = jim_getopt_string(&goi, &edm_sr_name, &edm_sr_name_len);
        if (e != JIM_OK)
                return e;
 
        jim_wide value;
-       e = Jim_GetOpt_Wide(&goi, &value);
+       e = jim_getopt_wide(&goi, &value);
        if (e != JIM_OK)
                return e;
 
index 2a34ff6fa8af6e7c2b555a2d87e75576ba02f31e..00b524e315f38a5d3b6bbc34abf90ee801c882c5 100644 (file)
@@ -1945,7 +1945,7 @@ static int stm8_run_algorithm(struct target *target, int num_mem_params,
        return ERROR_OK;
 }
 
-static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
+static int stm8_jim_configure(struct target *target, struct jim_getopt_info *goi)
 {
        struct stm8_common *stm8 = target_to_stm8(target);
        jim_wide w;
@@ -1954,7 +1954,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
 
        arg = Jim_GetString(goi->argv[0], NULL);
        if (!strcmp(arg, "-blocksize")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -1964,7 +1964,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide(goi, &w);
+               e = jim_getopt_wide(goi, &w);
                if (e != JIM_OK)
                        return e;
 
@@ -1973,7 +1973,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-flashstart")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -1983,7 +1983,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide(goi, &w);
+               e = jim_getopt_wide(goi, &w);
                if (e != JIM_OK)
                        return e;
 
@@ -1992,7 +1992,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-flashend")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -2002,7 +2002,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide(goi, &w);
+               e = jim_getopt_wide(goi, &w);
                if (e != JIM_OK)
                        return e;
 
@@ -2011,7 +2011,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-eepromstart")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -2021,7 +2021,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide(goi, &w);
+               e = jim_getopt_wide(goi, &w);
                if (e != JIM_OK)
                        return e;
 
@@ -2030,7 +2030,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-eepromend")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -2040,7 +2040,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide(goi, &w);
+               e = jim_getopt_wide(goi, &w);
                if (e != JIM_OK)
                        return e;
 
@@ -2049,7 +2049,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-optionstart")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -2059,7 +2059,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide(goi, &w);
+               e = jim_getopt_wide(goi, &w);
                if (e != JIM_OK)
                        return e;
 
@@ -2068,7 +2068,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-optionend")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -2078,7 +2078,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide(goi, &w);
+               e = jim_getopt_wide(goi, &w);
                if (e != JIM_OK)
                        return e;
 
@@ -2087,7 +2087,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-enable_step_irq")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
@@ -2096,7 +2096,7 @@ static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
                return JIM_OK;
        }
        if (!strcmp(arg, "-enable_stm8l")) {
-               e = Jim_GetOpt_String(goi, &arg, NULL);
+               e = jim_getopt_string(goi, &arg, NULL);
                if (e != JIM_OK)
                        return e;
 
index 1c1deeef9c47287d02d8fd5c578a3e1a3674dcc6..1547b29e7ea67599dc5daa1b28981c13b828644a 100644 (file)
@@ -158,7 +158,7 @@ static LIST_HEAD(target_reset_callback_list);
 static LIST_HEAD(target_trace_callback_list);
 static const int polling_interval = 100;
 
-static const Jim_Nvp nvp_assert[] = {
+static const struct jim_nvp nvp_assert[] = {
        { .name = "assert", NVP_ASSERT },
        { .name = "deassert", NVP_DEASSERT },
        { .name = "T", NVP_ASSERT },
@@ -168,7 +168,7 @@ static const Jim_Nvp nvp_assert[] = {
        { .name = NULL, .value = -1 }
 };
 
-static const Jim_Nvp nvp_error_target[] = {
+static const struct jim_nvp nvp_error_target[] = {
        { .value = ERROR_TARGET_INVALID, .name = "err-invalid" },
        { .value = ERROR_TARGET_INIT_FAILED, .name = "err-init-failed" },
        { .value = ERROR_TARGET_TIMEOUT, .name = "err-timeout" },
@@ -185,16 +185,16 @@ static const Jim_Nvp nvp_error_target[] = {
 
 static const char *target_strerror_safe(int err)
 {
-       const Jim_Nvp *n;
+       const struct jim_nvp *n;
 
-       n = Jim_Nvp_value2name_simple(nvp_error_target, err);
+       n = jim_nvp_value2name_simple(nvp_error_target, err);
        if (n->name == NULL)
                return "unknown";
        else
                return n->name;
 }
 
-static const Jim_Nvp nvp_target_event[] = {
+static const struct jim_nvp nvp_target_event[] = {
 
        { .value = TARGET_EVENT_GDB_HALT, .name = "gdb-halt" },
        { .value = TARGET_EVENT_HALTED, .name = "halted" },
@@ -237,7 +237,7 @@ static const Jim_Nvp nvp_target_event[] = {
        { .name = NULL, .value = -1 }
 };
 
-static const Jim_Nvp nvp_target_state[] = {
+static const struct jim_nvp nvp_target_state[] = {
        { .name = "unknown", .value = TARGET_UNKNOWN },
        { .name = "running", .value = TARGET_RUNNING },
        { .name = "halted",  .value = TARGET_HALTED },
@@ -246,7 +246,7 @@ static const Jim_Nvp nvp_target_state[] = {
        { .name = NULL, .value = -1 },
 };
 
-static const Jim_Nvp nvp_target_debug_reason[] = {
+static const struct jim_nvp nvp_target_debug_reason[] = {
        { .name = "debug-request",             .value = DBG_REASON_DBGRQ },
        { .name = "breakpoint",                .value = DBG_REASON_BREAKPOINT },
        { .name = "watchpoint",                .value = DBG_REASON_WATCHPOINT },
@@ -259,7 +259,7 @@ static const Jim_Nvp nvp_target_debug_reason[] = {
        { .name = NULL, .value = -1 },
 };
 
-static const Jim_Nvp nvp_target_endian[] = {
+static const struct jim_nvp nvp_target_endian[] = {
        { .name = "big",    .value = TARGET_BIG_ENDIAN },
        { .name = "little", .value = TARGET_LITTLE_ENDIAN },
        { .name = "be",     .value = TARGET_BIG_ENDIAN },
@@ -267,7 +267,7 @@ static const Jim_Nvp nvp_target_endian[] = {
        { .name = NULL,     .value = -1 },
 };
 
-static const Jim_Nvp nvp_reset_modes[] = {
+static const struct jim_nvp nvp_reset_modes[] = {
        { .name = "unknown", .value = RESET_UNKNOWN },
        { .name = "run",     .value = RESET_RUN },
        { .name = "halt",    .value = RESET_HALT },
@@ -279,7 +279,7 @@ const char *debug_reason_name(struct target *t)
 {
        const char *cp;
 
-       cp = Jim_Nvp_value2name_simple(nvp_target_debug_reason,
+       cp = jim_nvp_value2name_simple(nvp_target_debug_reason,
                        t->debug_reason)->name;
        if (!cp) {
                LOG_ERROR("Invalid debug reason: %d", (int)(t->debug_reason));
@@ -291,7 +291,7 @@ const char *debug_reason_name(struct target *t)
 const char *target_state_name(struct target *t)
 {
        const char *cp;
-       cp = Jim_Nvp_value2name_simple(nvp_target_state, t->state)->name;
+       cp = jim_nvp_value2name_simple(nvp_target_state, t->state)->name;
        if (!cp) {
                LOG_ERROR("Invalid target state: %d", (int)(t->state));
                cp = "(*BUG*unknown*BUG*)";
@@ -306,7 +306,7 @@ const char *target_state_name(struct target *t)
 const char *target_event_name(enum target_event event)
 {
        const char *cp;
-       cp = Jim_Nvp_value2name_simple(nvp_target_event, event)->name;
+       cp = jim_nvp_value2name_simple(nvp_target_event, event)->name;
        if (!cp) {
                LOG_ERROR("Invalid target event: %d", (int)(event));
                cp = "(*BUG*unknown*BUG*)";
@@ -317,7 +317,7 @@ const char *target_event_name(enum target_event event)
 const char *target_reset_mode_name(enum target_reset_mode reset_mode)
 {
        const char *cp;
-       cp = Jim_Nvp_value2name_simple(nvp_reset_modes, reset_mode)->name;
+       cp = jim_nvp_value2name_simple(nvp_reset_modes, reset_mode)->name;
        if (!cp) {
                LOG_ERROR("Invalid target reset mode: %d", (int)(reset_mode));
                cp = "(*BUG*unknown*BUG*)";
@@ -661,8 +661,8 @@ static int target_process_reset(struct command_invocation *cmd, enum target_rese
 {
        char buf[100];
        int retval;
-       Jim_Nvp *n;
-       n = Jim_Nvp_value2name_simple(nvp_reset_modes, reset_mode);
+       struct jim_nvp *n;
+       n = jim_nvp_value2name_simple(nvp_reset_modes, reset_mode);
        if (n->name == NULL) {
                LOG_ERROR("invalid reset mode");
                return ERROR_FAIL;
@@ -1823,7 +1823,7 @@ int target_call_event_callbacks(struct target *target, enum target_event event)
        }
 
        LOG_DEBUG("target event %i (%s) for core %s", event,
-                       Jim_Nvp_value2name_simple(nvp_target_event, event)->name,
+                       jim_nvp_value2name_simple(nvp_target_event, event)->name,
                        target_name(target));
 
        target_handle_event(target, event);
@@ -1842,7 +1842,7 @@ int target_call_reset_callbacks(struct target *target, enum target_reset_mode re
        struct target_reset_callback *callback;
 
        LOG_DEBUG("target reset %i (%s)", reset_mode,
-                       Jim_Nvp_value2name_simple(nvp_reset_modes, reset_mode)->name);
+                       jim_nvp_value2name_simple(nvp_reset_modes, reset_mode)->name);
 
        list_for_each_entry(callback, &target_reset_callback_list, list)
                callback->callback(target, reset_mode, callback->priv);
@@ -2859,7 +2859,7 @@ COMMAND_HANDLER(handle_targets_command)
                                marker,
                                target_name(target),
                                target_type_name(target),
-                               Jim_Nvp_value2name_simple(nvp_target_endian,
+                               jim_nvp_value2name_simple(nvp_target_endian,
                                        target->endianness)->name,
                                target->tap->dotted_name,
                                state);
@@ -3239,7 +3239,7 @@ int target_wait_state(struct target *target, enum target_state state, int ms)
                        once = false;
                        then = timeval_ms();
                        LOG_DEBUG("waiting for target %s...",
-                               Jim_Nvp_value2name_simple(nvp_target_state, state)->name);
+                               jim_nvp_value2name_simple(nvp_target_state, state)->name);
                }
 
                if (cur-then > 500)
@@ -3247,7 +3247,7 @@ int target_wait_state(struct target *target, enum target_state state, int ms)
 
                if ((cur-then) > ms) {
                        LOG_ERROR("timed out while waiting for target %s",
-                               Jim_Nvp_value2name_simple(nvp_target_state, state)->name);
+                               jim_nvp_value2name_simple(nvp_target_state, state)->name);
                        return ERROR_FAIL;
                }
        }
@@ -3297,8 +3297,8 @@ COMMAND_HANDLER(handle_reset_command)
 
        enum target_reset_mode reset_mode = RESET_RUN;
        if (CMD_ARGC == 1) {
-               const Jim_Nvp *n;
-               n = Jim_Nvp_name2value_simple(nvp_reset_modes, CMD_ARGV[0]);
+               const struct jim_nvp *n;
+               n = jim_nvp_name2value_simple(nvp_reset_modes, CMD_ARGV[0]);
                if ((n->name == NULL) || (n->value == RESET_UNKNOWN))
                        return ERROR_COMMAND_SYNTAX_ERROR;
                reset_mode = n->value;
@@ -4775,7 +4775,7 @@ void target_handle_event(struct target *target, enum target_event e)
                                           target_name(target),
                                           target_type_name(target),
                                           e,
-                                          Jim_Nvp_value2name_simple(nvp_target_event, e)->name,
+                                          jim_nvp_value2name_simple(nvp_target_event, e)->name,
                                           Jim_GetString(teap->body, NULL));
 
                        /* Override current target by the target an event
@@ -4799,7 +4799,7 @@ void target_handle_event(struct target *target, enum target_event e)
                        if (retval != JIM_OK) {
                                Jim_MakeErrorMessage(teap->interp);
                                LOG_USER("Error executing event %s on target %s:\n%s",
-                                                 Jim_Nvp_value2name_simple(nvp_target_event, e)->name,
+                                                 jim_nvp_value2name_simple(nvp_target_event, e)->name,
                                                  target_name(target),
                                                  Jim_GetString(Jim_GetResult(teap->interp), NULL));
                                /* clean both error code and stacktrace before return */
@@ -4840,7 +4840,7 @@ enum target_cfg_param {
        TCFG_GDB_MAX_CONNECTIONS,
 };
 
-static Jim_Nvp nvp_config_opts[] = {
+static struct jim_nvp nvp_config_opts[] = {
        { .name = "-type",             .value = TCFG_TYPE },
        { .name = "-event",            .value = TCFG_EVENT },
        { .name = "-work-area-virt",   .value = TCFG_WORK_AREA_VIRT },
@@ -4858,9 +4858,9 @@ static Jim_Nvp nvp_config_opts[] = {
        { .name = NULL, .value = -1 }
 };
 
-static int target_configure(Jim_GetOptInfo *goi, struct target *target)
+static int target_configure(struct jim_getopt_info *goi, struct target *target)
 {
-       Jim_Nvp *n;
+       struct jim_nvp *n;
        Jim_Obj *o;
        jim_wide w;
        int e;
@@ -4868,7 +4868,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
        /* parse config or cget options ... */
        while (goi->argc > 0) {
                Jim_SetEmptyResult(goi->interp);
-               /* Jim_GetOpt_Debug(goi); */
+               /* jim_getopt_debug(goi); */
 
                if (target->type->target_jim_configure) {
                        /* target defines a configure function */
@@ -4884,9 +4884,9 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
                        }
                        /* otherwise we 'continue' below */
                }
-               e = Jim_GetOpt_Nvp(goi, nvp_config_opts, &n);
+               e = jim_getopt_nvp(goi, nvp_config_opts, &n);
                if (e != JIM_OK) {
-                       Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0);
+                       jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
                        return e;
                }
                switch (n->value) {
@@ -4915,9 +4915,9 @@ no_params:
                                return JIM_ERR;
                        }
 
-                       e = Jim_GetOpt_Nvp(goi, nvp_target_event, &n);
+                       e = jim_getopt_nvp(goi, nvp_target_event, &n);
                        if (e != JIM_OK) {
-                               Jim_GetOpt_NvpUnknown(goi, nvp_target_event, 1);
+                               jim_getopt_nvp_unknown(goi, nvp_target_event, 1);
                                return e;
                        }
 
@@ -4958,7 +4958,7 @@ no_params:
                                        }
                                        teap->event = n->value;
                                        teap->interp = goi->interp;
-                                       Jim_GetOpt_Obj(goi, &o);
+                                       jim_getopt_obj(goi, &o);
                                        if (teap->body)
                                                Jim_DecrRefCount(teap->interp, teap->body);
                                        teap->body  = Jim_DuplicateObj(goi->interp, o);
@@ -4994,7 +4994,7 @@ no_params:
                case TCFG_WORK_AREA_VIRT:
                        if (goi->isconfigure) {
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide(goi, &w);
+                               e = jim_getopt_wide(goi, &w);
                                if (e != JIM_OK)
                                        return e;
                                target->working_area_virt = w;
@@ -5010,7 +5010,7 @@ no_params:
                case TCFG_WORK_AREA_PHYS:
                        if (goi->isconfigure) {
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide(goi, &w);
+                               e = jim_getopt_wide(goi, &w);
                                if (e != JIM_OK)
                                        return e;
                                target->working_area_phys = w;
@@ -5026,7 +5026,7 @@ no_params:
                case TCFG_WORK_AREA_SIZE:
                        if (goi->isconfigure) {
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide(goi, &w);
+                               e = jim_getopt_wide(goi, &w);
                                if (e != JIM_OK)
                                        return e;
                                target->working_area_size = w;
@@ -5041,7 +5041,7 @@ no_params:
                case TCFG_WORK_AREA_BACKUP:
                        if (goi->isconfigure) {
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide(goi, &w);
+                               e = jim_getopt_wide(goi, &w);
                                if (e != JIM_OK)
                                        return e;
                                /* make this exactly 1 or 0 */
@@ -5057,9 +5057,9 @@ no_params:
 
                case TCFG_ENDIAN:
                        if (goi->isconfigure) {
-                               e = Jim_GetOpt_Nvp(goi, nvp_target_endian, &n);
+                               e = jim_getopt_nvp(goi, nvp_target_endian, &n);
                                if (e != JIM_OK) {
-                                       Jim_GetOpt_NvpUnknown(goi, nvp_target_endian, 1);
+                                       jim_getopt_nvp_unknown(goi, nvp_target_endian, 1);
                                        return e;
                                }
                                target->endianness = n->value;
@@ -5067,10 +5067,10 @@ no_params:
                                if (goi->argc != 0)
                                        goto no_params;
                        }
-                       n = Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness);
+                       n = jim_nvp_value2name_simple(nvp_target_endian, target->endianness);
                        if (n->name == NULL) {
                                target->endianness = TARGET_LITTLE_ENDIAN;
-                               n = Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness);
+                               n = jim_nvp_value2name_simple(nvp_target_endian, target->endianness);
                        }
                        Jim_SetResultString(goi->interp, n->name, -1);
                        /* loop for more */
@@ -5078,7 +5078,7 @@ no_params:
 
                case TCFG_COREID:
                        if (goi->isconfigure) {
-                               e = Jim_GetOpt_Wide(goi, &w);
+                               e = jim_getopt_wide(goi, &w);
                                if (e != JIM_OK)
                                        return e;
                                target->coreid = (int32_t)w;
@@ -5102,7 +5102,7 @@ no_params:
                                }
 
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Obj(goi, &o_t);
+                               e = jim_getopt_obj(goi, &o_t);
                                if (e != JIM_OK)
                                        return e;
                                tap = jtag_tap_by_jim_obj(goi->interp, o_t);
@@ -5119,7 +5119,7 @@ no_params:
                        break;
                case TCFG_DBGBASE:
                        if (goi->isconfigure) {
-                               e = Jim_GetOpt_Wide(goi, &w);
+                               e = jim_getopt_wide(goi, &w);
                                if (e != JIM_OK)
                                        return e;
                                target->dbgbase = (uint32_t)w;
@@ -5156,7 +5156,7 @@ no_params:
                                }
 
                                const char *s;
-                               e = Jim_GetOpt_String(goi, &s, NULL);
+                               e = jim_getopt_string(goi, &s, NULL);
                                if (e != JIM_OK)
                                        return e;
                                free(target->gdb_port_override);
@@ -5177,7 +5177,7 @@ no_params:
                                        return JIM_ERR;
                                }
 
-                               e = Jim_GetOpt_Wide(goi, &w);
+                               e = jim_getopt_wide(goi, &w);
                                if (e != JIM_OK)
                                        return e;
                                target->gdb_max_connections = (w < 0) ? CONNECTION_LIMIT_UNLIMITED : (int)w;
@@ -5198,9 +5198,9 @@ no_params:
 static int jim_target_configure(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
 {
        struct command *c = jim_to_command(interp);
-       Jim_GetOptInfo goi;
+       struct jim_getopt_info goi;
 
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        goi.isconfigure = !strcmp(c->name, "configure");
        if (goi.argc < 1) {
                Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
@@ -5241,8 +5241,8 @@ static int jim_target_examine(Jim_Interp *interp, int argc, Jim_Obj *const *argv
 {
        bool allow_defer = false;
 
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc > 1) {
                const char *cmd_name = Jim_GetString(argv[0], NULL);
                Jim_SetResultFormatted(goi.interp,
@@ -5253,7 +5253,7 @@ static int jim_target_examine(Jim_Interp *interp, int argc, Jim_Obj *const *argv
            strcmp(Jim_GetString(argv[1], NULL), "allow-defer") == 0) {
                /* consume it */
                Jim_Obj *obj;
-               int e = Jim_GetOpt_Obj(&goi, &obj);
+               int e = jim_getopt_obj(&goi, &obj);
                if (e != JIM_OK)
                        return e;
                allow_defer = true;
@@ -5337,8 +5337,8 @@ static int jim_target_poll(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
 static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        if (goi.argc != 2) {
                Jim_WrongNumArgs(interp, 0, argv,
@@ -5346,15 +5346,15 @@ static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
                return JIM_ERR;
        }
 
-       Jim_Nvp *n;
-       int e = Jim_GetOpt_Nvp(&goi, nvp_assert, &n);
+       struct jim_nvp *n;
+       int e = jim_getopt_nvp(&goi, nvp_assert, &n);
        if (e != JIM_OK) {
-               Jim_GetOpt_NvpUnknown(&goi, nvp_assert, 1);
+               jim_getopt_nvp_unknown(&goi, nvp_assert, 1);
                return e;
        }
        /* the halt or not param */
        jim_wide a;
-       e = Jim_GetOpt_Wide(&goi, &a);
+       e = jim_getopt_wide(&goi, &a);
        if (e != JIM_OK)
                return e;
 
@@ -5404,8 +5404,8 @@ static int jim_target_halt(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
 static int jim_target_wait_state(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
 
        /* params:  <name>  statename timeoutmsecs */
        if (goi.argc != 2) {
@@ -5415,14 +5415,14 @@ static int jim_target_wait_state(Jim_Interp *interp, int argc, Jim_Obj *const *a
                return JIM_ERR;
        }
 
-       Jim_Nvp *n;
-       int e = Jim_GetOpt_Nvp(&goi, nvp_target_state, &n);
+       struct jim_nvp *n;
+       int e = jim_getopt_nvp(&goi, nvp_target_state, &n);
        if (e != JIM_OK) {
-               Jim_GetOpt_NvpUnknown(&goi, nvp_target_state, 1);
+               jim_getopt_nvp_unknown(&goi, nvp_target_state, 1);
                return e;
        }
        jim_wide a;
-       e = Jim_GetOpt_Wide(&goi, &a);
+       e = jim_getopt_wide(&goi, &a);
        if (e != JIM_OK)
                return e;
        struct command_context *cmd_ctx = current_command_context(interp);
@@ -5457,7 +5457,7 @@ COMMAND_HANDLER(handle_target_event_list)
        command_print(CMD, "------------------------- | "
                        "----------------------------------------");
        while (teap) {
-               Jim_Nvp *opt = Jim_Nvp_value2name_simple(nvp_target_event, teap->event);
+               struct jim_nvp *opt = jim_nvp_value2name_simple(nvp_target_event, teap->event);
                command_print(CMD, "%-25s | %s",
                                opt->name, Jim_GetString(teap->body, NULL));
                teap = teap->next;
@@ -5479,17 +5479,17 @@ static int jim_target_current_state(Jim_Interp *interp, int argc, Jim_Obj *const
 }
 static int jim_target_invoke_event(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc != 1) {
                const char *cmd_name = Jim_GetString(argv[0], NULL);
                Jim_SetResultFormatted(goi.interp, "%s <eventname>", cmd_name);
                return JIM_ERR;
        }
-       Jim_Nvp *n;
-       int e = Jim_GetOpt_Nvp(&goi, nvp_target_event, &n);
+       struct jim_nvp *n;
+       int e = jim_getopt_nvp(&goi, nvp_target_event, &n);
        if (e != JIM_OK) {
-               Jim_GetOpt_NvpUnknown(&goi, nvp_target_event, 1);
+               jim_getopt_nvp_unknown(&goi, nvp_target_event, 1);
                return e;
        }
        struct command_context *cmd_ctx = current_command_context(interp);
@@ -5658,7 +5658,7 @@ static const struct command_registration target_instance_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-static int target_create(Jim_GetOptInfo *goi)
+static int target_create(struct jim_getopt_info *goi)
 {
        Jim_Obj *new_cmd;
        Jim_Cmd *cmd;
@@ -5677,7 +5677,7 @@ static int target_create(Jim_GetOptInfo *goi)
        }
 
        /* COMMAND */
-       Jim_GetOpt_Obj(goi, &new_cmd);
+       jim_getopt_obj(goi, &new_cmd);
        /* does this command exist? */
        cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
        if (cmd) {
@@ -5687,7 +5687,7 @@ static int target_create(Jim_GetOptInfo *goi)
        }
 
        /* TYPE */
-       e = Jim_GetOpt_String(goi, &cp, NULL);
+       e = jim_getopt_string(goi, &cp, NULL);
        if (e != JIM_OK)
                return e;
        struct transport *tr = get_current_transport();
@@ -5991,8 +5991,8 @@ static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
 static int jim_target_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
-       Jim_GetOptInfo goi;
-       Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+       struct jim_getopt_info goi;
+       jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
        if (goi.argc < 3) {
                Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
                        "<name> <target_type> [<target_options> ...]");
index 1948121fa8a03996cf556e36f3337e00e7e24055..cc51c0401659405d2307f79766673126f22f7101 100644 (file)
@@ -210,11 +210,11 @@ struct target_type {
        /* called for various config parameters */
        /* returns JIM_CONTINUE - if option not understood */
        /* otherwise: JIM_OK, or JIM_ERR, */
-       int (*target_jim_configure)(struct target *target, Jim_GetOptInfo *goi);
+       int (*target_jim_configure)(struct target *target, struct jim_getopt_info *goi);
 
        /* target commands specifically handled by the target */
        /* returns JIM_OK, or JIM_ERR, or JIM_CONTINUE - if option not understood */
-       int (*target_jim_commands)(struct target *target, Jim_GetOptInfo *goi);
+       int (*target_jim_commands)(struct target *target, struct jim_getopt_info *goi);
 
        /**
         * This method is used to perform target setup that requires

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)