aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/InterfaceFile.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2010-08-29 13:03:28 +0000
committerDavid Waern <david.waern@gmail.com>2010-08-29 13:03:28 +0000
commitd5ec98534422eba93298bb8a76e6b315a55c3158 (patch)
tree72a4c3e98b60199e4bf1808878a81d441fa9b84c /src/Haddock/InterfaceFile.hs
parenta01b2ef92f9164734d6673b1f3e01cde8da477c8 (diff)
Add source entity path to --read-interface
You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before.
Diffstat (limited to 'src/Haddock/InterfaceFile.hs')
-rw-r--r--src/Haddock/InterfaceFile.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs
index 5fe47b72..1df9cd12 100644
--- a/src/Haddock/InterfaceFile.hs
+++ b/src/Haddock/InterfaceFile.hs
@@ -12,7 +12,7 @@
-- Reading and writing the .haddock interface file
-----------------------------------------------------------------------------
module Haddock.InterfaceFile (
- InterfaceFile(..),
+ InterfaceFile(..), ifPackageId,
readInterfaceFile, nameCacheFromGhc, freshNameCache, NameCacheAccessor,
writeInterfaceFile
) where
@@ -46,6 +46,13 @@ data InterfaceFile = InterfaceFile {
}
+ifPackageId :: InterfaceFile -> PackageId
+ifPackageId if_ =
+ case ifInstalledIfaces if_ of
+ [] -> error "empty InterfaceFile"
+ iface:_ -> modulePackageId $ instMod iface
+
+
binaryInterfaceMagic :: Word32
binaryInterfaceMagic = 0xD0Cface