Natalia Portillo adecbc7c7f Unify external API signatures across all buffer transforms
Every exported buffer transform now has the same shape:

    int32_t AARU_xxx(const uint8_t *src_buffer, size_t src_size,
                     uint8_t *dst_buffer, size_t *dst_size, ...extras);

On entry *dst_size is the capacity of dst_buffer; on success it holds the
number of bytes written. The return value is 0 (AARU_ERROR_NONE) on success
and non-zero on error, either an AARU_ERROR_* constant or the underlying
library's own error code when it is propagated.

Changes by category:

- Parameter reorder only: all AARU_zip_*, AARU_stuffit*, AARU_dd_*,
  AARU_cpt_*, AARU_lzo_*, AARU_xz_*, AARU_lzma2_*, AARU_kencode_*,
  AARU_apple_lzh_* and ace_decompress_*.
- Byte count return replaced by an out-parameter plus a status code:
  AARU_adc_*, AARU_apple_rle_*, AARU_lz4_*, AARU_lzip_*, AARU_lzfse_*,
  AARU_lzvn_*, AARU_zstd_* and AARU_flac_*. Their algorithm bodies are kept
  as static internals behind a thin exported wrapper.
- Type normalisation: bzip2 uint32_t* -> size_t*, zstd void* -> uint8_t*,
  ZIP PPMd size_t -> size_t*, and int/unsigned char -> int32_t/uint8_t
  throughout the header.
- AARU_lzma_decode_buffer no longer takes src_size as an in/out pointer; the
  consumed length is tracked internally.
- Already conforming decompressors (arc_*, pak_*, ha_*, lha_*, larc_*,
  pmarc_*, arj*, rar*, lh5_decompress) only had their declarations
  normalised.

The streaming LZD context API and AARU_get_acn_version are left alone, as
they are not buffer transforms.

Tests updated to the new call convention; all 78 pass.
2026-08-31 12:26:05 +01:00
2024-12-19 15:24:07 +00:00
2025-12-23 08:21:08 +00:00
2026-04-16 23:19:47 +01:00
2025-12-23 08:21:08 +00:00
2025-12-23 08:21:08 +00:00
2024-12-19 15:24:27 +00:00
2025-12-26 14:09:26 +01:00
2026-07-14 17:48:45 +01:00
2024-04-30 15:37:29 +01:00
2025-12-23 08:21:08 +00:00
2024-04-30 15:37:29 +01:00
2021-10-14 04:44:34 +01:00

Aaru.Compression.Native

This repository contains the Aaru.Compression.Native library for Aaru.

The purpose of this library is to provide compression and de-compression algorithms for Aaru.

No archiver processing code should fall here, those go in Aaru.Compression.

To build you just need Docker on Linux and run build.sh, that will generate a NuGet package for use with Aaru.Compression.

Currently implemented algorithms are:

General-purpose codecs

  • Apple Data Compression (RLE with sliding dictionary created for Apple Disk Copy's NDIF)
  • Apple LZH (LH1 variant used by Apple DART's "best" compression mode)
  • Apple RLE (Run Length Encoding created for Apple DART)
  • BZIP2
  • FLAC
  • KenCode (LZSS with variable-length prefix codes created for Apple Disk Copy's NDIF)
  • LZ4
  • LZFSE
  • LZIP
  • LZMA / LZMA2 / XZ
  • LZO
  • NDIF ShrinkWrap SIT2 (block Huffman LZSS from ShrinkWrap 3's Component Manager codec)
  • Zstandard

Archive decompressors

  • ACE v1 (LZ77) and v2 (blocked with delta/EXE/sound/picture modes)
  • ARC methods 39 (pack, squeeze, crunch, squash) and PAK methods 1011 (crush, distill)
  • ARJ methods 14 and ARJZ (standard LZH and extended DEFLATE)
  • Compact Pro (RLE, LZH+RLE)
  • DiskDoubler (ADn LZSS, DDn block Huffman LZ77, adaptive Huffman, Stac LZS, Compact Pro, LZW)
  • HA (ASC and HSC)
  • LHA (LH1LH7, LArc LZS/LZ5, PMarc PM1/PM2)
  • RAR 1.5 (custom LZ77 with fixed Huffman tables)
  • RAR 2.0 (block Huffman LZ77 with optional multichannel audio)
  • RAR 3.0 (Huffman LZ77 / PPMd Variant H with VM-based post-filters)
  • RAR 5.0 (Huffman LZ77 with native Delta/E8/E8E9/ARM filters)
  • StuffIt classic methods 13, 5, 8, 1315 (RLE, LZW, Huffman, LZAH, MW, LZSS, Arsenic)
  • StuffIt X methods 04, 6 (Brimstone/PPMd, Cyanide/BWT, Darkhorse/LZSS, Deflate, Blend, Iron/BWT)
  • StuffIt X preprocessors (English dictionary, x86 executable transform)
  • ZIP methods 16, 9-10, 9698 (Shrink, Reduce, Implode, DCL Implode, Deflate64, WinZip JPEG, WavPack, PPMd)
  • Zoo (LZD, LH5)

Each of these algorithms have a corresponding license, that can be found in their corresponding folder.

The resulting output of build.sh falls under the LGPL 2.1 license as stated in the LICENSE file.

Any new algorithm added should be under a license compatible with the LGPL 2.1 license to be accepted.

© 2021-2026 Natalia Portillo

Description
C library of compression algorithms used by Aaru.
Readme LGPL-2.1 36 MiB
Languages
C 94%
C++ 4.7%
CMake 0.8%
Shell 0.5%