for (i = 0; i < argc; i++)
{
int len;
- char *w=Jim_GetString(argv[i], &len);
+ const char *w=Jim_GetString(argv[i], &len);
if (*w=='#')
{
/* hit an end of line comment */
size_t nbytes;
const char *ptr;
Jim_Interp *interp;
- command_context_t *context;
/* make it a char easier to read code */
ptr = _ptr;
return 0;
}
- context = Jim_GetAssocData(interp, "context");
- if (context == NULL)
- {
- LOG_ERROR("openocd_jim_fwrite: no command context");
- /* TODO: Where should this go? */
- return n;
- }
-
/* do we have to chunk it? */
if (ptr[nbytes] == 0)
{
/* no it is a C style string */
- command_output_text(context, ptr);
+ LOG_USER_N("%s", ptr);
return strlen(ptr);
}
/* GRR we must chunk - not null terminated */
/* terminate it */
chunk[n] = 0;
/* output it */
- command_output_text(context, chunk);
+ LOG_USER_N("%s", chunk);
ptr += x;
nbytes -= x;
}
char *cp;
int n;
Jim_Interp *interp;
- command_context_t *context;
n = -1;
interp = cookie;
if (interp == NULL)
return n;
- context = Jim_GetAssocData(interp, "context");
- if (context == NULL)
- {
- LOG_ERROR("openocd_jim_vfprintf: no command context");
- return n;
- }
-
cp = alloc_vprintf(fmt, ap);
if (cp)
{
- command_output_text(context, cp);
+ LOG_USER_N("%s", cp);
n = strlen(cp);
free(cp);
}
* error codes < 100
*/
#define ERROR_OK (0)
-#define ERROR_INVALID_ARGUMENTS (-1)
+#define ERROR_INVALID_ARGUMENTS ERROR_COMMAND_SYNTAX_ERROR
#define ERROR_NO_CONFIG_FILE (-2)
#define ERROR_BUF_TOO_SMALL (-3)
-/* see "Error:" message for meaningful message to the user. The caller should
+/* see "Error:" log entry for meaningful message to the user. The caller should
* make no assumptions about what went wrong and try to handle the problem.
*/
#define ERROR_FAIL (-4)