diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-24 16:48:37 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-24 16:48:37 +0200 |
| commit | a55a55d43d949b2b33aa0337aa2695d838e6a875 (patch) | |
| tree | cb68de3707642076a04c358ed71b67757502c25f /vfs | |
| parent | 63cba0c9834d3b0b6bf6295d165cffbecd315f23 (diff) | |
| download | tuxcmd-a55a55d43d949b2b33aa0337aa2695d838e6a875.tar.xz | |
Show only networking plugins where appropriate
Also rename VFSGetExts and VFSGetServices functions
Diffstat (limited to 'vfs')
| -rw-r--r-- | vfs/UVFSCore.pas | 31 | ||||
| -rw-r--r-- | vfs/uVFSprototypes.pas | 8 |
2 files changed, 27 insertions, 12 deletions
diff --git a/vfs/UVFSCore.pas b/vfs/UVFSCore.pas index 475730c..a0ada8f 100644 --- a/vfs/UVFSCore.pas +++ b/vfs/UVFSCore.pas @@ -63,11 +63,13 @@ type FVFSCopyIn: TVFSCopyIn; FVFSIsOnSameFS: TVFSIsOnSameFS; FVFSTwoSameFiles: TVFSTwoSameFiles; - FVFSGetExts: TVFSGetExts; - FVFSGetServices: TVFSGetServices; + FVFSGetArchiveExts: TVFSGetArchiveExts; + FVFSGetNetworkServices: TVFSGetNetworkServices; FVFSGetPasswordRequired: TVFSGetPasswordRequired; FVFSSetCallbacks: TVFSSetCallbacks; FVFSResetPassword: TVFSResetPassword; + function GetHandlesArchives: boolean; + function GetHandlesNetwork: boolean; public ModuleHandle: Pointer; FullPath: string; // module path @@ -80,6 +82,9 @@ type function ModuleName: string; function ModuleAbout: string; function ModuleCopyright: string; + published + property HandlesArchives: boolean read GetHandlesArchives; + property HandlesNetwork: boolean read GetHandlesNetwork; end; @@ -231,8 +236,8 @@ begin @FVFSSetBlockSize := dlsym(ModuleHandle, 'VFSSetBlockSize'); @FVFSIsOnSameFS := dlsym(ModuleHandle, 'VFSIsOnSameFS'); @FVFSTwoSameFiles := dlsym(ModuleHandle, 'VFSTwoSameFiles'); - @FVFSGetExts := dlsym(ModuleHandle, 'VFSGetExts'); - @FVFSGetServices := dlsym(ModuleHandle, 'VFSGetServices'); + @FVFSGetArchiveExts := dlsym(ModuleHandle, 'VFSGetArchiveExts'); + @FVFSGetNetworkServices := dlsym(ModuleHandle, 'VFSGetNetworkServices'); @FVFSGetPasswordRequired := dlsym(ModuleHandle, 'VFSGetPasswordRequired'); @FVFSSetCallbacks := dlsym(ModuleHandle, 'VFSSetCallbacks'); @FVFSResetPassword := dlsym(ModuleHandle, 'VFSResetPassword'); @@ -240,15 +245,15 @@ begin // Initialize the extensions list SetLength(Extensions, 0); SetLength(Services, 0); - if @FVFSGetExts <> nil then begin - s := FVFSGetExts; + if @FVFSGetArchiveExts <> nil then begin + s := FVFSGetArchiveExts; if s <> nil then begin ParseString(String(s), ';', Extensions); real_libc_free(s); end; end; - if @FVFSGetServices <> nil then begin - s := FVFSGetServices; + if @FVFSGetNetworkServices <> nil then begin + s := FVFSGetNetworkServices; if s <> nil then begin ParseString(String(s), ';', Services); real_libc_free(s); @@ -321,6 +326,16 @@ begin end else Result := ''; end; +function TVFSPlugin.GetHandlesArchives: boolean; +begin + Result := Length(Extensions) > 0; +end; + +function TVFSPlugin.GetHandlesNetwork: boolean; +begin + Result := Length(Services) > 0; +end; + (********************************************************************************************************************************) (********************************************************************************************************************************) constructor TVFSEngine.Create(SourcePlugin: TVFSPlugin); diff --git a/vfs/uVFSprototypes.pas b/vfs/uVFSprototypes.pas index d236d01..2de5ec4 100644 --- a/vfs/uVFSprototypes.pas +++ b/vfs/uVFSprototypes.pas @@ -203,14 +203,14 @@ type TVFSGetCharset = function (g:TVFSGlobs): PChar; cdecl; // TODO: Returns charset which the plugin uses // tuxcmd will take care of memory deallocation - TVFSGetExts = function: PChar; cdecl; + TVFSGetArchiveExts = function: PChar; cdecl; // Returns the list of filename extensions which the module can handle separated by ';' (without a leading dots) + // Returning NULL or not defining the symbol at all means plugin can't handle archives // tuxcmd will take care of memory deallocation - TVFSGetServices = function: PChar; cdecl; + TVFSGetNetworkServices = function: PChar; cdecl; // Returns the list of supported remote protocols separated by ';' (without the '://') + // Returning NULL or not defining the symbol at all means plugin can't access network services // tuxcmd will take care of memory deallocation - TVFSCaps = function (const sExt: PChar): Integer; cdecl; - // TODO: Returns a bit mask of plugin capabilities TVFSSetProtocolLogFunc = procedure (g:TVFSGlobs; ProtocolLogFunc: TVFSLogFunc); cdecl; // TODO: Sets the protocol log function (unlike module debug log func this is intended only for server messages (FTP mainly)) TVFSSetBlockSize = procedure (g:TVFSGlobs; Value: Cardinal); cdecl; |
