# Convert .tcl to cfile
startup_tcl.c: startup.tcl $(BIN2C)
- $(BIN2C) startup_tcl < $< > $@ || rm -f $@
+ $(BIN2C) openocd_startup_tcl < $< > $@ || rm -f $@
# add startup_tcl.c to make clean list
CLEANFILES = startup.tcl startup_tcl.c
}
-struct command_context* command_init()
+struct command_context* command_init(const char *startup_tcl)
{
struct command_context* context = malloc(sizeof(struct command_context));
- extern const char startup_tcl[];
const char *HostOs;
context->mode = COMMAND_EXEC;
int command_context_mode(struct command_context *context, enum command_mode mode);
-struct command_context* command_init(void);
+/**
+ * Creates a new command context using the startup TCL provided.
+ */
+struct command_context* command_init(const char *startup_tcl);
int command_done(struct command_context *context);
void command_print(struct command_context *context, const char *format, ...)
#include "config.h"
#endif
+#include "openocd.h"
#include "jtag.h"
#include "configuration.h"
#include "xsvf.h"
{
struct command_context *cmd_ctx;
- global_cmd_ctx = cmd_ctx = command_init();
+ global_cmd_ctx = cmd_ctx = command_init(openocd_startup_tcl);
register_command(cmd_ctx, NULL, "version", handle_version_command,
COMMAND_EXEC, "show OpenOCD version");
/// used by the server_loop() function in src/server/server.c
void openocd_sleep_postlude(void);
+/// provides a hard-coded command environment setup
+extern const char *openocd_startup_tcl;
+
#endif