函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\decompress_inflate.c Create Date:2022-07-27 07:13:59
Last Modify:2020-03-15 22:47:18 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Included from initramfs et al code

函数原型:STATIC int __attribute__((__section__(".init.text"))) __attribute__((__cold__))__gunzip(unsigned char *buf, long len, long (*fill)(void *, unsigned long ), long (*flush)(void *, unsigned long ), unsigned char *out_buf, long out_len, long *pos, void (*error)(char *x))

返回类型:int

参数:

类型参数名称
unsigned char *buf
longlen
long (*fill
long (*flush
unsigned char *out_buf
longout_len
long *pos
void (*error
48  rc等于负1
49  如果flush
50  out_len等于0x8000
51  out_buf等于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 (out_len)
52  否则
53  如果非out_lenout_len等于0的反减out_buf
56  如果非out_buf
57  error("Out of memory while allocating output buffer")
58  转到:gunzip_nomem1
61  如果bufzbuf等于buf
63  否则
64  zbuf等于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 (GZIP_IOBUF_SIZE)
65  len等于0
67  如果非zbuf
68  error("Out of memory while allocating input buffer")
69  转到:gunzip_nomem2
72  strm等于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 (strm的长度)
73  如果(strm == NULL)则
74  error("Out of memory while allocating z_stream")
75  转到:gunzip_nomem3
78  memory allocated for this stream 等于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 (flush ? All dynamically allocated data structures for this stream are freed : sizeof(structinflate_state))
80  如果( memory allocated for this stream == NULL)则
81  error("Out of memory while allocating workspace")
82  转到:gunzip_nomem4
85  如果非fillfill等于nofill
88  如果len恒等于0则len等于fill(zbuf, GZIP_IOBUF_SIZE)
92  如果len小于10或zbuf[0]不等于0x1f或zbuf[1]不等于0x8b或zbuf[2]不等于0x08则
94  如果pospos等于0
96  error("Not a gzip file")
97  转到:gunzip_5
103  next input byte 等于zbuf加10
104  number of bytes available at next_in 等于len减10
106  如果zbuf[3]按位与0x8则
107  循环
113  如果 number of bytes available at next_in 恒等于0则
114  error("header error")
115  转到:gunzip_5
118  next input byte 自加循环
121  next output byte should be put there 等于out_buf
122  remaining free space at next_out 等于out_len
124  rc等于zlib_inflateInit2(strm, - 32K LZ77 window )
126  如果非flush
127  wsize等于0
128  window = NULL
131 rc恒等于Allowed flush values; see deflate() and inflate() below for details 循环
132  如果 number of bytes available at next_in 恒等于0则
134  len等于fill(zbuf, GZIP_IOBUF_SIZE)
135  如果len小于0则
136  rc等于负1
137  error("read error")
138  退出
143  rc等于late() uses a state machine to process as much input data and generate asmuch output data as possible before returning
148  如果l不等于flush(out_buf, l)则
149  rc等于负1
150  error("write error")
151  退出
158  如果rc恒等于Z_STREAM_END
159  rc等于0
160  退出
162  error("uncompression error")
163  rc等于负1
167  late decompresses as much data as possible, and stops when the inputbuffer becomes empty or the output buffer becomes full. It may introducesome output latency (reading input without producing any output) except whenforced to flush.
168  如果pospos等于 next input byte zbuf加8
172  gunzip_5 :
173  free( memory allocated for this stream )
174  gunzip_nomem4 :
175  free(strm)
176  gunzip_nomem3 :
177  如果非buffree(zbuf)
179  gunzip_nomem2 :
180  如果flushfree(out_buf)
182  gunzip_nomem1 :
183  返回:rc
调用者
名称描述
__decompress
gunzip