/* ----------------------------------------------------------------------------
- * $Id: RtsAPI.h,v 1.22 2001/08/03 16:30:13 sof Exp $
+ * $Id: RtsAPI.h,v 1.30 2002/09/05 08:58:55 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#ifndef RTSAPI_H
#define RTSAPI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "HsFFI.h"
/*
NoStatus, /* not finished yet */
Success, /* completed successfully */
Killed, /* uncaught exception */
- Interrupted, /* stopped in response to a call to interruptStgRts */
- Deadlock /* no threads to run, but main thread hasn't finished */
+ Interrupted /* stopped in response to a call to interruptStgRts */
} SchedulerStatus;
typedef StgClosure *HaskellObj;
HaskellObj rts_apply ( HaskellObj, HaskellObj );
-/* DEPRECATED (use rts_mkPtr): */
-HaskellObj rts_mkAddr ( HsAddr a );
-
/* ----------------------------------------------------------------------------
Deconstructing Haskell objects
------------------------------------------------------------------------- */
HsStablePtr rts_getStablePtr ( HaskellObj );
HsBool rts_getBool ( HaskellObj );
-/* DEPRECATED (use rts_getPtr): */
-HsAddr rts_getAddr ( HaskellObj );
-
/* ----------------------------------------------------------------------------
Evaluating Haskell expressions
SchedulerStatus
rts_evalIO ( HaskellObj p, /*out*/HaskellObj *ret );
+#if defined(COMPILING_RTS_MAIN)
+/* Used by the RTS' main() only */
+SchedulerStatus
+rts_mainEvalIO ( HaskellObj p, /*out*/HaskellObj *ret );
+#endif
+
+SchedulerStatus
+rts_evalStableIO ( HsStablePtr s, /*out*/HsStablePtr *ret );
+
SchedulerStatus
rts_evalLazyIO ( HaskellObj p, unsigned int stack_size, /*out*/HaskellObj *ret );
void
rts_checkSchedStatus ( char* site, SchedulerStatus rc);
+/* --------------------------------------------------------------------------
+ Wrapper closures
+
+ These are used by foreign export and foreign import "wrapper" stubs.
+ ----------------------------------------------------------------------- */
+
+extern StgClosure GHCziTopHandler_runIO_closure;
+extern StgClosure GHCziTopHandler_runNonIO_closure;
+#define runIO_closure (&GHCziTopHandler_runIO_closure)
+#define runNonIO_closure (&GHCziTopHandler_runNonIO_closure)
+
+/* ------------------------------------------------------------------------ */
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* RTSAPI_H */