[project @ 2000-03-13 11:37:16 by sewardj]
[ghc-hetmet.git] / ghc / interpreter / errors.h
1
2 /* --------------------------------------------------------------------------
3  * Error handling support functions
4  *
5  * The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the
6  * Yale Haskell Group, and the Oregon Graduate Institute of Science and
7  * Technology, 1994-1999, All rights reserved.  It is distributed as
8  * free software under the license in the file "License", which is
9  * included in the distribution.
10  *
11  * $RCSfile: errors.h,v $
12  * $Revision: 1.6 $
13  * $Date: 2000/03/13 11:37:16 $
14  * ------------------------------------------------------------------------*/
15
16 extern Void internal     ( String) HUGS_noreturn;
17 extern Void fatal        ( String) HUGS_noreturn;
18
19 #if HUGS_FOR_WINDOWS
20 #define Hilite()         WinTextcolor(hWndText,RED);
21 #define Lolite()         WinTextcolor(hWndText,BLACK);
22 #define errorStream      stderr
23 #else
24 #define Hilite()         doNothing()
25 #define Lolite()         doNothing()
26 #define errorStream      stdout
27 #endif
28
29 #define ERRMSG(l)        Hilite(); errHead(l); FPrintf(errorStream,
30 #define EEND             ); Lolite(); errFail()
31 #define ETHEN            );
32 #define ERRTEXT          Hilite(); FPrintf(errorStream,
33 #define ERREXPR(e)       Hilite(); printExp(errorStream,e); Lolite()
34 #define ERRTYPE(e)       Hilite(); printType(errorStream,e); Lolite()
35 #define ERRCONTEXT(qs)   Hilite(); printContext(errorStream,qs); Lolite()
36 #define ERRPRED(pi)      Hilite(); printPred(errorStream,pi); Lolite()
37 #define ERRKIND(k)       Hilite(); printKind(errorStream,k); Lolite()
38 #define ERRKINDS(ks)     Hilite(); printKinds(errorStream,ks); Lolite()
39 #define ERRFD(fd)        Hilite(); printFD(errorStream,fd); Lolite()
40
41 extern Void errHead      ( Int );                  /* in main.c            */
42 extern Void errFail      ( Void) HUGS_noreturn;
43 extern Void errAbort     ( Void );
44
45 extern sigProto(breakHandler);
46
47 extern Bool breakOn      ( Bool );                 /* in machdep.c         */
48
49 extern Void printExp     ( FILE *,Cell );          /* in output.c          */
50 extern Void printType    ( FILE *,Cell );
51 extern Void printContext ( FILE *,List );
52 extern Void printPred    ( FILE *,Cell );
53 extern Void printKind    ( FILE *,Kind );
54 extern Void printKinds   ( FILE *,Kinds );
55 extern Void printFD      ( FILE *,Pair );
56
57 /*-------------------------------------------------------------------------*/