* oyvind.harboe@zylin.com *
* *
* Copyright (C) 2008, Duane Ellis *
* oyvind.harboe@zylin.com *
* *
* Copyright (C) 2008, Duane Ellis *
/* we now need to add an overrideable proc */
const char *override_name = alloc_printf("proc %s%s%s {args} {if {[catch {eval ocd_%s%s%s $args}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
/* we now need to add an overrideable proc */
const char *override_name = alloc_printf("proc %s%s%s {args} {if {[catch {eval ocd_%s%s%s $args}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
- Jim_Eval_Named(interp, override_name, __THIS__FILE__, __LINE__ );
+ Jim_Eval_Named(interp, override_name, __THIS__FILE__, __LINE__);
- if ( context && context->output_handler && data ){
- context->output_handler( context, data );
+ if (context && context->output_handler && data) {
+ context->output_handler(context, data);
int run_command(command_context_t *context, command_t *c, char *words[], int num_words)
{
int start_word = 0;
int run_command(command_context_t *context, command_t *c, char *words[], int num_words)
{
int start_word = 0;
{
/* Config commands can not run after the config stage */
LOG_ERROR("Command '%s' only runs during configuration stage", c->name);
{
/* Config commands can not run after the config stage */
LOG_ERROR("Command '%s' only runs during configuration stage", c->name);
retcode = Jim_SetAssocData(interp, "retval", NULL, &retval);
if (retcode == JIM_OK)
{
retcode = Jim_SetAssocData(interp, "retval", NULL, &retval);
if (retcode == JIM_OK)
{
- retcode = Jim_Eval_Named(interp, line, __THIS__FILE__, __LINE__ );
+ retcode = Jim_Eval_Named(interp, line, __THIS__FILE__, __LINE__);
- retcode = Jim_Eval_Named(interp, str, __THIS__FILE__, __LINE__ );
+ retcode = Jim_Eval_Named(interp, str, __THIS__FILE__, __LINE__);
/* WinXX - is generic, the forward
* looking problem is this:
*
/* WinXX - is generic, the forward
* looking problem is this:
*
- Jim_SetGlobalVariableStr( interp, "ocd_HOSTOS", Jim_NewStringObj( interp, HostOs , strlen(HostOs)) );
+ Jim_SetGlobalVariableStr(interp, "ocd_HOSTOS", Jim_NewStringObj(interp, HostOs , strlen(HostOs)));
Jim_CreateCommand(interp, "ocd_find", jim_find, NULL, NULL);
Jim_CreateCommand(interp, "echo", jim_echo, NULL, NULL);
Jim_CreateCommand(interp, "ocd_find", jim_find, NULL, NULL);
Jim_CreateCommand(interp, "echo", jim_echo, NULL, NULL);
return ERROR_OK; \
}
DEFINE_PARSE_NUM_TYPE(_ulong, unsigned long , strtoul, 0, ULONG_MAX)
return ERROR_OK; \
}
DEFINE_PARSE_NUM_TYPE(_ulong, unsigned long , strtoul, 0, ULONG_MAX)
#define DEFINE_PARSE_ULONG(name, type, min, max) \
DEFINE_PARSE_WRAPPER(name, type, min, max, unsigned long, _ulong)
#define DEFINE_PARSE_ULONG(name, type, min, max) \
DEFINE_PARSE_WRAPPER(name, type, min, max, unsigned long, _ulong)