summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-01-04 10:21:11 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2010-02-01 17:25:32 +0100
commit922bb41a47e390ee3367fc41081d4470cac1202d (patch)
treea0fb507db0cb768f2d77adf26d6be5c9057d2187 /common
parent88351d2e4bcf25fef3818c951e89180c764389ed (diff)
downloadbarebox-922bb41a47e390ee3367fc41081d4470cac1202d.tar.gz
remove typedef cmd_tbl_t and replace it with struct command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/command.c26
-rw-r--r--common/complete.c2
-rw-r--r--common/hush.c6
-rw-r--r--common/module.c4
4 files changed, 19 insertions, 19 deletions
diff --git a/common/command.c b/common/command.c
index e21e80d..8ed1072 100644
--- a/common/command.c
+++ b/common/command.c
@@ -44,7 +44,7 @@ EXPORT_SYMBOL(command_list);
#ifdef CONFIG_SHELL_HUSH
-static int do_exit (cmd_tbl_t *cmdtp, int argc, char *argv[])
+static int do_exit(struct command *cmdtp, int argc, char *argv[])
{
int r;
@@ -62,7 +62,7 @@ BAREBOX_CMD_END
#endif
-void barebox_cmd_usage(cmd_tbl_t *cmdtp)
+void barebox_cmd_usage(struct command *cmdtp)
{
#ifdef CONFIG_LONGHELP
/* found - print (long) help info */
@@ -85,15 +85,15 @@ EXPORT_SYMBOL(barebox_cmd_usage);
static int compare(struct list_head *a, struct list_head *b)
{
- char *na = (char*)list_entry(a, cmd_tbl_t, list)->name;
- char *nb = (char*)list_entry(b, cmd_tbl_t, list)->name;
+ char *na = (char*)list_entry(a, struct command, list)->name;
+ char *nb = (char*)list_entry(b, struct command, list)->name;
return strcmp(na, nb);
}
int execute_command(int argc, char **argv)
{
- cmd_tbl_t *cmdtp;
+ struct command *cmdtp;
int ret;
getopt_reset();
@@ -117,7 +117,7 @@ int execute_command(int argc, char **argv)
}
}
-int register_command(cmd_tbl_t *cmd)
+int register_command(struct command *cmd)
{
/*
* We do not check if the command already exists.
@@ -133,9 +133,9 @@ int register_command(cmd_tbl_t *cmd)
char **aliases = (char**)cmd->aliases;
while(*aliases) {
char *usage = "alias for ";
- cmd_tbl_t *c = xzalloc(sizeof(cmd_tbl_t));
+ struct command *c = xzalloc(sizeof(struct command));
- memcpy(c, cmd, sizeof(cmd_tbl_t));
+ memcpy(c, cmd, sizeof(struct command));
c->name = *aliases;
c->usage = xmalloc(strlen(usage) + strlen(cmd->name) + 1);
@@ -156,15 +156,15 @@ EXPORT_SYMBOL(register_command);
/*
* find command table entry for a command
*/
-cmd_tbl_t *find_cmd (const char *cmd)
+struct command *find_cmd (const char *cmd)
{
- cmd_tbl_t *cmdtp;
- cmd_tbl_t *cmdtp_temp = &__barebox_cmd_start; /*Init value */
+ struct command *cmdtp;
+ struct command *cmdtp_temp = &__barebox_cmd_start; /*Init value */
int len;
int n_found = 0;
len = strlen (cmd);
- cmdtp = list_entry(&command_list, cmd_tbl_t, list);
+ cmdtp = list_entry(&command_list, struct command, list);
for_each_command(cmdtp) {
if (strncmp (cmd, cmdtp->name, len) == 0) {
@@ -191,7 +191,7 @@ cmd_tbl_t *find_cmd (const char *cmd)
*/
static int init_command_list(void)
{
- cmd_tbl_t *cmdtp;
+ struct command *cmdtp;
for (cmdtp = &__barebox_cmd_start;
cmdtp != &__barebox_cmd_end;
diff --git a/common/complete.c b/common/complete.c
index 87435ee..46ba871 100644
--- a/common/complete.c
+++ b/common/complete.c
@@ -69,7 +69,7 @@ out:
static int command_complete(struct string_list *sl, char *instr)
{
- cmd_tbl_t *cmdtp;
+ struct command *cmdtp;
char cmd[128];
for_each_command(cmdtp) {
diff --git a/common/hush.c b/common/hush.c
index e7a13c2..cf6704b 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -122,7 +122,7 @@
#include <glob.h>
/*cmd_boot.c*/
-extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* do_bootd */
+extern int do_bootd(struct command *cmdtp, int flag, int argc, char *argv[]); /* do_bootd */
#define SPECIAL_VAR_SYMBOL 03
@@ -1583,7 +1583,7 @@ int run_shell(void)
return rcode;
}
-static int do_sh(cmd_tbl_t *cmdtp, int argc, char *argv[])
+static int do_sh(struct command *cmdtp, int argc, char *argv[])
{
if (argc < 2)
return COMMAND_ERROR_USAGE;
@@ -1602,7 +1602,7 @@ BAREBOX_CMD_START(sh)
BAREBOX_CMD_HELP(cmd_sh_help)
BAREBOX_CMD_END
-static int do_source(cmd_tbl_t *cmdtp, int argc, char *argv[])
+static int do_source(struct command *cmdtp, int argc, char *argv[])
{
if (argc < 2)
return COMMAND_ERROR_USAGE;
diff --git a/common/module.c b/common/module.c
index cedd702..29f3eb7 100644
--- a/common/module.c
+++ b/common/module.c
@@ -297,8 +297,8 @@ struct module * load_module(void *mod_image, unsigned long len)
#ifdef CONFIG_COMMAND
cmdindex = find_sec(ehdr, sechdrs, secstrings, ".barebox_cmd");
if (cmdindex) {
- cmd_tbl_t *cmd = (cmd_tbl_t *)sechdrs[cmdindex].sh_addr;
- for (i = 0; i < sechdrs[cmdindex].sh_size / sizeof(cmd_tbl_t); i++) {
+ struct command *cmd =(struct command *)sechdrs[cmdindex].sh_addr;
+ for (i = 0; i < sechdrs[cmdindex].sh_size / sizeof(struct command); i++) {
register_command(cmd);
cmd++;
}