-static char* openocd_jim_fgets(char *s, int size, void *cookie)
-{
- /* not supported */
- errno = ENOTSUP;
- return NULL;
-}
-
-void add_jim(const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help)
-{
- Jim_CreateCommand(interp, name, cmd, NULL, NULL);
- /* FIX!!! add scheme to accumulate help! */
-
-}
-
-void initJim(void)
-{
- Jim_CreateCommand(interp, "openocd", Jim_Command_openocd, NULL, NULL);
- Jim_CreateCommand(interp, "openocd_throw", Jim_Command_openocd_throw, NULL, NULL);
- Jim_CreateCommand(interp, "find", Jim_Command_find, NULL, NULL);
- Jim_CreateCommand(interp, "echo", Jim_Command_echo, NULL, NULL);
- Jim_CreateCommand(interp, "mem2array", Jim_Command_mem2array, NULL, NULL );
- Jim_CreateCommand(interp, "array2mem", Jim_Command_array2mem, NULL, NULL );
-
- /* Set Jim's STDIO */
- interp->cookie_stdin = NULL;
- interp->cookie_stdout = NULL;
- interp->cookie_stderr = NULL;
- interp->cb_fwrite = openocd_jim_fwrite;
- interp->cb_fread = openocd_jim_fread ;
- interp->cb_vfprintf = openocd_jim_vfprintf;
- interp->cb_fflush = openocd_jim_fflush;
- interp->cb_fgets = openocd_jim_fgets;
-}
-
-extern const unsigned char filedata_startup[];
-
-/* after command line parsing */
-void initJim2(void)
-{
- if (Jim_Eval(interp, filedata_startup)==JIM_ERR)
- {
- LOG_ERROR("Failed to run startup.tcl (embedded into OpenOCD compile time)");
- Jim_PrintErrorMessage(interp);
- exit(-1);
- }