source: src/linux/sl2312/linux-2.6.23/fs/jffs2/lzma/LzmaEnc.h @ 10886

Last change on this file since 10886 was 10886, checked in by BrainSlayer, 5 years ago

further storm patches for lzma jffs2

File size: 2.9 KB
Line 
1/*  LzmaEnc.h -- LZMA Encoder
22008-04-27
3Copyright (c) 1999-2008 Igor Pavlov
4Read LzFind.h for license options */
5
6#ifndef __LZMAENC_H
7#define __LZMAENC_H
8
9#include "Types.h"
10
11#define LZMA_PROPS_SIZE 5
12
13typedef struct _CLzmaEncProps
14{
15  int level;       /*  0 <= level <= 9 */
16  UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
17                      (1 << 12) <= dictSize <= (1 << 30) for 64-bit version
18                       default = (1 << 24) */
19  int lc;          /* 0 <= lc <= 8, default = 3 */
20  int lp;          /* 0 <= lp <= 4, default = 0 */
21  int pb;          /* 0 <= pb <= 4, default = 2 */
22  int algo;        /* 0 - fast, 1 - normal, default = 1 */
23  int fb;          /* 5 <= fb <= 273, default = 32 */
24  int btMode;      /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
25  int numHashBytes; /* 2, 3 or 4, default = 4 */
26  UInt32 mc;        /* 1 <= mc <= (1 << 30), default = 32 */
27  unsigned writeEndMark;  /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
28  int numThreads;  /* 1 or 2, default = 2 */
29} CLzmaEncProps;
30
31void LzmaEncProps_Init(CLzmaEncProps *p);
32void LzmaEncProps_Normalize(CLzmaEncProps *p);
33UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
34
35
36/* ---------- CLzmaEncHandle Interface ---------- */
37
38/* LzmaEnc_* functions can return the following exit codes:
39Returns:
40  SZ_OK           - OK
41  SZ_ERROR_MEM    - Memory allocation error
42  SZ_ERROR_PARAM  - Incorrect paramater in props
43  SZ_ERROR_WRITE  - Write callback error.
44  SZ_ERROR_PROGRESS - some break from progress callback
45  SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
46*/
47
48typedef void * CLzmaEncHandle;
49
50CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
51void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
52SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
53SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
54SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
55    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
56SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
57    int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
58
59/* ---------- One Call Interface ---------- */
60
61/* LzmaEncode
62Return code:
63  SZ_OK               - OK
64  SZ_ERROR_MEM        - Memory allocation error
65  SZ_ERROR_PARAM      - Incorrect paramater
66  SZ_ERROR_OUTPUT_EOF - output buffer overflow
67  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)
68*/
69
70SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
71    const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
72    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
73
74#endif
Note: See TracBrowser for help on using the repository browser.