43d3dbd9eb6a3dea75903cf418759e454e86a693
[packages/base.git] / Foreign / ForeignPtr.hs
1 {-# LANGUAGE CPP, NoImplicitPrelude #-}
2 #if sh_SAFE_DEFAULT
3 {-# LANGUAGE Trustworthy #-}
4 #else
5 {-# LANGUAGE Unsafe #-}
6 #endif
7 {-# OPTIONS_HADDOCK hide #-}
8
9 -----------------------------------------------------------------------------
10 -- |
11 -- Module : Foreign.ForeignPtr
12 -- Copyright : (c) The University of Glasgow 2001
13 -- License : BSD-style (see the file libraries/base/LICENSE)
14 --
15 -- Maintainer : ffi@haskell.org
16 -- Stability : provisional
17 -- Portability : portable
18 --
19 -- The 'ForeignPtr' type and operations. This module is part of the
20 -- Foreign Function Interface (FFI) and will usually be imported via
21 -- the "Foreign" module.
22 --
23 -----------------------------------------------------------------------------
24
25 module Foreign.ForeignPtr (
26 module Foreign.ForeignPtr.Safe
27 #if !sh_SAFE_DEFAULT
28 -- ** Unsafe low-level operations
29 , unsafeForeignPtrToPtr
30 #endif
31 ) where
32
33 import Foreign.ForeignPtr.Safe
34
35 #if !sh_SAFE_DEFAULT
36 import Foreign.Ptr ( Ptr )
37 import qualified Foreign.ForeignPtr.Unsafe as U
38
39 {-# DEPRECATED unsafeForeignPtrToPtr "Use Foreign.ForeignPtr.Unsafe.unsafeForeignPtrToPtr instead; This function will be removed in the next release" #-}
40 {-# INLINE unsafeForeignPtrToPtr #-}
41 unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a
42 unsafeForeignPtrToPtr = U.unsafeForeignPtrToPtr
43 #endif
44