/* ----------------------------------------------------------------------------
- * $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.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------
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 );
/* ----------------------------------------------------------------------------
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 );