X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FPtr.hs;h=f4260fd0a4918d992396ac0fb15386cdfd0797fb;hb=f7a485978f04e84b086f1974b88887cc72d832d0;hp=9d7416c3c6cdc2cd600519f0914f35ad5c6e3df9;hpb=efe463cd65059c7e669a1c6fd553b3550aeccdd0;p=ghc-base.git diff --git a/Foreign/Ptr.hs b/Foreign/Ptr.hs index 9d7416c..f4260fd 100644 --- a/Foreign/Ptr.hs +++ b/Foreign/Ptr.hs @@ -1,35 +1,34 @@ {-# OPTIONS -fno-implicit-prelude #-} ----------------------------------------------------------------------------- --- +-- | -- Module : Foreign.Ptr -- Copyright : (c) The FFI task force 2001 --- License : BSD-style (see the file libraries/core/LICENSE) +-- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : ffi@haskell.org -- Stability : provisional -- Portability : portable -- --- $Id: Ptr.hs,v 1.4 2002/02/27 14:31:44 simonmar Exp $ --- --- Pointer types. +-- The "Ptr" module provides typed pointers to foreign data. It is part +-- of the Foreign Function Interface (FFI) and will normally be +-- imported via the "Foreign" module. -- ----------------------------------------------------------------------------- module Foreign.Ptr ( - -------------------------------------------------------------------- - -- Data pointers. + + -- * Data pointers - Ptr(..), -- data Ptr a + Ptr, -- data Ptr a nullPtr, -- :: Ptr a castPtr, -- :: Ptr a -> Ptr b plusPtr, -- :: Ptr a -> Int -> Ptr b alignPtr, -- :: Ptr a -> Int -> Ptr a minusPtr, -- :: Ptr a -> Ptr b -> Int - -------------------------------------------------------------------- - -- Function pointers. + -- * Function pointers - FunPtr(..), -- data FunPtr a + FunPtr, -- data FunPtr a nullFunPtr, -- :: FunPtr a castFunPtr, -- :: FunPtr a -> FunPtr b castFunPtrToPtr, -- :: FunPtr a -> Ptr b @@ -40,8 +39,6 @@ module Foreign.Ptr ( ) where -import Data.Dynamic - #ifdef __GLASGOW_HASKELL__ import GHC.Ptr import GHC.IOBase @@ -69,8 +66,5 @@ instance Show (Ptr a) where #endif #endif -foreign import "freeHaskellFunctionPtr" unsafe +foreign import ccall unsafe "freeHaskellFunctionPtr" freeHaskellFunPtr :: FunPtr a -> IO () - -#include "Dynamic.h" -INSTANCE_TYPEABLE1(Ptr,ptrTc,"Ptr")