kernels/linux-2.4.0/fs/cramfs/uncompress.c
/* Returns length of decompressed data. */
Returns length of decompressed data.
Returns length of decompressed data .
int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen)
{
	int err;
	stream.next_in = src;
	stream.avail_in = srclen;
	stream.next_out = dst;
	stream.avail_out = dstlen;
	err = cramfs_inflateReset(&stream);
	if (err != Z_OK) {
		printk("cramfs_inflateReset error %d\n", err);
		cramfs_inflateEnd(&stream);
		cramfs_inflateInit(&stream);
	}
	err = cramfs_inflate(&stream, Z_FINISH);
	if (err != Z_STREAM_END)
		goto err;
	return stream.total_out;
err:
	printk("Error %d while decompressing!\n", err);
	printk("%p(%d)->%p(%d)\n", src, srclen, dst, dstlen);
	return 0;
}
int cramfs_uncompress_block ( void * dst , int dstlen , void * src , int srclen ) { int err ; stream . next_in = src ; stream . avail_in = srclen ; stream . next_out = dst ; stream . avail_out = dstlen ; err = cramfs_inflateReset ( & stream ) ; if ( err != Z_OK ) { printk ( " \n " , err ) ; cramfs_inflateEnd ( & stream ) ; cramfs_inflateInit ( & stream ) ; } err = cramfs_inflate ( & stream , Z_FINISH ) ; if ( err != Z_STREAM_END ) goto err ; return stream . total_out ; err : printk ( " \n " , err ) ; printk ( " \n " , src , srclen , dst , dstlen ) ; return 0 ; }
Returns length of decompressed data.
Returns length of decompressed data .