summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-18 11:38:23 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-18 11:38:23 +0000
commit60ba4476dfef5fae48b85d54e376a3ca27442113 (patch)
treed830eeb18a83b51cb23f3fb672cb0587c4d92804 /src/helper
parent722fcb8d61e98be3ec2be73f26e8c9ab2136d70c (diff)
downloadopenocd+libswd-60ba4476dfef5fae48b85d54e376a3ca27442113.tar.gz
openocd+libswd-60ba4476dfef5fae48b85d54e376a3ca27442113.tar.bz2
openocd+libswd-60ba4476dfef5fae48b85d54e376a3ca27442113.tar.xz
openocd+libswd-60ba4476dfef5fae48b85d54e376a3ca27442113.zip
- fix incorrectly registered function openocd_array2mem
- removed unused variables - reformatted lpc288x.[ch] - fixed helper/Makefile.am dependencies - add correct svn props to added files git-svn-id: svn://svn.berlios.de/openocd/trunk@829 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/Makefile.am14
-rw-r--r--src/helper/command.c15
-rw-r--r--src/helper/command.h2
-rw-r--r--src/helper/jim.h2
4 files changed, 12 insertions, 21 deletions
diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am
index 2ba0a563..630fbf50 100644
--- a/src/helper/Makefile.am
+++ b/src/helper/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = -I$(top_srcdir)/src $(all_includes)
+INCLUDES = -I$(top_srcdir)/src $(all_includes) -I$(top_srcdir)/src/target
METASOURCES = AUTO
AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" -DPKGLIBDIR=\"$(pkglibdir)\" @CPPFLAGS@
noinst_LIBRARIES = libhelper.a
@@ -10,20 +10,18 @@ CONFIGFILES = options.c jim.c
endif
libhelper_a_SOURCES = binarybuffer.c $(CONFIGFILES) configuration.c log.c command.c time_support.c \
- replacements.c fileio.c
-noinst_HEADERS = binarybuffer.h configuration.h types.h log.h command.h \
- time_support.h replacements.h fileio.h \
- jim.h
+ replacements.c fileio.c startup_tcl.c
-libhelper_a_SOURCES += startup_tcl.c
+noinst_HEADERS = binarybuffer.h configuration.h types.h log.h command.h \
+ time_support.h replacements.h fileio.h jim.h
noinst_PROGRAMS = bin2char
bin2char_SOURCES = bin2char.c
# Convert .tcl to cfile
-startup_tcl.c: bin2char startup.tcl
- ./bin2char startup_tcl < $(srcdir)/startup.tcl > startup_tcl.c
+startup_tcl.c: startup.tcl bin2char$(EXEEXT)
+ ./bin2char$(EXEEXT) startup_tcl < $(srcdir)/$< > $@
# add startup_tcl.c to make clean list
CLEANFILES = startup_tcl.c
diff --git a/src/helper/command.c b/src/helper/command.c
index 7c5d77d6..234b64ef 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -25,8 +25,9 @@
#endif
#include "replacements.h"
-
+#include "target.h"
#include "command.h"
+#include "configuration.h"
#include "log.h"
#include "time_support.h"
@@ -44,6 +45,9 @@ Jim_Interp *interp = NULL;
int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+
+int run_command(command_context_t *context, command_t *c, char *words[], int num_words);
+
static void tcl_output(void *privData, const char *file, int line, const char *function, const char *string)
{
Jim_Obj *tclOutput=(Jim_Obj *)privData;
@@ -178,7 +182,6 @@ command_t* register_command(command_context_t *context, command_t *parent, char
Jim_CreateCommand(interp, full_name, script_command, c, NULL);
free((void *)full_name);
-
/* accumulate help text in Tcl helptext list. */
Jim_Obj *helptext=Jim_GetGlobalVariableStr(interp, "ocd_helptext", JIM_ERRMSG);
if (Jim_IsShared(helptext))
@@ -207,7 +210,6 @@ int unregister_all_commands(command_context_t *context)
if (context == NULL)
return ERROR_OK;
-
while(NULL != context->commands)
{
c = context->commands;
@@ -277,7 +279,6 @@ int unregister_command(command_context_t *context, char *name)
return ERROR_OK;
}
-
void command_output_text(command_context_t *context, const char *data)
{
if( context && context->output_handler && data ){
@@ -435,7 +436,6 @@ int command_run_line(command_context_t *context, char *line)
return retval;
}
-
int command_run_linef(command_context_t *context, char *format, ...)
{
int retval=ERROR_FAIL;
@@ -451,8 +451,6 @@ int command_run_linef(command_context_t *context, char *format, ...)
return retval;
}
-
-
void command_set_output_handler(command_context_t* context, int (*output_handler)(struct command_context_s *context, const char* line), void *priv)
{
context->output_handler = output_handler;
@@ -476,7 +474,6 @@ int command_done(command_context_t *context)
return ERROR_OK;
}
-
/* find full path to file */
static int jim_find(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
@@ -502,8 +499,6 @@ static int jim_echo(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return JIM_OK;
}
-
-
static size_t openocd_jim_fwrite(const void *_ptr, size_t size, size_t n, void *cookie)
{
size_t nbytes;
diff --git a/src/helper/command.h b/src/helper/command.h
index 9aa66078..0ef313ad 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -76,14 +76,12 @@ extern int command_run_line(command_context_t *context, char *line);
extern int command_run_linef(command_context_t *context, char *format, ...);
extern void command_output_text(command_context_t *context, const char *data);
-
#define ERROR_COMMAND_CLOSE_CONNECTION (-600)
#define ERROR_COMMAND_SYNTAX_ERROR (-601)
#define ERROR_COMMAND_NOTFOUND (-602)
extern int fast_and_dangerous;
-
/* Integrate the JIM TCL interpretor into the command processing. */
#include <stdarg.h>
#ifdef __ECOS
diff --git a/src/helper/jim.h b/src/helper/jim.h
index 9e9c7dc5..caba5ae1 100644
--- a/src/helper/jim.h
+++ b/src/helper/jim.h
@@ -970,7 +970,7 @@ static void Jim_InitExtension(Jim_Interp *interp)
#ifdef JIM_EMBEDDED
Jim_Interp *ExportedJimCreateInterp(void);
-static void Jim_InitEmbedded(void) {
+static inline void Jim_InitEmbedded(void) {
Jim_Interp *i = ExportedJimCreateInterp();
Jim_InitExtension(i);
Jim_FreeInterp(i);