@@ -23,6 +23,7 @@ module Data.Streaming.Zlib.Lowlevel
23
23
, c_call_inflate_set_dictionary
24
24
) where
25
25
26
+ import Data.Functor (void )
26
27
import Foreign.C
27
28
import Foreign.Ptr
28
29
import Codec.Compression.Zlib (WindowBits (WindowBits ))
@@ -43,19 +44,19 @@ foreign import ccall unsafe "streaming_commons_create_z_stream"
43
44
44
45
foreign import ccall unsafe " streaming_commons_deflate_init2"
45
46
c_deflateInit2 :: ZStream' -> CInt -> CInt -> CInt -> CInt
46
- -> IO ()
47
+ -> IO CInt
47
48
48
49
deflateInit2 :: ZStream' -> Int -> WindowBits -> Int -> Strategy -> IO ()
49
- deflateInit2 zstream level windowBits memlevel strategy =
50
+ deflateInit2 zstream level windowBits memlevel strategy = void $
50
51
c_deflateInit2 zstream (fromIntegral level) (wbToInt windowBits)
51
52
(fromIntegral memlevel)
52
53
(fromIntegral $ fromEnum strategy)
53
54
54
55
foreign import ccall unsafe " streaming_commons_inflate_init2"
55
- c_inflateInit2 :: ZStream' -> CInt -> IO ()
56
+ c_inflateInit2 :: ZStream' -> CInt -> IO CInt
56
57
57
58
inflateInit2 :: ZStream' -> WindowBits -> IO ()
58
- inflateInit2 zstream wb = c_inflateInit2 zstream (wbToInt wb)
59
+ inflateInit2 zstream wb = void $ c_inflateInit2 zstream (wbToInt wb)
59
60
60
61
foreign import ccall unsafe " &streaming_commons_free_z_stream_inflate"
61
62
c_free_z_stream_inflate :: FunPtr (ZStream' -> IO () )
@@ -94,10 +95,10 @@ foreign import ccall unsafe "streaming_commons_call_deflate_full_flush"
94
95
c_call_deflate_full_flush :: ZStream' -> IO CInt
95
96
96
97
foreign import ccall unsafe " streaming_commons_deflate_set_dictionary"
97
- c_call_deflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO ()
98
+ c_call_deflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO CInt
98
99
99
100
foreign import ccall unsafe " streaming_commons_inflate_set_dictionary"
100
- c_call_inflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO ()
101
+ c_call_inflate_set_dictionary :: ZStream' -> Ptr CChar -> CUInt -> IO CInt
101
102
102
103
wbToInt :: WindowBits -> CInt
103
104
wbToInt (WindowBits i) = fromIntegral i
0 commit comments