Skip to content

Commit

Permalink
Backwards compatibility with 0.2 releases for zstream init functions (#…
Browse files Browse the repository at this point in the history
…63)

* Backwards compatibility with 0.2 releases for init_inflate_zstream and init_deflate_zstream.

* Add backwards compatibility with 0.2 releases for all functions that had an argument added.
  • Loading branch information
GunnarFarneback authored and Ben J. Ward committed Jul 18, 2018
1 parent d0b2a2e commit c22e7a1
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lowlevel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,8 @@ function init_deflate_zstream(raw::Bool, gzip::Bool, level::Integer, mem_level::
@zcheck init_deflate!(zstream, level, Z_DEFLATED, window_bits, mem_level, strategy)
return zstream
end

# For backwards compatibility with 0.2 releases.
init_inflate_zstream(gzip::Bool) = init_inflate_zstream(false, gzip)
init_deflate_zstream(gzip::Bool, level::Integer, mem_level::Integer, strategy) =
init_deflate_zstream(false, gzip, level, mem_level, strategy)
23 changes: 23 additions & 0 deletions src/sink.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,26 @@ function reset!(sink::Sink{mode}) where mode
)
return sink
end

# For backwards compatibility with 0.2 releases.
InflateSink(output::BufferedOutputStream, gzip::Bool) =
InflateSink(output, false, gzip)
InflateSink(output::BufferedOutputStream, bufsize::Integer, gzip::Bool) =
InflateSink(output, bufsize, false, gzip)
InflateSink(output::IO, bufsize::Integer, gzip::Bool) =
InflateSink(output, bufsize, false, gzip)
InflateSink(output::Vector{UInt8}, bufsize::Integer, gzip::Bool) =
InflateSink(output, bufsize, false, gzip)

DeflateSink(output::BufferedOutputStream, gzip::Bool, level::Integer,
mem_level::Integer, strategy) =
DeflateSink(output, false, gzip, level, mem_level, strategy)
DeflateSink(output::BufferedOutputStream, bufsize::Integer,
gzip::Bool, level::Integer, mem_level::Integer, strategy) =
DeflateSink(output, bufsize, false, gzip, level, mem_level, strategy)
DeflateSink(output::IO, bufsize::Integer, gzip::Bool, level::Integer,
mem_level::Integer, strategy) =
DeflateSink(output, bufsize, false, gzip::Bool, level, mem_level, strategy)
DeflateSink(output::Vector{UInt8}, bufsize::Integer, gzip::Bool,
level::Integer, mem_level::Integer, strategy) =
DeflateSink(output, bufsize, false, gzip, level, mem_level, strategy)
25 changes: 25 additions & 0 deletions src/source.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,28 @@ function reset!(source::Source{mode}) where mode
)
return source
end

# For backwards compatibility with 0.2 releases.
InflateSource(input::BufferedInputStream, gzip::Bool, reset_on_end::Bool) =
InflateSource(input, false, gzip, reset_on_end)
InflateSource(input::BufferedInputStream, bufsize::Integer, gzip::Bool,
reset_on_end::Bool) =
InflateSource(input, bufsize, false, gzip, reset_on_end)
InflateSource(input::IO, bufsize::Integer, gzip::Bool, reset_on_end::Bool) =
InflateSource(input, bufsize, false, gzip, reset_on_end)
InflateSource(input::Vector{UInt8}, bufsize::Integer, gzip::Bool,
reset_on_end::Bool) =
InflateSource(input, bufsize, false, gzip, reset_on_end)

DeflateSource(input::BufferedInputStream, gzip::Bool, level::Integer,
mem_level::Integer, strategy) =
DeflateSource(input, false, gzip, level, mem_level, strategy)
DeflateSource(input::BufferedInputStream, bufsize::Integer, gzip::Bool,
level::Integer, mem_level::Integer, strategy) =
DeflateSource(input, bufsize, false, gzip, level, mem_level, strategy)
DeflateSource(input::IO, bufsize::Integer, gzip::Bool, level::Integer,
mem_level::Integer, strategy) =
DeflateSource(input, bufsize, false, gzip, level, mem_level, strategy)
DeflateSource(input::Vector{UInt8}, bufsize::Integer, gzip::Bool,
level::Integer, mem_level::Integer, strategy) =
DeflateSource(input, bufsize, false, gzip, level, mem_level, strategy)

0 comments on commit c22e7a1

Please sign in to comment.