-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Implementation of the Virtual Hard Disk (VHD) disk format -- -- Provide a toolbox of function to manipulate VHD files. @package vhd @version 0.1 module Data.VHD -- | create an empty vhd with the specified parameters create :: FilePath -> CreateParameters -> IO () data CreateParameters CreateParameters :: BlockSize -> Size -> Maybe TimeStamp -> Maybe UniqueId -> Bool -> CreateParameters blockSize :: CreateParameters -> BlockSize size :: CreateParameters -> Size timeStamp :: CreateParameters -> Maybe TimeStamp uuid :: CreateParameters -> Maybe UniqueId useBatmap :: CreateParameters -> Bool defaultCreateParameters :: CreateParameters -- | grab the header and footer from a vhd file. getInfo :: FilePath -> IO (Either String (Header, Footer)) data Block readBlock :: Block -> Int -> Int -> IO ByteString writeBlock :: Block -> ByteString -> Int -> IO () -- | mmap a block using a filepath, a blocksize withBlock :: FilePath -> BlockSize -> Word32 -> (Block -> IO a) -> IO a data Context Context :: Bat -> Header -> Footer -> Handle -> FilePath -> IORef Bool -> Context ctxBatPtr :: Context -> Bat ctxHeader :: Context -> Header ctxFooter :: Context -> Footer ctxHandle :: Context -> Handle ctxFilePath :: Context -> FilePath ctxBModified :: Context -> IORef Bool withVhdContext :: FilePath -> (Context -> IO r) -> IO r extendBlock :: Context -> Int -> IO () data Header Header :: Cookie -> Offset -> Offset -> Version -> EntryCount -> BlockSize -> CheckSum -> UniqueId -> TimeStamp -> ByteString -> ParentUnicodeName -> ParentLocatorEntries -> Header headerCookie :: Header -> Cookie headerDataOffset :: Header -> Offset headerTableOffset :: Header -> Offset headerVersion :: Header -> Version headerMaxTableEntries :: Header -> EntryCount headerBlockSize :: Header -> BlockSize headerCheckSum :: Header -> CheckSum headerParentUniqueId :: Header -> UniqueId headerParentTimeStamp :: Header -> TimeStamp headerReserved1 :: Header -> ByteString headerParentUnicodeName :: Header -> ParentUnicodeName headerParentLocatorEntries :: Header -> ParentLocatorEntries data Footer Footer :: Cookie -> Bool -> Version -> Offset -> TimeStamp -> CreatorApplication -> Version -> CreatorHostOs -> Size -> Size -> DiskGeometry -> DiskType -> CheckSum -> UniqueId -> Bool -> Footer footerCookie :: Footer -> Cookie footerIsTemporaryDisk :: Footer -> Bool footerFormatVersion :: Footer -> Version footerDataOffset :: Footer -> Offset footerTimeStamp :: Footer -> TimeStamp footerCreatorApplication :: Footer -> CreatorApplication footerCreatorVersion :: Footer -> Version footerCreatorHostOs :: Footer -> CreatorHostOs footerOriginalSize :: Footer -> Size footerCurrentSize :: Footer -> Size footerDiskGeometry :: Footer -> DiskGeometry footerDiskType :: Footer -> DiskType footerCheckSum :: Footer -> CheckSum footerUniqueId :: Footer -> UniqueId footerIsSavedState :: Footer -> Bool data BatmapHeader BatmapHeader :: Cookie -> Offset -> Word32 -> Version -> CheckSum -> BatmapHeader batmapHeaderCookie :: BatmapHeader -> Cookie batmapHeaderOffset :: BatmapHeader -> Offset batmapHeaderSize :: BatmapHeader -> Word32 batmapHeaderVersion :: BatmapHeader -> Version batmapHeaderCheckSum :: BatmapHeader -> CheckSum type BlockSize = Word32 type DiskGeometryCylinders = Word16 type DiskGeometryHeads = Word8 type DiskGeometrySectorsPerTrack = Word8 type CheckSum = Word32 type EntryCount = Word32 type Offset = Word64 type Size = Word64 type TimeStamp = Word32 data Version Version :: VersionMajor -> VersionMinor -> Version type VersionMajor = Word16 type VersionMinor = Word16 data CreatorHostOs CreatorHostOsUnknown :: CreatorHostOs CreatorHostOsWindows :: CreatorHostOs CreatorHostOsMacintosh :: CreatorHostOs data DiskGeometry DiskGeometry :: DiskGeometryCylinders -> DiskGeometryHeads -> DiskGeometrySectorsPerTrack -> DiskGeometry data DiskType DiskTypeFixed :: DiskType DiskTypeDynamic :: DiskType DiskTypeDifferencing :: DiskType newtype Cookie Cookie :: ByteString -> Cookie newtype CreatorApplication CreatorApplication :: ByteString -> CreatorApplication newtype ParentLocatorEntry ParentLocatorEntry :: ByteString -> ParentLocatorEntry newtype ParentUnicodeName ParentUnicodeName :: String -> ParentUnicodeName newtype UniqueId UniqueId :: ByteString -> UniqueId newtype ParentLocatorEntries ParentLocatorEntries :: [ParentLocatorEntry] -> ParentLocatorEntries randomUniqueId :: IO UniqueId instance Show CreateParameters instance Eq CreateParameters