home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Utilitare / pec / pec2setup.exe / lzma / sdk / LzmaDecode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-04-25  |  1.9 KB  |  86 lines

  1. /* 
  2. LzmaDecode.h
  3. LZMA Decoder interface
  4. LZMA SDK 4.01 Copyright (c) 1999-2004 Igor Pavlov (2004-02-15)
  5. */
  6.  
  7. #ifndef __LZMADECODE_H
  8. #define __LZMADECODE_H
  9.  
  10. /* #define _LZMA_IN_CB */
  11. /* Use callback for input data */
  12.  
  13. /* #define _LZMA_OUT_READ */
  14. /* Use read function for output data */
  15.  
  16. /* #define _LZMA_PROB32 */
  17. /* It can increase speed on some 32-bit CPUs, 
  18.    but memory usage will be doubled in that case */
  19.  
  20. /* #define _LZMA_LOC_OPT */
  21. /* Enable local speed optimizations inside code */
  22.  
  23. #ifndef UInt32
  24. #ifdef _LZMA_UINT32_IS_ULONG
  25. #define UInt32 unsigned long
  26. #else
  27. #define UInt32 unsigned int
  28. #endif
  29. #endif
  30.  
  31. #ifdef _LZMA_PROB32
  32. #define CProb UInt32
  33. #else
  34. #define CProb unsigned short
  35. #endif
  36.  
  37. #define LZMA_RESULT_OK 0
  38. #define LZMA_RESULT_DATA_ERROR 1
  39. #define LZMA_RESULT_NOT_ENOUGH_MEM 2
  40.  
  41. #ifdef _LZMA_IN_CB
  42. typedef struct _ILzmaInCallback
  43. {
  44.   int (*Read)(void *object, unsigned char **buffer, UInt32 *bufferSize);
  45. } ILzmaInCallback;
  46. #endif
  47.  
  48. #define LZMA_BASE_SIZE 1846
  49. #define LZMA_LIT_SIZE 768
  50.  
  51. /* 
  52. bufferSize = (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp)))* sizeof(CProb)
  53. bufferSize += 100 in case of _LZMA_OUT_READ
  54. by default CProb is unsigned short, 
  55. but if specify _LZMA_PROB_32, CProb will be UInt32(unsigned int)
  56. */
  57.  
  58. #ifdef _LZMA_OUT_READ
  59. int LzmaDecoderInit(
  60.     unsigned char *buffer, UInt32 bufferSize,
  61.     int lc, int lp, int pb,
  62.     unsigned char *dictionary, UInt32 dictionarySize,
  63.   #ifdef _LZMA_IN_CB
  64.     ILzmaInCallback *inCallback
  65.   #else
  66.     unsigned char *inStream, UInt32 inSize
  67.   #endif
  68. );
  69. #endif
  70.  
  71. int LzmaDecode(
  72.     unsigned char *buffer, 
  73.   #ifndef _LZMA_OUT_READ
  74.     UInt32 bufferSize,
  75.     int lc, int lp, int pb,
  76.   #ifdef _LZMA_IN_CB
  77.     ILzmaInCallback *inCallback,
  78.   #else
  79.     unsigned char *inStream, UInt32 inSize,
  80.   #endif
  81.   #endif
  82.     unsigned char *outStream, UInt32 outSize,
  83.     UInt32 *outSizeProcessed);
  84.  
  85. #endif
  86.