LzmaRamDecode.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* LzmaRamDecode.h */
  2. #ifndef __LzmaRamDecode_h
  3. #define __LzmaRamDecode_h
  4. #include <stdlib.h>
  5. /*
  6. LzmaRamGetUncompressedSize:
  7. In:
  8. inBuffer - input data
  9. inSize - input data size
  10. Out:
  11. outSize - uncompressed size
  12. Return code:
  13. 0 - OK
  14. 1 - Error in headers
  15. */
  16. int LzmaRamGetUncompressedSize(
  17. const unsigned char *inBuffer,
  18. size_t inSize,
  19. size_t *outSize);
  20. /*
  21. LzmaRamDecompress:
  22. In:
  23. inBuffer - input data
  24. inSize - input data size
  25. outBuffer - output data
  26. outSize - output size
  27. allocFunc - alloc function (can be malloc)
  28. freeFunc - free function (can be free)
  29. Out:
  30. outSizeProcessed - processed size
  31. Return code:
  32. 0 - OK
  33. 1 - Error in headers / data stream
  34. 2 - Memory allocating error
  35. Memory requirements depend from properties of LZMA stream.
  36. With default lzma settings it's about 16 KB.
  37. */
  38. int LzmaRamDecompress(
  39. const unsigned char *inBuffer,
  40. size_t inSize,
  41. unsigned char *outBuffer,
  42. size_t outSize,
  43. size_t *outSizeProcessed,
  44. void * (*allocFunc)(size_t size),
  45. void (*freeFunc)(void *));
  46. #endif