]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/TianoTools/CustomizedCompress/CustomizedCompress.c
ca0ea17ce6ead8fa741f0cd7edd3cf8e8bc1a051
[mirror_edk2.git] / Tools / Source / TianoTools / CustomizedCompress / CustomizedCompress.c
1 /*++
2
3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 CustomizedCompress.c
15
16 Abstract:
17
18 Header file for Customized compression routine
19
20 --*/
21
22 #include <Base.h>
23 #include <UefiBaseTypes.h>
24
25 EFI_STATUS
26 SetCustomizedCompressionType (
27 IN CHAR8 *Type
28 )
29 /*++
30
31 Routine Description:
32
33 The implementation of Customized SetCompressionType().
34
35 Arguments:
36 Type - The type if compression.
37
38 Returns:
39
40 EFI_SUCCESS - The type has been set.
41 EFI_UNSUPPORTED - This type is unsupported.
42
43
44 --*/
45 {
46 return EFI_UNSUPPORTED;
47 }
48
49 EFI_STATUS
50 CustomizedGetInfo (
51 IN VOID *Source,
52 IN UINT32 SrcSize,
53 OUT UINT32 *DstSize,
54 OUT UINT32 *ScratchSize
55 )
56 /*++
57
58 Routine Description:
59
60 The implementation of Customized GetInfo().
61
62 Arguments:
63 Source - The source buffer containing the compressed data.
64 SrcSize - The size of source buffer
65 DstSize - The size of destination buffer.
66 ScratchSize - The size of scratch buffer.
67
68 Returns:
69
70 EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
71 EFI_INVALID_PARAMETER - The source data is corrupted
72 EFI_UNSUPPORTED - The operation is unsupported.
73
74
75 --*/
76 {
77 return EFI_UNSUPPORTED;
78 }
79
80 EFI_STATUS
81 CustomizedDecompress (
82 IN VOID *Source,
83 IN UINT32 SrcSize,
84 IN OUT VOID *Destination,
85 IN UINT32 DstSize,
86 IN OUT VOID *Scratch,
87 IN UINT32 ScratchSize
88 )
89 /*++
90
91 Routine Description:
92
93 The implementation of Customized Decompress().
94
95 Arguments:
96
97 This - The protocol instance pointer
98 Source - The source buffer containing the compressed data.
99 SrcSize - The size of source buffer
100 Destination - The destination buffer to store the decompressed data
101 DstSize - The size of destination buffer.
102 Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
103 ScratchSize - The size of scratch buffer.
104
105 Returns:
106
107 EFI_SUCCESS - Decompression is successfull
108 EFI_INVALID_PARAMETER - The source data is corrupted
109 EFI_UNSUPPORTED - The operation is unsupported.
110
111 --*/
112 {
113 return EFI_UNSUPPORTED;
114 }
115
116 EFI_STATUS
117 CustomizedCompress (
118 IN UINT8 *SrcBuffer,
119 IN UINT32 SrcSize,
120 IN UINT8 *DstBuffer,
121 IN OUT UINT32 *DstSize
122 )
123 /*++
124
125 Routine Description:
126
127 The Customized compression routine.
128
129 Arguments:
130
131 SrcBuffer - The buffer storing the source data
132 SrcSize - The size of source data
133 DstBuffer - The buffer to store the compressed data
134 DstSize - On input, the size of DstBuffer; On output,
135 the size of the actual compressed data.
136
137 Returns:
138
139 EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
140 DstSize contains the size needed.
141 EFI_SUCCESS - Compression is successful.
142
143 EFI_UNSUPPORTED - The operation is unsupported.
144 --*/
145 {
146 return EFI_UNSUPPORTED;
147 }