e77f5c1f2884722a70daf588ba21777cd1f78264
[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.8 $
13  * $Date: 2000/03/22 18:14:22 $
14  * ------------------------------------------------------------------------*/
15
16 extern Void internal     ( String) HUGS_noreturn;
17 extern Void fatal        ( String) HUGS_noreturn;
18
19 #define Hilite()         doNothing()
20 #define Lolite()         doNothing()
21 #define errorStream      stdout
22
23 #define ERRMSG(l)        Hilite(); errHead(l); FPrintf(errorStream,
24 #define EEND             ); Lolite(); errFail()
25 #define EEND_NO_LONGJMP  ); Lolite(); errFail_no_longjmp()
26 #define ETHEN            );
27 #define ERRTEXT          Hilite(); FPrintf(errorStream,
28 #define ERREXPR(e)       Hilite(); printExp(errorStream,e); Lolite()
29 #define ERRTYPE(e)       Hilite(); printType(errorStream,e); Lolite()
30 #define ERRCONTEXT(qs)   Hilite(); printContext(errorStream,qs); Lolite()
31 #define ERRPRED(pi)      Hilite(); printPred(errorStream,pi); Lolite()
32 #define ERRKIND(k)       Hilite(); printKind(errorStream,k); Lolite()
33 #define ERRKINDS(ks)     Hilite(); printKinds(errorStream,ks); Lolite()
34 #define ERRFD(fd)        Hilite(); printFD(errorStream,fd); Lolite()
35
36 extern Void errHead            ( Int );            /* in main.c            */
37 extern Void errFail            ( Void ) HUGS_noreturn;
38 extern Void errFail_no_longjmp ( Void );
39 extern Void errAbort           ( Void );
40 extern Cell errAssert    ( Int );
41
42 extern sigProto(breakHandler);
43
44 extern Bool breakOn      ( Bool );                 /* in machdep.c         */
45
46 extern Void printExp     ( FILE *,Cell );          /* in output.c          */
47 extern Void printType    ( FILE *,Cell );
48 extern Void printContext ( FILE *,List );
49 extern Void printPred    ( FILE *,Cell );
50 extern Void printKind    ( FILE *,Kind );
51 extern Void printKinds   ( FILE *,Kinds );
52 extern Void printFD      ( FILE *,Pair );
53
54 /*-------------------------------------------------------------------------*/