    {-# LINE 1 "src/System/Posix/Syslog/Options.hsc" #-}
    {-# LANGUAGE DeriveGeneric #-}

    {- |
       Maintainer: simons@cryp.to
       Stability: provisional
       Portability: POSIX

       FFI bindings to @syslog(3)@ from
       <http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html POSIX.1-2008>.
       This module is intended for purposes of low-level implementation. Users of
       this library should prefer safer and more convenient API provided by
       "System.Posix.Syslog".
    -}

    module System.Posix.Syslog.Options where

    import Foreign.C.Types
    import GHC.Generics ( Generic )

    -- | The function 'openlog' allows one to configure a handful of process-wide
    -- options that modify the behavior of the 'syslog' function. These options are
    -- 'pid', 'cons', 'odelay', and 'ndelay'.

    data Option = LogPID              -- ^ Log the pid with each message.
                | Console             -- ^ Log on the console if errors occur while sending messages.
                | DelayedOpen         -- ^ Delay all initialization until first @syslog()@ call (default).
                | ImmediateOpen       -- ^ Initialize the syslog system immediately.
                | DontWaitForChildren -- ^ The syslog system should not attempt to wait for child
                                      -- process it may have created. This option is required by
                                      -- applications who enable @SIGCHLD@ themselves.
      deriving (Int -> Option -> ShowS
    [Option] -> ShowS
    Option -> String
    (Int -> Option -> ShowS)
    -> (Option -> String) -> ([Option] -> ShowS) -> Show Option
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [Option] -> ShowS
    $cshowList :: [Option] -> ShowS
    show :: Option -> String
    $cshow :: Option -> String
    showsPrec :: Int -> Option -> ShowS
    $cshowsPrec :: Int -> Option -> ShowS
    Show, ReadPrec [Option]
    ReadPrec Option
    Int -> ReadS Option
    ReadS [Option]
    (Int -> ReadS Option)
    -> ReadS [Option]
    -> ReadPrec Option
    -> ReadPrec [Option]
    -> Read Option
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    readListPrec :: ReadPrec [Option]
    $creadListPrec :: ReadPrec [Option]
    readPrec :: ReadPrec Option
    $creadPrec :: ReadPrec Option
    readList :: ReadS [Option]
    $creadList :: ReadS [Option]
    readsPrec :: Int -> ReadS Option
    $creadsPrec :: Int -> ReadS Option
    Read, Option
    Option -> Option -> Bounded Option
    forall a. a -> a -> Bounded a
    maxBound :: Option
    $cmaxBound :: Option
    minBound :: Option
    $cminBound :: Option
    Bounded, Int -> Option
    Option -> Int
    Option -> [Option]
    Option -> Option
    Option -> Option -> [Option]
    Option -> Option -> Option -> [Option]
    (Option -> Option)
    -> (Option -> Option)
    -> (Int -> Option)
    -> (Option -> Int)
    -> (Option -> [Option])
    -> (Option -> Option -> [Option])
    -> (Option -> Option -> [Option])
    -> (Option -> Option -> Option -> [Option])
    -> Enum Option
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    enumFromThenTo :: Option -> Option -> Option -> [Option]
    $cenumFromThenTo :: Option -> Option -> Option -> [Option]
    enumFromTo :: Option -> Option -> [Option]
    $cenumFromTo :: Option -> Option -> [Option]
    enumFromThen :: Option -> Option -> [Option]
    $cenumFromThen :: Option -> Option -> [Option]
    enumFrom :: Option -> [Option]
    $cenumFrom :: Option -> [Option]
    fromEnum :: Option -> Int
    $cfromEnum :: Option -> Int
    toEnum :: Int -> Option
    $ctoEnum :: Int -> Option
    pred :: Option -> Option
    $cpred :: Option -> Option
    succ :: Option -> Option
    $csucc :: Option -> Option
    Enum, Option -> Option -> Bool
    (Option -> Option -> Bool)
    -> (Option -> Option -> Bool) -> Eq Option
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: Option -> Option -> Bool
    $c/= :: Option -> Option -> Bool
    == :: Option -> Option -> Bool
    $c== :: Option -> Option -> Bool
    Eq, (forall x. Option -> Rep Option x)
    -> (forall x. Rep Option x -> Option) -> Generic Option
    forall x. Rep Option x -> Option
    forall x. Option -> Rep Option x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep Option x -> Option
    $cfrom :: forall x. Option -> Rep Option x
    Generic)

    -- | Translate an 'Option' into the system-dependent identifier that's used by
    -- the @syslog(3)@ implementation.

    {-# INLINE fromOption #-}
    fromOption :: Option -> CInt
    fromOption :: Option -> CInt
    fromOption LogPID              = 1
    {-# LINE 41 "src/System/Posix/Syslog/Options.hsc" #-}
    fromOption Console             = 2
    {-# LINE 42 "src/System/Posix/Syslog/Options.hsc" #-}
    fromOption DelayedOpen         = 4
    {-# LINE 43 "src/System/Posix/Syslog/Options.hsc" #-}
    fromOption ImmediateOpen       = 8
    {-# LINE 44 "src/System/Posix/Syslog/Options.hsc" #-}
    fromOption DontWaitForChildren = 16
    {-# LINE 45 "src/System/Posix/Syslog/Options.hsc" #-}