code refactoring
This commit is contained in:
@@ -31,11 +31,9 @@
|
||||
|
||||
#define MAX_PATH 256
|
||||
|
||||
#include "drivers/drv_loader.h"
|
||||
#include "jtag_core/jtag_core_internal.h"
|
||||
#include "script.h"
|
||||
#include "jtag_core/jtag_core.h"
|
||||
#include "jtag_core/version.h"
|
||||
#include "config/version.h"
|
||||
|
||||
#include "bsdl_parser/bsdl_loader.h"
|
||||
#include "os_interface/os_interface.h"
|
||||
@@ -61,7 +59,7 @@ typedef struct label_list_
|
||||
|
||||
extern cmd_list script_commands_list[];
|
||||
|
||||
static int dummy_script_printf(void * ctx, int MSGTYPE, char * string, ... )
|
||||
static int dummy_script_printf(script_ctx * ctx, int MSGTYPE, char * string, ... )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -2557,43 +2555,6 @@ script_ctx * jtagcore_initScript(jtag_core * jc)
|
||||
return init_script((void*)jc,0x00000000,(void*)jc->envvar);
|
||||
}
|
||||
|
||||
void jtagcore_setScriptOutputFunc( script_ctx * ctx, SCRIPT_PRINTF_FUNC ext_printf )
|
||||
{
|
||||
setOutputFunc_script(ctx, ext_printf);
|
||||
}
|
||||
|
||||
int jtagcore_execScriptLine( script_ctx * ctx, char * line )
|
||||
{
|
||||
if(!ctx)
|
||||
return JTAG_CORE_INTERNAL_ERROR;
|
||||
|
||||
return execute_line_script( ctx, line );
|
||||
}
|
||||
|
||||
int jtagcore_execScriptFile( script_ctx * ctx, char * script_path )
|
||||
{
|
||||
if(!ctx)
|
||||
return JTAG_CORE_INTERNAL_ERROR;
|
||||
|
||||
return execute_file_script( ctx, script_path );
|
||||
}
|
||||
|
||||
int jtagcore_execScriptRam( script_ctx * ctx, unsigned char * script_buffer, int buffersize )
|
||||
{
|
||||
if(!ctx)
|
||||
return JTAG_CORE_INTERNAL_ERROR;
|
||||
|
||||
return execute_ram_script( ctx, script_buffer, buffersize );
|
||||
}
|
||||
|
||||
script_ctx * jtagcore_deinitScript(script_ctx * ctx)
|
||||
{
|
||||
if(!ctx)
|
||||
return NULL;
|
||||
|
||||
return deinit_script(ctx);
|
||||
}
|
||||
|
||||
int jtagcore_savePinsStateScript( jtag_core * jc, int device, char * script_path )
|
||||
{
|
||||
FILE * f;
|
||||
|
||||
Reference in New Issue
Block a user