X-Git-Url: https://sfsrealm.hopto.org/projects/?a=blobdiff_plain;f=SFmpqapi.h;h=dd6b01cac80b9cbb636bfc92bca5243fc80e6297;hb=89eb0ac4c4ed931e796ceecd6287b57170cf9f98;hp=5626028c05f32226d04e5551f416be53da1aa982;hpb=e32ff2fecf5ed03c2eb90343f9bc373852636f13;p=SFmpqapi.git diff --git a/SFmpqapi.h b/SFmpqapi.h index 5626028..dd6b01c 100644 --- a/SFmpqapi.h +++ b/SFmpqapi.h @@ -1,6 +1,6 @@ /* - ShadowFlare MPQ API Library. (c) ShadowFlare Software 2002-2008 + ShadowFlare MPQ API Library. (c) ShadowFlare Software 2002-2010 License information for this code is in license.txt and included in this file at the end of this comment. @@ -129,7 +129,7 @@ License information: - Copyright (c) 2002-2008, ShadowFlare + Copyright (c) 2002-2010, ShadowFlare All rights reserved. Redistribution and use in source and binary forms, with or without @@ -230,6 +230,7 @@ long SFMPQAPI __inline SFMpqCompareVersion(); // MpqAddFileToArchive flags #define MAFA_EXISTS 0x80000000 //This flag will be added if not present #define MAFA_UNKNOWN40000000 0x40000000 //Unknown flag +#define MAFA_SINGLEBLOCK 0x01000000 //File is stored as a single unit rather than being split by the block size #define MAFA_MODCRYPTKEY 0x00020000 //Used with MAFA_ENCRYPT. Uses an encryption key based on file position and size #define MAFA_ENCRYPT 0x00010000 //Encrypts the file. The file is still accessible when using this, so the use of this has depreciated #define MAFA_COMPRESS 0x00000200 //File is to be compressed when added. This is used for most of the compression methods @@ -239,12 +240,13 @@ long SFMPQAPI __inline SFMpqCompareVersion(); // MpqAddFileToArchiveEx compression flags #define MAFA_COMPRESS_STANDARD 0x08 //Standard PKWare DCL compression #define MAFA_COMPRESS_DEFLATE 0x02 //ZLib's deflate compression -#define MAFA_COMPRESS_WAVE 0x81 //Standard wave compression -#define MAFA_COMPRESS_WAVE2 0x41 //Unused wave compression +#define MAFA_COMPRESS_BZIP2 0x10 //bzip2 compression +#define MAFA_COMPRESS_WAVE 0x81 //Stereo wave compression +#define MAFA_COMPRESS_WAVE2 0x41 //Mono wave compression // Flags for individual compression types used for wave compression -#define MAFA_COMPRESS_WAVECOMP1 0x80 //Main compressor for standard wave compression -#define MAFA_COMPRESS_WAVECOMP2 0x40 //Main compressor for unused wave compression +#define MAFA_COMPRESS_WAVECOMP1 0x80 //Main compressor for stereo wave compression +#define MAFA_COMPRESS_WAVECOMP2 0x40 //Main compressor for mono wave compression #define MAFA_COMPRESS_WAVECOMP3 0x01 //Secondary compressor for wave compression // ZLib deflate compression level constants (used with MpqAddFileToArchiveEx and MpqAddFileFromBufferEx) @@ -281,7 +283,7 @@ long SFMPQAPI __inline SFMpqCompareVersion(); #define SFILE_LIST_MEMORY_LIST 0x01 // Specifies that lpFilelists is a file list from memory, rather than being a list of file lists #define SFILE_LIST_ONLY_KNOWN 0x02 // Only list files that the function finds a name for #define SFILE_LIST_ONLY_UNKNOWN 0x04 // Only list files that the function does not find a name for -#define SFILE_LIST_FLAG_UNKNOWN 0x08 // Use without SFILE_LIST_ONLY_KNOWN or SFILE_LIST_FLAG_UNKNOWN to list all files, but set dwFileExists to 3 if file's name is not found +#define SFILE_LIST_FLAG_UNKNOWN 0x08 // Use without SFILE_LIST_ONLY_KNOWN or SFILE_LIST_FLAG_UNKNOWN to list all files, but will set dwFileExists to 3 if file's name is not found // SFileOpenArchive flags #define SFILE_OPEN_HARD_DISK_FILE 0x0000 //Open archive without regard to the drive type it resides on @@ -294,6 +296,8 @@ long SFMPQAPI __inline SFMpqCompareVersion(); typedef HANDLE MPQHANDLE; +#include + struct FILELISTENTRY { DWORD dwFileExists; // Nonzero if this entry is used LCID lcLocale; // Locale ID of file @@ -321,6 +325,8 @@ struct MPQHEADER { DWORD dwBlockTableSize; // Number of entries in block table }; +#include + //Archive handles may be typecasted to this struct so you can access //some of the archive's properties and the decrypted hash table and //block table directly. This struct is based on Storm's internal @@ -378,6 +384,8 @@ struct MPQFILE { LPSTR lpFileName; }; +#include + struct BLOCKTABLEENTRY { DWORD dwFileOffset; // Offset to file DWORD dwCompressedSize; // Compressed size of file @@ -392,6 +400,8 @@ struct HASHTABLEENTRY { DWORD dwBlockTableIndex; // Index to the block table entry for the file }; +#include + // Defines for backward compatibility with old lmpqapi function names #define MpqAddFileToArcive MpqAddFileToArchive #define MpqOpenArchive SFileOpenArchive