File: Code.hs

package info (click to toggle)
haskell-curl 1.3.8-16
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 260 kB
  • sloc: haskell: 1,528; ansic: 33; makefile: 2
file content (108 lines) | stat: -rw-r--r-- 2,477 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{-# 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 ( Eq, Show, Enum )

toCode :: CInt -> CurlCode
toCode x = toEnum (fromIntegral x)