add Outputable instance for OccIfaceEq
[ghc-hetmet.git] / utils / hp2ps / Error.c
1 #include "Main.h"
2 #include <stdarg.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include "Defines.h"
6
7 /* own stuff */
8 #include "Error.h"
9
10 /*VARARGS0*/
11 void
12 Error(const char *fmt, ...)
13 {
14     va_list ap;
15     fflush(stdout);
16     fprintf(stderr, "%s: ", programname);
17     va_start(ap, fmt);
18     vfprintf(stderr, fmt, ap);
19     va_end(ap);
20     fprintf(stderr, "\n");
21     exit(1);
22 }
23
24 /*VARARGS0*/
25 void
26 Disaster(const char *fmt, ...)
27 {
28     va_list ap;
29     fflush(stdout);
30     fprintf(stderr, "%s: ", programname);
31     fprintf(stderr, " Disaster! (");
32     va_start(ap, fmt);
33     vfprintf(stderr, fmt, ap);
34     va_end(ap);
35     fprintf(stderr, ")\n");
36     exit(1);
37 }
38
39 void
40 Usage(str)
41   const char *str;
42 {
43    if (str) printf("error: %s\n", str);
44    printf("usage: %s -b -d -ef -g -i -p -mn -p -s -tf -y [file[.hp]]\n", programname);
45    printf("where -b  use large title box\n");
46    printf("      -d  sort by standard deviation\n"); 
47    printf("      -ef[in|mm|pt] produce Encapsulated PostScript f units wide (f > 2 inches)\n");
48    printf("      -g  produce output suitable for GHOSTSCRIPT previever\n");
49    printf("      -i[+|-] sort by identifier string (-i+ gives greatest on top) \n"); 
50    printf("      -M  multi-page output (key separate from graph)\n");
51    printf("      -mn print maximum of n bands (default & max 20)\n");
52    printf("          -m0 removes the band limit altogether\n");
53    printf("      -p  use previous scaling, shading and ordering\n");
54    printf("      -s  use small title box\n");
55    printf("      -tf ignore trace bands which sum below f%% (default 1%%, max 5%%)\n");
56    printf("      -y  traditional\n");
57    printf("      -c  colour ouput\n");
58    exit(0);
59 }
60