diff options
author | davve <davve@dtek.chalmers.se> | 2007-01-12 18:33:59 +0000 |
---|---|---|
committer | davve <davve@dtek.chalmers.se> | 2007-01-12 18:33:59 +0000 |
commit | 77507eb719d8db00573e5053a45d4bac7b664860 (patch) | |
tree | 580ec5a90fd84c67dff4fa78bc3955a7a6c7a67c | |
parent | 0f2144d8c918261152f1efbf753cb975d94ce503 (diff) |
Remove interface file read/write
-rw-r--r-- | src/Main.hs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/Main.hs b/src/Main.hs index 774e0811..6ff83401 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1303,36 +1303,3 @@ getPackages session dynflags flags = do -- | Build one big doc env out of a list of packages packagesDocEnv :: [PackageData] -> PackageEnv packagesDocEnv packages = Map.unions (map pdDocEnv packages) - --------------------------------------------------------------------------------- --- Package/Interface files --------------------------------------------------------------------------------- - -packageFileMagic = 0xDA303001 :: Word32 - -savePackageFile :: FilePath -> PackageEnv -> IO () -savePackageFile filename pkgEnv = do - h <- openBinaryFile filename WriteMode - bh <- openBinIO h - - ud <- newWriteState - bh <- return $ setUserData bh ud - - put_ bh packageFileMagic - put_ bh (Map.toList pkgEnv) - hClose h - -loadPackageFile :: FilePath -> IO PackageEnv -loadPackageFile filename = do - h <- openBinaryFile filename ReadMode - bh <- openBinIO h - - ud <- newReadState undefined - bh <- return (setUserData bh ud) - - magic <- get bh - when (magic /= packageFileMagic) $ throwE $ - "Magic number mismatch: couldn't load interface file: " ++ filename - - envList <- get bh - return (Map.fromList envList) |