-- GENERATED by C->Haskell Compiler, version 0.16.0 Crystal Seed, 24 Jan 2009 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "./Gnome/Keyring/Item/Internal.chs" #-}-- Copyright (C) 2009 John Millikin <jmillikin@gmail.com>
-- 
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- any later version.
-- 
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
-- 
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
-- 
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}

{-# LINE 20 "./Gnome/Keyring/Item/Internal.chs" #-}

module Gnome.Keyring.Item.Internal where

import Data.Set (Set, toList)
import Data.Text.Lazy (Text)
import Gnome.Keyring.Operation.Internal
import Gnome.Keyring.Types
import Gnome.Keyring.AccessControl.Internal
import Gnome.Keyring.Attribute.Internal
import Gnome.Keyring.ItemInfo.Internal

import Foreign
import Foreign.C
import Gnome.Keyring.FFI

data ItemInfoFlag
	= ItemInfoBasics
	| ItemInfoSecret
	deriving (Show, Eq)

peekItemID :: (Storable a, Integral a) => Ptr a -> IO ItemID
peekItemID = fmap (ItemID . fromIntegral) . peek

cItemID :: Integral a => ItemID -> a
cItemID (ItemID x) = fromIntegral x

cItemInfoFlags :: Bits a => Set ItemInfoFlag -> a
cItemInfoFlags = foldr (.|.) 0 . map flagValue . toList where
	flagValue ItemInfoBasics = 0
	flagValue ItemInfoSecret = 1

-- wrap a GetWordCallback
data GetItemIDCallback = GetItemIDCallback GetWordCallback
instance Callback GetItemIDCallback ItemID where
	callbackToPtr (GetItemIDCallback x) = callbackToPtr x
	freeCallback (GetItemIDCallback x) = freeCallback x
	buildCallback onSuccess = let
		onSuccess' = onSuccess . ItemID
		in fmap GetItemIDCallback . buildCallback onSuccess'

-- GnomeKeyringOperationGetItemInfoCallback
data GetItemInfoCallback = GetItemInfoCallback GetItemInfoCallbackPtr
instance Callback GetItemInfoCallback ItemInfo where
	callbackToPtr (GetItemInfoCallback x) = castFunPtr x
	freeCallback  (GetItemInfoCallback x) = freeHaskellFunPtr x
	buildCallback onSuccess onError = do
		funptr <- wrapGetItemInfoCallback $ \cres ptr _ ->
			case result cres of
				RESULT_OK -> peekItemInfo ptr >>= onSuccess
				x -> onError $ resultToError x
		return $ GetItemInfoCallback funptr

type RawGetItemInfoCallback = CInt -> Ptr () -> Ptr () -> IO ()
type GetItemInfoCallbackPtr = FunPtr ((CInt -> ((Ptr ()) -> ((Ptr ()) -> (IO ())))))
{-# LINE 74 "./Gnome/Keyring/Item/Internal.chs" #-}
foreign import ccall "wrapper"
	wrapGetItemInfoCallback :: RawGetItemInfoCallback -> IO GetItemInfoCallbackPtr

-- GnomeKeyringOperationGetAttributesCallback
data GetAttributesCallback = GetAttributesCallback GetAttributesCallbackPtr
instance Callback GetAttributesCallback [Attribute] where
	callbackToPtr (GetAttributesCallback x) = castFunPtr x
	freeCallback  (GetAttributesCallback x) = freeHaskellFunPtr x
	buildCallback onSuccess onError = do
		funptr <- wrapGetAttributesCallback $ \cres ptr _ ->
			case result cres of
				RESULT_OK -> peekAttributeList ptr >>= onSuccess
				x -> onError $ resultToError x
		return $ GetAttributesCallback funptr

type RawGetAttributesCallback = CInt -> Ptr () -> Ptr () -> IO ()
type GetAttributesCallbackPtr = FunPtr ((CInt -> ((Ptr ()) -> ((Ptr ()) -> (IO ())))))
{-# LINE 91 "./Gnome/Keyring/Item/Internal.chs" #-}
foreign import ccall "wrapper"
	wrapGetAttributesCallback :: RawGetAttributesCallback -> IO GetAttributesCallbackPtr

-- | Create a new item in a keyring.
-- 
-- The user may have been prompted to unlock necessary keyrings. If 'Nothing'
-- is specified as the keyring and no default keyring exists, the user will
-- be prompted to create a new keyring.
-- 
-- If an existing item should be updated, the user may be prompted for access
-- to the existing item.
-- 
-- Whether a new item is created or not, the ID of the item will be returned.
-- 
itemCreate :: Maybe KeyringName
           -> ItemType
           -> Text -- ^ Display name
           -> [Attribute]
           -> Text -- ^ The secret
           -> Bool -- ^ Update an existing item, if one exists.
           -> Operation ItemID
itemCreate k t dn as s u = operation
	(item_create k t dn as s u)
	(item_create_sync k t dn as s u)

item_create :: Maybe Text -> ItemType -> Text -> [Attribute] -> Text -> Bool -> GetItemIDCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_create a1 a2 a3 a4 a5 a6 a7 a8 a9 =
  withNullableText a1 $ \a1' -> 
  let {a2' = fromItemType a2} in 
  withText a3 $ \a3' -> 
  withAttributeList a4 $ \a4' -> 
  withText a5 $ \a5' -> 
  let {a6' = fromBool a6} in 
  let {a7' = callbackToPtr a7} in 
  let {a8' = id a8} in 
  let {a9' = id a9} in 
  item_create'_ a1' a2' a3' a4' a5' a6' a7' a8' a9' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 127 "./Gnome/Keyring/Item/Internal.chs" #-}

item_create_sync :: Maybe Text -> ItemType -> Text -> [Attribute] -> Text -> Bool -> IO (Result, ItemID)
item_create_sync a1 a2 a3 a4 a5 a6 =
  withNullableText a1 $ \a1' -> 
  let {a2' = fromItemType a2} in 
  withText a3 $ \a3' -> 
  withAttributeList a4 $ \a4' -> 
  withText a5 $ \a5' -> 
  let {a6' = fromBool a6} in 
  alloca $ \a7' -> 
  item_create_sync'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  peekItemID a7'>>= \a7'' -> 
  let {res' = result res} in
  return (res', a7'')
{-# LINE 137 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Delete an item in a keyring.
-- 
-- The user may be prompted if the calling application doesn't have
-- necessary access to delete the item.
-- 
itemDelete :: Maybe KeyringName -> ItemID -> Operation ()
itemDelete k item = operation (item_delete k item) (item_delete_sync k item)

item_delete :: Maybe Text -> ItemID -> DoneCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_delete a1 a2 a3 a4 a5 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  let {a3' = callbackToPtr a3} in 
  let {a4' = id a4} in 
  let {a5' = id a5} in 
  item_delete'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 153 "./Gnome/Keyring/Item/Internal.chs" #-}

item_delete_sync :: Maybe Text -> ItemID -> IO ((Result, ()))
item_delete_sync a1 a2 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  item_delete_sync'_ a1' a2' >>= \res ->
  let {res' = resultAndTuple res} in
  return (res')
{-# LINE 158 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Get information about an item and its secret.
-- 
-- The user may be prompted if the calling application doesn't have
-- necessary access to read the item with its secret.
-- 
itemGetInfo :: Maybe KeyringName -> ItemID -> Operation ItemInfo
itemGetInfo k item = operation
	(item_get_info k item)
	(item_get_info_sync k item)

item_get_info :: Maybe Text -> ItemID -> GetItemInfoCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_get_info a1 a2 a3 a4 a5 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  let {a3' = callbackToPtr a3} in 
  let {a4' = id a4} in 
  let {a5' = id a5} in 
  item_get_info'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 176 "./Gnome/Keyring/Item/Internal.chs" #-}

item_get_info_sync :: Maybe Text -> ItemID -> IO (Result, ItemInfo)
item_get_info_sync a1 a2 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  alloca $ \a3' -> 
  item_get_info_sync'_ a1' a2' a3' >>= \res ->
  stealItemInfo a3'>>= \a3'' -> 
  let {res' = result res} in
  return (res', a3'')
{-# LINE 182 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Get information about an item, optionally retrieving its secret.
-- 
-- If the flags include 'ItemInfoSecret', then the user may be prompted if
-- the calling application doesn't have necessary access to read the item
-- with its secret.
-- 
itemGetInfoFull :: Maybe KeyringName -> ItemID -> Set ItemInfoFlag
                -> Operation ItemInfo
itemGetInfoFull k item flags = operation
	(item_get_info_full k item flags)
	(item_get_info_full_sync k item flags)

item_get_info_full :: Maybe Text -> ItemID -> Set ItemInfoFlag -> GetItemInfoCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_get_info_full a1 a2 a3 a4 a5 a6 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  let {a3' = cItemInfoFlags a3} in 
  let {a4' = callbackToPtr a4} in 
  let {a5' = id a5} in 
  let {a6' = id a6} in 
  item_get_info_full'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 203 "./Gnome/Keyring/Item/Internal.chs" #-}

item_get_info_full_sync :: Maybe Text -> ItemID -> Set ItemInfoFlag -> IO (Result, ItemInfo)
item_get_info_full_sync a1 a2 a3 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  let {a3' = cItemInfoFlags a3} in 
  alloca $ \a4' -> 
  item_get_info_full_sync'_ a1' a2' a3' a4' >>= \res ->
  stealItemInfo a4'>>= \a4'' -> 
  let {res' = result res} in
  return (res', a4'')
{-# LINE 210 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Set information on an item, like its display name, secret, etc.
-- 
-- Only the fields in the info info which are non-'Nothing' or non-zero
-- will be set on the item.
-- 
itemSetInfo :: Maybe KeyringName -> ItemID -> ItemInfo -> Operation ()
itemSetInfo k item info = operation
	(item_set_info k item info)
	(item_set_info_sync k item info)

item_set_info :: Maybe Text -> ItemID -> ItemInfo -> DoneCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_set_info a1 a2 a3 a4 a5 a6 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  withItemInfo a3 $ \a3' -> 
  let {a4' = callbackToPtr a4} in 
  let {a5' = id a5} in 
  let {a6' = id a6} in 
  item_set_info'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 229 "./Gnome/Keyring/Item/Internal.chs" #-}

item_set_info_sync :: Maybe Text -> ItemID -> ItemInfo -> IO ((Result, ()))
item_set_info_sync a1 a2 a3 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  withItemInfo a3 $ \a3' -> 
  item_set_info_sync'_ a1' a2' a3' >>= \res ->
  let {res' = resultAndTuple res} in
  return (res')
{-# LINE 235 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Get all the attributes for an item.
-- 
itemGetAttributes :: Maybe KeyringName -> ItemID -> Operation [Attribute]
itemGetAttributes k item = operation
	(item_get_attributes k item)
	(item_get_attributes_sync k item)

item_get_attributes :: Maybe Text -> ItemID -> GetAttributesCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_get_attributes a1 a2 a3 a4 a5 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  let {a3' = callbackToPtr a3} in 
  let {a4' = id a4} in 
  let {a5' = id a5} in 
  item_get_attributes'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 250 "./Gnome/Keyring/Item/Internal.chs" #-}

item_get_attributes_sync :: Maybe Text -> ItemID -> IO (Result, [Attribute])
item_get_attributes_sync a1 a2 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  alloca $ \a3' -> 
  item_get_attributes_sync'_ a1' a2' a3' >>= \res ->
  stealAttributeList a3'>>= \a3'' -> 
  let {res' = result res} in
  return (res', a3'')
{-# LINE 256 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Set all the attributes for an item. These will replace any previous
-- attributes set on the item.
-- 
itemSetAttributes :: Maybe KeyringName -> ItemID -> [Attribute] -> Operation ()
itemSetAttributes k item as = operation
	(item_set_attributes k item as)
	(item_set_attributes_sync k item as)

item_set_attributes :: Maybe Text -> ItemID -> [Attribute] -> DoneCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_set_attributes a1 a2 a3 a4 a5 a6 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  withAttributeList a3 $ \a3' -> 
  let {a4' = callbackToPtr a4} in 
  let {a5' = id a5} in 
  let {a6' = id a6} in 
  item_set_attributes'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 273 "./Gnome/Keyring/Item/Internal.chs" #-}

item_set_attributes_sync :: Maybe Text -> ItemID -> [Attribute] -> IO ((Result, ()))
item_set_attributes_sync a1 a2 a3 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  withAttributeList a3 $ \a3' -> 
  item_set_attributes_sync'_ a1' a2' a3' >>= \res ->
  let {res' = resultAndTuple res} in
  return (res')
{-# LINE 279 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Get the access control list for an item.
-- 
itemGetACL :: Maybe KeyringName -> ItemID -> Operation [AccessControl]
itemGetACL k item = operation
	(item_get_acl k item)
	(item_get_acl_sync k item)

item_get_acl :: Maybe Text -> ItemID -> GetACLCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_get_acl a1 a2 a3 a4 a5 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  let {a3' = callbackToPtr a3} in 
  let {a4' = id a4} in 
  let {a5' = id a5} in 
  item_get_acl'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 294 "./Gnome/Keyring/Item/Internal.chs" #-}

item_get_acl_sync :: Maybe Text -> ItemID -> IO (Result, [AccessControl])
item_get_acl_sync a1 a2 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  alloca $ \a3' -> 
  item_get_acl_sync'_ a1' a2' a3' >>= \res ->
  stealACL a3'>>= \a3'' -> 
  let {res' = result res} in
  return (res', a3'')
{-# LINE 300 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Set the full access control list on an item. This replaces any previous
-- ACL set on the item.
-- 
itemSetACL :: Maybe KeyringName -> ItemID -> [AccessControl] -> Operation ()
itemSetACL k item acl = operation
	(item_set_acl k item acl)
	(item_set_acl_sync k item acl)

item_set_acl :: Maybe Text -> ItemID -> [AccessControl] -> DoneCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_set_acl a1 a2 a3 a4 a5 a6 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  withACL a3 $ \a3' -> 
  let {a4' = callbackToPtr a4} in 
  let {a5' = id a5} in 
  let {a6' = id a6} in 
  item_set_acl'_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 317 "./Gnome/Keyring/Item/Internal.chs" #-}

item_set_acl_sync :: Maybe Text -> ItemID -> [AccessControl] -> IO ((Result, ()))
item_set_acl_sync a1 a2 a3 =
  withNullableText a1 $ \a1' -> 
  let {a2' = cItemID a2} in 
  withACL a3 $ \a3' -> 
  item_set_acl_sync'_ a1' a2' a3' >>= \res ->
  let {res' = resultAndTuple res} in
  return (res')
{-# LINE 323 "./Gnome/Keyring/Item/Internal.chs" #-}

-- | Will grant the application access rights to the item, provided callee
-- has write access to said item.
-- 
-- This is similar to performing 'itemGetACL' and 'itemSetACL' with
-- appropriate parameters.
-- 
itemGrantAccessRights :: Maybe KeyringName
                      -> Text -- ^ Display name
                      -> Text -- ^ Application executable path
                      -> ItemID
                      -> Set AccessType
                      -> Operation ()
itemGrantAccessRights k d p item r = operation
	(item_grant_access_rights k d p item r)
	(item_grant_access_rights_sync k d p item r)

item_grant_access_rights :: Maybe Text -> Text -> Text -> ItemID -> Set AccessType -> DoneCallback -> Ptr () -> DestroyNotifyPtr -> IO (CancellationKey)
item_grant_access_rights a1 a2 a3 a4 a5 a6 a7 a8 =
  withNullableText a1 $ \a1' -> 
  withText a2 $ \a2' -> 
  withText a3 $ \a3' -> 
  let {a4' = cItemID a4} in 
  let {a5' = cAccessTypes a5} in 
  let {a6' = callbackToPtr a6} in 
  let {a7' = id a7} in 
  let {a8' = id a8} in 
  item_grant_access_rights'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
  let {res' = CancellationKey res} in
  return (res')
{-# LINE 350 "./Gnome/Keyring/Item/Internal.chs" #-}

item_grant_access_rights_sync :: Maybe Text -> Text -> Text -> ItemID -> Set AccessType -> IO ((Result, ()))
item_grant_access_rights_sync a1 a2 a3 a4 a5 =
  withNullableText a1 $ \a1' -> 
  withText a2 $ \a2' -> 
  withText a3 $ \a3' -> 
  let {a4' = cItemID a4} in 
  let {a5' = cAccessTypes a5} in 
  item_grant_access_rights_sync'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = resultAndTuple res} in
  return (res')
{-# LINE 358 "./Gnome/Keyring/Item/Internal.chs" #-}

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_create"
  item_create'_ :: ((Ptr CChar) -> (CInt -> ((Ptr CChar) -> ((Ptr ()) -> ((Ptr CChar) -> (CInt -> ((FunPtr (CInt -> (CUInt -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ())))))))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_create_sync"
  item_create_sync'_ :: ((Ptr CChar) -> (CInt -> ((Ptr CChar) -> ((Ptr ()) -> ((Ptr CChar) -> (CInt -> ((Ptr CUInt) -> (IO CInt))))))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_delete"
  item_delete'_ :: ((Ptr CChar) -> (CUInt -> ((FunPtr (CInt -> ((Ptr ()) -> (IO ())))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ())))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_delete_sync"
  item_delete_sync'_ :: ((Ptr CChar) -> (CUInt -> (IO CInt)))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_info"
  item_get_info'_ :: ((Ptr CChar) -> (CUInt -> ((GetItemInfoCallbackPtr) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ())))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_info_sync"
  item_get_info_sync'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr (Ptr ())) -> (IO CInt))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_info_full"
  item_get_info_full'_ :: ((Ptr CChar) -> (CUInt -> (CUInt -> ((GetItemInfoCallbackPtr) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ()))))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_info_full_sync"
  item_get_info_full_sync'_ :: ((Ptr CChar) -> (CUInt -> (CUInt -> ((Ptr (Ptr ())) -> (IO CInt)))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_set_info"
  item_set_info'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr ()) -> ((FunPtr (CInt -> ((Ptr ()) -> (IO ())))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ()))))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_set_info_sync"
  item_set_info_sync'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr ()) -> (IO CInt))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_attributes"
  item_get_attributes'_ :: ((Ptr CChar) -> (CUInt -> ((GetAttributesCallbackPtr) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ())))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_attributes_sync"
  item_get_attributes_sync'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr (Ptr ())) -> (IO CInt))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_set_attributes"
  item_set_attributes'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr ()) -> ((FunPtr (CInt -> ((Ptr ()) -> (IO ())))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ()))))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_set_attributes_sync"
  item_set_attributes_sync'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr ()) -> (IO CInt))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_acl"
  item_get_acl'_ :: ((Ptr CChar) -> (CUInt -> ((FunPtr (CInt -> ((Ptr ()) -> ((Ptr ()) -> (IO ()))))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ())))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_get_acl_sync"
  item_get_acl_sync'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr (Ptr ())) -> (IO CInt))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_set_acl"
  item_set_acl'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr ()) -> ((FunPtr (CInt -> ((Ptr ()) -> (IO ())))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ()))))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_set_acl_sync"
  item_set_acl_sync'_ :: ((Ptr CChar) -> (CUInt -> ((Ptr ()) -> (IO CInt))))

foreign import ccall safe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_grant_access_rights"
  item_grant_access_rights'_ :: ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr CChar) -> (CUInt -> (CInt -> ((FunPtr (CInt -> ((Ptr ()) -> (IO ())))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO (Ptr ()))))))))))

foreign import ccall unsafe "Gnome/Keyring/Item/Internal.chs.h gnome_keyring_item_grant_access_rights_sync"
  item_grant_access_rights_sync'_ :: ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr CChar) -> (CUInt -> (CInt -> (IO CInt))))))