[haiku-commits] haiku: hrev43806 - src/tools/fs_shell

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 29 Feb 2012 22:13:33 +0100 (CET)

hrev43806 adds 1 changeset to branch 'master'
old head: a697ddedc5a0bfbbeffead67621cfec948e1cbf3
new head: 360a6446506d9316265df77c0f89804e3de11412

----------------------------------------------------------------------------

360a644: Implemented support for file system specific commands.
  
  * File system specific shell implementations can now register any additional
    commands by implementing the register_additional_commands() function.

                                   [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev43806
Commit:      360a6446506d9316265df77c0f89804e3de11412
URL:         http://cgit.haiku-os.org/haiku/commit/?id=360a644
Author:      Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Wed Feb 29 21:09:08 2012 UTC

----------------------------------------------------------------------------

4 files changed, 28 insertions(+), 2 deletions(-)
src/tools/fs_shell/Jamfile                      |    4 +-
src/tools/fs_shell/fssh.cpp                     |    2 +
src/tools/fs_shell/fssh.h                       |    4 +++
src/tools/fs_shell/fssh_additional_commands.cpp |   20 +++++++++++++++++++

----------------------------------------------------------------------------

diff --git a/src/tools/fs_shell/Jamfile b/src/tools/fs_shell/Jamfile
index b5823b9..1ef5e33 100644
--- a/src/tools/fs_shell/Jamfile
+++ b/src/tools/fs_shell/Jamfile
@@ -4,9 +4,7 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ;
 
 if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
        UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ;
-       #UseHeaders [ FDirName $(HAIKU_TOP) headers build os app ] : true ;
        UseHeaders [ FDirName $(HAIKU_TOP) headers build os kernel ] : true ;
-       #UseHeaders [ FDirName $(HAIKU_TOP) headers build os interface ] : true 
;
        UseHeaders [ FDirName $(HAIKU_TOP) headers build os storage ] : true ;
        UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ;
 }
@@ -80,6 +78,8 @@ BuildPlatformStaticLibrary <build>fs_shell.a :
        $(externalCommandsSources)
 
        fssh.cpp
+       fssh_additional_commands.cpp
+
        : <build>fs_shell_kernel.o
 ;
 
diff --git a/src/tools/fs_shell/fssh.cpp b/src/tools/fs_shell/fssh.cpp
index 5f6a2f5..58b51d3 100644
--- a/src/tools/fs_shell/fssh.cpp
+++ b/src/tools/fs_shell/fssh.cpp
@@ -3,6 +3,7 @@
  * Distributed under the terms of the MIT License.
  */
 
+
 #include "compatibility.h"
 
 #include "fssh.h"
@@ -1471,6 +1472,7 @@ standard_session(const char* device, const char* fsName, 
bool interactive)
 
        // register commands
        register_commands();
+       register_additional_commands();
 
        // process commands
        input_loop(interactive);
diff --git a/src/tools/fs_shell/fssh.h b/src/tools/fs_shell/fssh.h
index 65dd8a4..fc13891 100644
--- a/src/tools/fs_shell/fssh.h
+++ b/src/tools/fs_shell/fssh.h
@@ -5,6 +5,7 @@
 #ifndef _FSSH_FSSH_H
 #define _FSSH_FSSH_H
 
+
 #include "compatibility.h"
 
 #include <map>
@@ -71,6 +72,9 @@ private:
 };
 
 
+extern void register_additional_commands(void);
+
+
 }      // namespace FSShell
 
 
diff --git a/src/tools/fs_shell/fssh_additional_commands.cpp 
b/src/tools/fs_shell/fssh_additional_commands.cpp
new file mode 100644
index 0000000..c8ad354
--- /dev/null
+++ b/src/tools/fs_shell/fssh_additional_commands.cpp
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2012, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include "fssh.h"
+
+
+namespace FSShell {
+
+
+void
+register_additional_commands()
+{
+       // To be implemented by file system specific shell implementations.
+}
+
+
+}      // namespace FSShell


Other related posts: