From 77507eb719d8db00573e5053a45d4bac7b664860 Mon Sep 17 00:00:00 2001 From: davve Date: Fri, 12 Jan 2007 18:33:59 +0000 Subject: Remove interface file read/write --- src/Main.hs | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/Main.hs') 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) -- cgit v1.2.3