From 3a9a6ec46beaf839cfe4fe8b6a26e1ca5e2d0316 Mon Sep 17 00:00:00 2001 From: Ladislav Date: Fri, 27 Dec 2013 23:13:28 +0100 Subject: + Support for master-mirror pairs + Support for streaming MPQs + Bug fixes --- src/FileStream.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/FileStream.h') diff --git a/src/FileStream.h b/src/FileStream.h index f660a87..60f41d3 100644 --- a/src/FileStream.h +++ b/src/FileStream.h @@ -24,6 +24,7 @@ typedef bool (*STREAM_CREATE)( typedef bool (*STREAM_OPEN)( struct TFileStream * pStream, // Pointer to an unopened stream + const TCHAR * szFileName, // Pointer to file name to be open DWORD dwStreamFlags // Stream flags ); @@ -57,11 +58,11 @@ typedef bool (*STREAM_GETPOS)( ); typedef void (*STREAM_CLOSE)( - struct TFileStream * pStream + struct TFileStream * pStream // Pointer to an open stream ); typedef bool (*BLOCK_READ)( - struct TFileStream * pStream, // Pointer to an opened block stream + struct TFileStream * pStream, // Pointer to a block-oriented stream ULONGLONG StartOffset, // Byte offset of start of the block array ULONGLONG EndOffset, // End offset (either end of the block or end of the file) LPBYTE BlockBuffer, // Pointer to block-aligned buffer @@ -70,8 +71,12 @@ typedef bool (*BLOCK_READ)( ); typedef DWORD (*BLOCK_CHECK)( - struct TFileStream * pStream, - ULONGLONG BlockOffset + struct TFileStream * pStream, // Pointer to a block-oriented stream + ULONGLONG BlockOffset // Offset of the file to check + ); + +typedef void (*BLOCK_SAVEMAP)( + struct TFileStream * pStream // Pointer to a block-oriented stream ); //----------------------------------------------------------------------------- @@ -187,12 +192,15 @@ struct TFileStream struct TBlockStream : public TFileStream { + SFILE_DOWNLOAD_CALLBACK pfnCallback; // Callback for downloading void * FileBitmap; // Array of bits for file blocks + void * UserData; // User data to be passed to the download callback DWORD BitmapSize; // Size of the file bitmap (in bytes) DWORD BlockSize; // Size of one block, in bytes DWORD BlockCount; // Number of data blocks in the file DWORD IsComplete; // If nonzero, no blocks are missing -}; + DWORD IsModified; // nonzero if the bitmap has been modified +}; //----------------------------------------------------------------------------- // Structure for encrypted stream -- cgit v1.2.3