init and deinit
This commit is contained in:
15
bs/init.c
15
bs/init.c
@@ -39,7 +39,8 @@ jtag_core * bsexp_init(void)
|
||||
/* initialize the JTAG library */
|
||||
jc = jtagcore_init();
|
||||
|
||||
if (NULL == jc) goto end;
|
||||
if (NULL == jc)
|
||||
goto end;
|
||||
|
||||
jc->envvar = (void *)initEnv(NULL, NULL);
|
||||
|
||||
@@ -67,10 +68,18 @@ jtag_core * bsexp_init(void)
|
||||
{
|
||||
jtagcore_set_logs_file(jc, jtagcore_getEnvVar(jc, "LOG_MESSAGES_FILE_OUTPUT", NULL));
|
||||
}
|
||||
|
||||
deinit_script(sctx);
|
||||
}
|
||||
deinit_script(sctx);
|
||||
|
||||
end:
|
||||
return jc;
|
||||
}
|
||||
|
||||
void bsexp_deinit(jtag_core *jc)
|
||||
{
|
||||
if (NULL == jc) return;
|
||||
|
||||
envvar_entry *env = jc->envvar;
|
||||
deinitEnv(env);
|
||||
jtagcore_deinit(jc);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _BS_INIT_H
|
||||
#define _BS_INIT_H
|
||||
|
||||
#include "jtag_core/jtag_core.h"
|
||||
#include "config/bs_defines.h"
|
||||
|
||||
typedef int (*command_call)(jtag_core *jc, int argc, char *argv[]);
|
||||
|
||||
@@ -13,5 +13,6 @@ typedef struct {
|
||||
extern Command commands[];
|
||||
|
||||
jtag_core *bsexp_init(void);
|
||||
void bsexp_deinit(jtag_core *jc);
|
||||
|
||||
#endif
|
||||
@@ -47,29 +47,6 @@ jtag_core * jtagcore_init()
|
||||
if ( jc )
|
||||
{
|
||||
memset( jc, 0, sizeof(jtag_core) );
|
||||
/*
|
||||
jc->envvar = (void*)initEnv(NULL, NULL);
|
||||
|
||||
jtagcore_setEnvVar( jc, "LIBVERSION", "v"jtag_core_VERSION);
|
||||
|
||||
sctx = jtagcore_initScript(jc);
|
||||
|
||||
jtagcore_execScriptRam( sctx, config_script, config_script_len );
|
||||
|
||||
jtagcore_execScriptFile( sctx, "config.script" );
|
||||
|
||||
if(jtagcore_getEnvVar( jc, "LOG_MESSAGES_FILTER_LEVEL", NULL))
|
||||
{
|
||||
jtagcore_set_logs_level( jc, jtagcore_getEnvVarValue( jc, "LOG_MESSAGES_FILTER_LEVEL") );
|
||||
}
|
||||
|
||||
if(jtagcore_getEnvVar( jc, "LOG_MESSAGES_FILE_OUTPUT", NULL))
|
||||
{
|
||||
jtagcore_set_logs_file( jc, jtagcore_getEnvVar( jc, "LOG_MESSAGES_FILE_OUTPUT", NULL) );
|
||||
}
|
||||
|
||||
jtagcore_deinitScript(sctx);
|
||||
*/
|
||||
}
|
||||
|
||||
return jc;
|
||||
|
||||
Reference in New Issue
Block a user