diff --git a/libmspack/Compressor.cs b/libmspack/BaseCompressor.cs similarity index 53% rename from libmspack/Compressor.cs rename to libmspack/BaseCompressor.cs index 6c58243..42ea3b7 100644 --- a/libmspack/Compressor.cs +++ b/libmspack/BaseCompressor.cs @@ -3,8 +3,14 @@ namespace SabreTools.Compression.libmspack /// /// Base class for all compressor implementations /// - public abstract class Compressor + public abstract class BaseCompressor : mspack_file { +#if NET48 public mspack_system system { get; set; } +#else + public mspack_system? system { get; set; } +#endif + + public MSPACK_ERR error { get; set; } } } \ No newline at end of file diff --git a/libmspack/Decompressor.cs b/libmspack/BaseDecompressor.cs similarity index 53% rename from libmspack/Decompressor.cs rename to libmspack/BaseDecompressor.cs index 1f8c949..c064774 100644 --- a/libmspack/Decompressor.cs +++ b/libmspack/BaseDecompressor.cs @@ -3,8 +3,14 @@ namespace SabreTools.Compression.libmspack /// /// Base class for all decompressor implementations /// - public abstract class Decompressor + public abstract class Decompressor : mspack_file { +#if NET48 public mspack_system system { get; set; } +#else + public mspack_system? system { get; set; } +#endif + + public MSPACK_ERR error { get; set; } } } \ No newline at end of file diff --git a/libmspack/BitStream.cs b/libmspack/BitStream.cs new file mode 100644 index 0000000..962ef18 --- /dev/null +++ b/libmspack/BitStream.cs @@ -0,0 +1,49 @@ +namespace SabreTools.Compression.libmspack +{ + public unsafe abstract class BitStream + { + /// + /// I/O routines + /// + public mspack_system sys { get; set; } + + /// + /// Input file handle + /// + public mspack_file input { get; set; } + + /// + /// Output file handle + /// + public mspack_file output { get; set; } + + /// + /// Decompression offset within window + /// + public uint window_posn { get; set; } + + #region I/O buffering + + public byte* inbuf { get; set; } + + public byte* i_ptr { get; set; } + + public byte* i_end { get; set; } + + public byte* o_ptr { get; set; } + + public byte* o_end { get; set; } + + public int input_end { get; set; } + + public uint bit_buffer { get; set; } + + public uint bits_left { get; set; } + + public uint inbuf_size { get; set; } + + #endregion + + public MSPACK_ERR error { get; set; } + } +} \ No newline at end of file diff --git a/libmspack/mscab_compressor.cs b/libmspack/CAB/Compressor.cs similarity index 53% rename from libmspack/mscab_compressor.cs rename to libmspack/CAB/Compressor.cs index d20c6fa..aa46196 100644 --- a/libmspack/mscab_compressor.cs +++ b/libmspack/CAB/Compressor.cs @@ -1,9 +1,9 @@ -namespace SabreTools.Compression.libmspack +namespace SabreTools.Compression.libmspack.CAB { /// /// TODO /// - public class mscab_compressor : Compressor + public class Compressor : BaseCompressor { public int dummy { get; set; } } diff --git a/libmspack/CAB/Constants.cs b/libmspack/CAB/Constants.cs new file mode 100644 index 0000000..2ea4b30 --- /dev/null +++ b/libmspack/CAB/Constants.cs @@ -0,0 +1,68 @@ +namespace SabreTools.Compression.libmspack.CAB +{ + public static class Constants + { + /* structure offsets */ + public const byte cfhead_Signature = 0x00; + public const byte cfhead_CabinetSize = 0x08; + public const byte cfhead_FileOffset = 0x10; + public const byte cfhead_MinorVersion = 0x18; + public const byte cfhead_MajorVersion = 0x19; + public const byte cfhead_NumFolders = 0x1A; + public const byte cfhead_NumFiles = 0x1C; + public const byte cfhead_Flags = 0x1E; + public const byte cfhead_SetID = 0x20; + public const byte cfhead_CabinetIndex = 0x22; + public const byte cfhead_SIZEOF = 0x24; + public const byte cfheadext_HeaderReserved = 0x00; + public const byte cfheadext_FolderReserved = 0x02; + public const byte cfheadext_DataReserved = 0x03; + public const byte cfheadext_SIZEOF = 0x04; + public const byte cffold_DataOffset = 0x00; + public const byte cffold_NumBlocks = 0x04; + public const byte cffold_CompType = 0x06; + public const byte cffold_SIZEOF = 0x08; + public const byte cffile_UncompressedSize = 0x00; + public const byte cffile_FolderOffset = 0x04; + public const byte cffile_FolderIndex = 0x08; + public const byte cffile_Date = 0x0A; + public const byte cffile_Time = 0x0C; + public const byte cffile_Attribs = 0x0E; + public const byte cffile_SIZEOF = 0x10; + public const byte cfdata_CheckSum = 0x00; + public const byte cfdata_CompressedSize = 0x04; + public const byte cfdata_UncompressedSize = 0x06; + public const byte cfdata_SIZEOF = 0x08; + + /* flags */ + public const ushort cffoldCOMPTYPE_MASK = 0x000f; + public const ushort cffileCONTINUED_FROM_PREV = 0xFFFD; + public const ushort cffileCONTINUED_TO_NEXT = 0xFFFE; + public const ushort cffileCONTINUED_PREV_AND_NEXT = 0xFFFF; + + /* CAB data blocks are <= 32768 bytes in uncompressed form. Uncompressed + * blocks have zero growth. MSZIP guarantees that it won't grow above + * uncompressed size by more than 12 bytes. LZX guarantees it won't grow + * more than 6144 bytes. Quantum has no documentation, but the largest + * block seen in the wild is 337 bytes above uncompressed size. + */ + public const int CAB_BLOCKMAX = 32768; + public const int CAB_INPUTMAX = CAB_BLOCKMAX + 6144; + + /* input buffer needs to be CAB_INPUTMAX + 1 byte to allow for max-sized block + * plus 1 trailer byte added by cabd_sys_read_block() for Quantum alignment. + * + * When MSCABD_PARAM_SALVAGE is set, block size is not checked so can be + * up to 65535 bytes, so max input buffer size needed is 65535 + 1 + */ + public const int CAB_INPUTMAX_SALVAGE = 65535; + public const int CAB_INPUTBUF = CAB_INPUTMAX_SALVAGE + 1; + + /* There are no more than 65535 data blocks per folder, so a folder cannot + * be more than 32768*65535 bytes in length. As files cannot span more than + * one folder, this is also their max offset, length and offset+length limit. + */ + public const int CAB_FOLDERMAX = 65535; + public const int CAB_LENGTHMAX = CAB_BLOCKMAX * CAB_FOLDERMAX; + } +} \ No newline at end of file diff --git a/libmspack/mschm_compressor.cs b/libmspack/CHM/Compressor.cs similarity index 91% rename from libmspack/mschm_compressor.cs rename to libmspack/CHM/Compressor.cs index 19d8820..9f242a1 100644 --- a/libmspack/mschm_compressor.cs +++ b/libmspack/CHM/Compressor.cs @@ -1,20 +1,18 @@ -namespace SabreTools.Compression.libmspack +namespace SabreTools.Compression.libmspack.CHM { /// /// A compressor for .CHM (Microsoft HTMLHelp) files. /// /// All fields are READ ONLY. /// - /// - /// - public abstract class mschm_compressor : Compressor + /// + /// + public class Compressor : BaseCompressor { public string temp_file { get; set; } public int use_temp_file { get; set; } - public MSPACK_ERR error { get; set; } - /// /// Generates a CHM help file. /// @@ -46,9 +44,9 @@ namespace SabreTools.Compression.libmspack /// This is passed directly to mspack_system::open() /// /// An error code, or MSPACK_ERR_OK if successful - /// - /// - public abstract MSPACK_ERR generate(mschmc_file[] file_list, in string output_file); + /// + /// + public MSPACK_ERR generate(mschmc_file[] file_list, in string output_file) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Specifies whether a temporary file is used during CHM generation. @@ -104,7 +102,7 @@ namespace SabreTools.Compression.libmspack /// /// An error code, or MSPACK_ERR_OK if successful /// - public abstract MSPACK_ERR use_temporary_file(int use_temp_file, in string temp_file); + public MSPACK_ERR use_temporary_file(int use_temp_file, in string temp_file) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Sets a CHM compression engine parameter. @@ -150,7 +148,7 @@ namespace SabreTools.Compression.libmspack /// is a problem with either parameter or value. /// /// - public abstract MSPACK_ERR set_param(MSCHMC_PARAM param, int value); + public MSPACK_ERR set_param(MSCHMC_PARAM param, int value) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Returns the error code set by the most recently called method. @@ -158,6 +156,6 @@ namespace SabreTools.Compression.libmspack /// The most recent error code /// /// - public abstract MSPACK_ERR last_error(); + public MSPACK_ERR last_error() => MSPACK_ERR.MSPACK_ERR_OK; } } \ No newline at end of file diff --git a/libmspack/chm.cs b/libmspack/CHM/Constants.cs similarity index 97% rename from libmspack/chm.cs rename to libmspack/CHM/Constants.cs index 2d2d143..828c227 100644 --- a/libmspack/chm.cs +++ b/libmspack/CHM/Constants.cs @@ -1,6 +1,6 @@ -namespace SabreTools.Compression.libmspack +namespace SabreTools.Compression.libmspack.CHM { - public static class chm + public static class Constants { public const ushort chmhead_Signature = 0x0000; public const ushort chmhead_Version = 0x0004; diff --git a/libmspack/mskwaj_compressor.cs b/libmspack/KWAJ/Compressor.cs similarity index 85% rename from libmspack/mskwaj_compressor.cs rename to libmspack/KWAJ/Compressor.cs index e7de9d2..283af01 100644 --- a/libmspack/mskwaj_compressor.cs +++ b/libmspack/KWAJ/Compressor.cs @@ -1,20 +1,16 @@ -namespace SabreTools.Compression.libmspack +namespace SabreTools.Compression.libmspack.KWAJ { /// /// A compressor for the KWAJ file format. /// /// All fields are READ ONLY. /// - /// - /// - public unsafe abstract class mskwaj_compressor : Compressor + /// + /// + public unsafe class Compressor : BaseCompressor { - public mspack_system system { get; set; } - public int[] param { get; set; } = new int[2]; - public MSPACK_ERR error { get; set; } - /// /// Reads an input file and creates a compressed output file in the /// KWAJ compressed file format. The KWAJ compression format is quick @@ -36,7 +32,7 @@ namespace SabreTools.Compression.libmspack /// /// An error code, or MSPACK_ERR_OK if successful /// - public abstract MSPACK_ERR compress(in string input, in string output, long length); + public MSPACK_ERR compress(in string input, in string output, long length) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Sets an KWAJ compression engine parameter. @@ -60,7 +56,7 @@ namespace SabreTools.Compression.libmspack /// is a problem with either parameter or value. /// /// - public abstract MSPACK_ERR set_param(MSKWAJC_PARAM param, int value); + public MSPACK_ERR set_param(MSKWAJC_PARAM param, int value) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Sets the original filename of the file before compression, @@ -78,7 +74,7 @@ namespace SabreTools.Compression.libmspack /// MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if the /// filename is too long /// - public abstract MSPACK_ERR set_filename(in string filename); + public MSPACK_ERR set_filename(in string filename) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Sets arbitrary data that will be stored in the header of the @@ -96,13 +92,13 @@ namespace SabreTools.Compression.libmspack /// MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS extra data /// is too long /// - public abstract MSPACK_ERR set_extra_data(void* data, int bytes); + public MSPACK_ERR set_extra_data(void* data, int bytes) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Returns the error code set by the most recently called method. /// /// The most recent error code /// - public abstract MSPACK_ERR last_error(); + public MSPACK_ERR last_error() => MSPACK_ERR.MSPACK_ERR_OK; } } \ No newline at end of file diff --git a/libmspack/cab.cs b/libmspack/cab.cs index e3d91fb..9e1b318 100644 --- a/libmspack/cab.cs +++ b/libmspack/cab.cs @@ -1,72 +1,7 @@ -using System; - namespace SabreTools.Compression.libmspack { public unsafe static class cab { - /* structure offsets */ - public const byte cfhead_Signature = 0x00; - public const byte cfhead_CabinetSize = 0x08; - public const byte cfhead_FileOffset = 0x10; - public const byte cfhead_MinorVersion = 0x18; - public const byte cfhead_MajorVersion = 0x19; - public const byte cfhead_NumFolders = 0x1A; - public const byte cfhead_NumFiles = 0x1C; - public const byte cfhead_Flags = 0x1E; - public const byte cfhead_SetID = 0x20; - public const byte cfhead_CabinetIndex = 0x22; - public const byte cfhead_SIZEOF = 0x24; - public const byte cfheadext_HeaderReserved = 0x00; - public const byte cfheadext_FolderReserved = 0x02; - public const byte cfheadext_DataReserved = 0x03; - public const byte cfheadext_SIZEOF = 0x04; - public const byte cffold_DataOffset = 0x00; - public const byte cffold_NumBlocks = 0x04; - public const byte cffold_CompType = 0x06; - public const byte cffold_SIZEOF = 0x08; - public const byte cffile_UncompressedSize = 0x00; - public const byte cffile_FolderOffset = 0x04; - public const byte cffile_FolderIndex = 0x08; - public const byte cffile_Date = 0x0A; - public const byte cffile_Time = 0x0C; - public const byte cffile_Attribs = 0x0E; - public const byte cffile_SIZEOF = 0x10; - public const byte cfdata_CheckSum = 0x00; - public const byte cfdata_CompressedSize = 0x04; - public const byte cfdata_UncompressedSize = 0x06; - public const byte cfdata_SIZEOF = 0x08; - - /* flags */ - public const ushort cffoldCOMPTYPE_MASK = 0x000f; - public const ushort cffileCONTINUED_FROM_PREV = 0xFFFD; - public const ushort cffileCONTINUED_TO_NEXT = 0xFFFE; - public const ushort cffileCONTINUED_PREV_AND_NEXT = 0xFFFF; - - /* CAB data blocks are <= 32768 bytes in uncompressed form. Uncompressed - * blocks have zero growth. MSZIP guarantees that it won't grow above - * uncompressed size by more than 12 bytes. LZX guarantees it won't grow - * more than 6144 bytes. Quantum has no documentation, but the largest - * block seen in the wild is 337 bytes above uncompressed size. - */ - public const int CAB_BLOCKMAX = 32768; - public const int CAB_INPUTMAX = CAB_BLOCKMAX + 6144; - - /* input buffer needs to be CAB_INPUTMAX + 1 byte to allow for max-sized block - * plus 1 trailer byte added by cabd_sys_read_block() for Quantum alignment. - * - * When MSCABD_PARAM_SALVAGE is set, block size is not checked so can be - * up to 65535 bytes, so max input buffer size needed is 65535 + 1 - */ - public const int CAB_INPUTMAX_SALVAGE = 65535; - public const int CAB_INPUTBUF = CAB_INPUTMAX_SALVAGE + 1; - - /* There are no more than 65535 data blocks per folder, so a folder cannot - * be more than 32768*65535 bytes in length. As files cannot span more than - * one folder, this is also their max offset, length and offset+length limit. - */ - public const int CAB_FOLDERMAX = 65535; - public const int CAB_LENGTHMAX = CAB_BLOCKMAX * CAB_FOLDERMAX; - #region decomp /// diff --git a/libmspack/mscab_decompressor.cs b/libmspack/mscab_decompressor.cs index bfc95fb..5ecef2c 100644 --- a/libmspack/mscab_decompressor.cs +++ b/libmspack/mscab_decompressor.cs @@ -1,4 +1,5 @@ using static SabreTools.Compression.libmspack.cab; +using static SabreTools.Compression.libmspack.CAB.Constants; namespace SabreTools.Compression.libmspack { @@ -21,8 +22,6 @@ namespace SabreTools.Compression.libmspack public int salvage { get; set; } - public MSPACK_ERR error { get; set; } - public MSPACK_ERR read_error { get; set; } /// @@ -133,7 +132,7 @@ namespace SabreTools.Compression.libmspack if (this.d != null && (this.d.folder == fol)) { if (this.d.infh != null) sys.close(this.d.infh); - cabd_free_decomp(); + cabd_free_decomp(this); //sys.free(this.d); this.d = null; } @@ -507,7 +506,7 @@ namespace SabreTools.Compression.libmspack /// /// /// - public abstract mscabd_cabinet search(in string filename); + public mscabd_cabinet search(in string filename) => null; /// /// Appends one mscabd_cabinet to another, forming or extending a cabinet @@ -546,7 +545,7 @@ namespace SabreTools.Compression.libmspack /// /// /// - public abstract MSPACK_ERR append(mscabd_cabinet cab, mscabd_cabinet nextcab); + public MSPACK_ERR append(mscabd_cabinet cab, mscabd_cabinet nextcab) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Prepends one mscabd_cabinet to another, forming or extending a @@ -563,7 +562,7 @@ namespace SabreTools.Compression.libmspack /// /// /// - public abstract MSPACK_ERR prepend(mscabd_cabinet cab, mscabd_cabinet prevcab); + public MSPACK_ERR prepend(mscabd_cabinet cab, mscabd_cabinet prevcab) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Extracts a file from a cabinet or cabinet set. @@ -584,7 +583,7 @@ namespace SabreTools.Compression.libmspack /// The file to be decompressed /// The filename of the file being written to /// An error code, or MSPACK_ERR.MSPACK_ERR_OK if successful - public abstract MSPACK_ERR extract(mscabd_file file, in string filename); + public MSPACK_ERR extract(mscabd_file file, in string filename) => MSPACK_ERR.MSPACK_ERR_OK; /// /// Sets a CAB decompression engine parameter. diff --git a/libmspack/mschm_decompressor.cs b/libmspack/mschm_decompressor.cs index 4015593..f1396eb 100644 --- a/libmspack/mschm_decompressor.cs +++ b/libmspack/mschm_decompressor.cs @@ -11,8 +11,6 @@ namespace SabreTools.Compression.libmspack { public mschmd_decompress_state d { get; set; } - public MSPACK_ERR error { get; set; } - /// /// Opens a CHM helpfile and reads its contents. /// diff --git a/libmspack/mshlp_compressor.cs b/libmspack/mshlp_compressor.cs index 0c4b44f..6c6630b 100644 --- a/libmspack/mshlp_compressor.cs +++ b/libmspack/mshlp_compressor.cs @@ -3,7 +3,7 @@ namespace SabreTools.Compression.libmspack /// /// TODO /// - public class mshlp_compressor : Compressor + public class mshlp_compressor : BaseCompressor { public int dummy { get; set; } } diff --git a/libmspack/mskwaj_decompressor.cs b/libmspack/mskwaj_decompressor.cs index 45478f4..2d7d49f 100644 --- a/libmspack/mskwaj_decompressor.cs +++ b/libmspack/mskwaj_decompressor.cs @@ -9,8 +9,6 @@ namespace SabreTools.Compression.libmspack /// public abstract class mskwaj_decompressor : Decompressor { - public MSPACK_ERR error { get; set; } - /// /// Opens a KWAJ file and reads the header. /// diff --git a/libmspack/mslit_compressor.cs b/libmspack/mslit_compressor.cs index 9d40235..c69cb9f 100644 --- a/libmspack/mslit_compressor.cs +++ b/libmspack/mslit_compressor.cs @@ -3,7 +3,7 @@ namespace SabreTools.Compression.libmspack /// /// TODO /// - public class mslit_compressor : Compressor + public class mslit_compressor : BaseCompressor { public int dummy { get; set; } } diff --git a/libmspack/msoab_compressor.cs b/libmspack/msoab_compressor.cs index dba4489..d4f76a7 100644 --- a/libmspack/msoab_compressor.cs +++ b/libmspack/msoab_compressor.cs @@ -7,7 +7,7 @@ namespace SabreTools.Compression.libmspack /// /// /// - public abstract class msoab_compressor : Compressor + public abstract class msoab_compressor : BaseCompressor { /// /// Compress a full OAB file. diff --git a/libmspack/mspack.cs b/libmspack/mspack.cs index 05981d9..4dc5c60 100644 --- a/libmspack/mspack.cs +++ b/libmspack/mspack.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.Serialization; namespace SabreTools.Compression.libmspack { @@ -8,14 +7,14 @@ namespace SabreTools.Compression.libmspack /// /// Creates a new CAB compressor. /// - /// A custom mspack_system structure, or null to use the default - /// A or null - public static mscab_compressor mspack_create_cab_compressor(mspack_system sys) => null; + /// A custom structure, or null to use the default + /// A or null + public static CAB.Compressor CreateCABCompressor(mspack_system sys) => null; /// /// Creates a new CAB decompressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static mscab_decompressor mspack_create_cab_decompressor(mspack_system sys) { @@ -39,8 +38,8 @@ namespace SabreTools.Compression.libmspack /// /// Destroys an existing CAB compressor. /// - /// The to destroy - public static void mspack_destroy_cab_compressor(mscab_compressor self) { } + /// The to destroy + public static void DestroyCABCompressor(CAB.Compressor self) { } /// /// Destroys an existing CAB decompressor. @@ -65,22 +64,22 @@ namespace SabreTools.Compression.libmspack /// /// Creates a new CHM compressor. /// - /// A custom mspack_system structure, or null to use the default - /// A or null - public static mschm_compressor mspack_create_chm_compressor(mspack_system sys) => null; + /// A custom structure, or null to use the default + /// A or null + public static CHM.Compressor CreateCHMCompressor(mspack_system sys) => null; /// /// Creates a new CHM decompressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static mschm_decompressor mspack_create_chm_decompressor(mspack_system sys) => throw new NotImplementedException(); /// /// Destroys an existing CHM compressor. /// - /// The to destroy - public static void mspack_destroy_chm_compressor(mschm_compressor self) { } + /// The to destroy + public static void DestroyCHMCompressor(CHM.Compressor self) { } /// /// Destroys an existing CHM decompressor. @@ -91,14 +90,14 @@ namespace SabreTools.Compression.libmspack /// /// Creates a new LIT compressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static mslit_compressor mspack_create_lit_compressor(mspack_system sys) => null; /// /// Creates a new LIT decompressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static mslit_decompressor mspack_create_lit_decompressor(mspack_system sys) => null; @@ -117,14 +116,14 @@ namespace SabreTools.Compression.libmspack /// /// Creates a new HLP compressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static mshlp_compressor mspack_create_hlp_compressor(mspack_system sys) => null; /// /// Creates a new HLP decompressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static mshlp_decompressor mspack_create_hlp_decompressor(mspack_system sys) => null; @@ -143,14 +142,14 @@ namespace SabreTools.Compression.libmspack /// /// Creates a new SZDD compressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static msszdd_compressor mspack_create_szdd_compressor(mspack_system sys) => null; /// /// Creates a new SZDD decompressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static msszdd_decompressor mspack_create_szdd_decompressor(mspack_system sys) { @@ -187,22 +186,22 @@ namespace SabreTools.Compression.libmspack /// /// Creates a new KWAJ compressor. /// - /// A custom mspack_system structure, or null to use the default - /// A or null - public static mskwaj_compressor mspack_create_kwaj_compressor(mspack_system sys) => null; + /// A custom structure, or null to use the default + /// A or null + public static KWAJ.Compressor CreateKWAJCompressor(mspack_system sys) => null; /// /// Creates a new KWAJ decompressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static mskwaj_decompressor mspack_create_kwaj_decompressor(mspack_system sys) => throw new NotImplementedException(); /// /// Destroys an existing KWAJ compressor. /// - /// The to destroy - public static void mspack_destroy_kwaj_compressor(mskwaj_compressor self) { } + /// The to destroy + public static void DestroyKWAJCompressor(KWAJ.Compressor self) { } /// /// Destroys an existing KWAJ decompressor. @@ -213,14 +212,14 @@ namespace SabreTools.Compression.libmspack /// /// Creates a new OAB compressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static msoab_compressor mspack_create_oab_compressor(mspack_system sys) => throw new NotImplementedException(); /// /// Creates a new OAB decompressor. /// - /// A custom mspack_system structure, or null to use the default + /// A custom structure, or null to use the default /// A or null public static msoab_decompressor mspack_create_oab_decompressor(mspack_system sys) { diff --git a/libmspack/msszdd_compressor.cs b/libmspack/msszdd_compressor.cs index 4653317..d2a5d1d 100644 --- a/libmspack/msszdd_compressor.cs +++ b/libmspack/msszdd_compressor.cs @@ -7,10 +7,8 @@ namespace SabreTools.Compression.libmspack /// /// /// - public abstract class msszdd_compressor : Compressor + public abstract class msszdd_compressor : BaseCompressor { - public MSPACK_ERR error { get; set; } - /// /// Reads an input file and creates a compressed output file in the /// SZDD compressed file format. The SZDD compression format is quick diff --git a/libmspack/msszdd_decompressor.cs b/libmspack/msszdd_decompressor.cs index e546f3b..3bf2fd2 100644 --- a/libmspack/msszdd_decompressor.cs +++ b/libmspack/msszdd_decompressor.cs @@ -12,8 +12,6 @@ namespace SabreTools.Compression.libmspack /// public unsafe class msszdd_decompressor : Decompressor { - public MSPACK_ERR error { get; set; } - /// /// Opens a SZDD file and reads the header. ///