summaryrefslogtreecommitdiffstats
path: root/commands/mem.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-04-17 10:46:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-04-17 12:56:44 +0200
commitd91b7772c48fa47bbd73857471e91a5d0cc8b876 (patch)
tree79a8ef7aabddd6e46ebf14d3c8a1e91754b99844 /commands/mem.c
parent59dbb4fe2c70fc79497f486c55c5fa785299b1c1 (diff)
downloadbarebox-d91b7772c48fa47bbd73857471e91a5d0cc8b876.tar.gz
barebox-d91b7772c48fa47bbd73857471e91a5d0cc8b876.tar.xz
memory commands: export common functions
The memory commands all use open_and_lseek and mem_parse_options. Export them to be able to split the memory commands into separate files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/mem.c')
-rw-r--r--commands/mem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/commands/mem.c b/commands/mem.c
index 51aa04daa2..f25c6b6256 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -112,7 +112,7 @@ int memory_display(char *addr, loff_t offs, ulong nbytes, int size, int swab)
return 0;
}
-static int open_and_lseek(const char *filename, int mode, loff_t pos)
+int open_and_lseek(const char *filename, int mode, loff_t pos)
{
int fd, ret;
@@ -135,7 +135,11 @@ static int open_and_lseek(const char *filename, int mode, loff_t pos)
return fd;
}
-static int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
+/*
+ * Common function for parsing options for the 'md', 'mw', 'memcpy', 'memcmp'
+ * commands.
+ */
+int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
char **sourcefile, char **destfile, int *swab)
{
int opt;