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.

61 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: LZMA Glue. Designed for Tool time Encoding/Decoding.
  4. //
  5. // LZMA Codec interface for engine. Based largely on LzmaUtil.c in SDK
  6. //
  7. // LZMA SDK 9.38 beta
  8. // 2015-01-03 : Igor Pavlov : Public domain
  9. // http://www.7-zip.org/
  10. //
  11. //====================================================================================//
  12. #ifndef LZMA_H
  13. #define LZMA_H
  14. #ifdef _WIN32
  15. #pragma once
  16. #endif
  17. //-----------------------------------------------------------------------------
  18. // These routines are designed for TOOL TIME encoding/decoding on the PC!
  19. // They have not been made to encode/decode on the PPC and lack big endian awarnesss.
  20. // Lightweight GAME TIME Decoding is part of tier1.lib, via CLZMA.
  21. //-----------------------------------------------------------------------------
  22. //-----------------------------------------------------------------------------
  23. // Encoding glue. Returns non-null Compressed buffer if successful.
  24. // Caller must free.
  25. //-----------------------------------------------------------------------------
  26. unsigned char *LZMA_Compress(
  27. unsigned char *pInput,
  28. unsigned int inputSize,
  29. unsigned int *pOutputSize );
  30. //-----------------------------------------------------------------------------
  31. // Above, but returns null if compression would not yield a size improvement
  32. //-----------------------------------------------------------------------------
  33. unsigned char *LZMA_OpportunisticCompress(
  34. unsigned char *pInput,
  35. unsigned int inputSize,
  36. unsigned int *pOutputSize );
  37. //-----------------------------------------------------------------------------
  38. // Decoding glue. Returns TRUE if succesful.
  39. //-----------------------------------------------------------------------------
  40. bool LZMA_Uncompress(
  41. unsigned char *pInput,
  42. unsigned char **ppOutput,
  43. unsigned int *pOutputSize );
  44. //-----------------------------------------------------------------------------
  45. // Decoding helper, returns TRUE if buffer is LZMA compressed.
  46. //-----------------------------------------------------------------------------
  47. bool LZMA_IsCompressed( unsigned char *pInput );
  48. //-----------------------------------------------------------------------------
  49. // Decoding helper, returns non-zero size of data when uncompressed, otherwise 0.
  50. //-----------------------------------------------------------------------------
  51. unsigned int LZMA_GetActualSize( unsigned char *pInput );
  52. #endif