Lines Matching defs:LZF

82  * LZF block header.
97 /** Pointer to a LZF block header. */
99 /** Pointer to a const LZF block header. */
102 /** The magic of a LZF block header. */
166 /** LZF stream. */
177 } LZF;
231 /** LZF 'stream'. */
241 * LZF is a block based compressor and not a stream compressor. So,
249 } LZF;
901 size_t cb = pZip->u.LZF.pbOutput - &pZip->abBuffer[0];
902 pZip->u.LZF.pbOutput = &pZip->abBuffer[0];
908 * Compresses a buffer using LZF.
923 unsigned cbFree = (unsigned)(sizeof(pZip->abBuffer) - (pZip->u.LZF.pbOutput - &pZip->abBuffer[0]));
937 PRTZIPLZFHDR pHdr = (PRTZIPLZFHDR)pZip->u.LZF.pbOutput; /* warning: This might be unaligned! */
943 pZip->u.LZF.pbOutput += sizeof(*pHdr);
955 unsigned cbOutput = lzf_compress(pbBuf, cbInput, pZip->u.LZF.pbOutput, cbFree);
967 cbOutput = lzf_compress(pbBuf, cbInput, pZip->u.LZF.pbOutput, cbFree);
979 pZip->u.LZF.pbOutput += cbOutput;
994 size_t cb = pZip->u.LZF.pbInput - &pZip->u.LZF.abInput[0];
995 pZip->u.LZF.pbInput = &pZip->u.LZF.abInput[0];
996 pZip->u.LZF.cbInputFree = sizeof(pZip->u.LZF.abInput);
998 return rtZipLZFCompressBuffer(pZip, pZip->u.LZF.abInput, cb);
1014 && cbBuf > pZip->u.LZF.cbInputFree)
1016 && pZip->u.LZF.cbInputFree != sizeof(pZip->u.LZF.abInput))
1030 Assert(pZip->u.LZF.cbInputFree >= cbBuf);
1031 memcpy(pZip->u.LZF.pbInput, pvBuf, cbBuf);
1032 pZip->u.LZF.pbInput += cbBuf;
1033 pZip->u.LZF.cbInputFree -= cbBuf;
1037 Assert(pZip->u.LZF.cbInputFree == sizeof(pZip->u.LZF.abInput));
1081 pZip->u.LZF.pbOutput = &pZip->abBuffer[1];
1082 pZip->u.LZF.pbInput = &pZip->u.LZF.abInput[0];
1083 pZip->u.LZF.cbInputFree = sizeof(pZip->u.LZF.abInput);
1103 AssertMsgFailed(("Invalid LZF header! %.*%Rhxs\n", sizeof(pHdr), pHdr));
1133 if (pZip->u.LZF.cbSpill > 0)
1135 unsigned cb = (unsigned)RT_MIN(pZip->u.LZF.cbSpill, cbBuf);
1136 memcpy(pvBuf, pZip->u.LZF.pbSpill, cb);
1137 pZip->u.LZF.pbSpill += cb;
1138 pZip->u.LZF.cbSpill -= cb;
1182 unsigned cbOutput = lzf_decompress(&pZip->abBuffer[0], Hdr.cbData, pZip->u.LZF.abSpill, cbUncompressed);
1189 pZip->u.LZF.pbSpill = &pZip->u.LZF.abSpill[0];
1190 pZip->u.LZF.cbSpill = cbUncompressed;
1202 if (pZip->u.LZF.cbSpill > 0)
1204 unsigned cb = (unsigned)RT_MIN(pZip->u.LZF.cbSpill, cbBuf);
1205 memcpy(pvBuf, pZip->u.LZF.pbSpill, cb);
1206 pZip->u.LZF.pbSpill += cb;
1207 pZip->u.LZF.cbSpill -= cb;
1220 if (pZip->u.LZF.cbInput < sizeof(RTZIPLZFHDR))
1222 if (pZip->u.LZF.cbInput <= 0)
1230 pZip->u.LZF.pbInput = &pZip->abBuffer[0];
1231 pZip->u.LZF.cbInput = cb;
1232 pHdr = (PCRTZIPLZFHDR)pZip->u.LZF.pbInput;
1237 size_t cbCur = pZip->u.LZF.cbInput;
1238 memmove(&pZip->abBuffer[0], pZip->u.LZF.pbInput, cbCur);
1239 pZip->u.LZF.pbInput = &pZip->abBuffer[0];
1246 pHdr = (PCRTZIPLZFHDR)pZip->u.LZF.pbInput;
1247 pZip->u.LZF.cbInput += cb;
1261 pHdr = (PCRTZIPLZFHDR)pZip->u.LZF.pbInput;
1265 if (pHdr->cbData > pZip->u.LZF.cbInput - sizeof(*pHdr))
1268 size_t cbToRead = pHdr->cbData - (pZip->u.LZF.cbInput - sizeof(*pHdr));
1269 Assert(&pZip->u.LZF.pbInput[pZip->u.LZF.cbInput + cbToRead] <= &pZip->u.LZF.pbInput[sizeof(pZip->abBuffer)]);
1270 int rc = pZip->pfnIn(pZip->pvUser, &pZip->u.LZF.pbInput[pZip->u.LZF.cbInput],
1274 pZip->u.LZF.cbInput += cbToRead;
1277 AssertMsgReturn(sizeof(*pHdr) + pHdr->cbData <= pZip->u.LZF.cbInput,
1278 ("cbData=%#x cbInput=%#x\n", pHdr->cbData, pZip->u.LZF.cbInput),
1300 unsigned cbOutput = lzf_decompress(pHdr + 1, pHdr->cbData, pZip->u.LZF.abSpill, cbUncompressed);
1307 pZip->u.LZF.pbSpill = &pZip->u.LZF.abSpill[0];
1308 pZip->u.LZF.cbSpill = cbUncompressed;
1312 pZip->u.LZF.cbInput -= pHdr->cbData + sizeof(*pHdr);
1313 pZip->u.LZF.pbInput += pHdr->cbData + sizeof(*pHdr);
1343 pZip->u.LZF.pbInput = NULL;
1344 pZip->u.LZF.cbInput = 0;
1346 pZip->u.LZF.cbSpill = 0;
1347 pZip->u.LZF.pbSpill = NULL;
1622 AssertMsgFailed(("LZF is not include in this build!\n"));