botan-bindings-0.2.0.0: src/Botan/Bindings/Version.hs
{-|
Module : Botan.Bindings.Version
Description : Botan version info
Copyright : (c) 2023-2024, Apotheca Labs
(c) 2024-2025, Haskell Foundation
License : BSD-3-Clause
Maintainer : joris@well-typed.com, leo@apotheca.io
Stability : experimental
Portability : POSIX
This module is based on the
[Versioning](https://botan.randombit.net/handbook/api_ref/ffi.html#versioning)
section of the C Botan FFI documentation.
-}
{-# LANGUAGE CApiFFI #-}
module Botan.Bindings.Version (
botan_ffi_api_version
, botan_ffi_supports_api
, botan_version_string
, botan_version_major
, botan_version_minor
, botan_version_patch
, botan_version_datestamp
) where
import Botan.Bindings.ConstPtr
import Data.Word
import Foreign.C.Types
-- TODO: consider making these bindings unsafe. See issue #47.
foreign import capi safe "botan/ffi.h botan_ffi_api_version"
botan_ffi_api_version :: IO Word32
foreign import capi safe "botan/ffi.h botan_ffi_supports_api"
botan_ffi_supports_api :: Word32 -> IO CInt
foreign import capi safe "botan/ffi.h botan_version_string"
botan_version_string :: IO (ConstPtr CChar)
foreign import capi safe "botan/ffi.h botan_version_major"
botan_version_major :: IO Word32
foreign import capi safe "botan/ffi.h botan_version_minor"
botan_version_minor :: IO Word32
foreign import capi safe "botan/ffi.h botan_version_patch"
botan_version_patch :: IO Word32
foreign import capi safe "botan/ffi.h botan_version_datestamp"
botan_version_datestamp :: IO Word32