blob: 2c46859a620c2cf950dda973d30ff9e82f449656 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Luigi 'Comio' Mantellinifc9c1722008-09-08 02:46:13 +02002/*
Luigi 'Comio' Mantellinicaf72ff2009-07-21 10:45:49 +02003 * Usefuls routines based on the LzmaTest.c file from LZMA SDK 4.65
Luigi 'Comio' Mantellinifc9c1722008-09-08 02:46:13 +02004 *
5 * Copyright (C) 2007-2008 Industrie Dial Face S.p.A.
6 * Luigi 'Comio' Mantellini (luigi.mantellini@idf-hit.com)
7 *
8 * Copyright (C) 1999-2005 Igor Pavlov
Luigi 'Comio' Mantellinifc9c1722008-09-08 02:46:13 +02009 */
10
11#ifndef __LZMA_TOOL_H__
12#define __LZMA_TOOL_H__
13
Luigi 'Comio' Mantellinicaf72ff2009-07-21 10:45:49 +020014#include <lzma/LzmaTypes.h>
Luigi 'Comio' Mantellinifc9c1722008-09-08 02:46:13 +020015
Simon Glassccfc9d72022-02-28 12:08:25 -070016/**
17 * lzmaBuffToBuffDecompress() - Decompress LZMA data
18 *
19 * @outStream: output buffer
20 * @uncompressedSize: On entry, the mnaximum uncompressed size of the data;
21 * on exit, the actual uncompressed size after processing
22 * @inStream: Compressed bytes to decompress
23 * @length: Sizeof @inStream
24 * @return 0 if OK, SZ_ERROR_DATA if the data is in a format that cannot be
25 * decompressed; SZ_ERROR_OUTPUT_EOF if *uncompressedSize is too small;
26 * see also other SZ_ERROR... values
27 */
28int lzmaBuffToBuffDecompress(unsigned char *outStream, SizeT *uncompressedSize,
29 const unsigned char *inStream, SizeT length);
30
Luigi 'Comio' Mantellinifc9c1722008-09-08 02:46:13 +020031#endif