转载请标注本人博客:https://mp.youkuaiyun.com/console/editor/html
背景:项目重构刷新的需要,需要对软件进行上载,并完成在线更新。
首先理一理压缩解压缩的函数定义:
inflate/deflate
/******************************************************************************
*
* inflate - inflate compressed code
*
* This routine inflates <nBytes> of data starting at address <src>.
* The inflated code is copied starting at address <dest>.
* Two sanity checks are performed on the data being decompressed.
* First, we look for a magic number at the start of the data to
* verify that it is really a compressed stream.
* Second, the entire data is optionally checksummed to verify its
* integrity. By default, the checksum is not verified in order to
* speed up the booting process. To turn on checksum verification,
* set the global variable `inflateCksum' to TRUE in the BSP.
*
* RETURNS: OK or ERROR.
*/
int inflate
(
Byte * src,
Byte * dest,
int nBytes
)
/* ===========================================================================
* Processes a new input file and return its compressed length. This
* function does not perform lazy evaluationof matches and inserts
* new strings in the dictionary only for unmatched strings or for short
* matches. It is used only for the fast compression options.
*/
local ulg deflate()
未完待续。。。。