-- GENERATED by C->Haskell Compiler, version 0.28.8 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/Notmuch/Talloc.chs" #-}
-- Copyright (C) 2014  Fraser Tweedale
--
-- hs-notmuch 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
-- (at your option) 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 #-}

module Notmuch.Talloc where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp





import Foreign (Ptr, castPtr, nullPtr)

detachPtr :: Ptr a -> IO (Ptr a)
detachPtr :: forall a. Ptr a -> IO (Ptr a)
detachPtr Ptr a
ptr =
  Ptr () -> Ptr a
forall a b. Ptr a -> Ptr b
castPtr (Ptr () -> Ptr a) -> IO (Ptr ()) -> IO (Ptr a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr () -> Ptr () -> Ptr CChar -> IO (Ptr ())
_talloc_steal_loc Ptr ()
forall a. Ptr a
nullPtr (Ptr a -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr a
ptr) Ptr CChar
forall a. Ptr a
nullPtr

foreign import ccall unsafe "Notmuch/Talloc.chs.h _talloc_steal_loc"
  _talloc_steal_loc :: ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))))