{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE TypeFamilies #-}
module Crypto.Saltine (
sodiumInit
) where
import Foreign.C
sodiumInit :: IO ()
sodiumInit :: IO ()
sodiumInit = do
CInt
err <- IO CInt
c_sodiumInit
case CInt
err of
CInt
0 ->
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
CInt
1 ->
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
CInt
_ ->
[Char] -> IO ()
forall a. HasCallStack => [Char] -> a
error [Char]
"Crypto.Saltine.sodiumInit"
foreign import ccall "sodium_init" c_sodiumInit :: IO CInt