Initial commit
[pdp8.git] / sw / plot_hpgl / pc / hpgl.h
1 #ifndef HPGL_H
2 #define HPGL_H
3 #include <stdio.h>
4
5 struct point {
6 double x;
7 double y;
8 int valid;
9 struct point * next;
10 struct point * previous_in_path;
11 };
12
13 struct path {
14 struct point * first_point;
15 struct point * last_point;
16 struct point * plot_start_point;
17 struct point * plot_end_point;
18 struct path * next;
19
20 /* Internal special stuff */
21 double dist;
22 struct path *back;
23
24 //int done;
25 };
26
27 enum hpgl_cmd_t {
28 CMD_NO_COMMAND,
29 CMD_PU,
30 CMD_PD,
31 CMD_SC,
32 CMD_IN,
33 CMD_LB,
34 CMD_DI,
35 CMD_SI,
36 CMD_SP,
37 CMD_PA,
38 CMD_PR };
39
40 enum plot_mode_t {absolute, relative};
41 enum pen_state_t {up,down};
42
43
44 #ifdef DEBUG
45
46 #define POS {fprintf(stderr,"(%s, %i) %20s(): ",__FILE__, __LINE__,__FUNCTION__);}
47 #define DBG(...) {POS; fprintf(stderr, "*** DEBUG: " __VA_ARGS__);}
48 #define ERR(...) {POS; fprintf(stderr, "*** ERROR: " __VA_ARGS__); exit(-1); }
49
50 #else
51 #define POS {}
52 #define DBG(...) {}
53 #define ERR(...) {}
54 #endif
55
56
57
58 #endif