]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Common/Compress.h
beb2ebe9f6fb31cbfc5042c47bd6459d5ff609d2
[mirror_edk2.git] / BaseTools / Source / C / Common / Compress.h
1 /** @file
2 Header file for compression routine.
3 Providing both EFI and Tiano Compress algorithms.
4
5 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _COMPRESS_H_
17 #define _COMPRESS_H_
18
19 #include <string.h>
20 #include <stdlib.h>
21
22 #include "CommonLib.h"
23 #include <Common/UefiBaseTypes.h>
24 /*++
25
26 Routine Description:
27
28 Tiano compression routine.
29
30 --*/
31 EFI_STATUS
32 TianoCompress (
33 IN UINT8 *SrcBuffer,
34 IN UINT32 SrcSize,
35 IN UINT8 *DstBuffer,
36 IN OUT UINT32 *DstSize
37 )
38 ;
39
40 /*++
41
42 Routine Description:
43
44 Efi compression routine.
45
46 --*/
47 EFI_STATUS
48 EfiCompress (
49 IN UINT8 *SrcBuffer,
50 IN UINT32 SrcSize,
51 IN UINT8 *DstBuffer,
52 IN OUT UINT32 *DstSize
53 )
54 ;
55
56 /*++
57
58 Routine Description:
59
60 The compression routine.
61
62 Arguments:
63
64 SrcBuffer - The buffer storing the source data
65 SrcSize - The size of source data
66 DstBuffer - The buffer to store the compressed data
67 DstSize - On input, the size of DstBuffer; On output,
68 the size of the actual compressed data.
69
70 Returns:
71
72 EFI_BUFFER_TOO_SMALL - The DstBuffer is too small. In this case,
73 DstSize contains the size needed.
74 EFI_SUCCESS - Compression is successful.
75 EFI_OUT_OF_RESOURCES - No resource to complete function.
76 EFI_INVALID_PARAMETER - Parameter supplied is wrong.
77
78 --*/
79 typedef
80 EFI_STATUS
81 (*COMPRESS_FUNCTION) (
82 IN UINT8 *SrcBuffer,
83 IN UINT32 SrcSize,
84 IN UINT8 *DstBuffer,
85 IN OUT UINT32 *DstSize
86 );
87
88 #endif