]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaDecompressLibInternal.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Library / LzmaCustomDecompressLib / LzmaDecompressLibInternal.h
CommitLineData
11ff2c71
LG
1/** @file\r
2 LZMA Decompress Library internal header file declares Lzma decompress interfaces.\r
3\r
d1102dba 4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
11ff2c71
LG
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __LZMADECOMPRESSLIB_INTERNAL_H__\r
16#define __LZMADECOMPRESSLIB_INTERNAL_H__\r
17\r
18#include <PiPei.h>\r
19#include <Library/BaseLib.h>\r
20#include <Library/BaseMemoryLib.h>\r
21#include <Library/DebugLib.h>\r
22#include <Library/ExtractGuidedSectionLib.h>\r
23#include <Guid/LzmaDecompress.h>\r
24\r
25/**\r
d1102dba
LG
26 Given a Lzma compressed source buffer, this function retrieves the size of\r
27 the uncompressed buffer and the size of the scratch buffer required\r
11ff2c71
LG
28 to decompress the compressed source buffer.\r
29\r
d1102dba 30 Retrieves the size of the uncompressed buffer and the temporary scratch buffer\r
11ff2c71 31 required to decompress the buffer specified by Source and SourceSize.\r
d1102dba 32 The size of the uncompressed buffer is returned in DestinationSize,\r
11ff2c71 33 the size of the scratch buffer is returned in ScratchSize, and RETURN_SUCCESS is returned.\r
d1102dba 34 This function does not have scratch buffer available to perform a thorough\r
11ff2c71
LG
35 checking of the validity of the source data. It just retrieves the "Original Size"\r
36 field from the LZMA_HEADER_SIZE beginning bytes of the source data and output it as DestinationSize.\r
37 And ScratchSize is specific to the decompression implementation.\r
38\r
39 If SourceSize is less than LZMA_HEADER_SIZE, then ASSERT().\r
40\r
41 @param Source The source buffer containing the compressed data.\r
42 @param SourceSize The size, in bytes, of the source buffer.\r
43 @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer\r
44 that will be generated when the compressed buffer specified\r
45 by Source and SourceSize is decompressed.\r
46 @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that\r
d1102dba 47 is required to decompress the compressed buffer specified\r
11ff2c71
LG
48 by Source and SourceSize.\r
49\r
d1102dba
LG
50 @retval RETURN_SUCCESS The size of the uncompressed data was returned\r
51 in DestinationSize and the size of the scratch\r
11ff2c71
LG
52 buffer was returned in ScratchSize.\r
53\r
54**/\r
55RETURN_STATUS\r
56EFIAPI\r
57LzmaUefiDecompressGetInfo (\r
58 IN CONST VOID *Source,\r
59 IN UINT32 SourceSize,\r
60 OUT UINT32 *DestinationSize,\r
61 OUT UINT32 *ScratchSize\r
62 );\r
63\r
64/**\r
65 Decompresses a Lzma compressed source buffer.\r
66\r
67 Extracts decompressed data to its original form.\r
d1102dba
LG
68 If the compressed source data specified by Source is successfully decompressed\r
69 into Destination, then RETURN_SUCCESS is returned. If the compressed source data\r
11ff2c71
LG
70 specified by Source is not in a valid compressed data format,\r
71 then RETURN_INVALID_PARAMETER is returned.\r
72\r
73 @param Source The source buffer containing the compressed data.\r
74 @param SourceSize The size of source buffer.\r
75 @param Destination The destination buffer to store the decompressed data\r
76 @param Scratch A temporary scratch buffer that is used to perform the decompression.\r
d1102dba 77 This is an optional parameter that may be NULL if the\r
11ff2c71 78 required scratch buffer size is 0.\r
d1102dba
LG
79\r
80 @retval RETURN_SUCCESS Decompression completed successfully, and\r
11ff2c71 81 the uncompressed buffer is returned in Destination.\r
d1102dba
LG
82 @retval RETURN_INVALID_PARAMETER\r
83 The source buffer specified by Source is corrupted\r
11ff2c71
LG
84 (not in a valid compressed format).\r
85**/\r
86RETURN_STATUS\r
87EFIAPI\r
88LzmaUefiDecompress (\r
89 IN CONST VOID *Source,\r
90 IN UINTN SourceSize,\r
91 IN OUT VOID *Destination,\r
92 IN OUT VOID *Scratch\r
93 );\r
94\r
95#endif\r
96\r