mirror of
https://github.com/SabreTools/SabreTools.Compression.git
synced 2026-02-17 05:45:27 +00:00
254 lines
10 KiB
C#
254 lines
10 KiB
C#
using System;
|
|
|
|
namespace SabreTools.Compression.libmspack
|
|
{
|
|
public partial class mspack
|
|
{
|
|
#region CAB
|
|
|
|
/// <summary>
|
|
/// Creates a new CAB compressor.
|
|
/// </summary>
|
|
/// <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>
|
|
/// <returns>A <see cref="CAB.Decompressor"/> or null</returns>
|
|
public static CAB.Decompressor CreateCABDecompressor()
|
|
{
|
|
var self = new CAB.Decompressor
|
|
{
|
|
system = new CAB.CABSystem(),
|
|
d = null,
|
|
error = MSPACK_ERR.MSPACK_ERR_OK,
|
|
|
|
searchbuf_size = 32768,
|
|
fix_mszip = 0,
|
|
buf_size = 4096,
|
|
salvage = 0,
|
|
};
|
|
|
|
return self;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Destroys an existing CAB compressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="CAB.Compressor"/> to destroy</param>
|
|
public static void DestroyCABCompressor(CAB.Compressor self) { }
|
|
|
|
/// <summary>
|
|
/// Destroys an existing CAB decompressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="CAB.Decompressor"/> to destroy</param>
|
|
public static void DestroyCABDecompressor(CAB.Decompressor self)
|
|
{
|
|
if (self != null)
|
|
{
|
|
mspack_system sys = self.system;
|
|
if (self.d != null)
|
|
{
|
|
if (self.d.infh != null) sys.close(self.d.infh);
|
|
cab.cabd_free_decomp(self);
|
|
//sys.free(self.d);
|
|
}
|
|
|
|
//sys.free(self);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// Creates a new CHM compressor.
|
|
/// </summary>
|
|
/// <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 <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="CHM.Compressor"/> to destroy</param>
|
|
public static void DestroyCHMCompressor(CHM.Compressor self) { }
|
|
|
|
/// <summary>
|
|
/// Destroys an existing CHM decompressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="mschm_decompressor"/> to destroy</param>
|
|
public static void mspack_destroy_chm_decompressor(mschm_decompressor self) => throw new NotImplementedException();
|
|
|
|
/// <summary>
|
|
/// Creates a new LIT compressor.
|
|
/// </summary>
|
|
/// <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 <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;
|
|
|
|
/// <summary>
|
|
/// Destroys an existing LIT compressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="mslit_compressor"/> to destroy</param>
|
|
public static void mspack_destroy_lit_compressor(mslit_compressor self) { }
|
|
|
|
/// <summary>
|
|
/// Destroys an existing LIT decompressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="mslit_decompressor"/> to destroy</param>
|
|
public static void mspack_destroy_lit_decompressor(mslit_decompressor self) { }
|
|
|
|
/// <summary>
|
|
/// Creates a new HLP compressor.
|
|
/// </summary>
|
|
/// <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 <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;
|
|
|
|
/// <summary>
|
|
/// Destroys an existing hlp compressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="mshlp_compressor"/> to destroy</param>
|
|
public static void mspack_destroy_hlp_compressor(mshlp_compressor self) { }
|
|
|
|
/// <summary>
|
|
/// Destroys an existing hlp decompressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="mshlp_decompressor"/> to destroy</param>
|
|
public static void mspack_destroy_hlp_decompressor(mshlp_decompressor self) { }
|
|
|
|
/// <summary>
|
|
/// Creates a new SZDD compressor.
|
|
/// </summary>
|
|
/// <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 <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)
|
|
{
|
|
msszdd_decompressor self = null;
|
|
|
|
if (sys == null) sys = new mspack_default_system();
|
|
|
|
self = new msszdd_decompressor();
|
|
self.system = sys;
|
|
self.error = MSPACK_ERR.MSPACK_ERR_OK;
|
|
|
|
return self;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Destroys an existing SZDD compressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="msszdd_compressor"/> to destroy</param>
|
|
public static void mspack_destroy_szdd_compressor(msszdd_compressor self) { }
|
|
|
|
/// <summary>
|
|
/// Destroys an existing SZDD decompressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="msszdd_decompressor"/> to destroy</param>
|
|
public static void mspack_destroy_szdd_decompressor(msszdd_decompressor self)
|
|
{
|
|
if (self != null)
|
|
{
|
|
mspack_system sys = self.system;
|
|
//sys.free(self);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a new KWAJ compressor.
|
|
/// </summary>
|
|
/// <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 <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="KWAJ.Compressor"/> to destroy</param>
|
|
public static void DestroyKWAJCompressor(KWAJ.Compressor self) { }
|
|
|
|
/// <summary>
|
|
/// Destroys an existing KWAJ decompressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="mskwaj_decompressor"/> to destroy</param>
|
|
public static void mspack_destroy_kwaj_decompressor(mskwaj_decompressor self) => throw new NotImplementedException();
|
|
|
|
/// <summary>
|
|
/// Creates a new OAB compressor.
|
|
/// </summary>
|
|
/// <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 <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)
|
|
{
|
|
if (sys == null) sys = new mspack_oab_system();
|
|
|
|
msoab_decompressor self = new msoab_decompressor();
|
|
self.system = sys;
|
|
self.buf_size = 4096;
|
|
return self;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Destroys an existing OAB compressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="msoab_compressor"/> to destroy</param>
|
|
public static void mspack_destroy_oab_compressor(msoab_compressor self)
|
|
{
|
|
if (self != null)
|
|
{
|
|
mspack_system sys = self.system;
|
|
//sys.free(self);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Destroys an existing OAB decompressor.
|
|
/// </summary>
|
|
/// <param name="self">The <see cref="msoab_decompressor"/> to destroy</param>
|
|
public static void mspack_destroy_oab_decompressor(msoab_decompressor self) => throw new NotImplementedException();
|
|
}
|
|
} |