[rtems commit] shell: Make mv, cp and rm usable for applications

Sebastian Huber sebh at rtems.org
Thu Nov 27 12:39:51 UTC 2014


Module:    rtems
Branch:    master
Commit:    43b09a9865760ec7ae7fcd0ef75842f3a201d5a7
Changeset: http://git.rtems.org/rtems/commit/?id=43b09a9865760ec7ae7fcd0ef75842f3a201d5a7

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov 27 13:37:04 2014 +0100

shell: Make mv, cp and rm usable for applications

close #2030

---

 cpukit/libmisc/shell/internal.h |  3 ---
 cpukit/libmisc/shell/main_mv.c  |  2 +-
 cpukit/libmisc/shell/shell.h    |  7 +++++++
 doc/shell/file.t                | 12 ++++++------
 4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/cpukit/libmisc/shell/internal.h b/cpukit/libmisc/shell/internal.h
index 0187e5f..ad51588 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 ed5de3f..9d6a3c2 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 657df77..ea8532d 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 bda3d3d..dc482a4 100644
--- a/doc/shell/file.t
+++ b/doc/shell/file.t
@@ -695,13 +695,13 @@ shell commands have been configured.
 
 @subheading PROGRAMMING INFORMATION:
 
- at findex rtems_shell_rtems_main_cp
+ at 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:
 
- at findex rtems_shell_rtems_main_mv
+ at 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:
 
- at findex rtems_shell_rtems_main_rm
+ at 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
 );




More information about the vc mailing list