From a379f8f5f925660613d12b418acbe79f20d165bc Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 8 Jun 2000 15:00:21 +0000 Subject: [PATCH] [project @ 2000-06-08 15:00:21 by simonmar] Remove out-of-date table that conflicts with the new one in the FFI documentation. --- ghc/docs/users_guide/glasgow_exts.sgml | 113 +++++--------------------------- 1 file changed, 15 insertions(+), 98 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index 1a001c5..7c262e6 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -1506,109 +1506,26 @@ For example, -typedef unsigned long *StgForeignObj; -typedef long StgInt; +#include "HsFFI.h" -void initialiseEFS (StgInt size); -StgInt terminateEFS (void); -StgForeignObj emptyEFS(void); -StgForeignObj updateEFS (StgForeignObj a, StgInt i, StgInt x); -StgInt lookupEFS (StgForeignObj a, StgInt i); +void initialiseEFS (HsInt size); +HsInt terminateEFS (void); +HsForeignObj emptyEFS(void); +HsForeignObj updateEFS (HsForeignObj a, HsInt i, HsInt x); +HsInt lookupEFS (HsForeignObj a, HsInt i); - - - - -You can find appropriate definitions for StgInt, StgForeignObj, -etc using gcc on your architecture by consulting -ghc/includes/StgTypes.h. The following table summarises the -relationship between Haskell types and C types. - - - - - - - - -C type name - Haskell Type - - - - -StgChar - Char# - - - -StgInt - Int# - - - -StgWord - Word# - - - -StgAddr - Addr# - - - -StgFloat - Float# - - - -StgDouble - Double# - - - -StgArray - Array# - - - -StgByteArray - ByteArray# - - - -StgArray - MutableArray# - - - -StgByteArray - MutableByteArray# - - - -StgStablePtr - StablePtr# - - - -StgForeignObj - ForeignObj# - - - - - - + The types HsInt, + HsForeignObj etc. are described in . - -Note that this approach is only essential for returning -floats (or if sizeof(int) != sizeof(int *) on your -architecture) but is a Good Thing for anyone who cares about writing -solid code. You're crazy not to do it. - + Note that this approach is only + essential for returning + floats (or if sizeof(int) != + sizeof(int *) on your architecture) but is a Good + Thing for anyone who cares about writing solid code. You're + crazy not to do it. -- 1.7.10.4