2024-04-23 13:30:43 -04:00
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2023-09-04 00:12:49 -04:00
|
|
|
namespace SabreTools.Models.Compression.LZ
|
2023-09-04 00:11:04 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Format of first 14 byte of LZ compressed file
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
|
2024-04-23 13:30:43 -04:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
2023-09-04 00:11:04 -04:00
|
|
|
public sealed class FileHeaader
|
|
|
|
|
{
|
2024-04-23 13:30:43 -04:00
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
|
|
|
|
public string? Magic;
|
2023-09-04 00:11:04 -04:00
|
|
|
|
2024-04-23 13:30:43 -04:00
|
|
|
public byte CompressionType;
|
2023-09-04 00:11:04 -04:00
|
|
|
|
2024-04-23 13:30:43 -04:00
|
|
|
[MarshalAs(UnmanagedType.U1)]
|
|
|
|
|
public char LastChar;
|
2023-09-04 00:11:04 -04:00
|
|
|
|
2024-04-23 13:30:43 -04:00
|
|
|
public uint RealLength;
|
2023-09-04 00:11:04 -04:00
|
|
|
}
|
|
|
|
|
}
|