From a379f8f5f925660613d12b418acbe79f20d165bc Mon Sep 17 00:00:00 2001 From: simonmar <unknown> 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 1a001c5ba1f2..7c262e67c85d 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -1506,109 +1506,26 @@ For example, <Para> <ProgramListing> -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); </ProgramListing> - -</Para> - -<Para> -You can find appropriate definitions for <Literal>StgInt</Literal>, <Literal>StgForeignObj</Literal>, -etc using <Command>gcc</Command> on your architecture by consulting -<Filename>ghc/includes/StgTypes.h</Filename>. The following table summarises the -relationship between Haskell types and C types. </Para> -<Para> - -<InformalTable> -<TGroup Cols="2"> -<ColSpec Align="Left" Colsep="0"> -<ColSpec Align="Left" Colsep="0"> -<TBody> -<Row> -<Entry><Emphasis>C type name</Emphasis> </Entry> -<Entry> <Emphasis>Haskell Type</Emphasis> </Entry> -</Row> - -<Row> -<Entry> -<Literal>StgChar</Literal> </Entry> -<Entry> <Literal>Char#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgInt</Literal> </Entry> -<Entry> <Literal>Int#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgWord</Literal> </Entry> -<Entry> <Literal>Word#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgAddr</Literal> </Entry> -<Entry> <Literal>Addr#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgFloat</Literal> </Entry> -<Entry> <Literal>Float#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgDouble</Literal> </Entry> -<Entry> <Literal>Double#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgArray</Literal> </Entry> -<Entry> <Literal>Array#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgByteArray</Literal> </Entry> -<Entry> <Literal>ByteArray#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgArray</Literal> </Entry> -<Entry> <Literal>MutableArray#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgByteArray</Literal> </Entry> -<Entry> <Literal>MutableByteArray#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgStablePtr</Literal> </Entry> -<Entry> <Literal>StablePtr#</Literal> </Entry> -</Row> -<Row> -<Entry> -<Literal>StgForeignObj</Literal> </Entry> -<Entry> <Literal>ForeignObj#</Literal></Entry> -</Row> -</TBody> - -</TGroup> -</InformalTable> -</Para> + <para>The types <literal>HsInt</literal>, + <literal>HsForeignObj</literal> etc. are described in <xref + linkend="sec-mapping-table">.</Para> -<Para> -Note that this approach is only <Emphasis>essential</Emphasis> for returning -<Literal>float</Literal>s (or if <Literal>sizeof(int) != sizeof(int *)</Literal> on your -architecture) but is a Good Thing for anyone who cares about writing -solid code. You're crazy not to do it. -</Para> + <Para>Note that this approach is only + <Emphasis>essential</Emphasis> for returning + <Literal>float</Literal>s (or if <Literal>sizeof(int) != + sizeof(int *)</Literal> on your architecture) but is a Good + Thing for anyone who cares about writing solid code. You're + crazy not to do it.</Para> </Sect2> -- GitLab