Compress.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /** @file
  2. Header file for compression routine.
  3. Providing both EFI and Tiano Compress algorithms.
  4. Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef _COMPRESS_H_
  8. #define _COMPRESS_H_
  9. #include <string.h>
  10. #include <stdlib.h>
  11. #include "CommonLib.h"
  12. #include <Common/UefiBaseTypes.h>
  13. /*++
  14. Routine Description:
  15. Tiano compression routine.
  16. --*/
  17. EFI_STATUS
  18. TianoCompress (
  19. IN UINT8 *SrcBuffer,
  20. IN UINT32 SrcSize,
  21. IN UINT8 *DstBuffer,
  22. IN OUT UINT32 *DstSize
  23. )
  24. ;
  25. /*++
  26. Routine Description:
  27. Efi compression routine.
  28. --*/
  29. EFI_STATUS
  30. EfiCompress (
  31. IN UINT8 *SrcBuffer,
  32. IN UINT32 SrcSize,
  33. IN UINT8 *DstBuffer,
  34. IN OUT UINT32 *DstSize
  35. )
  36. ;
  37. /*++
  38. Routine Description:
  39. The compression routine.
  40. Arguments:
  41. SrcBuffer - The buffer storing the source data
  42. SrcSize - The size of source data
  43. DstBuffer - The buffer to store the compressed data
  44. DstSize - On input, the size of DstBuffer; On output,
  45. the size of the actual compressed data.
  46. Returns:
  47. EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
  48. DstSize contains the size needed.
  49. EFI_SUCCESS - Compression is successful.
  50. EFI_OUT_OF_RESOURCES - No resource to complete function.
  51. EFI_INVALID_PARAMETER - Parameter supplied is wrong.
  52. --*/
  53. typedef
  54. EFI_STATUS
  55. (*COMPRESS_FUNCTION) (
  56. IN UINT8 *SrcBuffer,
  57. IN UINT32 SrcSize,
  58. IN UINT8 *DstBuffer,
  59. IN OUT UINT32 *DstSize
  60. );
  61. #endif