summaryrefslogtreecommitdiff
path: root/release/src/linux/linux/scripts/squashfs/lzma/C/7zip/Compress/LZMA_Alone/LzmaRamDecode.h
blob: 783734a44fe8b34674da40e70a5501320591d77f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* LzmaRamDecode.h */

#ifndef __LzmaRamDecode_h
#define __LzmaRamDecode_h

#include <stdlib.h>

/*
LzmaRamGetUncompressedSize:
  In: 
    inBuffer - input data
    inSize   - input data size
  Out: 
    outSize  - uncompressed size
  Return code:
    0 - OK
    1 - Error in headers
*/

int LzmaRamGetUncompressedSize(
    const unsigned char *inBuffer, 
    size_t inSize,
    size_t *outSize);


/*
LzmaRamDecompress:
  In: 
    inBuffer  - input data
    inSize    - input data size
    outBuffer - output data
    outSize   - output size
    allocFunc - alloc function (can be malloc)
    freeFunc  - free function (can be free)
  Out: 
    outSizeProcessed - processed size
  Return code:
    0 - OK
    1 - Error in headers / data stream
    2 - Memory allocating error

Memory requirements depend from properties of LZMA stream.
With default lzma settings it's about 16 KB.
*/

int LzmaRamDecompress(
    const unsigned char *inBuffer, 
    size_t inSize,
    unsigned char *outBuffer,
    size_t outSize,
    size_t *outSizeProcessed,
    void * (*allocFunc)(size_t size), 
    void (*freeFunc)(void *));

#endif