Path: blob/master/thirdparty/graphite/src/inc/Decompressor.h
9906 views
// SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later1// Copyright 2015, SIL International, All rights reserved.234#pragma once56#include <cstddef>78namespace lz49{1011// decompress an LZ4 block12// Parameters:13// @in - Input buffer containing an LZ4 block.14// @in_size - Size of the input LZ4 block in bytes.15// @out - Output buffer to hold decompressed results.16// @out_size - The size of the buffer pointed to by @out.17// Invariants:18// @in - This buffer must be at least 1 machine word in length,19// regardless of the actual LZ4 block size.20// @in_size - This must be at least 4 and must also be <= to the21// allocated buffer @in.22// @out - This must be bigger than the input buffer and at least23// 13 bytes.24// @out_size - Must always be big enough to hold the expected size.25// Return:26// -1 - Decompression failed.27// size - Actual number of bytes decompressed.28int decompress(void const *in, size_t in_size, void *out, size_t out_size);2930} // end of namespace shrinker313233