From 85e5a0f25d083eb74764e674361ddf49c410c14d Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Wed, 31 Jan 2001 02:15:23 +0000 Subject: Misc changes, needed for kioslave and backup: - Added copyOnPsion to optimize speed of copying files from Psion to Psion. - Added a void pointer to the callback function of copy{To,From,On}Psion. This permits setting up a C callback function from within a C++ method by providing this-> in that arg. In the C callback function, the apropriate method of the foreign class can then be called. - Added opendir(), readdir(), closedir() in a libc-like fashion. - Removed old time code. - Added setVolumeName() --- lib/rfsv.h | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'lib/rfsv.h') diff --git a/lib/rfsv.h b/lib/rfsv.h index a1241d6..99adcab 100644 --- a/lib/rfsv.h +++ b/lib/rfsv.h @@ -3,9 +3,9 @@ #include "Enum.h" #include "psitime.h" +#include "bufferstore.h" class ppsocket; -class bufferStore; class bufferArray; const long RFSV_SENDLEN = 2000; @@ -14,7 +14,13 @@ const long RFSV_SENDLEN = 2000; * Defines the callback procedure for * progress indication of copy operations. */ -typedef int (*cpCallback_t)(long); +typedef int (*cpCallback_t)(void *, long); + +class rfsvDirhandle { + public: + unsigned long h; + bufferStore b; +}; /** * Access remote file services of a Psion. @@ -44,18 +50,18 @@ class rfsv { * The known modes for file open. */ enum open_flags { - PSI_O_RDONLY = 00, - PSI_O_WRONLY = 01, - PSI_O_RDWR = 02, + PSI_O_RDONLY = 0000, + PSI_O_WRONLY = 0001, + PSI_O_RDWR = 0002, }; /** * The known modes for file creation. */ enum open_mode { - PSI_O_CREAT = 0100, - PSI_O_EXCL = 0200, - PSI_O_TRUNC = 01000, + PSI_O_CREAT = 00100, + PSI_O_EXCL = 00200, + PSI_O_TRUNC = 01000, PSI_O_APPEND = 02000, }; @@ -330,7 +336,7 @@ class rfsv { * * @returns A Psion error code (One of enum @ref #errs ). */ - virtual Enum copyFromPsion(const char *from, const char *to, cpCallback_t func) = 0; + virtual Enum copyFromPsion(const char *from, const char *to, void *, cpCallback_t func) = 0; /** * Copies a file from local machine to the Psion. @@ -343,8 +349,20 @@ class rfsv { * * @returns A Psion error code (One of enum @ref #errs ). */ - virtual Enum copyToPsion(const char * const from, const char * const to, cpCallback_t func) = 0; + virtual Enum copyToPsion(const char * const from, const char * const to, void *, cpCallback_t func) = 0; + /** + * Copies a file from the Psion to the Psion. + * + * @param from Name of the file to be copied. + * @param to Name of the destination file. + * @param func Pointer to a function which gets called on every read. + * This function can be used to show some progress etc. May be set + * to NULL, where no callback is performed. + * + * @returns A Psion error code (One of enum @ref #errs ). + */ + virtual Enum copyOnPsion(const char * const from, const char * const to, void *, cpCallback_t func) = 0; /** * Resizes an open file on the Psion. * If the new size is greater than the file's @@ -408,6 +426,11 @@ class rfsv { */ virtual Enum remove(const char * const name) = 0; + virtual Enum opendir(const long attr, const char * const name, rfsvDirhandle &handle) = 0; + virtual Enum readdir(rfsvDirhandle &handle, bufferStore &buff) = 0; + virtual Enum closedir(rfsvDirhandle &handle) = 0; + virtual Enum setVolumeName(const char drive, const char * const name) = 0; + /** * Converts a file attribute @ref rfsv::file_attribs to * human readable format, usable for showing them in directory -- cgit v1.2.3