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