-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A binding to the kqueue event library.
--
-- A low-level binding to the kqueue library as found in BSD and Mac OS
-- X. It provides, among other things, a way of monitoring files and
-- directories for changes.
@package kqueue
@version 0.2.1
-- | This module contains a low-level binding to the kqueue interface. It
-- stays close to the C API, changing the types to more native Haskell
-- types, but not significantly changing it. See the kqueue man page or
-- the examples in examples/ for usage information. For a
-- higher-level binding, see System.KQueue.HighLevel.
module System.KQueue
-- | A kernel event queue.
data KQueue
-- | Create a new KQueue.
kqueue :: IO KQueue
-- | A kernel event.
data KEvent
KEvent :: CULong -> Filter -> [Flag] -> [FFlag] -> CLong -> Ptr () -> KEvent
-- | The identifier for the event, often a file descriptor.
[ident] :: KEvent -> CULong
-- | The kernel filter (type of event).
[evfilter] :: KEvent -> Filter
-- | Actions to perform on the event.
[flags] :: KEvent -> [Flag]
-- | Filter-specific flags.
[fflags] :: KEvent -> [FFlag]
-- | Filter-specific data value.
[data_] :: KEvent -> CLong
-- | User-defined data, passed through unchanged.
[udata] :: KEvent -> Ptr ()
-- | The types of kernel events.
data Filter
EvfiltTimer :: Filter
EvfiltSignal :: Filter
EvfiltProc :: Filter
EvfiltVnode :: Filter
EvfiltAio :: Filter
EvfiltWrite :: Filter
EvfiltRead :: Filter
-- | The actions to perform on the event.
data Flag
EvAdd :: Flag
EvDelete :: Flag
EvEnable :: Flag
EvDisable :: Flag
EvOneshot :: Flag
EvClear :: Flag
EvReceipt :: Flag
EvError :: Flag
EvEof :: Flag
-- | The filter specific flags.
data FFlag
NoteDelete :: FFlag
NoteWrite :: FFlag
NoteExtend :: FFlag
NoteAttrib :: FFlag
NoteLink :: FFlag
NoteRename :: FFlag
NoteRevoke :: FFlag
NoteSignal :: FFlag
NoteExec :: FFlag
NoteFork :: FFlag
NoteExit :: FFlag
-- | Add events to monitor, or retrieve events from the kqueue. If an error
-- occurs, will throw a KQueueException if there is no room in the
-- returned event list. Otherwise, will set EvError on the event
-- and add it to the returned event list.
kevent :: KQueue -> [KEvent] -> Int -> Maybe NominalDiffTime -> IO [KEvent]
data KQueueException
instance GHC.Show.Show System.KQueue.KQueueException
instance GHC.Classes.Eq System.KQueue.TimeSpec
instance GHC.Show.Show System.KQueue.TimeSpec
instance GHC.Classes.Eq System.KQueue.KEvent
instance GHC.Show.Show System.KQueue.KEvent
instance GHC.Classes.Eq System.KQueue.FFlag
instance GHC.Show.Show System.KQueue.FFlag
instance GHC.Classes.Eq System.KQueue.Flag
instance GHC.Show.Show System.KQueue.Flag
instance GHC.Classes.Eq System.KQueue.Filter
instance GHC.Show.Show System.KQueue.Filter
instance GHC.Enum.Enum System.KQueue.Filter
instance GHC.Enum.Enum System.KQueue.Flag
instance GHC.Enum.Enum System.KQueue.FFlag
instance Foreign.Storable.Storable System.KQueue.KEvent
instance Foreign.Storable.Storable System.KQueue.TimeSpec
instance GHC.Exception.Exception System.KQueue.KQueueException
-- | This module contains higher-level abstraction for monitoring file
-- system changes, built on top of the bindings from
-- System.KQueue.
module System.KQueue.HighLevel
-- | Watch a file for changes. The file doesn't have to exist, but the
-- directory it is in, does. Returns immediately. You can stop watching
-- by passing the Watcher to stopWatching.
watchFile :: FilePath -> (EventType -> IO ()) -> IO Watcher
-- | Stop a watcher from watching.
stopWatching :: Watcher -> IO ()
-- | The type of file change that occurred.
data EventType
Changed :: EventType
Created :: EventType
Deleted :: EventType
-- | An identifier for the watcher of a file. Allows you to stop watching
-- it later.
data Watcher
instance GHC.Show.Show System.KQueue.HighLevel.EventType