Commit 7e63e7e6 authored by panne's avatar panne

[project @ 2002-11-17 15:27:07 by panne]

Added RTS entry points as mandated by the FFI addendum to the Haskell
98 report. NOTE: The implementations of hs_init, hs_exit, and
hs_set_argv are still missing.
parent 805fcaad
/* -----------------------------------------------------------------------------
* $Id: HsFFI.h,v 1.16 2001/11/07 19:11:43 sof Exp $
* $Id: HsFFI.h,v 1.17 2002/11/17 15:27:07 panne Exp $
*
* (c) The GHC Team, 2000
*
......@@ -148,6 +148,15 @@ typedef void* HsForeignObj; /* DEPRECATED */
#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
......
/* -----------------------------------------------------------------------------
* $Id: HsFFI.c,v 1.1 2002/11/17 15:27:08 panne Exp $
*
* (c) The GHC Team, 2002
*
* RTS entry points as mandated by the FFI addendum to the Haskell 98 report
*
* ---------------------------------------------------------------------------*/
#include "HsFFI.h"
#include "Rts.h"
void
hs_init(int *argc, char **argv[])
{
/* ToDo: Implement! */
}
void
hs_exit(void)
{
/* ToDo: Implement! */
}
void
hs_set_argv(int argc, char *argv[])
{
/* ToDo: Implement! */
}
void
hs_perform_gc(void)
{
/* Hmmm, the FFI spec is a bit vague, but it seems to imply a major GC... */
performMajorGC();
}
void
hs_free_stable_ptr(HsStablePtr *sp)
{
/* The cast is for clarity only, both HsStablePtr and StgStablePtr are
typedefs for void*. */
freeStablePtr((StgStablePtr)sp);
}
void
hs_free_fun_ptr(HsFunPtr *fp)
{
/* I simply *love* all these similar names... */
freeHaskellFunctionPtr(fp);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment