[project @ 2001-01-08 12:31:34 by rrt]
[ghc-hetmet.git] / ghc / interpreter / connect.h
index 3dacc5c..a93a265 100644 (file)
@@ -9,8 +9,8 @@
  * included in the distribution.
  *
  * $RCSfile: connect.h,v $
- * $Revision: 1.33 $
- * $Date: 2000/03/24 14:32:03 $
+ * $Revision: 1.44 $
+ * $Date: 2000/06/28 10:42:17 $
  * ------------------------------------------------------------------------*/
 
 /* --------------------------------------------------------------------------
@@ -18,6 +18,7 @@
  * Texts, Names, Instances, Classes, Types, Kinds and Modules
  * ------------------------------------------------------------------------*/
 
+extern Text  textPrelPrim;
 extern Text  textPrelude;
 extern Text  textNum;                   /* used to process default decls   */
 extern Text  textCcall;                 /* used to process foreign import  */
@@ -220,10 +221,9 @@ extern Type typeST;
 extern Type typeIO;
 extern Type typeException;
 
-
+extern Module modulePrelPrim;
 extern Module modulePrelude;
 
-
 extern Kind   starToStar;                /* Type -> Type                    */
 
 
@@ -312,6 +312,7 @@ extern Int    whnfInt;                  /* integer value of term in whnf   */
 extern Float  whnfFloat;                /* float value of term in whnf     */
 extern Long   numCells;                 /* number of cells allocated       */
 extern Int    numGcs;                   /* number of garbage collections   */
+extern int    numEnters;               /* number of enters                */
 extern Bool   preludeLoaded;            /* TRUE => prelude has been loaded */
 extern Bool   flagAssert;               /* TRUE => assert False <e> causes
                                                    an assertion failure    */
@@ -327,6 +328,9 @@ extern List   diVars;                   /* deriving: cache of names        */
 extern Int    diNum;                    /* also for deriving               */
 extern List   cfunSfuns;                /* List of (Cfun,[SelectorVar])    */
 
+extern Module moduleBeingParsed;        /* so the parser (topModule) knows */
+
+
 #if USE_PREPROCESSOR
 extern String preprocessor;             /* preprocessor command            */
 #endif
@@ -358,7 +362,7 @@ extern  Void   machdep          ( Int );
 extern  Void   liftControl      ( Int );
 extern  Void   substitution     ( Int );
 extern  Void   typeChecker      ( Int );
-extern  Void   interface        ( Int );
+extern  Void   interfayce       ( Int );
 extern  Void   storage          ( Int );
 
 
@@ -447,6 +451,7 @@ extern  Void  foreignImport     ( Cell,Text,Pair,Cell,Cell );
 extern  Void  foreignExport     ( Cell,Text,Cell,Cell,Cell );
 
 extern  Void  implementForeignImport ( Name );
+extern  Text  makeTypeDescrText      ( Type );
 extern  Void  implementForeignExport ( Name );
 
 extern  List  foreignExports;            /* foreign export declarations     */
@@ -522,20 +527,6 @@ extern FILE *outputStream;             /* current output stream            */
 extern Int  outColumn;                 /* current output column number     */
 
 
-
-/*---------------------------------------------------------------------------
- * Crude profiling (probably doesn't work)
- *-------------------------------------------------------------------------*/
-
-#ifdef CRUDE_PROFILING
-extern void cp_init             ( void );
-extern void cp_enter            ( Cell /*StgVar*/ );
-extern void cp_bill_words       ( int );
-extern void cp_bill_insns       ( int );
-extern void cp_show             ( void );
-#endif
-
-
 /*---------------------------------------------------------------------------
  * For dynamic.c and general object-related stuff
  *-------------------------------------------------------------------------*/
@@ -575,6 +566,9 @@ extern HugsBreakAction setBreakAction ( HugsBreakAction );
    to get the signal mask to a sane state each time.
 */
 #include <signal.h>
+
+#if !defined(mingw32_TARGET_OS)
+
 #define setHandler(bh)          { sigset_t mask; \
                           signal(SIGINT,bh); \
                           sigemptyset(&mask); \
@@ -582,24 +576,18 @@ extern HugsBreakAction setBreakAction ( HugsBreakAction );
                           sigprocmask(SIG_UNBLOCK, &mask, NULL); \
                         }
 
+#else
+
+#define setHandler(bh)  { void* old_hdlr = signal(SIGINT,bh);\
+                          if (old_hdlr == SIG_ERR) internal("setHandler"); \
+                         }
+
+#endif /* !defined(mingw32_TARGET_OS) */
 
 /*---------------------------------------------------------------------------
  * Environment variables and the registry
  *-------------------------------------------------------------------------*/
 
-/* On Win32 we can use the registry to supplement info in environment 
- * variables.
- */
-/* AJG: Commented out for now for development */
-/* #define USE_REGISTRY (HAVE_WINDOWS_H && !__MSDOS__) */
-
-#ifdef USE_REGISTRY
-Bool   writeRegString          ( String var, String val );
-String         readRegString           ( String var, String def );
-Int    readRegInt              ( String var, Int def );
-Bool   writeRegInt             ( String var, Int val );
-#endif
-
 #define N_INSTALLDIR 200
 extern char installDir[N_INSTALLDIR];
 
@@ -653,6 +641,8 @@ extern void     exit            ( int );
 # define filenamecmp(s1,s2) strcmp(s1,s2)
 #endif
 
+#define HI_ENDING ".u_hi"
+
 
 /*---------------------------------------------------------------------------
  * Pipe-related operations:
@@ -795,7 +785,6 @@ extern Command readCommand      ( struct cmd *, Char, Char );
  * Freevar analysis: list of free vars after
  * Lambda lifting:   freevar list or UNIT on input, discarded after
  * Code generation:  unused
- * Optimisation:     number of uses (sort-of) of let-bound variable
  * ------------------------------------------------------------------------*/
 
 typedef Cell   StgRhs;
@@ -893,16 +882,12 @@ extern  Name  implementRecShw        ( Text );
 extern  Name  implementRecEq         ( Text );
 #endif
 
-/* Association list storing globals assigned to dictionaries, tuples, etc */
-extern List stgGlobals;
-
-extern List    liftBinds        ( List binds );
+extern void    liftModule       ( Module );
 extern StgExpr substExpr        ( List sub, StgExpr e );
 extern List    freeVarsBind     ( List, StgVar );
 
 
-extern Void    cgBinds          ( StgRhs );
-extern void*   closureOfVar     ( StgVar );
+extern Void    cgModule         ( Module );
 extern char*   lookupHugsName   ( void* );