lzo 0.1.0.0 → 0.1.1.0
raw patch · 6 files changed
+38/−3 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Codec.Compression.Lzo: lzoVersion :: Word
+ Codec.Compression.Lzo: lzoVersionDate :: String
+ Codec.Compression.Lzo: lzoVersionString :: String
Files
- CHANGELOG.md +5/−0
- README.md +2/−1
- lzo.cabal +6/−1
- src/Codec/Compression/Lzo.hs +4/−0
- src/Codec/Compression/Lzo/Block.hsc +20/−0
- src/Codec/Compression/Lzo/File.hs +1/−1
CHANGELOG.md view
@@ -1,5 +1,10 @@ # lzo +## 0.1.1.0++ * Added `lzoVersionString` etc.+ * Set file mode bit more sensibly+ ## 0.1.0.0 Initial release
README.md view
@@ -3,4 +3,5 @@ This bundles [minilzo](http://www.oberhumer.com/opensource/lzo/#minilzo) and hence only offers one compression level. -It contains a file (frame) compressor as well as block compression.+It contains a file (frame) compressor as well as block compression. File+compression (and decompression) is fully lazy.
lzo.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: lzo-version: 0.1.0.0+version: 0.1.1.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2020 Vanessa McHale@@ -20,6 +20,11 @@ extra-doc-files: README.md CHANGELOG.md++source-repository head+ type: darcs+ location: https://hub.darcs.net/vmchale/sak+ subdir: lzo library exposed-modules: Codec.Compression.Lzo
src/Codec/Compression/Lzo.hs view
@@ -21,6 +21,10 @@ , lzoEInvalidAlignment , lzoEOutputNotConsumed , lzoEInternalError+ -- * Version info+ , lzoVersion+ , lzoVersionString+ , lzoVersionDate ) where import Codec.Compression.Lzo.Block
src/Codec/Compression/Lzo/Block.hsc view
@@ -15,12 +15,16 @@ , lzoEInvalidAlignment , lzoEOutputNotConsumed , lzoEInternalError+ , lzoVersion+ , lzoVersionString+ , lzoVersionDate ) where import Control.Applicative import Control.Exception (Exception, throw) import qualified Data.ByteString as BS import qualified Data.ByteString.Unsafe as BS+import Foreign.C.String (CString, peekCString) import Foreign.C.Types (CChar, CInt (..), CUInt (..)) import Control.Monad (when) import Foreign.Ptr (Ptr, nullPtr)@@ -34,6 +38,22 @@ foreign import ccall lzo1x_1_compress :: Ptr Byte -> CUInt -> Ptr Byte -> Ptr CUInt -> Ptr a -> IO CInt foreign import ccall lzo1x_decompress_safe :: Ptr Byte -> CUInt -> Ptr Byte -> Ptr CUInt -> Ptr a -> IO CInt++foreign import ccall lzo_version :: CUInt+foreign import ccall lzo_version_string :: CString+foreign import ccall lzo_version_date :: CString++-- | @since 0.1.1.0+lzoVersion :: Word+lzoVersion = fromIntegral lzo_version++-- | @since 0.1.1.0+lzoVersionString :: String+lzoVersionString = unsafePerformIO $ peekCString lzo_version_string++-- | @since 0.1.1.0+lzoVersionDate :: String+lzoVersionDate = unsafePerformIO $ peekCString lzo_version_date lzo1MemCompress :: Integral a => a lzo1MemCompress = #{const LZO1X_1_MEM_COMPRESS}
src/Codec/Compression/Lzo/File.hs view
@@ -125,7 +125,7 @@ <> putWord8 1 -- method <> putWord8 2 -- compression level <> putWord32be (unixFlag .|. adler32dFlag) -- flags- <> putWord32be 0x644 -- from here: https://github.com/libarchive/libarchive/blob/3649ed23c6b4392d692580c03b10a611e3eaaa32/libarchive/archive_write_add_filter_lzop.c#L123+ <> putWord32be 0x81a4 -- from here: https://github.com/libarchive/libarchive/blob/3649ed23c6b4392d692580c03b10a611e3eaaa32/libarchive/archive_write_add_filter_lzop.c#L123 <> putWord32be 0 -- mtime low (ignored) <> putWord32be 0 -- mtime high (ignored) <> putWord8 0 -- filename length