File: ERR.hs

package info (click to toggle)
haskell-hsopenssl 0.11.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 496 kB
  • ctags: 74
  • sloc: haskell: 1,990; ansic: 349; makefile: 16
file content (23 lines) | stat: -rw-r--r-- 506 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE ForeignFunctionInterface #-}
module OpenSSL.ERR
    ( getError
    , peekError

    , errorString
    )
    where
import Foreign
import Foreign.C

foreign import ccall unsafe "ERR_get_error"
    getError :: IO CULong

foreign import ccall unsafe "ERR_peek_error"
    peekError :: IO CULong

foreign import ccall unsafe "ERR_error_string"
    _error_string :: CULong -> CString -> IO CString

errorString :: CULong -> IO String
errorString code
    = _error_string code nullPtr >>= peekCString