~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/lzma/LzmaStateDecode.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
  LzmaStateDecode.h
3
 
  LZMA Decoder interface (State version)
4
 
 
5
 
  LZMA SDK 4.40 Copyright (c) 1999-2006 Igor Pavlov (2006-05-01)
6
 
  http://www.7-zip.org/
7
 
 
8
 
  LZMA SDK is licensed under two licenses:
9
 
  1) GNU Lesser General Public License (GNU LGPL)
10
 
  2) Common Public License (CPL)
11
 
  It means that you can select one of these two licenses and 
12
 
  follow rules of that license.
13
 
 
14
 
  SPECIAL EXCEPTION:
15
 
  Igor Pavlov, as the author of this code, expressly permits you to 
16
 
  statically or dynamically link your code (or bind by name) to the 
17
 
  interfaces of this file without subjecting your linked code to the 
18
 
  terms of the CPL or GNU LGPL. Any modifications or additions 
19
 
  to this file, however, are subject to the LGPL or CPL terms.
20
 
*/
21
 
 
22
 
#ifndef __LZMASTATEDECODE_H
23
 
#define __LZMASTATEDECODE_H
24
 
 
25
 
#include "LzmaTypes.h"
26
 
 
27
 
/* #define _LZMA_PROB32 */
28
 
/* It can increase speed on some 32-bit CPUs, 
29
 
   but memory usage will be doubled in that case */
30
 
 
31
 
#ifdef _LZMA_PROB32
32
 
#define CProb UInt32
33
 
#else
34
 
#define CProb UInt16
35
 
#endif
36
 
 
37
 
#define LZMA_RESULT_OK 0
38
 
#define LZMA_RESULT_DATA_ERROR 1
39
 
 
40
 
#define LZMA_BASE_SIZE 1846
41
 
#define LZMA_LIT_SIZE 768
42
 
 
43
 
#define LZMA_PROPERTIES_SIZE 5
44
 
 
45
 
typedef struct _CLzmaProperties
46
 
{
47
 
  int lc;
48
 
  int lp;
49
 
  int pb;
50
 
  UInt32 DictionarySize;
51
 
}CLzmaProperties;
52
 
 
53
 
int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size);
54
 
 
55
 
#define LzmaGetNumProbs(lzmaProps) (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((lzmaProps)->lc + (lzmaProps)->lp)))
56
 
 
57
 
#define kLzmaInBufferSize 64   /* don't change it. it must be larger than kRequiredInBufferSize */
58
 
 
59
 
#define kLzmaNeedInitId (-2)
60
 
 
61
 
typedef struct _CLzmaDecoderState
62
 
{
63
 
  CLzmaProperties Properties;
64
 
  CProb *Probs;
65
 
  unsigned char *Dictionary;
66
 
 
67
 
  unsigned char Buffer[kLzmaInBufferSize];
68
 
  int BufferSize;
69
 
 
70
 
  UInt32 Range;
71
 
  UInt32 Code;
72
 
  UInt32 DictionaryPos;
73
 
  UInt32 GlobalPos;
74
 
  UInt32 DistanceLimit;
75
 
  UInt32 Reps[4];
76
 
  int State;
77
 
  int RemainLen;  /* -2: decoder needs internal initialization
78
 
                     -1: stream was finished, 
79
 
                      0: ok
80
 
                    > 0: need to write RemainLen bytes as match Reps[0],
81
 
                  */
82
 
  unsigned char TempDictionary[4];  /* it's required when DictionarySize = 0 */
83
 
} CLzmaDecoderState;
84
 
 
85
 
#define LzmaDecoderInit(vs) { (vs)->RemainLen = kLzmaNeedInitId; (vs)->BufferSize = 0; }
86
 
 
87
 
/* LzmaDecode: decoding from input stream to output stream.
88
 
  If finishDecoding != 0, then there are no more bytes in input stream
89
 
  after inStream[inSize - 1]. */
90
 
 
91
 
int LzmaDecode(CLzmaDecoderState *vs,
92
 
    const unsigned char *inStream, SizeT inSize,  SizeT *inSizeProcessed,
93
 
    unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed,
94
 
    int finishDecoding);
95
 
 
96
 
#endif