summaryrefslogtreecommitdiff
path: root/vfs
diff options
context:
space:
mode:
Diffstat (limited to 'vfs')
-rw-r--r--vfs/uVFSprototypes.pas19
1 files changed, 9 insertions, 10 deletions
diff --git a/vfs/uVFSprototypes.pas b/vfs/uVFSprototypes.pas
index 9ed0844..6fbe65d 100644
--- a/vfs/uVFSprototypes.pas
+++ b/vfs/uVFSprototypes.pas
@@ -224,7 +224,7 @@ type
// Changes times for the file/directory - mtime and atime are __time_t parameters (glibc)
TVFSChangeTimes = function (g:TVFSGlobs; const APath: PChar; mtime, atime: guint32; Error: PPGError): gboolean; cdecl;
-
+
// Performs the copy process from inside of module to local filesystem
// (thus sSrcName is a path from inside of module and sDstName is path in the local filesystem where the file should be copied)
// Note: if you need to transfer a file between two VFS modules, you need to do it manually -
@@ -242,20 +242,19 @@ type
TVFSPack = function (g:TVFSGlobs; const sSrcName, sDstName: PChar; CompressionLevel: integer; const Password: PChar; Error: PPGError): gboolean; cdecl;
- // TODO: not implemented at all
- // This is the set of basic functions which can manipulate with data
- // There is a TVFSFileDes object which identifies the processed file (filedescriptor)
- // All these functions needs a pointer to an int variable to store the error code
+ // Low-level open-read-write-close, used for e.g. cross-VFS copy
+ // An abstract TVFSFileDes object serves as a file descriptor/handle
// NOTE: not all modules could support this set of functions due to its design (unable to set a solid block size)
TVFSOpenFile = function (g:TVFSGlobs; const APath: PChar; Mode: integer; Error: PPGError): TVFSFileDes; cdecl;
// Opens a file or creates new (the values for the Mode parameter are described above) and returns the assigned filedescriptor
- TVFSReadFile = function (g:TVFSGlobs; const FileDescriptor: TVFSFileDes; Buffer: Pointer; ABlockSize: integer; Error: PPGError): integer; cdecl;
- // Returns number of bytes read; the buffer needs to be allocated by a blocksize (set it by VFSSetBlockSize function)
- TVFSWriteFile = function (g:TVFSGlobs; const FileDescriptor: TVFSFileDes; Buffer: Pointer; BytesCount: integer; Error: PPGError): integer; cdecl;
- // Returns number of bytes written
+ TVFSReadFile = function (g:TVFSGlobs; const FileDescriptor: TVFSFileDes; Buffer: Pointer; ABlockSize: guint64; Error: PPGError): gint64; cdecl;
+ // Returns number of bytes read that may be smaller than requested number of bytes. Returns 0 typically at EOF or -1 in case of an error.
+ // The buffer needs to be allocated for a blocksize (set it by VFSSetBlockSize function)
+ TVFSWriteFile = function (g:TVFSGlobs; const FileDescriptor: TVFSFileDes; Buffer: Pointer; BytesCount: guint64; Error: PPGError): gint64; cdecl;
+ // Returns number of bytes written that may be smaller than requested number of bytes. Returns -1 in case of an error.
TVFSCloseFile = function (g:TVFSGlobs; const FileDescriptor: TVFSFileDes; Error: PPGError): gboolean; cdecl;
TVFSFileSeek = function (g:TVFSGlobs; const FileDescriptor: TVFSFileDes; const AbsoluteOffset: Int64; Error: PPGError): Int64; cdecl;
- // Sets the position in the file from the start and returns real current position
+ // Sets the position in the file from the start and returns real current position. Returns -1 in case of an error.
// Archive-specific routines: