    {-# LINE 1 "src/System/Posix/Syslog/Facility.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.Facility where

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

    -- | Syslog distinguishes various system facilities. Most applications should
    -- log in 'USER'.

    data Facility  = Kernel      -- ^ kernel messages
                   | User        -- ^ user-level messages (default unless set otherwise)
                   | Mail        -- ^ mail system
                   | News        -- ^ network news subsystem
                   | UUCP        -- ^ UUCP subsystem
                   | Daemon      -- ^ system daemons
                   | Auth        -- ^ security and authorization messages
                   | Cron        -- ^ clock daemon
                   | LPR         -- ^ line printer subsystem
                   | Local0      -- ^ reserved for local use
                   | Local1      -- ^ reserved for local use
                   | Local2      -- ^ reserved for local use
                   | Local3      -- ^ reserved for local use
                   | Local4      -- ^ reserved for local use
                   | Local5      -- ^ reserved for local use
                   | Local6      -- ^ reserved for local use
                   | Local7      -- ^ reserved for local use
       deriving (Int -> Facility -> ShowS
    [Facility] -> ShowS
    Facility -> String
    (Int -> Facility -> ShowS)
    -> (Facility -> String) -> ([Facility] -> ShowS) -> Show Facility
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Facility -> ShowS
    showsPrec :: Int -> Facility -> ShowS
    $cshow :: Facility -> String
    show :: Facility -> String
    $cshowList :: [Facility] -> ShowS
    showList :: [Facility] -> ShowS
    Show, ReadPrec [Facility]
    ReadPrec Facility
    Int -> ReadS Facility
    ReadS [Facility]
    (Int -> ReadS Facility)
    -> ReadS [Facility]
    -> ReadPrec Facility
    -> ReadPrec [Facility]
    -> Read Facility
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS Facility
    readsPrec :: Int -> ReadS Facility
    $creadList :: ReadS [Facility]
    readList :: ReadS [Facility]
    $creadPrec :: ReadPrec Facility
    readPrec :: ReadPrec Facility
    $creadListPrec :: ReadPrec [Facility]
    readListPrec :: ReadPrec [Facility]
    Read, Facility
    Facility -> Facility -> Bounded Facility
    forall a. a -> a -> Bounded a
    $cminBound :: Facility
    minBound :: Facility
    $cmaxBound :: Facility
    maxBound :: Facility
    Bounded, Int -> Facility
    Facility -> Int
    Facility -> [Facility]
    Facility -> Facility
    Facility -> Facility -> [Facility]
    Facility -> Facility -> Facility -> [Facility]
    (Facility -> Facility)
    -> (Facility -> Facility)
    -> (Int -> Facility)
    -> (Facility -> Int)
    -> (Facility -> [Facility])
    -> (Facility -> Facility -> [Facility])
    -> (Facility -> Facility -> [Facility])
    -> (Facility -> Facility -> Facility -> [Facility])
    -> Enum Facility
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: Facility -> Facility
    succ :: Facility -> Facility
    $cpred :: Facility -> Facility
    pred :: Facility -> Facility
    $ctoEnum :: Int -> Facility
    toEnum :: Int -> Facility
    $cfromEnum :: Facility -> Int
    fromEnum :: Facility -> Int
    $cenumFrom :: Facility -> [Facility]
    enumFrom :: Facility -> [Facility]
    $cenumFromThen :: Facility -> Facility -> [Facility]
    enumFromThen :: Facility -> Facility -> [Facility]
    $cenumFromTo :: Facility -> Facility -> [Facility]
    enumFromTo :: Facility -> Facility -> [Facility]
    $cenumFromThenTo :: Facility -> Facility -> Facility -> [Facility]
    enumFromThenTo :: Facility -> Facility -> Facility -> [Facility]
    Enum, Facility -> Facility -> Bool
    (Facility -> Facility -> Bool)
    -> (Facility -> Facility -> Bool) -> Eq Facility
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Facility -> Facility -> Bool
    == :: Facility -> Facility -> Bool
    $c/= :: Facility -> Facility -> Bool
    /= :: Facility -> Facility -> Bool
    Eq, (forall x. Facility -> Rep Facility x)
    -> (forall x. Rep Facility x -> Facility) -> Generic Facility
    forall x. Rep Facility x -> Facility
    forall x. Facility -> Rep Facility x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. Facility -> Rep Facility x
    from :: forall x. Facility -> Rep Facility x
    $cto :: forall x. Rep Facility x -> Facility
    to :: forall x. Rep Facility x -> Facility
    Generic)

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

    {-# INLINE fromFacility #-}
    fromFacility :: Facility -> CInt
    fromFacility :: Facility -> CInt
    fromFacility Facility
    Kernel    = CInt
    0
    {-# LINE 50 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility User      = 8
    {-# LINE 51 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Mail      = 16
    {-# LINE 52 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Daemon    = 24
    {-# LINE 53 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Auth      = 32
    {-# LINE 54 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility LPR       = 48
    {-# LINE 55 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility News      = 56
    {-# LINE 56 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility UUCP      = 64
    {-# LINE 57 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Cron      = 72
    {-# LINE 58 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local0    = 128
    {-# LINE 59 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local1    = 136
    {-# LINE 60 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local2    = 144
    {-# LINE 61 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local3    = 152
    {-# LINE 62 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local4    = 160
    {-# LINE 63 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local5    = 168
    {-# LINE 64 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local6    = 176
    {-# LINE 65 "src/System/Posix/Syslog/Facility.hsc" #-}
    fromFacility Local7    = 184
    {-# LINE 66 "src/System/Posix/Syslog/Facility.hsc" #-}