diff options
author | davve <davve@dtek.chalmers.se> | 2007-02-05 00:12:23 +0000 |
---|---|---|
committer | davve <davve@dtek.chalmers.se> | 2007-02-05 00:12:23 +0000 |
commit | 953d1fa77925a695311670e86b2f6cf27e00454c (patch) | |
tree | c502a1a6b13d33abc11cd50c07c43169d2e8041f /src/Main.hs | |
parent | b07ed2188bb5f5824d27ee821b3d6e2549618963 (diff) |
Solve conflicts
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Main.hs b/src/Main.hs index db6b0775..1539316a 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -455,8 +455,7 @@ run flags modules extEnv = do case [str | Flag_DumpInterface str <- flags] of [] -> return () fs -> let filename = (last fs) in - savePackageFile filename homeEnv - + writePackageFile filename homeEnv {- instance Outputable (DocEntity Name) where ppr (DocEntity d) = ppr d @@ -1331,9 +1330,10 @@ packagesDocEnv packages = Map.unions (map pdDocEnv packages) -------------------------------------------------------------------------------- packageFileMagic = 0xDA303001 :: Word32 +packageFileVersion = 0 :: Word16 -savePackageFile :: FilePath -> PackageEnv -> IO () -savePackageFile filename pkgEnv = do +writePackageFile :: FilePath -> DocEnv -> IO () +writePackageFile filename pkgEnv = do h <- openBinaryFile filename WriteMode bh <- openBinIO h @@ -1341,11 +1341,12 @@ savePackageFile filename pkgEnv = do bh <- return $ setUserData bh ud put_ bh packageFileMagic + put_ bh packageFileVersion put_ bh (Map.toList pkgEnv) hClose h -loadPackageFile :: FilePath -> IO PackageEnv -loadPackageFile filename = do +readPackageFile :: FilePath -> IO DocEnv +readPackageFile filename = do h <- openBinaryFile filename ReadMode bh <- openBinIO h @@ -1355,6 +1356,7 @@ loadPackageFile filename = do magic <- get bh when (magic /= packageFileMagic) $ throwE $ "Magic number mismatch: couldn't load interface file: " ++ filename - + + (version :: Word16) <- get bh envList <- get bh return (Map.fromList envList) |