summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-15 05:57:37 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-17 11:40:06 -0800
commit2861877b32a7a2f4022a1c3d9b66c9b4879878ac (patch)
treed0f25f82899181b13241b2147d6ad7c72765542c /src/helper
parent23402315ce01071f30d7ec0c5ca7563ce41f1cc6 (diff)
downloadopenocd_libswd-2861877b32a7a2f4022a1c3d9b66c9b4879878ac.tar.gz
openocd_libswd-2861877b32a7a2f4022a1c3d9b66c9b4879878ac.tar.bz2
openocd_libswd-2861877b32a7a2f4022a1c3d9b66c9b4879878ac.tar.xz
openocd_libswd-2861877b32a7a2f4022a1c3d9b66c9b4879878ac.zip
command_handler: change 'cmd_ctx' to CMD_CTX
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/command.h2
-rw-r--r--src/helper/ioutil.c26
-rw-r--r--src/helper/log.c2
3 files changed, 15 insertions, 15 deletions
diff --git a/src/helper/command.h b/src/helper/command.h
index 3e366275..74849646 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -244,7 +244,7 @@ DECLARE_PARSE_WRAPPER(_s8, int8_t);
do { \
int retval = parse_##type(in, &(out)); \
if (ERROR_OK != retval) { \
- command_print(cmd_ctx, stringify(out) \
+ command_print(CMD_CTX, stringify(out) \
" option value ('%s') is not valid", in); \
return retval; \
} \
diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c
index 3fc1a966..3fb3014a 100644
--- a/src/helper/ioutil.c
+++ b/src/helper/ioutil.c
@@ -61,13 +61,13 @@ COMMAND_HANDLER(handle_rm_command)
{
if (CMD_ARGC != 1)
{
- command_print(cmd_ctx, "rm <filename>");
+ command_print(CMD_CTX, "rm <filename>");
return ERROR_INVALID_ARGUMENTS;
}
if (unlink(CMD_ARGV[0]) != 0)
{
- command_print(cmd_ctx, "failed: %d", errno);
+ command_print(CMD_CTX, "failed: %d", errno);
}
return ERROR_OK;
@@ -137,7 +137,7 @@ COMMAND_HANDLER(handle_cat_command)
{
if (CMD_ARGC != 1)
{
- command_print(cmd_ctx, "cat <filename>");
+ command_print(CMD_CTX, "cat <filename>");
return ERROR_INVALID_ARGUMENTS;
}
@@ -148,12 +148,12 @@ COMMAND_HANDLER(handle_cat_command)
int retval = loadFile(CMD_ARGV[0], &data, &len);
if (retval == ERROR_OK)
{
- command_print(cmd_ctx, "%s", (char *)data);
+ command_print(CMD_CTX, "%s", (char *)data);
free(data);
}
else
{
- command_print(cmd_ctx, "%s not found %d", CMD_ARGV[0], retval);
+ command_print(CMD_CTX, "%s not found %d", CMD_ARGV[0], retval);
}
return ERROR_OK;
@@ -163,7 +163,7 @@ COMMAND_HANDLER(handle_trunc_command)
{
if (CMD_ARGC != 1)
{
- command_print(cmd_ctx, "trunc <filename>");
+ command_print(CMD_CTX, "trunc <filename>");
return ERROR_INVALID_ARGUMENTS;
}
@@ -182,7 +182,7 @@ COMMAND_HANDLER(handle_meminfo_command)
if (CMD_ARGC != 0)
{
- command_print(cmd_ctx, "meminfo");
+ command_print(CMD_CTX, "meminfo");
return ERROR_INVALID_ARGUMENTS;
}
@@ -190,11 +190,11 @@ COMMAND_HANDLER(handle_meminfo_command)
if (prev > 0)
{
- command_print(cmd_ctx, "Diff: %d", prev - info.fordblks);
+ command_print(CMD_CTX, "Diff: %d", prev - info.fordblks);
}
prev = info.fordblks;
- command_print(cmd_ctx, "Available ram: %d", info.fordblks);
+ command_print(CMD_CTX, "Available ram: %d", info.fordblks);
return ERROR_OK;
}
@@ -204,7 +204,7 @@ COMMAND_HANDLER(handle_append_command)
{
if (CMD_ARGC < 1)
{
- command_print(cmd_ctx,
+ command_print(CMD_CTX,
"append <filename> [<string1>, [<string2>, ...]]");
return ERROR_INVALID_ARGUMENTS;
}
@@ -276,7 +276,7 @@ COMMAND_HANDLER(handle_cp_command)
break;
}
- command_print(cmd_ctx, "%zu", len - pos);
+ command_print(CMD_CTX, "%zu", len - pos);
pos += chunk;
@@ -286,10 +286,10 @@ COMMAND_HANDLER(handle_cp_command)
if (retval == ERROR_OK)
{
- command_print(cmd_ctx, "Copied %s to %s", CMD_ARGV[0], CMD_ARGV[1]);
+ command_print(CMD_CTX, "Copied %s to %s", CMD_ARGV[0], CMD_ARGV[1]);
} else
{
- command_print(cmd_ctx, "Failed: %d", retval);
+ command_print(CMD_CTX, "Failed: %d", retval);
}
if (data != NULL)
diff --git a/src/helper/log.c b/src/helper/log.c
index 0e04c8e1..caaed423 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -296,7 +296,7 @@ COMMAND_HANDLER(handle_debug_level_command)
}
}
- command_print(cmd_ctx, "debug_level: %i", debug_level);
+ command_print(CMD_CTX, "debug_level: %i", debug_level);
return ERROR_OK;
}