lib/ruby/truffle/pr-zlib/lib/pr/rbzlib.rb
# Copy without compression as much as possible from the input stream, return
# the current block state.
# This function does not insert new strings in the dictionary since
# uncompressible data is probably not useful. This function is used
# only for the level=0 compression option.
# NOTE: this function should be optimized to avoid extra copying from
# window to pending_buf.
Copy without compression as much as possible from the input stream, return
the current block state.
This function does not insert new strings in the dictionary since
uncompressible data is probably not useful. This function is used
only for the level=0 compression option.
NOTE: this function should be optimized to avoid extra copying from
window to pending_buf.
Copy without compression as much as possible from the input stream return the current block state . This function does not insert new strings in the dictionary since uncompressible data is probably not useful . This function is used only for the level = 0 compression option . NOTE : this function should be optimized to avoid extra copying from window to pending_buf .
def deflate_stored(s,flush)
    max_block_size = 0xffff
    if (max_block_size > s.pending_buf_size - 5)
      max_block_size = s.pending_buf_size - 5
    end
    loop do
      if (s.lookahead <= 1)
        fill_window(s)
        if s.lookahead == 0 && (flush == Z_NO_FLUSH)
          return :need_more
        end
        break if s.lookahead == 0
      end
      s.strstart += s.lookahead
      s.lookahead = 0
      max_start = s.block_start + max_block_size
      if s.strstart == 0 || ((s.strstart) >= max_start)
        s.lookahead = (s.strstart - max_start)
        s.strstart = (max_start)
        FLUSH_BLOCK_ONLY(s, false)
        if s.strm.avail_out == 0
          return :need_more
        end
      end
      if (s.strstart - (s.block_start) >=
          s.w_size-MIN_LOOKAHEAD)
        FLUSH_BLOCK_ONLY(s, false)
        if s.strm.avail_out == 0
          return :need_more
        end
      end
    end
    FLUSH_BLOCK_ONLY(s, flush == Z_FINISH)
    if s.strm.avail_out == 0
      if flush == Z_FINISH
        return :finish_started
      else
        return :need_more
      end
    end
    if flush == Z_FINISH
      return :finish_done
    else
      return :block_done
    end
  end
def deflate_stored ( s , flush ) max_block_size = 0xffff if ( max_block_size > s . pending_buf_size - 5 ) max_block_size = s . pending_buf_size - 5 end loop do if ( s . lookahead <= 1 ) fill_window ( s ) if s . lookahead == 0 && ( flush == Z_NO_FLUSH ) return :need_more end break if s . lookahead == 0 end s . strstart += s . lookahead s . lookahead = 0 max_start = s . block_start + max_block_size if s . strstart == 0 || ( ( s . strstart ) >= max_start ) s . lookahead = ( s . strstart - max_start ) s . strstart = ( max_start ) FLUSH_BLOCK_ONLY ( s , false ) if s . strm . avail_out == 0 return :need_more end end if ( s . strstart - ( s . block_start ) >= s . w_size - MIN_LOOKAHEAD ) FLUSH_BLOCK_ONLY ( s , false ) if s . strm . avail_out == 0 return :need_more end end end FLUSH_BLOCK_ONLY ( s , flush == Z_FINISH ) if s . strm . avail_out == 0 if flush == Z_FINISH return :finish_started else return :need_more end end if flush == Z_FINISH return :finish_done else return :block_done end end
Copy without compression as much as possible from the input stream, return
the current block state.
Copy without compression as much as possible from the input stream return the current block state .
s
<not_specific>
flush
<not_specific>