Add ZStandard frame and dictionary types

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-29 13:36:01 +00:00
parent b9b159be4c
commit 3a6d24b1d9
5 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
namespace SharpCompress.Compressors.ZStandard.Unsafe;
public enum ZSTD_ResetDirective
{
ZSTD_reset_session_only = 1,
ZSTD_reset_parameters = 2,
ZSTD_reset_session_and_parameters = 3,
}

View File

@@ -0,0 +1,13 @@
namespace SharpCompress.Compressors.ZStandard.Unsafe;
public enum ZSTD_dictContentType_e
{
/// <summary>dictionary is "full" when starting with ZSTD_MAGIC_DICTIONARY, otherwise it is "rawContent"</summary>
ZSTD_dct_auto = 0,
/// <summary>ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY</summary>
ZSTD_dct_rawContent = 1,
/// <summary>refuses to load a dictionary if it does not respect Zstandard's specification</summary>
ZSTD_dct_fullDict = 2,
}

View File

@@ -0,0 +1,10 @@
namespace SharpCompress.Compressors.ZStandard.Unsafe;
public enum ZSTD_dictLoadMethod_e
{
/// <summary>Copy dictionary content internally</summary>
ZSTD_dlm_byCopy = 0,
/// <summary>Reference dictionary content -- the dictionary buffer must outlive its users</summary>
ZSTD_dlm_byRef = 1,
}

View File

@@ -0,0 +1,21 @@
namespace SharpCompress.Compressors.ZStandard.Unsafe;
public struct ZSTD_frameHeader
{
/// <summary>if == ZSTD_CONTENTSIZE_UNKNOWN, it means this field is not available. 0 means "empty"</summary>
public ulong frameContentSize;
/// <summary>can be very large, up to frameContentSize</summary>
public ulong windowSize;
public uint blockSizeMax;
/// <summary>if == ZSTD_skippableFrame, frameContentSize is the size of skippable content</summary>
public ZSTD_frameType_e frameType;
public uint headerSize;
/// <summary>for ZSTD_skippableFrame, contains the skippable magic variant [0-15]</summary>
public uint dictID;
public uint checksumFlag;
public uint _reserved1;
public uint _reserved2;
}

View File

@@ -0,0 +1,7 @@
namespace SharpCompress.Compressors.ZStandard.Unsafe;
public enum ZSTD_frameType_e
{
ZSTD_frame,
ZSTD_skippableFrame,
}