diff options
author | Fritz Elfert <felfert@to.com> | 2000-08-07 23:42:40 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2000-08-07 23:42:40 +0000 |
commit | 68d5fd192fee358ad195c32b47333f8f87ae13f2 (patch) | |
tree | 59f865b9679830a006c5c35fb13dcf8f81b85099 /lib/rfsv16.h | |
parent | 50dee0db8d5117ed3b9691140ceb02d8aac292d1 (diff) | |
download | plptools-68d5fd192fee358ad195c32b47333f8f87ae13f2.tar.gz plptools-68d5fd192fee358ad195c32b47333f8f87ae13f2.tar.bz2 plptools-68d5fd192fee358ad195c32b47333f8f87ae13f2.zip |
General cleanup:
- Corrected some operators of bufferArray
- Added more constructors to PsiTime
- Added one more fallback for Timezone calculation in PsiTime
- Use PsiTime in rfsv
- Moved some common methods from rfsv16/32 to rfsv
- Added more kdoc comments.
- Made interface more robust (added const whereever possible,
changed pointer arguments to references)
Diffstat (limited to 'lib/rfsv16.h')
-rw-r--r-- | lib/rfsv16.h | 188 |
1 files changed, 83 insertions, 105 deletions
diff --git a/lib/rfsv16.h b/lib/rfsv16.h index 08c87f5..73c4983 100644 --- a/lib/rfsv16.h +++ b/lib/rfsv16.h @@ -4,126 +4,104 @@ #include "rfsv.h" class rfsv16 : public rfsv { - public: +public: rfsv16(ppsocket *); - ~rfsv16(); - void reset(); // these 2 added - void reconnect(); - // these are the original publics - Enum<rfsv::errs> dir(const char *, bufferArray *); - /*long read(const char* psionName, const char* localName); - long write(const char* localName, const char* psionName);*/ - Enum<rfsv::errs> mkdir(const char *); + Enum<rfsv::errs> fopen(const long, const char * const, long &); + Enum<rfsv::errs> mktemp(long &, char * const); + Enum<rfsv::errs> fcreatefile(const long, const char * const, long &); + Enum<rfsv::errs> freplacefile(const long, const char * const, long &); + Enum<rfsv::errs> fclose(const long); + Enum<rfsv::errs> dir(const char * const, bufferArray &); + Enum<rfsv::errs> fgetmtime(const char * const, PsiTime &); + Enum<rfsv::errs> fsetmtime(const char * const, const PsiTime); + Enum<rfsv::errs> fgetattr(const char * const, long &); + Enum<rfsv::errs> fgeteattr(const char * const, long &, long &, PsiTime &); + Enum<rfsv::errs> fsetattr(const char * const, const long seta, const long unseta); + Enum<rfsv::errs> dircount(const char * const, long &); + Enum<rfsv::errs> devlist(long &); + Enum<rfsv::errs> devinfo(const int, long &, long &, long &, long &, char * const); + Enum<rfsv::errs> fread(const long, unsigned char * const, const long, long &); + Enum<rfsv::errs> fwrite(const long, const unsigned char * const, const long, long &); + Enum<rfsv::errs> copyFromPsion(const char * const, const char * const, cpCallback_t); + Enum<rfsv::errs> copyToPsion(const char * const, const char * const, cpCallback_t); + Enum<rfsv::errs> fsetsize(const long, const long); + Enum<rfsv::errs> fseek(const long, const long, const long, long &); + Enum<rfsv::errs> mkdir(const char * const); + Enum<rfsv::errs> rmdir(const char * const); + Enum<rfsv::errs> rename(const char * const, const char * const); + Enum<rfsv::errs> remove(const char * const); - // these are FS' promotions - Enum<rfsv::errs> dircount(const char *, long *); - Enum<rfsv::errs> copyFromPsion(const char *, const char *, cpCallback_t); - Enum<rfsv::errs> copyToPsion(const char *, const char *, cpCallback_t); - Enum<rfsv::errs> rmdir(const char *); - Enum<rfsv::errs> remove(const char *); // MJG: was this del? FE: yes - Enum<rfsv::errs> rename(const char *, const char *); - Enum<rfsv::errs> mktemp(long *, char *); - Enum<rfsv::errs> fgeteattr(const char *, long *, long *, long *); - Enum<rfsv::errs> fgetattr(const char *, long *); - Enum<rfsv::errs> fsetattr(const char *, long seta, long unseta); - Enum<rfsv::errs> fgetmtime(const char *, long *); - Enum<rfsv::errs> fsetmtime(const char *, long); - Enum<rfsv::errs> fopendir(long, const char *, long &); - Enum<rfsv::errs> fopen(long, const char *, long &); - Enum<rfsv::errs> fcreatefile(long, const char *, long &); - Enum<rfsv::errs> freplacefile(long, const char *, long &); - long fseek(long, long, long); - long fread(long, unsigned char *, long); - long fwrite(long, unsigned char *, long); - Enum<rfsv::errs> fsetsize(long, long); - Enum<rfsv::errs> fclose(long); - - Enum<rfsv::errs> devlist(long *); - char *devinfo(int, long *, long *, long *, long *); - Enum<rfsv::errs> getStatus(); - char *opAttr(long); - long opMode(long); - - long attr2std(long); - long std2attr(long); + long opMode(const long); private: - enum commands { - FOPEN = 0, // File Open - FCLOSE = 2, // File Close - FREAD = 4, // File Read - FDIRREAD = 6, // Read Directory entries - FDEVICEREAD = 8, // Device Information - FWRITE = 10, // File Write - FSEEK = 12, // File Seek - FFLUSH = 14, // Flush - FSETEOF = 16, - RENAME = 18, - DELETE = 20, - FINFO = 22, - SFSTAT = 24, - PARSE = 26, - MKDIR = 28, - OPENUNIQUE = 30, - STATUSDEVICE = 32, - PATHTEST = 34, - STATUSSYSTEM = 36, - CHANGEDIR = 38, - SFDATE = 40, - RESPONSE = 42 - }; + enum commands { + FOPEN = 0, // File Open + FCLOSE = 2, // File Close + FREAD = 4, // File Read + FDIRREAD = 6, // Read Directory entries + FDEVICEREAD = 8, // Device Information + FWRITE = 10, // File Write + FSEEK = 12, // File Seek + FFLUSH = 14, // Flush + FSETEOF = 16, + RENAME = 18, + DELETE = 20, + FINFO = 22, + SFSTAT = 24, + PARSE = 26, + MKDIR = 28, + OPENUNIQUE = 30, + STATUSDEVICE = 32, + PATHTEST = 34, + STATUSSYSTEM = 36, + CHANGEDIR = 38, + SFDATE = 40, + RESPONSE = 42 + }; - enum fopen_attrib { - P_FOPEN = 0x0000, /* Open file */ - P_FCREATE = 0x0001, /* Create file */ - P_FREPLACE = 0x0002, /* Replace file */ - P_FAPPEND = 0x0003, /* Append records */ - P_FUNIQUE = 0x0004, /* Unique file open */ - P_FSTREAM = 0x0000, /* Stream access to a binary file */ - P_FSTREAM_TEXT = 0x0010, /* Stream access to a text file */ - P_FTEXT = 0x0020, /* Record access to a text file */ - P_FDIR = 0x0030, /* Record access to a directory file */ - P_FFORMAT = 0x0040, /* Format a device */ - P_FDEVICE = 0x0050, /* Record access to device name list */ - P_FNODE = 0x0060, /* Record access to node name list */ - P_FUPDATE = 0x0100, /* Read and write access */ - P_FRANDOM = 0x0200, /* Random access */ - P_FSHARE = 0x0400 /* File can be shared */ - }; + enum fopen_attrib { + P_FOPEN = 0x0000, /* Open file */ + P_FCREATE = 0x0001, /* Create file */ + P_FREPLACE = 0x0002, /* Replace file */ + P_FAPPEND = 0x0003, /* Append records */ + P_FUNIQUE = 0x0004, /* Unique file open */ + P_FSTREAM = 0x0000, /* Stream access to a binary file */ + P_FSTREAM_TEXT = 0x0010, /* Stream access to a text file */ + P_FTEXT = 0x0020, /* Record access to a text file */ + P_FDIR = 0x0030, /* Record access to a directory file */ + P_FFORMAT = 0x0040, /* Format a device */ + P_FDEVICE = 0x0050, /* Record access to device name list */ + P_FNODE = 0x0060, /* Record access to node name list */ + P_FUPDATE = 0x0100, /* Read and write access */ + P_FRANDOM = 0x0200, /* Random access */ + P_FSHARE = 0x0400 /* File can be shared */ + }; - enum status_enum { - P_FAWRITE = 0x0001, /* can the file be written to? */ - P_FAHIDDEN = 0x0002, /* set if file is hidden */ - P_FASYSTEM = 0x0004, /* set if file is a system file */ - P_FAVOLUME = 0x0008, /* set if the name is a volume name */ - P_FADIR = 0x0010, /* set if file is a directory file */ - P_FAMOD = 0x0020, /* has the file been modified? */ - P_FAREAD = 0x0100, /* can the file be read? */ - P_FAEXEC = 0x0200, /* is the file executable? */ - P_FASTREAM = 0x0400, /* is the file a byte stream file? */ - P_FATEXT = 0x0800 /* is it a text file? */ - }; + enum status_enum { + P_FAWRITE = 0x0001, /* can the file be written to? */ + P_FAHIDDEN = 0x0002, /* set if file is hidden */ + P_FASYSTEM = 0x0004, /* set if file is a system file */ + P_FAVOLUME = 0x0008, /* set if the name is a volume name */ + P_FADIR = 0x0010, /* set if file is a directory file */ + P_FAMOD = 0x0020, /* has the file been modified? */ + P_FAREAD = 0x0100, /* can the file be read? */ + P_FAEXEC = 0x0200, /* is the file executable? */ + P_FASTREAM = 0x0400, /* is the file a byte stream file? */ + P_FATEXT = 0x0800, /* is it a text file? */ + P_FAMASK = 0x0f3f /* All of the above */ + }; - const char *getConnectName(); - - // File handlers - //long fopen(fopen_attrib a, const char* file, int &handle); // returns status 0=OK - //long fclose(int fileHandle); // Miscellaneous Enum<rfsv::errs> convertName(const char*, char *); + Enum<rfsv::errs> fopendir(const char * const, long &); + long attr2std(const long); + long std2attr(const long); // Communication bool sendCommand(enum commands, bufferStore &); Enum<rfsv::errs> getResponse(bufferStore &); - - // Vars - ppsocket *skt; - // MJG: not sure what these are yet - int serNum; - Enum<errs> status; // current connection status - int tDiff; // don't think this is used anywhere }; #endif |