X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FHsFFI.h;h=7010aa14eb891d065841285cb0b6e6820f323497;hb=0316a9e603115e6d3f04bd03824a1ca9430b0f0f;hp=33b76ffda30c4d753a10b8002232677e44c200b7;hpb=9ac55e08e159d7a4647ab01e7872e69dd762f275;p=ghc-hetmet.git diff --git a/ghc/includes/HsFFI.h b/ghc/includes/HsFFI.h index 33b76ff..7010aa1 100644 --- a/ghc/includes/HsFFI.h +++ b/ghc/includes/HsFFI.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: HsFFI.h,v 1.11 2000/12/04 12:31:20 simonmar Exp $ + * $Id: HsFFI.h,v 1.17 2002/11/17 15:27:07 panne Exp $ * * (c) The GHC Team, 2000 * @@ -13,6 +13,10 @@ #ifndef HSFFI_H #define HSFFI_H +#ifdef __cplusplus +extern "C" { +#endif + /* get types from GHC's runtime system */ #include "config.h" #include "StgTypes.h" @@ -78,13 +82,23 @@ typedef StgWord64 HsWord64; typedef StgFloat HsFloat; typedef StgDouble HsDouble; typedef StgBool HsBool; -typedef void* HsAddr; /* this should better match StgAddr */ -typedef void* HsForeignObj; /* ... and this StgForeignPtr */ +typedef void* HsPtr; /* this should better match StgAddr */ +typedef void (*HsFunPtr)(void); /* this should better match StgAddr */ +typedef void* HsForeignPtr; /* ... and this StgForeignPtr */ typedef void* HsStablePtr; +typedef void* HsAddr; /* DEPRECATED */ +typedef void* HsForeignObj; /* DEPRECATED */ /* this should correspond to the type of StgChar in StgTypes.h */ #define HS_CHAR_MIN 0 -#define HS_CHAR_MAX __INT32_MAX +#define HS_CHAR_MAX 0x10FFFF + +/* is it true or not? */ +#define HS_BOOL_FALSE 0 +#define HS_BOOL_TRUE 1 + +#define HS_BOOL_MIN HS_BOOL_FALSE +#define HS_BOOL_MAX HS_BOOL_TRUE /* this mirrors the distinction of cases in StgTypes.h */ #if SIZEOF_VOID_P == 8 @@ -134,4 +148,19 @@ typedef void* HsStablePtr; #define HS_DOUBLE_MAX_EXP DBL_MAX_EXP #define HS_DOUBLE_MAX_10_EXP DBL_MAX_10_EXP +extern void hs_init (int *argc, char **argv[]); +extern void hs_exit (void); +extern void hs_set_argv (int argc, char *argv[]); + +extern void hs_perform_gc (void); + +extern void hs_free_stable_ptr (HsStablePtr *sp); +extern void hs_free_fun_ptr (HsFunPtr *fp); + +/* -------------------------------------------------------------------------- */ + +#ifdef __cplusplus +} +#endif + #endif /* HSFFI_H */