FireBirdLib - Topfield TMS PVR TAP Programming Library
UncompressedFirmwareSize.c
Go to the documentation of this file.
1
#include "
libFireBird.h
"
2
#include "
FBLib_compression.h
"
3
4
dword
UncompressedFirmwareSize
(
byte
*pSrc)
5
{
6
TRACEENTER
();
7
8
word compSize = 0, uncompSize = 0;
9
dword outSize = 0;
10
11
if
(!pSrc)
12
{
13
TRACEEXIT
();
14
return
0;
15
}
16
17
compSize =
LOAD_WORD
(pSrc + 2);
18
uncompSize =
LOAD_WORD
(pSrc + 0);
19
20
while
(uncompSize != 0xfefe)
21
{
22
if
(uncompSize > 0x8000)
23
{
24
//Uncompressed data block size too large
25
TRACEEXIT
();
26
27
return
0;
28
}
29
30
pSrc += (6 + compSize);
31
outSize += uncompSize;
32
33
compSize =
LOAD_WORD
(pSrc + 2);
34
uncompSize =
LOAD_WORD
(pSrc + 0);
35
}
36
37
TRACEEXIT
();
38
return
outSize;
39
}
FBLib_compression.h
LOAD_WORD
#define LOAD_WORD(x)
Definition:
FBLib_compression.h:25
UncompressedFirmwareSize
dword UncompressedFirmwareSize(byte *pSrc)
Definition:
UncompressedFirmwareSize.c:4
libFireBird.h
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
compression
UncompressedFirmwareSize.c
Generated on Fri Apr 29 2022 13:34:00 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3