OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
zlib_uefi.c
Go to the documentation of this file.
1
15#include "zutil.h"
16
17#include <Library/MemoryAllocationLib.h>
19
21 voidpf opaque;
22 unsigned items;
23 unsigned size;
24{
25 (void) opaque;
26 return (voidpf) AllocatePool (items * size);
27}
28
29void ZLIB_INTERNAL zcfree (opaque, ptr)
30 voidpf opaque;
31 voidpf ptr;
32{
33 (void) opaque;
34 FreePool (ptr);
35}
36
37UINT8 *
39 OUT UINT8 *Dst,
40 IN UINT32 DstLen,
41 IN CONST UINT8 *Src,
42 IN UINT32 SrcLen
43 )
44{
45 uLongf ResultingLen = DstLen;
46
48 return 0;
49 }
50
51 if (compress (Dst, &ResultingLen, Src, SrcLen) == Z_OK) {
52 return Dst + ResultingLen;
53 }
54
55 return NULL;
56}
57
58UINTN
60 OUT UINT8 *Dst,
61 IN UINTN DstLen,
62 IN CONST UINT8 *Src,
63 IN UINTN SrcLen
64 )
65{
66 uLongf ResultingLen = DstLen;
67
69 return 0;
70 }
71
72 if (uncompress (Dst, &ResultingLen, Src, SrcLen) == Z_OK) {
73 return ResultingLen;
74 }
75
76 return 0;
77}
78
79UINT32
81 IN CONST UINT8 *Buffer,
82 IN UINT32 BufferLen
83 )
84{
85 return adler32 (1, Buffer, BufferLen);
86}
UINT32 size
#define OC_COMPRESSION_MAX_LENGTH
OC_TYPING_BUFFER_ENTRY Buffer[OC_TYPING_BUFFER_SIZE]
Definition OcTypingLib.h:42
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
Definition adler32.c:134
#define ZLIB_INTERNAL
Definition compress.c:8
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition compress.c:68
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Definition uncompr.c:86
void * voidpf
Definition zconf.h:58
uLong uLongf
Definition zconf.h:56
#define Z_OK
Definition zlib.h:177
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
Definition zlib_uefi.c:29
UINT8 * CompressZLIB(OUT UINT8 *Dst, IN UINT32 DstLen, IN CONST UINT8 *Src, IN UINT32 SrcLen)
Definition zlib_uefi.c:38
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
Definition zlib_uefi.c:20
UINTN DecompressZLIB(OUT UINT8 *Dst, IN UINTN DstLen, IN CONST UINT8 *Src, IN UINTN SrcLen)
Definition zlib_uefi.c:59
UINT32 Adler32(IN CONST UINT8 *Buffer, IN UINT32 BufferLen)
Definition zlib_uefi.c:80