    {-# LANGUAGE ForeignFunctionInterface #-}
    --------------------------------------------------------------------
    -- |
    -- Module    : Network.Curl.Code
    -- Copyright : (c) Galois Inc 2007-2009, 2011
    -- License   : BSD3
    --
    -- Maintainer: Sigbjorn Finne <sof@galois.com>
    -- Stability : provisional
    -- Portability: portable
    --
    -- Representing Curl's status codes as a Haskell type.
    --
    --------------------------------------------------------------------

    module Network.Curl.Code where

    import Foreign.C.Types

    data CurlCode
     = CurlOK
     | CurlUnspportedProtocol
     | CurlFailedInit
     | CurlUrlMalformat
     | CurlUrlMalformatUser
     | CurlCouldntResolveProxy
     | CurlCouldntResolveHost
     | CurlCouldntConnect
     | CurlFtpWeirdServerReply
     | CurlFtpAccessDenied
     | CurlFtpUserPasswordIncorrect
     | CurlFtpWeirdPassReply
     | CurlFtpWeirdUserReply
     | CurlFtpWeirdPASVReply
     | CurlFtpWeird227Format
     | CurlFtpCantGetHost
     | CurlFtpCantReconnect
     | CurlFtpCouldnSetBinary
     | CurlPartialFile
     | CurlFtpCouldntRetrFile
     | CurlFtpWriteError
     | CurlFtpQuoteError
     | CurlHttpReturnedError
     | CurlWriteError
     | CurlMalformatError
     | CurlFtpCouldnStorFile
     | CurlReadError
     | CurlOutOfMemory
     | CurlOperationTimeout
     | CurlFtpCouldntSetAscii
     | CurlFtpPortFailed
     | CurlFtpCouldntUseRest
     | CurlFtpCouldntGetSize
     | CurlHttpRangeError
     | CurlHttpPostError
     | CurlSSLConnectError
     | CurlBadDownloadResume
     | CurlFileCouldntReadFile
     | CurlLDAPCannotBind
     | CurlLDPAPSearchFailed
     | CurlLibraryNotFound
     | CurlFunctionNotFound
     | CurlAbortedByCallback
     | CurlBadFunctionArgument
     | CurlBadCallingOrder
     | CurlInterfaceFailed
     | CurlBadPasswordEntered
     | CurlTooManyRedirects
     | CurlUnknownTelnetOption
     | CurlTelnetOptionSyntax
     | CurlObsolete
     | CurlSSLPeerCertificate
     | CurlGotNothing
     | CurlSSLEngineNotFound
     | CurlSSLEngineSetFailed
     | CurlSendError
     | CurlRecvError
     | CurlShareInUse
     | CurlSSLCertProblem
     | CurlSSLCipher
     | CurlSSLCACert
     | CurlBadContentEncoding
     | CurlLDAPInvalidUrl
     | CurlFilesizeExceeded
     | CurlFtpSSLFailed
     | CurlSendFailRewind
     | CurlSSLEngineInitFailed
     | CurlLoginDenied
     | CurlTFtpNotFound
     | CurlTFtpPerm
     | CurlTFtpDiskFull
     | CurlTFtpIllegal
     | CurlTFtpUnknownId
     | CurlTFtpExists
     | CurlTFtpNoSuchUser
     | CurlConvFailed
     | CurlConvReqd
     | CurlSSLCACertBadFile
     | CurlRemoveFileNotFound
     | CurlSSH
     | CurlSSLShutdownFailed
     | CurlAgain
     | CurlSSLCRLBadFile
     | CurlSSLIssuerError
       deriving ( CurlCode -> CurlCode -> Bool
    (CurlCode -> CurlCode -> Bool)
    -> (CurlCode -> CurlCode -> Bool) -> Eq CurlCode
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CurlCode -> CurlCode -> Bool
    == :: CurlCode -> CurlCode -> Bool
    $c/= :: CurlCode -> CurlCode -> Bool
    /= :: CurlCode -> CurlCode -> Bool
    Eq, Int -> CurlCode -> ShowS
    [CurlCode] -> ShowS
    CurlCode -> String
    (Int -> CurlCode -> ShowS)
    -> (CurlCode -> String) -> ([CurlCode] -> ShowS) -> Show CurlCode
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> CurlCode -> ShowS
    showsPrec :: Int -> CurlCode -> ShowS
    $cshow :: CurlCode -> String
    show :: CurlCode -> String
    $cshowList :: [CurlCode] -> ShowS
    showList :: [CurlCode] -> ShowS
    Show, Int -> CurlCode
    CurlCode -> Int
    CurlCode -> [CurlCode]
    CurlCode -> CurlCode
    CurlCode -> CurlCode -> [CurlCode]
    CurlCode -> CurlCode -> CurlCode -> [CurlCode]
    (CurlCode -> CurlCode)
    -> (CurlCode -> CurlCode)
    -> (Int -> CurlCode)
    -> (CurlCode -> Int)
    -> (CurlCode -> [CurlCode])
    -> (CurlCode -> CurlCode -> [CurlCode])
    -> (CurlCode -> CurlCode -> [CurlCode])
    -> (CurlCode -> CurlCode -> CurlCode -> [CurlCode])
    -> Enum CurlCode
    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 :: CurlCode -> CurlCode
    succ :: CurlCode -> CurlCode
    $cpred :: CurlCode -> CurlCode
    pred :: CurlCode -> CurlCode
    $ctoEnum :: Int -> CurlCode
    toEnum :: Int -> CurlCode
    $cfromEnum :: CurlCode -> Int
    fromEnum :: CurlCode -> Int
    $cenumFrom :: CurlCode -> [CurlCode]
    enumFrom :: CurlCode -> [CurlCode]
    $cenumFromThen :: CurlCode -> CurlCode -> [CurlCode]
    enumFromThen :: CurlCode -> CurlCode -> [CurlCode]
    $cenumFromTo :: CurlCode -> CurlCode -> [CurlCode]
    enumFromTo :: CurlCode -> CurlCode -> [CurlCode]
    $cenumFromThenTo :: CurlCode -> CurlCode -> CurlCode -> [CurlCode]
    enumFromThenTo :: CurlCode -> CurlCode -> CurlCode -> [CurlCode]
    Enum )

    toCode :: CInt -> CurlCode
    toCode :: CInt -> CurlCode
    toCode CInt
    x = Int -> CurlCode
    forall a. Enum a => Int -> a
    toEnum (CInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral CInt
    x)