Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\decompress_bunzip2.c Create Date:2022-07-28 06:16:51
Last Modify:2020-03-15 22:49:38 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Example usage: decompress src_fd to dst_fd. (Stops at end of bzip2 data,not end of file.)

Proto:STATIC int __attribute__((__section__(".init.text"))) __attribute__((__cold__))bunzip2(unsigned char *buf, long len, long (*fill)(void *, unsigned long ), long (*flush)(void *, unsigned long ), unsigned char *outbuf, long *pos, void (*error)(char *x))

Type:int

Parameter:

TypeParameterName
unsigned char *buf
longlen
long (*fill
long (*flush
unsigned char *outbuf
long *pos
void (*error
687  i = -1
690  If flush Then outbuf = Use defines rather than static inline in order to avoid spurious* warnings when not needed (indeed large_malloc / large_free are not* needed by inflate (Other housekeeping constants )
693  If Not outbuf Then
694  error("Could not allocate output buffer")
695  Return RETVAL_OUT_OF_MEMORY
697  If buf Then inbuf = buf
699  Else inbuf = Use defines rather than static inline in order to avoid spurious* warnings when not needed (indeed large_malloc / large_free are not* needed by inflate (Other housekeeping constants )
701  If Not inbuf Then
702  error("Could not allocate input buffer")
703  i = RETVAL_OUT_OF_MEMORY
704  Go to exit_0
706  i = Allocate the structure, read file header. If in_fd ==-1, inbuf must containa complete bunzip file (len bytes long). If in_fd!=-1, inbuf and len areignored, and data is read from file handle into temporary buffer.
707  If Not i Then
708  cycle
710  If i <= 0 Then Break
712  If Not flush Then outbuf += i
714  Else If i != flush(outbuf, i) Then
717  Break
722  If i == RETVAL_LAST_BLOCK Then
723  If The CRC values stored in the block header and calculated from thedata != The CRC values stored in the block header and calculated from thedata Then error("Data integrity error when decompressing.")
725  Else i = Status return values
727  Else if i == RETVAL_UNEXPECTED_OUTPUT_EOF Then
728  error("Compressed file ends unexpectedly")
730  If Not bd Then Go to exit_1
732  If Intermediate buffer and its size (in bytes) Then large_free(Intermediate buffer and its size (in bytes) )
734  If pos Then pos = , outbufPos
736  free(bd)
737  exit_1 :
738  If Not buf Then free(inbuf)
740  exit_0 :
741  If flush Then free(outbuf)
743  Return i
Caller
NameDescribe
__decompress