[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:49:40 UTC 2010


The following commit has been merged in the master branch:
commit 99e9d39d218644afa9daf87f3f27fed8151fc3c8
Author: John Goerzen <jgoerzen at complete.org>
Date:   Sat Dec 4 05:39:47 2004 +0100

    Hacking on Inflate
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.7--patch-23)

diff --git a/ChangeLog b/ChangeLog
index ab40ce9..0729512 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,19 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
 #
 
+2004-12-03 22:39:47 GMT	John Goerzen <jgoerzen at complete.org>	patch-23
+
+    Summary:
+      Hacking on Inflate
+    Revision:
+      missingh--head--0.7--patch-23
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/Compression/Inflate.hs
+     libsrc/MissingH/FileArchive/GZip.hs
+
+
 2004-12-03 22:22:27 GMT	John Goerzen <jgoerzen at complete.org>	patch-22
 
     Summary:
diff --git a/libsrc/MissingH/Compression/Inflate.hs b/libsrc/MissingH/Compression/Inflate.hs
index dd6cbd6..7b903a1 100644
--- a/libsrc/MissingH/Compression/Inflate.hs
+++ b/libsrc/MissingH/Compression/Inflate.hs
@@ -29,6 +29,7 @@ Copyright (C) 2004 Ian Lynagh
 -}
 
 module MissingH.Compression.Inflate (inflate_string,
+                                     inflate_string_remainder,
                                      inflate, Output, Bit,
                                     bits_to_word32) where
 
@@ -42,8 +43,22 @@ import Data.Bits
 import Data.Word
 
 inflate_string :: String -> String
-inflate_string s = 
-    map (Data.Char.chr . fromIntegral) $ fst $ inflate $ map Data.Char.ord s
+inflate_string = fst . inflate_string_remainder
+--    map (Data.Char.chr . fromIntegral) $ fst $ inflate $ map Data.Char.ord s
+
+-- | Returns (Data, Remainder)
+inflate_string_remainder :: String -> (String, String)
+inflate_string_remainder s =
+    let res = inflate $ map Data.Char.ord s
+        convw32l l = map (Data.Char.chr . fromIntegral) l
+        output = convw32l $ fst res
+        b2w32 [] = []
+        b2w32 b = let (this, next) = splitAt 8 b
+                      in
+                      bits_to_word32 this : b2w32 next
+        remainder = convw32l $ b2w32 $ snd res
+        in
+        (output, remainder)
 
 {-
 \section{Types}
diff --git a/libsrc/MissingH/FileArchive/GZip.hs b/libsrc/MissingH/FileArchive/GZip.hs
index adb88d4..d944533 100644
--- a/libsrc/MissingH/FileArchive/GZip.hs
+++ b/libsrc/MissingH/FileArchive/GZip.hs
@@ -62,6 +62,10 @@ decompress s =
        let rem = snd x
        return $ inflate_string rem
 
+{- | Obtain the components of the file.
+-}
+
+
 {- | Read the GZip header.  Return (Header, Remainder).
 -}
 read_header :: String -> Either GZipError (Header, String)

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list