mirror of
https://github.com/SabreTools/SabreTools.Compression.git
synced 2026-09-21 14:24:55 +00:00
Checkpoint (nw)
This commit is contained in:
@@ -3,8 +3,14 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Base class for all compressor implementations
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,14 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Base class for all decompressor implementations
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
}
|
||||
49
libmspack/BitStream.cs
Normal file
49
libmspack/BitStream.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
namespace SabreTools.Compression.libmspack
|
||||
{
|
||||
public unsafe abstract class BitStream
|
||||
{
|
||||
/// <summary>
|
||||
/// I/O routines
|
||||
/// </summary>
|
||||
public mspack_system sys { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Input file handle
|
||||
/// </summary>
|
||||
public mspack_file input { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Output file handle
|
||||
/// </summary>
|
||||
public mspack_file output { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Decompression offset within window
|
||||
/// </summary>
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace SabreTools.Compression.libmspack
|
||||
namespace SabreTools.Compression.libmspack.CAB
|
||||
{
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public class mscab_compressor : Compressor
|
||||
public class Compressor : BaseCompressor
|
||||
{
|
||||
public int dummy { get; set; }
|
||||
}
|
||||
68
libmspack/CAB/Constants.cs
Normal file
68
libmspack/CAB/Constants.cs
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,18 @@
|
||||
namespace SabreTools.Compression.libmspack
|
||||
namespace SabreTools.Compression.libmspack.CHM
|
||||
{
|
||||
/// <summary>
|
||||
/// A compressor for .CHM (Microsoft HTMLHelp) files.
|
||||
///
|
||||
/// All fields are READ ONLY.
|
||||
/// </summary>
|
||||
/// <see cref="mspack_create_chm_compressor()"/>
|
||||
/// <see cref="mspack_destroy_chm_compressor()"/>
|
||||
public abstract class mschm_compressor : Compressor
|
||||
/// <see cref="mspack.CreateCHMCompressor(mspack_system)"/>
|
||||
/// <see cref="mspack.DestroyCHMCompressor(Compressor)"/>
|
||||
public class Compressor : BaseCompressor
|
||||
{
|
||||
public string temp_file { get; set; }
|
||||
|
||||
public int use_temp_file { get; set; }
|
||||
|
||||
public MSPACK_ERR error { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Generates a CHM help file.
|
||||
///
|
||||
@@ -46,9 +44,9 @@ namespace SabreTools.Compression.libmspack
|
||||
/// This is passed directly to mspack_system::open()
|
||||
/// </param>
|
||||
/// <returns>An error code, or MSPACK_ERR_OK if successful</returns>
|
||||
/// <see cref="use_temporary_file()"/>
|
||||
/// <see cref="set_param()"/>
|
||||
public abstract MSPACK_ERR generate(mschmc_file[] file_list, in string output_file);
|
||||
/// <see cref="use_temporary_file(int in string)"/>
|
||||
/// <see cref="set_param(MSCHMC_PARAM, int)"/>
|
||||
public MSPACK_ERR generate(mschmc_file[] file_list, in string output_file) => MSPACK_ERR.MSPACK_ERR_OK;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies whether a temporary file is used during CHM generation.
|
||||
@@ -104,7 +102,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// </param>
|
||||
/// <returns>An error code, or MSPACK_ERR_OK if successful</returns>
|
||||
/// <see cref="generate(mschmc_file[], in string)"/>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Sets a CHM compression engine parameter.
|
||||
@@ -150,7 +148,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// is a problem with either parameter or value.
|
||||
/// </returns>
|
||||
/// <see cref="generate(mschmc_file[], in string)"/>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the error code set by the most recently called method.
|
||||
@@ -158,6 +156,6 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <returns>The most recent error code</returns>
|
||||
/// <see cref="set_param(int, int)"/>
|
||||
/// <see cref="generate(mschmc_file[], in string)"/>
|
||||
public abstract MSPACK_ERR last_error();
|
||||
public MSPACK_ERR last_error() => MSPACK_ERR.MSPACK_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -1,20 +1,16 @@
|
||||
namespace SabreTools.Compression.libmspack
|
||||
namespace SabreTools.Compression.libmspack.KWAJ
|
||||
{
|
||||
/// <summary>
|
||||
/// A compressor for the KWAJ file format.
|
||||
///
|
||||
/// All fields are READ ONLY.
|
||||
/// </summary>
|
||||
/// <see cref="mspack_create_kwaj_compressor()"/>
|
||||
/// <see cref="mspack_destroy_kwaj_compressor()"/>
|
||||
public unsafe abstract class mskwaj_compressor : Compressor
|
||||
/// <see cref="mspack.CreateKWAJCompressor(mspack_system)"/>
|
||||
/// <see cref="mspack.DestroyKWAJCompressor(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; }
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </param>
|
||||
/// <returns>An error code, or MSPACK_ERR_OK if successful</returns>
|
||||
/// <see cref="set_param(int, int)" />
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Sets an KWAJ compression engine parameter.
|
||||
@@ -60,7 +56,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// is a problem with either parameter or value.
|
||||
/// </returns>
|
||||
/// <see cref="generate()"/>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </returns>
|
||||
public abstract MSPACK_ERR set_filename(in string filename);
|
||||
public MSPACK_ERR set_filename(in string filename) => MSPACK_ERR.MSPACK_ERR_OK;
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </returns>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the error code set by the most recently called method.
|
||||
/// </summary>
|
||||
/// <returns>The most recent error code</returns>
|
||||
/// <see cref="compress(in string, in string, long)"/>
|
||||
public abstract MSPACK_ERR last_error();
|
||||
public MSPACK_ERR last_error() => MSPACK_ERR.MSPACK_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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; }
|
||||
|
||||
/// <summary>
|
||||
@@ -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
|
||||
/// <see cref="close(mscabd_cabinet)"/>
|
||||
/// <see cref="open(in string)"/>
|
||||
/// <see cref="last_error()"/>
|
||||
public abstract mscabd_cabinet search(in string filename);
|
||||
public mscabd_cabinet search(in string filename) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Appends one mscabd_cabinet to another, forming or extending a cabinet
|
||||
@@ -546,7 +545,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <see cref="prepend(mscabd_cabinet, mscabd_cabinet)"/>
|
||||
/// <see cref="open(in string)"/>
|
||||
/// <see cref="close(mscabd_cabinet)"/>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Prepends one mscabd_cabinet to another, forming or extending a
|
||||
@@ -563,7 +562,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <see cref="append(mscabd_cabinet, mscabd_cabinet)"/>
|
||||
/// <see cref="open(in string)"/>
|
||||
/// <see cref="close(mscabd_cabinet)"/>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Extracts a file from a cabinet or cabinet set.
|
||||
@@ -584,7 +583,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <param name="file">The file to be decompressed</param>
|
||||
/// <param name="filename">The filename of the file being written to</param>
|
||||
/// <returns>An error code, or MSPACK_ERR.MSPACK_ERR_OK if successful</returns>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// Sets a CAB decompression engine parameter.
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace SabreTools.Compression.libmspack
|
||||
{
|
||||
public mschmd_decompress_state d { get; set; }
|
||||
|
||||
public MSPACK_ERR error { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opens a CHM helpfile and reads its contents.
|
||||
///
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public class mshlp_compressor : Compressor
|
||||
public class mshlp_compressor : BaseCompressor
|
||||
{
|
||||
public int dummy { get; set; }
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <see cref="mspack_destroy_kwaj_decompressor()"/>
|
||||
public abstract class mskwaj_decompressor : Decompressor
|
||||
{
|
||||
public MSPACK_ERR error { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opens a KWAJ file and reads the header.
|
||||
///
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public class mslit_compressor : Compressor
|
||||
public class mslit_compressor : BaseCompressor
|
||||
{
|
||||
public int dummy { get; set; }
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace SabreTools.Compression.libmspack
|
||||
/// </summary>
|
||||
/// <see cref="mspack_create_oab_compressor()"/>
|
||||
/// <see cref="mspack_destroy_oab_compressor()"/>
|
||||
public abstract class msoab_compressor : Compressor
|
||||
public abstract class msoab_compressor : BaseCompressor
|
||||
{
|
||||
/// <summary>
|
||||
/// Compress a full OAB file.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace SabreTools.Compression.libmspack
|
||||
{
|
||||
@@ -8,14 +7,14 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Creates a new CAB compressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mscab_compressor"/> or null</returns>
|
||||
public static mscab_compressor mspack_create_cab_compressor(mspack_system sys) => null;
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="CAB.Compressor"/> or null</returns>
|
||||
public static CAB.Compressor CreateCABCompressor(mspack_system sys) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new CAB decompressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mscab_decompressor"/> or null</returns>
|
||||
public static mscab_decompressor mspack_create_cab_decompressor(mspack_system sys)
|
||||
{
|
||||
@@ -39,8 +38,8 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Destroys an existing CAB compressor.
|
||||
/// </summary>
|
||||
/// <param name="self">The <see cref="mscab_compressor"/> to destroy</param>
|
||||
public static void mspack_destroy_cab_compressor(mscab_compressor self) { }
|
||||
/// <param name="self">The <see cref="CAB.Compressor"/> to destroy</param>
|
||||
public static void DestroyCABCompressor(CAB.Compressor self) { }
|
||||
|
||||
/// <summary>
|
||||
/// Destroys an existing CAB decompressor.
|
||||
@@ -65,22 +64,22 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Creates a new CHM compressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mschm_compressor"/> or null</returns>
|
||||
public static mschm_compressor mspack_create_chm_compressor(mspack_system sys) => null;
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="CHM.Compressor"/> or null</returns>
|
||||
public static CHM.Compressor CreateCHMCompressor(mspack_system sys) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new CHM decompressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mschm_decompressor"/> or null</returns>
|
||||
public static mschm_decompressor mspack_create_chm_decompressor(mspack_system sys) => throw new NotImplementedException();
|
||||
|
||||
/// <summary>
|
||||
/// Destroys an existing CHM compressor.
|
||||
/// </summary>
|
||||
/// <param name="self">The <see cref="mschm_compressor"/> to destroy</param>
|
||||
public static void mspack_destroy_chm_compressor(mschm_compressor self) { }
|
||||
/// <param name="self">The <see cref="CHM.Compressor"/> to destroy</param>
|
||||
public static void DestroyCHMCompressor(CHM.Compressor self) { }
|
||||
|
||||
/// <summary>
|
||||
/// Destroys an existing CHM decompressor.
|
||||
@@ -91,14 +90,14 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Creates a new LIT compressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mslit_compressor"/> or null</returns>
|
||||
public static mslit_compressor mspack_create_lit_compressor(mspack_system sys) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new LIT decompressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mslit_decompressor"/> or null</returns>
|
||||
public static mslit_decompressor mspack_create_lit_decompressor(mspack_system sys) => null;
|
||||
|
||||
@@ -117,14 +116,14 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Creates a new HLP compressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mshlp_compressor"/> or null</returns>
|
||||
public static mshlp_compressor mspack_create_hlp_compressor(mspack_system sys) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new HLP decompressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mshlp_decompressor"/> or null</returns>
|
||||
public static mshlp_decompressor mspack_create_hlp_decompressor(mspack_system sys) => null;
|
||||
|
||||
@@ -143,14 +142,14 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Creates a new SZDD compressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="msszdd_compressor"/> or null</returns>
|
||||
public static msszdd_compressor mspack_create_szdd_compressor(mspack_system sys) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new SZDD decompressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="msszdd_decompressor"/> or null</returns>
|
||||
public static msszdd_decompressor mspack_create_szdd_decompressor(mspack_system sys)
|
||||
{
|
||||
@@ -187,22 +186,22 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Creates a new KWAJ compressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mskwaj_compressor"/> or null</returns>
|
||||
public static mskwaj_compressor mspack_create_kwaj_compressor(mspack_system sys) => null;
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="KWAJ.Compressor"/> or null</returns>
|
||||
public static KWAJ.Compressor CreateKWAJCompressor(mspack_system sys) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new KWAJ decompressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="mskwaj_decompressor"/> or null</returns>
|
||||
public static mskwaj_decompressor mspack_create_kwaj_decompressor(mspack_system sys) => throw new NotImplementedException();
|
||||
|
||||
/// <summary>
|
||||
/// Destroys an existing KWAJ compressor.
|
||||
/// </summary>
|
||||
/// <param name="self">The <see cref="mskwaj_compressor"/> to destroy</param>
|
||||
public static void mspack_destroy_kwaj_compressor(mskwaj_compressor self) { }
|
||||
/// <param name="self">The <see cref="KWAJ.Compressor"/> to destroy</param>
|
||||
public static void DestroyKWAJCompressor(KWAJ.Compressor self) { }
|
||||
|
||||
/// <summary>
|
||||
/// Destroys an existing KWAJ decompressor.
|
||||
@@ -213,14 +212,14 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <summary>
|
||||
/// Creates a new OAB compressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="msoab_compressor"/> or null</returns>
|
||||
public static msoab_compressor mspack_create_oab_compressor(mspack_system sys) => throw new NotImplementedException();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new OAB decompressor.
|
||||
/// </summary>
|
||||
/// <param name="sys">A custom mspack_system structure, or null to use the default</param>
|
||||
/// <param name="sys">A custom <see cref="mspack_system"/> structure, or null to use the default</param>
|
||||
/// <returns>A <see cref="msoab_decompressor"/> or null</returns>
|
||||
public static msoab_decompressor mspack_create_oab_decompressor(mspack_system sys)
|
||||
{
|
||||
|
||||
@@ -7,10 +7,8 @@ namespace SabreTools.Compression.libmspack
|
||||
/// </summary>
|
||||
/// <see cref="mspack_create_szdd_compressor()"/>
|
||||
/// <see cref="mspack_destroy_szdd_compressor()"/>
|
||||
public abstract class msszdd_compressor : Compressor
|
||||
public abstract class msszdd_compressor : BaseCompressor
|
||||
{
|
||||
public MSPACK_ERR error { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reads an input file and creates a compressed output file in the
|
||||
/// SZDD compressed file format. The SZDD compression format is quick
|
||||
|
||||
@@ -12,8 +12,6 @@ namespace SabreTools.Compression.libmspack
|
||||
/// <see cref="mspack_destroy_szdd_decompressor()"/>
|
||||
public unsafe class msszdd_decompressor : Decompressor
|
||||
{
|
||||
public MSPACK_ERR error { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opens a SZDD file and reads the header.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user