{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GLib.Structs.Hmac
    ( 

-- * Exported types
    Hmac(..)                                ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [copy]("GI.GLib.Structs.Hmac#g:method:copy"), [ref]("GI.GLib.Structs.Hmac#g:method:ref"), [unref]("GI.GLib.Structs.Hmac#g:method:unref"), [update]("GI.GLib.Structs.Hmac#g:method:update").
-- 
-- ==== Getters
-- [getDigest]("GI.GLib.Structs.Hmac#g:method:getDigest"), [getString]("GI.GLib.Structs.Hmac#g:method:getString").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveHmacMethod                       ,
#endif

-- ** copy #method:copy#

#if defined(ENABLE_OVERLOADING)
    HmacCopyMethodInfo                      ,
#endif
    hmacCopy                                ,


-- ** getDigest #method:getDigest#

#if defined(ENABLE_OVERLOADING)
    HmacGetDigestMethodInfo                 ,
#endif
    hmacGetDigest                           ,


-- ** getString #method:getString#

#if defined(ENABLE_OVERLOADING)
    HmacGetStringMethodInfo                 ,
#endif
    hmacGetString                           ,


-- ** new #method:new#

    hmacNew                                 ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    HmacRefMethodInfo                       ,
#endif
    hmacRef                                 ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    HmacUnrefMethodInfo                     ,
#endif
    hmacUnref                               ,


-- ** update #method:update#

#if defined(ENABLE_OVERLOADING)
    HmacUpdateMethodInfo                    ,
#endif
    hmacUpdate                              ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import {-# SOURCE #-} qualified GI.GLib.Enums as GLib.Enums

#else
import {-# SOURCE #-} qualified GI.GLib.Enums as GLib.Enums

#endif

-- | Memory-managed wrapper type.
newtype Hmac = Hmac (SP.ManagedPtr Hmac)
    deriving (Hmac -> Hmac -> Bool
(Hmac -> Hmac -> Bool) -> (Hmac -> Hmac -> Bool) -> Eq Hmac
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Hmac -> Hmac -> Bool
== :: Hmac -> Hmac -> Bool
$c/= :: Hmac -> Hmac -> Bool
/= :: Hmac -> Hmac -> Bool
Eq)

instance SP.ManagedPtrNewtype Hmac where
    toManagedPtr :: Hmac -> ManagedPtr Hmac
toManagedPtr (Hmac ManagedPtr Hmac
p) = ManagedPtr Hmac
p

foreign import ccall "g_hmac_get_type" c_g_hmac_get_type :: 
    IO GType

type instance O.ParentTypes Hmac = '[]
instance O.HasParentTypes Hmac

instance B.Types.TypedObject Hmac where
    glibType :: IO GType
glibType = IO GType
c_g_hmac_get_type

instance B.Types.GBoxed Hmac

-- | Convert 'Hmac' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Hmac) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_hmac_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Hmac -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Hmac
P.Nothing = Ptr GValue -> Ptr Hmac -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Hmac
forall a. Ptr a
FP.nullPtr :: FP.Ptr Hmac)
    gvalueSet_ Ptr GValue
gv (P.Just Hmac
obj) = Hmac -> (Ptr Hmac -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Hmac
obj (Ptr GValue -> Ptr Hmac -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Hmac)
gvalueGet_ Ptr GValue
gv = do
        Ptr Hmac
ptr <- Ptr GValue -> IO (Ptr Hmac)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Hmac)
        if Ptr Hmac
ptr Ptr Hmac -> Ptr Hmac -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Hmac
forall a. Ptr a
FP.nullPtr
        then Hmac -> Maybe Hmac
forall a. a -> Maybe a
P.Just (Hmac -> Maybe Hmac) -> IO Hmac -> IO (Maybe Hmac)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Hmac -> Hmac) -> Ptr Hmac -> IO Hmac
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Hmac -> Hmac
Hmac Ptr Hmac
ptr
        else Maybe Hmac -> IO (Maybe Hmac)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Hmac
forall a. Maybe a
P.Nothing
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Hmac
type instance O.AttributeList Hmac = HmacAttributeList
type HmacAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

-- method Hmac::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "digest_type"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "ChecksumType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUInt8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_len"
--           , argType = TBasicType TSize
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "Hmac" })
-- throws : False
-- Skip return : False

foreign import ccall "g_hmac_new" g_hmac_new :: 
    CUInt ->                                -- digest_type : TInterface (Name {namespace = "GLib", name = "ChecksumType"})
    Word8 ->                                -- key : TBasicType TUInt8
    FCT.CSize ->                            -- key_len : TBasicType TSize
    IO (Ptr Hmac)

-- | /No description available in the introspection data./
hmacNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.Enums.ChecksumType
    -> Word8
    -> FCT.CSize
    -> m Hmac
hmacNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ChecksumType -> Word8 -> CSize -> m Hmac
hmacNew ChecksumType
digestType Word8
key CSize
keyLen = IO Hmac -> m Hmac
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Hmac -> m Hmac) -> IO Hmac -> m Hmac
forall a b. (a -> b) -> a -> b
$ do
    let digestType' :: CUInt
digestType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ChecksumType -> Int) -> ChecksumType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ChecksumType -> Int
forall a. Enum a => a -> Int
fromEnum) ChecksumType
digestType
    Ptr Hmac
result <- CUInt -> Word8 -> CSize -> IO (Ptr Hmac)
g_hmac_new CUInt
digestType' Word8
key CSize
keyLen
    Text -> Ptr Hmac -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hmacNew" Ptr Hmac
result
    Hmac
result' <- ((ManagedPtr Hmac -> Hmac) -> Ptr Hmac -> IO Hmac
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Hmac -> Hmac
Hmac) Ptr Hmac
result
    Hmac -> IO Hmac
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Hmac
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Hmac::copy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "hmac"
--           , argType = TInterface Name { namespace = "GLib" , name = "Hmac" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "Hmac" })
-- throws : False
-- Skip return : False

foreign import ccall "g_hmac_copy" g_hmac_copy :: 
    Ptr Hmac ->                             -- hmac : TInterface (Name {namespace = "GLib", name = "Hmac"})
    IO (Ptr Hmac)

-- | /No description available in the introspection data./
hmacCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Hmac
    -> m Hmac
hmacCopy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Hmac -> m Hmac
hmacCopy Hmac
hmac = IO Hmac -> m Hmac
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Hmac -> m Hmac) -> IO Hmac -> m Hmac
forall a b. (a -> b) -> a -> b
$ do
    Ptr Hmac
hmac' <- Hmac -> IO (Ptr Hmac)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hmac
hmac
    Ptr Hmac
result <- Ptr Hmac -> IO (Ptr Hmac)
g_hmac_copy Ptr Hmac
hmac'
    Text -> Ptr Hmac -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hmacCopy" Ptr Hmac
result
    Hmac
result' <- ((ManagedPtr Hmac -> Hmac) -> Ptr Hmac -> IO Hmac
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Hmac -> Hmac
Hmac) Ptr Hmac
result
    Hmac -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hmac
hmac
    Hmac -> IO Hmac
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Hmac
result'

#if defined(ENABLE_OVERLOADING)
data HmacCopyMethodInfo
instance (signature ~ (m Hmac), MonadIO m) => O.OverloadedMethod HmacCopyMethodInfo Hmac signature where
    overloadedMethod = hmacCopy

instance O.OverloadedMethodInfo HmacCopyMethodInfo Hmac where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.Hmac.hmacCopy",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Hmac.html#v:hmacCopy"
        })


#endif

-- method Hmac::get_digest
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "hmac"
--           , argType = TInterface Name { namespace = "GLib" , name = "Hmac" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer"
--           , argType = TBasicType TUInt8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "digest_len"
--           , argType = TBasicType TSize
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_hmac_get_digest" g_hmac_get_digest :: 
    Ptr Hmac ->                             -- hmac : TInterface (Name {namespace = "GLib", name = "Hmac"})
    Word8 ->                                -- buffer : TBasicType TUInt8
    FCT.CSize ->                            -- digest_len : TBasicType TSize
    IO ()

-- | /No description available in the introspection data./
hmacGetDigest ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Hmac
    -> Word8
    -> FCT.CSize
    -> m ()
hmacGetDigest :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Hmac -> Word8 -> CSize -> m ()
hmacGetDigest Hmac
hmac Word8
buffer CSize
digestLen = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Hmac
hmac' <- Hmac -> IO (Ptr Hmac)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hmac
hmac
    Ptr Hmac -> Word8 -> CSize -> IO ()
g_hmac_get_digest Ptr Hmac
hmac' Word8
buffer CSize
digestLen
    Hmac -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hmac
hmac
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data HmacGetDigestMethodInfo
instance (signature ~ (Word8 -> FCT.CSize -> m ()), MonadIO m) => O.OverloadedMethod HmacGetDigestMethodInfo Hmac signature where
    overloadedMethod = hmacGetDigest

instance O.OverloadedMethodInfo HmacGetDigestMethodInfo Hmac where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.Hmac.hmacGetDigest",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Hmac.html#v:hmacGetDigest"
        })


#endif

-- method Hmac::get_string
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "hmac"
--           , argType = TInterface Name { namespace = "GLib" , name = "Hmac" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_hmac_get_string" g_hmac_get_string :: 
    Ptr Hmac ->                             -- hmac : TInterface (Name {namespace = "GLib", name = "Hmac"})
    IO CString

-- | /No description available in the introspection data./
hmacGetString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Hmac
    -> m T.Text
hmacGetString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Hmac -> m Text
hmacGetString Hmac
hmac = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Hmac
hmac' <- Hmac -> IO (Ptr Hmac)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hmac
hmac
    CString
result <- Ptr Hmac -> IO CString
g_hmac_get_string Ptr Hmac
hmac'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hmacGetString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    Hmac -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hmac
hmac
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data HmacGetStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod HmacGetStringMethodInfo Hmac signature where
    overloadedMethod = hmacGetString

instance O.OverloadedMethodInfo HmacGetStringMethodInfo Hmac where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.Hmac.hmacGetString",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Hmac.html#v:hmacGetString"
        })


#endif

-- method Hmac::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "hmac"
--           , argType = TInterface Name { namespace = "GLib" , name = "Hmac" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "Hmac" })
-- throws : False
-- Skip return : False

foreign import ccall "g_hmac_ref" g_hmac_ref :: 
    Ptr Hmac ->                             -- hmac : TInterface (Name {namespace = "GLib", name = "Hmac"})
    IO (Ptr Hmac)

-- | /No description available in the introspection data./
hmacRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Hmac
    -> m Hmac
hmacRef :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Hmac -> m Hmac
hmacRef Hmac
hmac = IO Hmac -> m Hmac
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Hmac -> m Hmac) -> IO Hmac -> m Hmac
forall a b. (a -> b) -> a -> b
$ do
    Ptr Hmac
hmac' <- Hmac -> IO (Ptr Hmac)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hmac
hmac
    Ptr Hmac
result <- Ptr Hmac -> IO (Ptr Hmac)
g_hmac_ref Ptr Hmac
hmac'
    Text -> Ptr Hmac -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hmacRef" Ptr Hmac
result
    Hmac
result' <- ((ManagedPtr Hmac -> Hmac) -> Ptr Hmac -> IO Hmac
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Hmac -> Hmac
Hmac) Ptr Hmac
result
    Hmac -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hmac
hmac
    Hmac -> IO Hmac
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Hmac
result'

#if defined(ENABLE_OVERLOADING)
data HmacRefMethodInfo
instance (signature ~ (m Hmac), MonadIO m) => O.OverloadedMethod HmacRefMethodInfo Hmac signature where
    overloadedMethod = hmacRef

instance O.OverloadedMethodInfo HmacRefMethodInfo Hmac where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.Hmac.hmacRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Hmac.html#v:hmacRef"
        })


#endif

-- method Hmac::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "hmac"
--           , argType = TInterface Name { namespace = "GLib" , name = "Hmac" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_hmac_unref" g_hmac_unref :: 
    Ptr Hmac ->                             -- hmac : TInterface (Name {namespace = "GLib", name = "Hmac"})
    IO ()

-- | /No description available in the introspection data./
hmacUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Hmac
    -> m ()
hmacUnref :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Hmac -> m ()
hmacUnref Hmac
hmac = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Hmac
hmac' <- Hmac -> IO (Ptr Hmac)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hmac
hmac
    Ptr Hmac -> IO ()
g_hmac_unref Ptr Hmac
hmac'
    Hmac -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hmac
hmac
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data HmacUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod HmacUnrefMethodInfo Hmac signature where
    overloadedMethod = hmacUnref

instance O.OverloadedMethodInfo HmacUnrefMethodInfo Hmac where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.Hmac.hmacUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Hmac.html#v:hmacUnref"
        })


#endif

-- method Hmac::update
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "hmac"
--           , argType = TInterface Name { namespace = "GLib" , name = "Hmac" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TUInt8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TSSize
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_hmac_update" g_hmac_update :: 
    Ptr Hmac ->                             -- hmac : TInterface (Name {namespace = "GLib", name = "Hmac"})
    Word8 ->                                -- data : TBasicType TUInt8
    DI.Int64 ->                             -- length : TBasicType TSSize
    IO ()

-- | /No description available in the introspection data./
hmacUpdate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Hmac
    -> Word8
    -> DI.Int64
    -> m ()
hmacUpdate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Hmac -> Word8 -> Int64 -> m ()
hmacUpdate Hmac
hmac Word8
data_ Int64
length_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Hmac
hmac' <- Hmac -> IO (Ptr Hmac)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Hmac
hmac
    Ptr Hmac -> Word8 -> Int64 -> IO ()
g_hmac_update Ptr Hmac
hmac' Word8
data_ Int64
length_
    Hmac -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Hmac
hmac
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data HmacUpdateMethodInfo
instance (signature ~ (Word8 -> DI.Int64 -> m ()), MonadIO m) => O.OverloadedMethod HmacUpdateMethodInfo Hmac signature where
    overloadedMethod = hmacUpdate

instance O.OverloadedMethodInfo HmacUpdateMethodInfo Hmac where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GLib.Structs.Hmac.hmacUpdate",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Hmac.html#v:hmacUpdate"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveHmacMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveHmacMethod "copy" o = HmacCopyMethodInfo
    ResolveHmacMethod "ref" o = HmacRefMethodInfo
    ResolveHmacMethod "unref" o = HmacUnrefMethodInfo
    ResolveHmacMethod "update" o = HmacUpdateMethodInfo
    ResolveHmacMethod "getDigest" o = HmacGetDigestMethodInfo
    ResolveHmacMethod "getString" o = HmacGetStringMethodInfo
    ResolveHmacMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveHmacMethod t Hmac, O.OverloadedMethod info Hmac p) => OL.IsLabel t (Hmac -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveHmacMethod t Hmac, O.OverloadedMethod info Hmac p, R.HasField t Hmac p) => R.HasField t Hmac p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveHmacMethod t Hmac, O.OverloadedMethodInfo info Hmac) => OL.IsLabel t (O.MethodProxy info Hmac) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif