[project @ 1996-07-19 18:36:04 by partain]
[ghc-hetmet.git] / ghc / compiler / parser / hschooks.c
1 /*
2 These routines customise the error messages
3 for various bits of the RTS.  They are linked
4 in instead of the defaults.
5 */
6 #include <stdio.h>
7
8 #define W_ unsigned long int
9 #define I_ long int
10
11 void
12 ErrorHdrHook (FILE *where)
13 {
14     fprintf(where, "\n"); /* no "Fail: " */
15 }
16
17
18 void
19 OutOfHeapHook (W_ request_size, W_ heap_size)  /* both in bytes */
20 {
21     fprintf(stderr, "GHC's heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse the `-H<size>' option to increase the total heap size.\n",
22         request_size,
23         heap_size);
24 }
25
26 void
27 StackOverflowHook (I_ stack_size)    /* in bytes */
28 {
29     fprintf(stderr, "GHC stack-space overflow: current size %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
30 }
31
32 void
33 PatErrorHdrHook (FILE *where)
34 {
35     fprintf(where, "\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@dcs.gla.ac.uk.\n\nFail: ");
36 }
37
38 void
39 PreTraceHook (FILE *where)
40 {
41     fprintf(where, "\n"); /* not "Trace On" */
42 }
43
44 void
45 PostTraceHook (FILE *where)
46 {
47     fprintf(where, "\n"); /* not "Trace Off" */
48 }