1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
4 -- Module : Foreign.Ptr
5 -- Copyright : (c) The FFI task force 2001
6 -- License : BSD-style (see the file libraries/core/LICENSE)
8 -- Maintainer : ffi@haskell.org
9 -- Stability : experimental
10 -- Portability : non-portable
12 -- $Id: Ptr.hs,v 1.1 2001/06/28 14:15:03 simonmar Exp $
16 -----------------------------------------------------------------------------
19 --------------------------------------------------------------------
22 Ptr(..), -- data Ptr a
24 castPtr, -- :: Ptr a -> Ptr b
25 plusPtr, -- :: Ptr a -> Int -> Ptr b
26 alignPtr, -- :: Ptr a -> Int -> Ptr a
27 minusPtr, -- :: Ptr a -> Ptr b -> Int
29 --------------------------------------------------------------------
32 FunPtr(..), -- data FunPtr a
33 nullFunPtr, -- :: FunPtr a
34 castFunPtr, -- :: FunPtr a -> FunPtr b
35 castFunPtrToPtr, -- :: FunPtr a -> Ptr b
36 castPtrToFunPtr, -- :: Ptr a -> FunPtr b
38 freeHaskellFunPtr, -- :: FunPtr a -> IO ()
39 -- Free the function pointer created by foreign export dynamic.
45 #ifdef __GLASGOW_HASKELL__
51 foreign import "freeHaskellFunctionPtr" unsafe
52 freeHaskellFunPtr :: FunPtr a -> IO ()
55 INSTANCE_TYPEABLE1(Ptr,ptrTc,"Ptr")