[project @ 2003-01-23 12:13:10 by simonmar]
[ghc-hetmet.git] / ghc / includes / RtsAPI.h
index 0cb351d..cf07923 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.h,v 1.23 2001/10/23 11:30:07 simonmar 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"
 
 /*
@@ -19,8 +23,7 @@ typedef enum {
     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;
@@ -58,9 +61,6 @@ HaskellObj   rts_mkString     ( char    *s );
 
 HaskellObj   rts_apply        ( HaskellObj, HaskellObj );
 
-/* DEPRECATED (use rts_mkPtr): */
-HaskellObj   rts_mkAddr       ( HsAddr   a );
-
 /* ----------------------------------------------------------------------------
    Deconstructing Haskell objects
    ------------------------------------------------------------------------- */
@@ -81,9 +81,6 @@ HsDouble     rts_getDouble    ( HaskellObj );
 HsStablePtr  rts_getStablePtr ( HaskellObj );
 HsBool       rts_getBool      ( HaskellObj );
 
-/* DEPRECATED (use rts_getPtr): */
-HsAddr       rts_getAddr      ( HaskellObj );
-
 /* ----------------------------------------------------------------------------
    Evaluating Haskell expressions
 
@@ -98,6 +95,12 @@ rts_eval_ ( HaskellObj p, unsigned int stack_size, /*out*/HaskellObj *ret );
 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 );
 
@@ -107,4 +110,21 @@ 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 */