lzlib (empty) → 0.1.0.0
raw patch · 6 files changed
+183/−0 lines, 6 filesdep +base
Dependencies added: base
Files
- CHANGELOG.md +5/−0
- LICENSE +11/−0
- README.md +3/−0
- lzlib.cabal +46/−0
- src/Codec/Lzip.chs +114/−0
- stack.yaml +4/−0
+ CHANGELOG.md view
@@ -0,0 +1,5 @@+# lzlib++## 0.1.0.0++Initial release
+ LICENSE view
@@ -0,0 +1,11 @@+Copyright Vanessa McHale (c) 2019++Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.++3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,3 @@+# lzlib++Low-level bindings to [lzlib](https://www.nongnu.org/lzip/lzlib.html).
+ lzlib.cabal view
@@ -0,0 +1,46 @@+cabal-version: 1.18+name: lzlib+version: 0.1.0.0+license: BSD3+license-file: LICENSE+copyright: Copyright: (c) 2019 Vanessa McHale+maintainer: vamchale@gmail.com+author: Vanessa McHale+synopsis: lzlib bindings+description:+ Lzlib bindings via [c2hs](http://hackage.haskell.org/package/c2hs).++category: Codec, Compression+build-type: Simple+extra-source-files: stack.yaml+extra-doc-files:+ README.md+ CHANGELOG.md++source-repository head+ type: git+ location: https://github.com/vmchale/lzlib++flag cross+ description: Set this flag if cross-compiling+ default: False+ manual: True++library+ exposed-modules: Codec.Lzip+ hs-source-dirs: src+ default-language: Haskell2010+ extra-libraries: lz+ ghc-options: -Wall+ build-depends: base >=4.3 && <5++ if !flag(cross)+ build-tool-depends: c2hs:c2hs -any++ if impl(ghc >=8.0)+ ghc-options:+ -Wincomplete-uni-patterns -Wincomplete-record-updates+ -Wredundant-constraints++ if impl(ghc >=8.4)+ ghc-options: -Wmissing-export-lists
+ src/Codec/Lzip.chs view
@@ -0,0 +1,114 @@+module Codec.Lzip ( -- * Prolegomena+ LZErrno (..)+ , lZVersion+ , lZStrerror+ , lZMinDictionaryBits+ , lZMinDictionarySize+ , lZMaxDictionaryBits+ , lZMaxDictionarySize+ , lZMinMatchLenLimit+ , lZMaxMatchLenLimit+ , UInt8+ -- * Compression functions+ , LZEncoder+ , LZEncoderPtr+ , lZCompressOpen+ , lZCompressClose+ , lZCompressFinish+ , lZCompressRestartMember+ , lZCompressSyncFlush+ , lZCompressRead+ , lZCompressWrite+ , lZCompressWriteSize+ , lZCompressErrno+ , lZCompressFinished+ , lZCompressMemberFinished+ , lZCompressDataPosition+ , lZCompressMemberPosition+ , lZCompressTotalInSize+ , lZCompressTotalOutSize+ -- * Decompression functions+ , LZDecoder+ , LZDecoderPtr+ , lZDecompressOpen+ , lZDecompressClose+ , lZDecompressFinish+ , lZDecompressReset+ , lZDecompressSyncToMember+ , lZDecompressRead+ , lZDecompressWrite+ , lZDecompressWriteSize+ , lZDecompressErrno+ , lZDecompressFinished+ , lZDecompressMemberFinished+ , lZDecompressDictionarySize+ , lZDecompressDataCrc+ , lZDecompressDataPosition+ , lZDecompressMemberPosition+ , lZDecompressTotalInSize+ , lZDecompressTotalOutSize+ ) where++import Foreign.C.String+import Foreign.C.Types+import Foreign.Ptr (Ptr)++#include <stdint.h>+#include <lzlib.h>++type UInt8 = {# type uint8_t #}++{# enum LZ_Errno as LZErrno {underscoreToCase} #}++{# fun LZ_version as ^ {} -> `CString' #}+{# fun LZ_strerror as ^ { `LZErrno' } -> `CString' #}+{# fun LZ_min_dictionary_bits as ^ {} -> `CInt' #}+{# fun LZ_min_dictionary_size as ^ {} -> `CInt' #}+{# fun LZ_max_dictionary_bits as ^ {} -> `CInt' #}+{# fun LZ_max_dictionary_size as ^ {} -> `CInt' #}+{# fun LZ_min_match_len_limit as ^ {} -> `CInt' #}+{# fun LZ_max_match_len_limit as ^ {} -> `CInt' #}++-- | Abstract data type+data LZEncoder++{# pointer *LZ_Encoder as LZEncoderPtr -> LZEncoder #}++{# fun LZ_compress_open as ^ { `CInt', `CInt', id `CULLong' } -> `LZEncoderPtr' #}+{# fun LZ_compress_close as ^ { `LZEncoderPtr' } -> `CInt' #}+{# fun LZ_compress_finish as ^ { `LZEncoderPtr' } -> `CInt' #}+{# fun LZ_compress_restart_member as ^ { `LZEncoderPtr', id `CULLong' } -> `CInt' #}+{# fun LZ_compress_sync_flush as ^ { `LZEncoderPtr' } -> `CInt' #}+{# fun LZ_compress_read as ^ { `LZEncoderPtr', id `Ptr UInt8', `CInt' } -> `CInt' #}+{# fun LZ_compress_write as ^ { `LZEncoderPtr', id `Ptr UInt8', `CInt' } -> `CInt' #}+{# fun LZ_compress_write_size as ^ { `LZEncoderPtr' } -> `CInt' #}+{# fun LZ_compress_errno as ^ { `LZEncoderPtr' } -> `LZErrno' #}+{# fun LZ_compress_finished as ^ { `LZEncoderPtr' } -> `CInt' #}+{# fun LZ_compress_member_finished as ^ { `LZEncoderPtr' } -> `CInt' #}+{# fun LZ_compress_data_position as ^ { `LZEncoderPtr' } -> `CULLong' id #}+{# fun LZ_compress_member_position as ^ { `LZEncoderPtr' } -> `CULLong' id #}+{# fun LZ_compress_total_in_size as ^ { `LZEncoderPtr' } -> `CULLong' id #}+{# fun LZ_compress_total_out_size as ^ { `LZEncoderPtr' } -> `CULLong' id #}++-- | Abstract data type+data LZDecoder++{# pointer *LZ_Decoder as LZDecoderPtr -> LZDecoder #}++{# fun LZ_decompress_open as ^ {} -> `LZDecoderPtr' #}+{# fun LZ_decompress_close as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_finish as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_reset as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_sync_to_member as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_read as ^ { `LZDecoderPtr', id `Ptr UInt8', `CInt' } -> `CInt' #}+{# fun LZ_decompress_write as ^ { `LZDecoderPtr', id `Ptr UInt8', `CInt' } -> `CInt' #}+{# fun LZ_decompress_write_size as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_errno as ^ { `LZDecoderPtr' } -> `LZErrno' #}+{# fun LZ_decompress_finished as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_member_finished as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_dictionary_size as ^ { `LZDecoderPtr' } -> `CInt' #}+{# fun LZ_decompress_data_crc as ^ { `LZDecoderPtr' } -> `CUInt' #}+{# fun LZ_decompress_data_position as ^ { `LZDecoderPtr' } -> `CULLong' id #}+{# fun LZ_decompress_member_position as ^ { `LZDecoderPtr' } -> `CULLong' id #}+{# fun LZ_decompress_total_in_size as ^ { `LZDecoderPtr' } -> `CULLong' id #}+{# fun LZ_decompress_total_out_size as ^ { `LZDecoderPtr' } -> `CULLong' id #}
+ stack.yaml view
@@ -0,0 +1,4 @@+---+resolver: lts-14.4+packages:+ - '.'