Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.7 KiB

  1. /* Lzma2Enc.h -- LZMA2 Encoder
  2. 2013-01-18 : Igor Pavlov : Public domain */
  3. #ifndef __LZMA2_ENC_H
  4. #define __LZMA2_ENC_H
  5. #include "LzmaEnc.h"
  6. EXTERN_C_BEGIN
  7. typedef struct
  8. {
  9. CLzmaEncProps lzmaProps;
  10. size_t blockSize;
  11. int numBlockThreads;
  12. int numTotalThreads;
  13. } CLzma2EncProps;
  14. void Lzma2EncProps_Init(CLzma2EncProps *p);
  15. void Lzma2EncProps_Normalize(CLzma2EncProps *p);
  16. /* ---------- CLzmaEnc2Handle Interface ---------- */
  17. /* Lzma2Enc_* functions can return the following exit codes:
  18. Returns:
  19. SZ_OK - OK
  20. SZ_ERROR_MEM - Memory allocation error
  21. SZ_ERROR_PARAM - Incorrect paramater in props
  22. SZ_ERROR_WRITE - Write callback error
  23. SZ_ERROR_PROGRESS - some break from progress callback
  24. SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
  25. */
  26. typedef void * CLzma2EncHandle;
  27. CLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig);
  28. void Lzma2Enc_Destroy(CLzma2EncHandle p);
  29. SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props);
  30. Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p);
  31. SRes Lzma2Enc_Encode(CLzma2EncHandle p,
  32. ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress);
  33. /* ---------- One Call Interface ---------- */
  34. /* Lzma2Encode
  35. Return code:
  36. SZ_OK - OK
  37. SZ_ERROR_MEM - Memory allocation error
  38. SZ_ERROR_PARAM - Incorrect paramater
  39. SZ_ERROR_OUTPUT_EOF - output buffer overflow
  40. SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
  41. */
  42. /*
  43. SRes Lzma2Encode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
  44. const CLzmaEncProps *props, Byte *propsEncoded, int writeEndMark,
  45. ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
  46. */
  47. EXTERN_C_END
  48. #endif