From 360a6446506d9316265df77c0f89804e3de11412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 29 Feb 2012 22:09:08 +0100 Subject: [PATCH] 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. --- src/tools/fs_shell/Jamfile | 4 ++-- src/tools/fs_shell/fssh.cpp | 2 ++ src/tools/fs_shell/fssh.h | 4 ++++ .../fs_shell/fssh_additional_commands.cpp | 20 +++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/tools/fs_shell/fssh_additional_commands.cpp diff --git a/src/tools/fs_shell/Jamfile b/src/tools/fs_shell/Jamfile index b5823b9885..1ef5e33e1e 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 fs_shell.a : $(externalCommandsSources) fssh.cpp + fssh_additional_commands.cpp + : fs_shell_kernel.o ; diff --git a/src/tools/fs_shell/fssh.cpp b/src/tools/fs_shell/fssh.cpp index 5f6a2f507e..58b51d37a1 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 65dd8a4f2b..fc13891922 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 @@ -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 0000000000..c8ad3541ba --- /dev/null +++ b/src/tools/fs_shell/fssh_additional_commands.cpp @@ -0,0 +1,20 @@ +/* + * Copyright 2012, Axel Dörfler, axeld@pinc-software.de. + * 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