From 13df0a2862ab945e7e404bdacb0bb9c7479accad Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 8 Aug 2001 13:19:34 +0000 Subject: [PATCH] [project @ 2001-08-08 13:19:34 by simonmar] Change some section ids so they aren't as likely to clash with the User Guide. --- docs/ffi.sgml | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/ffi.sgml b/docs/ffi.sgml index 727106c..0cc2aca 100644 --- a/docs/ffi.sgml +++ b/docs/ffi.sgml @@ -1,4 +1,4 @@ - + Introduction @@ -77,7 +77,7 @@ Haskell. - + Calling foreign functions @@ -112,11 +112,11 @@ an unsafe thing to do, as the external name will in most cases be untyped. The onus is on the programmer using foreign import to ensure that the Haskell type given correctly maps on to the type of the external function. - specifies the mapping from + specifies the mapping from Haskell types to external types. - + Giving the external function a Haskell name @@ -144,7 +144,7 @@ varid : small ( small | large | udigit | ' )* - + Naming the external function @@ -259,7 +259,7 @@ foreign import "sin" sin :: Double -> IO Double - + Calling conventions @@ -360,7 +360,7 @@ to leave out the specification of the calling convention, if possible. - + External function types @@ -414,7 +414,7 @@ unsafe_arr_ty : ByteArray a GHC permits the passing of its byte array primitive types to external functions. There's some restrictions on when -they can be used; see +they can be used; see for more details. @@ -424,12 +424,12 @@ for more details. - defines -prim_result; + defines +prim_result; defines prim_arg. - + Argument types @@ -467,7 +467,7 @@ C-like languages, although the numeric types are explicitly sized. The stable pointer StablePtr type looks out of place in this list of C-like types, but it has a well-defined and simple -C mapping, see +C mapping, see for details. @@ -583,7 +583,7 @@ be withdrawn sometime in the future.) - + Result type @@ -639,7 +639,7 @@ Haskell newtypes that wrap up ext_ty are also permitte - + Type mapping @@ -649,13 +649,13 @@ the various types that can be communicated between the Haskell world and the outside, needs to be precisely defined. We do this by presenting a mapping to C, as it is commonly used and most other languages define a mapping to it. Table - + defines the mapping between Haskell and C types. - +
Mapping of Haskell types to C types @@ -931,7 +931,7 @@ macros starting with HS_ are reserved for the FFI. - + Some <Literal>foreign import</Literal> wrinkles @@ -946,12 +946,12 @@ external function may cause a Haskell garbage collection as a result of being called. This will typically happen when the imported function end up calling Haskell functions that reside in the same 'Haskell world' (i.e., shares the same storage manager heap) -- see - for + for details of how the FFI let's you call Haskell functions from the outside. If the programmer can guarantee that the imported function won't call back into Haskell, the foreign import can be marked as -'unsafe' (see for details of +'unsafe' (see for details of how to do this.) Unsafe calls are cheaper than safe ones, so distinguishing the two @@ -1003,7 +1003,7 @@ valid) is avoided. - + Invoking external functions via a pointer @@ -1056,7 +1056,7 @@ and execute code. - + Exposing Haskell functions @@ -1165,7 +1165,7 @@ outside world. - + Exposing Haskell function values @@ -1218,7 +1218,7 @@ typedef cType[[Res]] (*Varid_FunPtr) where cType[[]] is the Haskell to C type mapping presented -in . +in . @@ -1297,7 +1297,7 @@ Foreign.freeHaskellFunctionPtr :: Addr -> IO () - + Code addresses @@ -1328,7 +1328,7 @@ contain the address of the label freeAtLast.