{-# LINE 1 "Data/GI/Base/GHashTable.hsc" #-}
module Data.GI.Base.GHashTable
( GHashFunc
, GEqualFunc
, gDirectHash
, gDirectEqual
, ptrPackPtr
, ptrUnpackPtr
, gStrHash
, gStrEqual
, cstringPackPtr
, cstringUnpackPtr
) where
import Data.Int
import Data.Word
import Foreign.C
import Foreign.Ptr (Ptr, castPtr, FunPtr)
import Data.GI.Base.BasicTypes (PtrWrapped(..))
type GHashFunc a = FunPtr (PtrWrapped a -> IO Word32)
{-# LINE 38 "Data/GI/Base/GHashTable.hsc" #-}
type GEqualFunc a = FunPtr (PtrWrapped a -> PtrWrapped a -> IO Int32)
{-# LINE 41 "Data/GI/Base/GHashTable.hsc" #-}
foreign import ccall "&g_direct_hash" gDirectHash :: GHashFunc (Ptr a)
foreign import ccall "&g_direct_equal" gDirectEqual :: GEqualFunc (Ptr a)
ptrPackPtr :: Ptr a -> PtrWrapped (Ptr a)
ptrPackPtr = PtrWrapped . castPtr
ptrUnpackPtr :: PtrWrapped (Ptr a) -> Ptr a
ptrUnpackPtr = castPtr . unwrapPtr
foreign import ccall "&g_str_hash" gStrHash :: GHashFunc CString
foreign import ccall "&g_str_equal" gStrEqual :: GEqualFunc CString
cstringPackPtr :: CString -> PtrWrapped CString
cstringPackPtr = ptrPackPtr
cstringUnpackPtr :: PtrWrapped CString -> CString
cstringUnpackPtr = ptrUnpackPtr