[project @ 2000-11-01 17:15:28 by simonpj]
[ghc-hetmet.git] / ghc / includes / RtsAPI.h
index b28d7ab..348e57a 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.h,v 1.12 2000/04/10 14:28:14 sewardj Exp $
+ * $Id: RtsAPI.h,v 1.17 2000/08/29 13:34:21 qrczak Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
  * Running the scheduler
  */
 typedef enum {
-    NoStatus,    /* not finished yet                                   */
-    Success,      
-    Killed,     /* another thread killed us                           */
-    Interrupted, /* stopped in response to a call to interruptStgRts   */
+    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 */
 } SchedulerStatus;
 
 typedef StgClosure *HaskellObj;
 
+
+/* Make this compilable with Visual C++.  We can't just use StgInt64 here,
+ * because this file should be compilable without reference to the rest
+ * of the RTS machinery.  These are absolutely non-standard types, but
+ * I don't know what alternatives are safe if we don't #include anything
+ * here.
+ */
+#if defined(__MSVC__)
+typedef __int64            HsInt64_;
+typedef unsigned __int64   HsWord64_;
+#else
+typedef long long          HsInt64_;
+typedef unsigned long long HsWord64_;
+#endif
+
 /* ----------------------------------------------------------------------------
    Starting up and shutting down the Haskell RTS.
    ------------------------------------------------------------------------- */
@@ -35,17 +50,17 @@ extern void getProgArgv            ( int *argc, char **argv[] );
 /* ----------------------------------------------------------------------------
    Building Haskell objects from C datatypes.
    ------------------------------------------------------------------------- */
-HaskellObj   rts_mkChar       ( char c );
+HaskellObj   rts_mkChar       ( unsigned int c );
 HaskellObj   rts_mkInt        ( int i );
 HaskellObj   rts_mkInt8       ( int i );
 HaskellObj   rts_mkInt16      ( int i );
 HaskellObj   rts_mkInt32      ( int i );
-HaskellObj   rts_mkInt64      ( long long i );
 HaskellObj   rts_mkWord       ( unsigned int w );
 HaskellObj   rts_mkWord8      ( unsigned int w );
 HaskellObj   rts_mkWord16     ( unsigned int w );
 HaskellObj   rts_mkWord32     ( unsigned int w );
-HaskellObj   rts_mkWord64     ( unsigned long long w );
+HaskellObj   rts_mkInt64      ( HsInt64_ i );
+HaskellObj   rts_mkWord64     ( HsWord64_ w );
 HaskellObj   rts_mkFloat      ( float f );
 HaskellObj   rts_mkDouble     ( double f );
 HaskellObj   rts_mkStablePtr  ( StgStablePtr s );
@@ -58,7 +73,7 @@ HaskellObj   rts_apply        ( HaskellObj, HaskellObj );
 /* ----------------------------------------------------------------------------
    Deconstructing Haskell objects
    ------------------------------------------------------------------------- */
-char         rts_getChar      ( HaskellObj );
+unsigned int rts_getChar      ( HaskellObj );
 int          rts_getInt       ( HaskellObj );
 int          rts_getInt32     ( HaskellObj );
 unsigned int rts_getWord      ( HaskellObj );