-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Interface to C file/magic library -- -- This package provides a Haskell interface to the C libmagic library. -- With it, you can determine the type of a file by examining its -- contents rather than its name. The Haskell interface provides a -- full-featured binding. @package magic @version 1.1 -- | Maintainer : jgoerzen@complete.org Stability : provisional -- Portability: portable -- -- Haskell types for libmagic constants -- -- Written by John Goerzen, jgoerzen@complete.org module Magic.Data data MagicFlag MagicNone :: MagicFlag MagicDebug :: MagicFlag MagicSymlink :: MagicFlag MagicCompress :: MagicFlag MagicDevices :: MagicFlag MagicMimeType :: MagicFlag MagicMimeEncoding :: MagicFlag MagicMime :: MagicFlag MagicContinue :: MagicFlag MagicCheck :: MagicFlag MagicPreserveAtime :: MagicFlag MagicRaw :: MagicFlag MagicError :: MagicFlag UnknownMagicFlag :: Int -> MagicFlag instance GHC.Show.Show Magic.Data.MagicFlag instance GHC.Enum.Enum Magic.Data.MagicFlag instance GHC.Classes.Ord Magic.Data.MagicFlag instance GHC.Classes.Eq Magic.Data.MagicFlag -- | Maintainer : jgoerzen@complete.org Stability : provisional -- Portability: portable -- -- Types for magic programs. -- -- Written by John Goerzen, jgoerzen@complete.org module Magic.Types -- | Main Magic object type. -- -- Magic objects are automatically closed (and memory freed) when they -- are garbage-collected by Haskell. There is no need to explicitly close -- them. type Magic = ForeignPtr CMagic data MagicFlag MagicNone :: MagicFlag MagicDebug :: MagicFlag MagicSymlink :: MagicFlag MagicCompress :: MagicFlag MagicDevices :: MagicFlag MagicMimeType :: MagicFlag MagicMimeEncoding :: MagicFlag MagicMime :: MagicFlag MagicContinue :: MagicFlag MagicCheck :: MagicFlag MagicPreserveAtime :: MagicFlag MagicRaw :: MagicFlag MagicError :: MagicFlag UnknownMagicFlag :: Int -> MagicFlag -- | Maintainer : jgoerzen@complete.org Stability : provisional -- Portability: portable -- -- Initialization and shutdown for magic programs -- -- Written by John Goerzen, jgoerzen@complete.org module Magic.Operations -- | Calls the Magic system on the specified file. magicFile :: Magic -> FilePath -> IO String -- | Calls the Magic system on stdin. magicStdin :: Magic -> IO String -- | Calls the Magic system to process the given String. Please note: it is -- not evaluated lazily. magicString :: Magic -> String -> IO String -- | Lower-level function used to call the Magic system to process a C -- string. magicCString :: Magic -> CStringLen -> IO String -- | Change the flags on an already-created object. magicSetFlags :: Magic -> [MagicFlag] -> IO () -- | Compile the colon-separated list of database file(s). The compiled -- files created have .mgc added to the names of the argument. magicCompile :: Magic -> Maybe String -> IO () -- | Maintainer : jgoerzen@complete.org Stability : provisional -- Portability: portable -- -- Initialization and shutdown for magic programs -- -- Written by John Goerzen, jgoerzen@complete.org module Magic.Init -- | Create a Magic object. You must call either magicLoadDefault or -- magicLoad after this. magicOpen :: [MagicFlag] -> IO Magic -- | Load the specified magic database(s). The given string may contain -- multiple colon-separated pathnames. magicLoad :: Magic -> String -> IO () -- | Load the system's default magic database. magicLoadDefault :: Magic -> IO () -- | Maintainer : jgoerzen@complete.org Stability : provisional -- Portability: portable -- -- Top-level Magic module. -- -- Written by John Goerzen, jgoerzen@complete.org -- -- Foo bar module Magic