[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:41 UTC 2010
The following commit has been merged in the master branch:
commit dd87bc73648fcb9b5de87595b138dc313aa74c6c
Author: John Goerzen <jgoerzen at complete.org>
Date: Sat Dec 4 05:53:40 2004 +0100
Checkpointing
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.7--patch-24)
diff --git a/ChangeLog b/ChangeLog
index 0729512..de1576e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
#
+2004-12-03 22:53:40 GMT John Goerzen <jgoerzen at complete.org> patch-24
+
+ Summary:
+ Checkpointing
+ Revision:
+ missingh--head--0.7--patch-24
+
+
+ modified files:
+ ChangeLog libsrc/MissingH/FileArchive/GZip.hs
+
+
2004-12-03 22:39:47 GMT John Goerzen <jgoerzen at complete.org> patch-23
Summary:
diff --git a/libsrc/MissingH/FileArchive/GZip.hs b/libsrc/MissingH/FileArchive/GZip.hs
index d944533..3d4cbc3 100644
--- a/libsrc/MissingH/FileArchive/GZip.hs
+++ b/libsrc/MissingH/FileArchive/GZip.hs
@@ -29,6 +29,7 @@ import Data.List
import Data.Bits
import Control.Monad.Error
import Data.Char
+import Data.Word
type GZipError = String
@@ -62,8 +63,21 @@ decompress s =
let rem = snd x
return $ inflate_string rem
-{- | Obtain the components of the file.
--}
+-- | Read the file's compressed data, returning
+-- (Decompressed, CRC32, Remainder)
+read_data :: String -> (String, Word32, String)
+read_data x =
+ let (decompressed1, remainder) = inflate_string_remainder x
+ (decompressed, crc32) = read_data_internal decompressed1 0 0
+ in
+ (decompressed, crc32, remainder)
+ where
+ read_data_internal [] ck l = ([], calc_crc32 [] ck l)
+ read_data_internal (x:xs) ck l =
+ let n = read_data_internal xs (iter_crc32 ck x) (l+1)
+ in
+ (x : fst n, snd n)
+
{- | Read the GZip header. Return (Header, Remainder).
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list