summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-27 13:37:04 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-27 13:37:52 +0100
commit43b09a9865760ec7ae7fcd0ef75842f3a201d5a7 (patch)
tree227f6f240b1fedf6b48a92714143143b87515969
parentsmptests/smpmrsp01: Use busy waits (diff)
downloadrtems-43b09a9865760ec7ae7fcd0ef75842f3a201d5a7.tar.bz2
shell: Make mv, cp and rm usable for applications
close #2030
-rw-r--r--cpukit/libmisc/shell/internal.h3
-rw-r--r--cpukit/libmisc/shell/main_mv.c2
-rw-r--r--cpukit/libmisc/shell/shell.h7
-rw-r--r--doc/shell/file.t12
4 files changed, 14 insertions, 10 deletions
diff --git a/cpukit/libmisc/shell/internal.h b/cpukit/libmisc/shell/internal.h
index 0187e5f013..ad51588b15 100644
--- a/cpukit/libmisc/shell/internal.h
+++ b/cpukit/libmisc/shell/internal.h
@@ -39,9 +39,6 @@ extern void rtems_shell_print_heap_info(
extern void rtems_shell_print_unified_work_area_message(void);
-extern int rtems_shell_main_rm(int argc, char *argv[]);
-extern int rtems_shell_main_cp(int argc, char *argv[]);
-
#include <sys/types.h>
extern void strmode(mode_t mode, char *p);
diff --git a/cpukit/libmisc/shell/main_mv.c b/cpukit/libmisc/shell/main_mv.c
index ed5de3fbba..9d6a3c2426 100644
--- a/cpukit/libmisc/shell/main_mv.c
+++ b/cpukit/libmisc/shell/main_mv.c
@@ -116,7 +116,7 @@ rtems_shell_mv_exit (rtems_shell_mv_globals* globals, int code)
const char *user_from_uid(uid_t uid, int nouser);
char *group_from_gid(gid_t gid, int nogroup);
-static int
+int
rtems_shell_main_mv(int argc, char *argv[])
{
rtems_shell_mv_globals mv_globals;
diff --git a/cpukit/libmisc/shell/shell.h b/cpukit/libmisc/shell/shell.h
index 657df777e5..ea8532d332 100644
--- a/cpukit/libmisc/shell/shell.h
+++ b/cpukit/libmisc/shell/shell.h
@@ -324,6 +324,13 @@ extern rtems_status_code rtems_shell_wait_for_input(
extern int rtems_shell_main_monitor(int argc, char **argv);
+/*
+ * Provide these commands for application use, as their implementation
+ * is tedious.
+ */
+int rtems_shell_main_mv(int argc, char *argv[]);
+int rtems_shell_main_cp(int argc, char *argv[]);
+int rtems_shell_main_rm(int argc, char *argv[]);
#ifdef __cplusplus
}
diff --git a/doc/shell/file.t b/doc/shell/file.t
index bda3d3d635..dc482a4df6 100644
--- a/doc/shell/file.t
+++ b/doc/shell/file.t
@@ -695,13 +695,13 @@ shell commands have been configured.
@subheading PROGRAMMING INFORMATION:
-@findex rtems_shell_rtems_main_cp
+@findex rtems_shell_main_cp
The @code{cp} command is implemented by a C language function which
has the following prototype:
@example
-int rtems_shell_rtems_main_cp(
+int rtems_shell_main_cp(
int argc,
char **argv
);
@@ -2460,13 +2460,13 @@ shell commands have been configured.
@subheading PROGRAMMING INFORMATION:
-@findex rtems_shell_rtems_main_mv
+@findex rtems_shell_main_mv
The @code{mv} command is implemented by a C language function which
has the following prototype:
@example
-int rtems_shell_rtems_main_mv(
+int rtems_shell_main_mv(
int argc,
char **argv
);
@@ -2697,13 +2697,13 @@ shell commands have been configured.
@subheading PROGRAMMING INFORMATION:
-@findex rtems_shell_rtems_main_rm
+@findex rtems_shell_main_rm
The @code{rm} is implemented by a C language function
which has the following prototype:
@example
-int rtems_shell_rtems_main_rm(
+int rtems_shell_main_rm(
int argc,
char **argv
);