Function report |
Source Code:lib\decompress_inflate.c |
Create Date:2022-07-28 06:16:41 |
| Last Modify:2020-03-15 22:47:18 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Included from initramfs et al code
Proto: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))
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| unsigned char * | buf | |
| long | len | |
| long (* | fill | |
| long (* | flush | |
| unsigned char * | out_buf | |
| long | out_len | |
| long * | pos | |
| void (* | error |
| 48 | rc = -1 |
| 49 | If flush Then |
| 50 | out_len = 0x8000 |
| 52 | Else |
| 56 | If Not out_buf Then |
| 57 | error("Out of memory while allocating output buffer") |
| 58 | Go to gunzip_nomem1 |
| 63 | Else |
| 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 | If Not zbuf Then |
| 68 | error("Out of memory while allocating input buffer") |
| 69 | Go to 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 ( size of strm ) |
| 73 | If (strm == NULL) Then |
| 74 | error("Out of memory while allocating z_stream") |
| 75 | Go to gunzip_nomem3 |
| 80 | If ( memory allocated for this stream == NULL) Then |
| 81 | error("Out of memory while allocating workspace") |
| 82 | Go to gunzip_nomem4 |
| 88 | If len == 0 Then len = fill(zbuf, GZIP_IOBUF_SIZE) |
| 103 | next input byte = zbuf + 10 |
| 104 | number of bytes available at next_in = len - 10 |
| 106 | If zbuf[3] & 0x8 Then |
| 124 | rc = zlib_inflateInit2(strm, - 32K LZ77 window ) |
| 126 | If Not flush Then |
| 132 | If number of bytes available at next_in == 0 Then |
| 143 | rc = late() uses a state machine to process as much input data and generate asmuch output data as possible before returning |
| 146 | If flush && next output byte should be put there > out_buf Then |
| 158 | If rc == Z_STREAM_END Then |
| 159 | rc = 0 |
| 160 | Break |
| 161 | Else if rc != Allowed flush values; see deflate() and inflate() below for details Then |
| 168 | If pos Then pos = next input byte - zbuf + 8 |
| 172 | gunzip_5 : |
| 174 | gunzip_nomem4 : |
| 176 | gunzip_nomem3 : |
| 179 | gunzip_nomem2 : |
| 182 | gunzip_nomem1 : |
| 183 | Return rc |
| Name | Describe |
|---|---|
| __decompress |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |