[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:51:55 UTC 2010


The following commit has been merged in the master branch:
commit 26e1d9e3fe35ca5875cc8cd122d16f915bfd94d1
Author: John Goerzen <jgoerzen at complete.org>
Date:   Tue Dec 21 02:46:55 2004 +0100

    Checkpointing
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.7--patch-102)

diff --git a/COPYRIGHT b/COPYRIGHT
index 424d60d..b9c5c56 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -120,6 +120,17 @@ Pursuant to the terms of the LGPL, you may consider this code to fall
 under the GPL as part of the whole MissingH work.
 
 ----------------------------------------------------
+Portions if MissingH.Path come from Volker Wysk's HsShellScript
+library, version 2.1.0.  That code is Copyright (c) 2004 Volker Wysk
+and is licensed under the GNU LGPL 2.1
+
+Debian GNU/Linux users may find the GNU LGPL 2.1 at
+/usr/share/common-licenses/LGPL-2.1.  Alternatively, you may find it
+at 3rd-party-licenses/LGPL-2.1 in the source distribution.
+
+Pursuant to the terms of the LGPL, you may consider this code to fall
+under the GPL as part of the whole MissingH work.
+----------------------------------------------------
 MissingH.Checksum.CRC32.Posix is
 (C) 2002 HardCore SoftWare, Doug Hoyte
 and is "distributed under the terms of the GNU GPL."  This license is
diff --git a/ChangeLog b/ChangeLog
index cc1028b..93ace1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
 #
 
+2004-12-20 19:46:55 GMT	John Goerzen <jgoerzen at complete.org>	patch-102
+
+    Summary:
+      Checkpointing
+    Revision:
+      missingh--head--0.7--patch-102
+
+
+    modified files:
+     COPYRIGHT ChangeLog libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
+
+
 2004-12-20 17:29:47 GMT	John Goerzen <jgoerzen at complete.org>	patch-101
 
     Summary:
diff --git a/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs b/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
index cc567e3..bedcdd7 100644
--- a/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
+++ b/libsrc/MissingH/IO/HVFS/InstanceHelpers.hs
@@ -39,6 +39,7 @@ module MissingH.IO.HVFS.InstanceHelpers(-- * HVFSStat objects
                                        )
 where
 import MissingH.IO.HVFS
+import Data.IORef
 
 {- | A simple class that assumes that everything is either a file
 or a directory. -}
@@ -53,5 +54,25 @@ instance HVFSStat SimpleStat where
 -- In-Memory Tree Types
 ----------------------------------------------------------------------
 
-data MemoryNode = MemoryFile String String -- ^ A file, defined by its name and contents
-                | MemoryDirectory String [MemoryNode] -- ^ A directory, defined by its name and list of component files
+type MemoryNode = (String, MemoryEntry)
+data MemoryEntry = MemoryDirectory [MemoryNode]
+                 | MemoryFile String
+data MemoryVFS = MemoryVFS 
+               { content :: IORef [MemoryNode],
+                 cwd :: IORef String
+               }
+
+-- | Create a new 'MemoryVFS' object from an existing tree.
+-- An empty filesystem may be created by using @[]@ for the parameter.
+newMemoryVFS :: [MemoryNode] -> IO MemoryVFS
+newMemoryVFS s = do r <- newIORef s
+                    newMemoryVFSRef r
+
+-- | Create a new 'MemoryVFS' object using an IORef to an
+-- existing tree.
+newMemoryVFSRef :: IORef [MemoryNode] -> IO MemoryVFS
+newMemoryVFSRef r = do
+                    c <- newIORef "/"
+                    return (MemoryVFS {content = r, cwd = c})
+
+

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list