函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\decompress_bunzip2.c Create Date:2022-07-27 07:14:06
Last Modify:2020-03-15 22:49:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Unpacks the next block and sets up for the inverse burrows-wheeler step.

函数原型:static int __attribute__((__section__(".init.text"))) __attribute__((__cold__))get_next_block(struct bunzip_data *bd)

返回类型:int

参数:

类型参数名称
struct bunzip_data *bd
158  struct group_data * hufGroup = NULL
159  int * base = NULL
160  int * limit = NULL
166  dbuf等于Intermediate buffer and its size (in bytes)
167  dbufSize等于Intermediate buffer and its size (in bytes)
168  selectors等于Selectors = 15 bits
169  byteCount等于byteCount
170  symToByte等于symToByte
171  mtfSymbol等于mtfSymbol
175  i等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian
176  j等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian
177  The CRC values stored in the block header and calculated from thedata 等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian
178  如果i恒等于0x177245且j恒等于0x385090则返回:RETVAL_LAST_BLOCK
180  如果i不等于0x314159或j不等于0x265359则返回:RETVAL_NOT_BZIP_DATA
185  如果Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian 则返回:RETVAL_OBSOLETE_INPUT
187  origPtr等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian
188  如果origPtr大于等于dbufSize则返回:RETVAL_DATA_ERROR
195  t等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian
196  symTotal等于0
197 i小于16循环
198  如果t按位与1左移15减i位则
200 j小于16循环如果k按位与1左移15减j位则
202  symToByte[symTotal++]等于16乘ij
206  groupCount等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian
207  如果groupCount小于2或groupCount大于Constants for Huffman coding 则返回:RETVAL_DATA_ERROR
214  nSelectors等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian
215  如果非nSelectors则返回:RETVAL_DATA_ERROR
217 i小于groupCount循环mtfSymbol[i]等于i
219 i小于nSelectors循环
221 Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian 循环如果j大于等于groupCount
223  返回:RETVAL_DATA_ERROR
225  uc等于mtfSymbol[j]
226 j循环mtfSymbol[j]等于mtfSymbol[j - 1]
228  mtfSymbol[0]等于selectors[i]等于uc
233  symCount等于symTotal加2
234 j小于groupCount循环
235  unsigned char length[258], temp[21]
246  t等于Return the next nnn bits of input. All reads from the compressed inputare done through this function. All reads are big endian 减1
247 i小于symCount循环
248  循环
269  length[i]等于t加1
272  minLen等于maxLen等于length[0]
274 i小于symCount循环
275  如果length[i]大于maxLenmaxLen等于length[i]
277  否则如果length[i]小于minLenminLen等于length[i]
296  hufGroup等于Huffman coding tables j
297  minLen等于minLen
298  maxLen等于maxLen
303  base等于base减1
304  limit等于We have an extra slot at the end of limit[] for a sentinal value. 减1
307  pp等于0
308 i小于等于maxLen循环
309  temp[i]等于limit[i]等于0
310 t小于symCount循环如果length[t]恒等于i
312  permute[pp++]等于t
315 i小于symCount循环temp[length[i]]自加
323  pp等于t等于0
324 i小于maxLen循环
325  pp加等于temp[i]
336  limit[i]等于pp左移maxLeni位的值减1
337  pp左移等于1位
338  base[i + 1]等于ppt加等于temp[i]的和
341  limit[maxLen + 1]等于INT_MAX
342  limit[maxLen]等于pptemp[maxLen]减1
343  base[minLen]等于0
352 i小于256循环
353  byteCount[i]等于0
354  mtfSymbol[i]等于i
357  runPos等于dbufCount等于symCount等于selector等于0
358  循环
360  如果非symCount自减则
362  如果selector大于等于nSelectors则返回:RETVAL_DATA_ERROR
365  base等于base减1
380 inbufBitCount小于maxLen循环
381  如果, outbufPos恒等于inbufCount
385  inbufBits等于inbufBits左移8位按位或,*outbuf[, outbufPos++]
387  inbufBitCount加等于8
389  inbufBitCount减等于maxLen
390  j等于inbufBits右移inbufBitCount位按位与1左移maxLen位的值减1
392  got_huff_bits :
395  i等于minLen
396 j大于limit[i]循环
397  i先自加
398  inbufBitCount加等于maxLeni
400  如果i大于maxLenj等于j右移maxLeni位的值减base[i]大于等于256 literals + RUNA + RUNB 则返回:RETVAL_DATA_ERROR
404  nextSym等于permute[j]
410  如果nextSym小于等于SYMBOL_RUNB
413  如果非runPos
414  runPos等于1
415  t等于0
427  t加等于runPos左移nextSym
430  runPos左移等于1位
431  继续下一循环
439  如果runPos
440  runPos等于0
441  如果dbufCountt大于等于dbufSize则返回:RETVAL_DATA_ERROR
444  uc等于symToByte[mtfSymbol[0]]
445  byteCount[uc]加等于t
446 t自减循环
447  dbuf[dbufCount++]等于uc
450  如果nextSym大于symTotal退出
461  如果dbufCount大于等于dbufSize则返回:RETVAL_DATA_ERROR
463  i等于nextSym减1
464  uc等于mtfSymbol[i]
470  循环
471  mtfSymbol[i]等于mtfSymbol[i - 1]
472 i先自减循环
473  mtfSymbol[0]等于uc
474  uc等于symToByte[uc]
476  byteCount[uc]自加
477  dbuf[dbufCount++]等于uc
487  j等于0
488 i小于256循环
489  k等于jbyteCount[i]
490  byteCount[i]等于j
491  j等于k
494 i小于dbufCount循环
495  uc等于dbuf[i]按位与0xff
496  dbuf[byteCount[uc]]或等于i左移8位
497  byteCount[uc]自加
503  如果dbufCount
504  如果origPtr大于等于dbufCount则返回:RETVAL_DATA_ERROR
506  State for interrupting output loop 等于dbuf[origPtr]
507  State for interrupting output loop 等于State for interrupting output loop 按位与0xff
508  State for interrupting output loop 右移等于8位
509  State for interrupting output loop 等于5
511  State for interrupting output loop 等于dbufCount
513  返回:Status return values
调用者
名称描述
read_bunzipUndo burrows-wheeler transform on intermediate buffer to produce output.If start_bunzip was initialized with out_fd =-1, then up to len bytes ofdata are written to outbuf. Return value is number of bytes written orerror (all errors are negative numbers)