aboutsummaryrefslogtreecommitdiff
path: root/src/StormLib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/StormLib.h')
-rw-r--r--src/StormLib.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/StormLib.h b/src/StormLib.h
index f254290..4d9066d 100644
--- a/src/StormLib.h
+++ b/src/StormLib.h
@@ -79,9 +79,9 @@
#define __STORMLIB_H__
#ifdef _MSC_VER
-#pragma warning(disable:4668) // 'XXX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
+#pragma warning(disable:4668) // 'XXX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
#pragma warning(disable:4820) // 'XXX' : '2' bytes padding added after data member 'XXX::yyy'
-#endif
+#endif
#include "StormPort.h"
@@ -94,7 +94,7 @@ extern "C" {
//
// The library type is encoded in the library name as the following
// StormLibXYZ.lib
-//
+//
// X - D for Debug version, R for Release version
// Y - A for ANSI version, U for Unicode version
// Z - S for static-linked CRT library, D for multithreaded DLL CRT library
@@ -107,30 +107,30 @@ extern "C" {
#if defined(_MSC_VER) && !defined(STORMLIB_NO_AUTO_LINK)
#ifndef WDK_BUILD
#ifdef _DEBUG // DEBUG VERSIONS
- #ifndef _UNICODE
- #ifdef _DLL
+ #ifndef _UNICODE
+ #ifdef _DLL
#pragma comment(lib, "StormLibDAD.lib") // Debug Ansi CRT-DLL version
- #else
+ #else
#pragma comment(lib, "StormLibDAS.lib") // Debug Ansi CRT-LIB version
#endif
#else
- #ifdef _DLL
+ #ifdef _DLL
#pragma comment(lib, "StormLibDUD.lib") // Debug Unicode CRT-DLL version
- #else
+ #else
#pragma comment(lib, "StormLibDUS.lib") // Debug Unicode CRT-LIB version
#endif
#endif
#else // RELEASE VERSIONS
- #ifndef _UNICODE
+ #ifndef _UNICODE
#ifdef _DLL
#pragma comment(lib, "StormLibRAD.lib") // Release Ansi CRT-DLL version
- #else
+ #else
#pragma comment(lib, "StormLibRAS.lib") // Release Ansi CRT-LIB version
#endif
#else
#ifdef _DLL
#pragma comment(lib, "StormLibRUD.lib") // Release Unicode CRT-DLL version
- #else
+ #else
#pragma comment(lib, "StormLibRUS.lib") // Release Unicode CRT-LIB version
#endif
#endif
@@ -215,7 +215,7 @@ extern "C" {
// Flags for SFileAddFile
#define MPQ_FILE_IMPLODE 0x00000100 // Implode method (By PKWARE Data Compression Library)
#define MPQ_FILE_COMPRESS 0x00000200 // Compress methods (By multiple methods)
-#define MPQ_FILE_ENCRYPTED 0x00010000 // Indicates whether file is encrypted
+#define MPQ_FILE_ENCRYPTED 0x00010000 // Indicates whether file is encrypted
#define MPQ_FILE_FIX_KEY 0x00020000 // File decryption key has to be fixed
#define MPQ_FILE_PATCH_FILE 0x00100000 // The file is a patch file. Raw file data begin with TPatchInfo structure
#define MPQ_FILE_SINGLE_UNIT 0x01000000 // File is stored as a single unit, rather than split into sectors (Thx, Quantam)
@@ -287,7 +287,7 @@ extern "C" {
#define PATCH_METADATA_NAME "(patch_metadata)"
#define MPQ_FORMAT_VERSION_1 0 // Up to The Burning Crusade
-#define MPQ_FORMAT_VERSION_2 1 // The Burning Crusade and newer
+#define MPQ_FORMAT_VERSION_2 1 // The Burning Crusade and newer
#define MPQ_FORMAT_VERSION_3 2 // WoW Cataclysm Beta
#define MPQ_FORMAT_VERSION_4 3 // WoW Cataclysm and newer
@@ -382,7 +382,7 @@ extern "C" {
#define ERROR_WEAK_SIGNATURE_ERROR 3 // There is a weak signature but sign check failed
#define ERROR_STRONG_SIGNATURE_OK 4 // There is a strong signature and sign check passed
#define ERROR_STRONG_SIGNATURE_ERROR 5 // There is a strong signature but sign check failed
-
+
#ifndef MD5_DIGEST_SIZE
#define MD5_DIGEST_SIZE 0x10
#endif
@@ -474,7 +474,7 @@ typedef enum _SFileInfoClass
#define CCB_COPYING_NON_MPQ_DATA 3 // Copying non-MPQ data: No params used
#define CCB_COMPACTING_FILES 4 // Compacting archive (dwParam1 = current, dwParam2 = total)
#define CCB_CLOSING_ARCHIVE 5 // Closing archive: No params used
-
+
typedef void (WINAPI * SFILE_DOWNLOAD_CALLBACK)(void * pvUserData, ULONGLONG ByteOffset, DWORD dwTotalBytes);
typedef void (WINAPI * SFILE_ADDFILE_CALLBACK)(void * pvUserData, DWORD dwBytesWritten, DWORD dwTotalBytes, bool bFinalCall);
typedef void (WINAPI * SFILE_COMPACT_CALLBACK)(void * pvUserData, DWORD dwWorkType, ULONGLONG BytesProcessed, ULONGLONG TotalBytes);
@@ -545,14 +545,14 @@ typedef struct _TMPQHeader
// Offset to the beginning of the hash table, relative to the beginning of the archive.
DWORD dwHashTablePos;
-
+
// Offset to the beginning of the block table, relative to the beginning of the archive.
DWORD dwBlockTablePos;
-
+
// Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for
// the original MoPaQ format, or less than 2^20 for the Burning Crusade format.
DWORD dwHashTableSize;
-
+
// Number of entries in the block table
DWORD dwBlockTableSize;
@@ -597,7 +597,7 @@ typedef struct _TMPQHeader
// Size of raw data chunk to calculate MD5.
// MD5 of each data chunk follows the raw file data.
- DWORD dwRawChunkSize;
+ DWORD dwRawChunkSize;
// MD5 of MPQ tables
unsigned char MD5_BlockTable[MD5_DIGEST_SIZE]; // MD5 of the block table before decryption
@@ -614,7 +614,7 @@ typedef struct _TMPQHash
{
// The hash of the file path, using method A.
DWORD dwName1;
-
+
// The hash of the file path, using method B.
DWORD dwName2;
@@ -651,16 +651,16 @@ typedef struct _TMPQBlock
{
// Offset of the beginning of the file, relative to the beginning of the archive.
DWORD dwFilePos;
-
+
// Compressed file size
DWORD dwCSize;
-
+
// Only valid if the block is a file; otherwise meaningless, and should be 0.
// If the file is compressed, this is the size of the uncompressed file data.
- DWORD dwFSize;
-
+ DWORD dwFSize;
+
// Flags for the file. See MPQ_FILE_XXXX constants
- DWORD dwFlags;
+ DWORD dwFlags;
} TMPQBlock;
// Patch file information, preceding the sector offset table
@@ -825,7 +825,7 @@ typedef struct _TMPQArchive
TMPQHetTable * pHetTable; // HET table
TFileEntry * pFileTable; // File table
HASH_STRING pfnHashString; // Hashing function that will convert the file name into hash
-
+
TMPQUserData UserData; // MPQ user data. Valid only when ID_MPQ_USERDATA has been found
DWORD HeaderData[MPQ_HEADER_DWORDS]; // Storage for MPQ header
@@ -849,7 +849,7 @@ typedef struct _TMPQArchive
ULONGLONG CompactBytesProcessed; // Amount of bytes that have been processed during a particular compact call
ULONGLONG CompactTotalBytes; // Total amount of bytes to be compacted
void * pvCompactUserData; // User data thats passed to the callback
-} TMPQArchive;
+} TMPQArchive;
// File handle structure
typedef struct _TMPQFile
@@ -1075,8 +1075,8 @@ bool WINAPI SFileWriteFile(HANDLE hFile, const void * pvData, DWORD dwSize, DW
bool WINAPI SFileFinishFile(HANDLE hFile);
bool WINAPI SFileAddFileEx(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwCompression, DWORD dwCompressionNext = MPQ_COMPRESSION_NEXT_SAME);
-bool WINAPI SFileAddFile(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags);
-bool WINAPI SFileAddWave(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality);
+bool WINAPI SFileAddFile(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags);
+bool WINAPI SFileAddWave(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality);
bool WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope);
bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szOldFileName, const char * szNewFileName);
bool WINAPI SFileSetFileLocale(HANDLE hFile, LCID lcNewLocale);