函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zlib_inflate\inflate.c Create Date:2022-07-27 07:55:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:late() uses a state machine to process as much input data and generate asmuch output data as possible before returning

函数原型:int zlib_inflate(z_streamp strm, int flush)

返回类型:int

参数:

类型参数名称
z_streampstrm>next_out, given the space available and the provided input--the effect
intflush
332  static const unsigned short order[19] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}
338  如果>next_out, given the space available and the provided input--the effect恒等于NULL not visible by applications 恒等于NULL next input byte 恒等于NULL number of bytes available at next_in 不等于0则返回:Z_STREAM_ERROR
342  state等于 not visible by applications
344  如果current inflate mode 恒等于 waiting for type bits, including last-flag bit current inflate mode 等于 same, but skip check to exit inflate on new block
345  Load registers with state in inflate() for speed ()
346  in等于have
347  out等于left
348  ret等于Allowed flush values; see deflate() and inflate() below for details
349  循环switch current inflate mode
351  :current inflate mode 恒等于 waiting for magic header
352  如果 0 true for zlib, bit 1 true for gzip 恒等于0则
354  退出
356  Assure that there are at least n bits in the bit accumulator. If there isnot enough available input to do that, then return from inflate(). (16)
357  如果Return the low n bits of the bit accumulator (n < 16) (8)左移8位的值加hold右移8位的值的和取模31则
359  last error message, NULL if no error 等于"incorrect header check"
361  退出
364  last error message, NULL if no error 等于"unknown compression method"
366  退出
368  Remove n bits from the bit accumulator (4)
369  len等于Return the low n bits of the bit accumulator (n < 16) (4)加8
371  last error message, NULL if no error 等于"invalid window size"
373  退出
375  zlib header max distance (INFLATE_STRICT) 等于1U左移len
376  adler32 value of the uncompressed data 等于protected copy of check value 等于Update a running Adler-32 checksum with the bytes buf[0..len-1] andreturn the updated checksum. If buf is NULL, this function returnsthe required initial value for the checksum.An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
377  current inflate mode 等于如果hold按位与0x200则 waiting for dictionary check value 否则 waiting for type bits, including last-flag bit
378  Clear the input bit accumulator ()
379  退出
380  :current inflate mode 恒等于 waiting for dictionary check value
381  Assure that there are at least n bits in the bit accumulator. If there isnot enough available input to do that, then return from inflate(). (32)
382  adler32 value of the uncompressed data 等于protected copy of check value 等于Reverse the bytes in a 32-bit value (hold)
383  Clear the input bit accumulator ()
384  current inflate mode 等于waiting for inflateSetDictionary() call
386  :current inflate mode 恒等于waiting for inflateSetDictionary() call
387  如果rue if dictionary provided 恒等于0则
389  返回:Z_NEED_DICT
391  adler32 value of the uncompressed data 等于protected copy of check value 等于Update a running Adler-32 checksum with the bytes buf[0..len-1] andreturn the updated checksum. If buf is NULL, this function returnsthe required initial value for the checksum.An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
392  current inflate mode 等于 waiting for type bits, including last-flag bit
394  :current inflate mode 恒等于 waiting for type bits, including last-flag bit
395  如果flush恒等于Only for inflate at present 则转到:inf_leave
397  :current inflate mode 恒等于 same, but skip check to exit inflate on new block
401  退出
403  Assure that there are at least n bits in the bit accumulator. If there isnot enough available input to do that, then return from inflate(). (3)
404  rue if processing last block 等于Return the low n bits of the bit accumulator (n < 16) (1)
405  Remove n bits from the bit accumulator (1)
409  退出
413  退出
416  退出
418  last error message, NULL if no error 等于"invalid block type"
421  Remove n bits from the bit accumulator (2)
422  退出
423  :current inflate mode 恒等于 waiting for stored size (length and complement)
424  Remove zero to seven bits as needed to go to a byte boundary ()
425  Assure that there are at least n bits in the bit accumulator. If there isnot enough available input to do that, then return from inflate(). (32)
426  如果hold按位与0xffff的值不等于hold右移16位按位异或0xffff的值则
427  last error message, NULL if no error 等于"invalid stored block lengths"
429  退出
431  literal or length of data to copy 等于hold按位与0xffff
432  Clear the input bit accumulator ()
433  current inflate mode 等于/o: waiting for input or output to copy stored block
435  :current inflate mode 恒等于/o: waiting for input or output to copy stored block
436  copy等于literal or length of data to copy
437  如果copy
438  如果copy大于havecopy等于have
439  如果copy大于leftcopy等于left
440  如果copy恒等于0则转到:inf_leave
442  have减等于copy
443  next加等于copy
444  left减等于copy
445  put加等于copy
447  退出
449  current inflate mode 等于 waiting for type bits, including last-flag bit
450  退出
451  :current inflate mode 恒等于 waiting for dynamic block table lengths
452  Assure that there are at least n bits in the bit accumulator. If there isnot enough available input to do that, then return from inflate(). (14)
453  umber of length code lengths 等于Return the low n bits of the bit accumulator (n < 16) (5)加257
454  Remove n bits from the bit accumulator (5)
455  umber of distance code lengths 等于Return the low n bits of the bit accumulator (n < 16) (5)加1
456  Remove n bits from the bit accumulator (5)
457  umber of code length code lengths 等于Return the low n bits of the bit accumulator (n < 16) (4)加4
458  Remove n bits from the bit accumulator (4)
461  last error message, NULL if no error 等于"too many length or distance symbols"
463  退出
466  umber of code lengths in lens[] 等于0
467  current inflate mode 等于 waiting for code length code lengths
469  :current inflate mode 恒等于 waiting for code length code lengths
475 umber of code lengths in lens[] 小于19循环
476  mporary storage for code lengths [order[umber of code lengths in lens[] ++]]等于0
477  xt available space in codes[] 等于space for code tables
478  starting table for length/literal codes 等于xt available space in codes[]
479  dex bits for lencode 等于7
480  ret等于zlib_inflate_table(CODES, mporary storage for code lengths , 19, & (xt available space in codes[] ), & (dex bits for lencode ), work area for code table building )
482  如果ret
483  last error message, NULL if no error 等于"invalid code lengths set"
485  退出
487  umber of code lengths in lens[] 等于0
488  current inflate mode 等于 waiting for length/lit and distance code lengths
490  :current inflate mode 恒等于 waiting for length/lit and distance code lengths
492  循环
497  如果ffset in table or code value 小于16则
502  否则
503  如果ffset in table or code value 恒等于16则
515  否则如果ffset in table or code value 恒等于17则
522  否则
534 copy自减循环
540  如果current inflate mode 恒等于got a data error -- remain here until reset 退出
543  xt available space in codes[] 等于space for code tables
544  starting table for length/literal codes 等于xt available space in codes[]
545  dex bits for lencode 等于9
546  ret等于zlib_inflate_table(LENS, mporary storage for code lengths , umber of length code lengths , & (xt available space in codes[] ), & (dex bits for lencode ), work area for code table building )
548  如果ret
549  last error message, NULL if no error 等于"invalid literal/lengths set"
551  退出
553  starting table for distance codes 等于xt available space in codes[]
554  dex bits for distcode 等于6
555  ret等于zlib_inflate_table(DISTS, mporary storage for code lengths + umber of length code lengths , umber of distance code lengths , & (xt available space in codes[] ), & (dex bits for distcode ), work area for code table building )
557  如果ret
558  last error message, NULL if no error 等于"invalid distances set"
560  退出
562  current inflate mode 等于 waiting for length/lit code
564  :current inflate mode 恒等于 waiting for length/lit code
565  如果have大于等于6且left大于等于258则
569  退出
571  循环
573  如果s in this part of the code 小于等于bits退出
576  如果peration, extra bits, table bits peration, extra bits, table bits 按位与0xf0的值恒等于0则
577  last = this
578  循环
586  Remove n bits from the bit accumulator (s in this part of the code )
587  literal or length of data to copy 等于ffset in table or code value
588  如果peration, extra bits, table bits 恒等于0则
590  退出
592  如果peration, extra bits, table bits 按位与32则
594  退出
596  如果peration, extra bits, table bits 按位与64则
597  last error message, NULL if no error 等于"invalid literal/length code"
599  退出
601  xtra bits needed 等于peration, extra bits, table bits 按位与15
602  current inflate mode 等于 waiting for length extra bits
604  :current inflate mode 恒等于 waiting for length extra bits
605  如果xtra bits needed
610  current inflate mode 等于 waiting for distance code
612  :current inflate mode 恒等于 waiting for distance code
613  循环
615  如果s in this part of the code 小于等于bits退出
618  如果peration, extra bits, table bits 按位与0xf0的值恒等于0则
619  last = this
620  循环
628  Remove n bits from the bit accumulator (s in this part of the code )
629  如果peration, extra bits, table bits 按位与64则
630  last error message, NULL if no error 等于"invalid distance code"
632  退出
634  distance back to copy string from 等于ffset in table or code value
635  xtra bits needed 等于peration, extra bits, table bits 按位与15
636  current inflate mode 等于 waiting for distance extra bits
638  :current inflate mode 恒等于 waiting for distance extra bits
639  如果xtra bits needed
652  last error message, NULL if no error 等于"invalid distance too far back"
654  退出
656  current inflate mode 等于 waiting for output space to copy string
658  :current inflate mode 恒等于 waiting for output space to copy string
659  如果left恒等于0则转到:inf_leave
660  copy等于outleft
663  如果copy大于window write index
671  否则
675  如果copy大于leftcopy等于left
676  left减等于copy
677  literal or length of data to copy 减等于copy
678  循环
679  put自加等于from自加
680 copy先自减循环
681  如果literal or length of data to copy 恒等于0则current inflate mode 等于 waiting for length/lit code
682  退出
683  :current inflate mode 恒等于 waiting for output space to write literal
684  如果left恒等于0则转到:inf_leave
685  put自加等于literal or length of data to copy
686  left自减
687  current inflate mode 等于 waiting for length/lit code
688  退出
689  :current inflate mode 恒等于 waiting for 32-bit check value
692  out减等于left
698  out等于left
707  current inflate mode 等于ished check, done -- remain here until reset
709  :current inflate mode 恒等于ished check, done -- remain here until reset
710  ret等于Z_STREAM_END
711  转到:inf_leave
712  :current inflate mode 恒等于got a data error -- remain here until reset
713  ret等于Z_DATA_ERROR
714  转到:inf_leave
715  :current inflate mode 恒等于got an inflate() memory error -- remain here until reset
716  返回:Z_MEM_ERROR
717  :current inflate mode 恒等于SYNC
718  默认
719  返回:Z_STREAM_ERROR
727  inf_leave :
728  Restore state from registers in inflate() ()
729  如果window size or zero if not using window current inflate mode 小于 waiting for 32-bit check value out不等于 remaining free space at next_out Update the window with the last wsize (normally 32K) bytes written beforereturning. This is only called when a window is already in use, or whenoutput has been written during this inflate call, but the end of the deflatestream has not been reached yet
732  in减等于 number of bytes available at next_in
733  out减等于 remaining free space at next_out
734  total nb of input bytes read so far 加等于in
735  total nb of bytes output so far 加等于out
736  protected copy of output count 加等于out
737  如果 0 true for zlib, bit 1 true for gzip out adler32 value of the uncompressed data 等于protected copy of check value 等于check function to use adler32() for zlib or crc32() for gzip (protected copy of check value , next output byte should be put there - out, out)
741  best guess about the data type: ascii or binary 等于umber of bits in "in" 加如果rue if processing last block 则64否则0加如果current inflate mode 恒等于 waiting for type bits, including last-flag bit 则128否则0
744  如果flush恒等于Z_PACKET_FLUSHret恒等于Allowed flush values; see deflate() and inflate() below for details remaining free space at next_out 不等于0且 number of bytes available at next_in 恒等于0则返回:Returns true if inflate is currently at the end of a block generated byZ_SYNC_FLUSH or Z_FULL_FLUSH
748  如果in恒等于0且out恒等于0或flush恒等于Z_FINISH的值且ret恒等于Allowed flush values; see deflate() and inflate() below for details ret等于Z_BUF_ERROR
751  返回:ret
调用者
名称描述
zlib_inflate_blobUtility function: initialize zlib, unpack binary blob, clean up zlib,* return len or negative error code.
__gunzipIncluded from initramfs et al code
deflate_decompress