GHC new build system megapatch
[ghc-hetmet.git] / utils / hp2ps / Marks.c
1 #include "Main.h"
2 #include <stdio.h>
3 #include "Curves.h"
4 #include "Dimensions.h"
5 #include "HpFile.h"
6
7 /* own stuff */
8 #include "Marks.h"
9
10 static void Caret PROTO((floatish, floatish, floatish));
11
12 void
13 Marks()
14 {
15     intish i;
16     floatish m;
17
18     for (i = 0; i < nmarks; i++) {
19         m = ((markmap[i] - samplemap[0]) / xrange) * graphwidth;
20         Caret(xpage(m), ypage(0.0), 4.0);
21     }
22 }
23
24
25 /*
26  * Draw a small white caret at (x,y) with width 2 * d
27  */
28
29 static void
30 Caret(x,y,d)
31   floatish x; floatish y; floatish d;
32 {
33     fprintf(psfp, "%f %f moveto\n", x - d, y);
34     fprintf(psfp, "%f %f rlineto\n",  d, -d);
35     fprintf(psfp, "%f %f rlineto\n",  d,  d);
36     fprintf(psfp, "closepath\n");
37
38     fprintf(psfp, "gsave\n");
39     fprintf(psfp, "1.0 setgray\n");
40     fprintf(psfp, "fill\n");
41     fprintf(psfp, "grestore\n");
42     fprintf(psfp, "stroke\n");
43 }