コード例 #1
0
ファイル: compress.c プロジェクト: KinaMarie/muon
// 解压缩 pbuf
void decompress(pbuf_t *pbuf)
{
    if (pbuf->flag & 0x04)
    {
        unlzo(pbuf);
    }
}
コード例 #2
0
int __init decompress(void *inbuf, unsigned int len, void *outbuf)
{
#if 0 /* Not needed here yet. */
    if ( len >= 2 &&
         (!memcmp(inbuf, "\037\213", 2) || !memcmp(inbuf, "\037\236", 2)) )
        return gunzip(inbuf, len, NULL, NULL, outbuf, NULL, error);
#endif

    if ( len >= 3 && !memcmp(inbuf, "\x42\x5a\x68", 3) )
        return bunzip2(inbuf, len, NULL, NULL, outbuf, NULL, error);

    if ( len >= 2 && !memcmp(inbuf, "\135\000", 2) )
        return unlzma(inbuf, len, NULL, NULL, outbuf, NULL, error);

    if ( len >= 5 && !memcmp(inbuf, "\x89LZO", 5) )
        return unlzo(inbuf, len, NULL, NULL, outbuf, NULL, error);

    return 1;
}