GHC new build system megapatch
[ghc-hetmet.git] / utils / hp2ps / HpFile.h
1 #ifndef HP_FILE_H
2 #define HP_FILE_H
3
4 typedef enum {
5         /* These tokens are found in ".hp" files */ 
6  
7         EOF_TOK,
8         INTEGER_TOK,
9         FLOAT_TOK,
10         IDENTIFIER_TOK,
11         STRING_TOK,
12         BEGIN_SAMPLE_TOK,
13         END_SAMPLE_TOK,
14         JOB_TOK, 
15         DATE_TOK,
16         SAMPLE_UNIT_TOK,
17         VALUE_UNIT_TOK,
18         MARK_TOK,
19  
20         /* These extra ones are found only in ".aux" files */ 
21  
22         X_RANGE_TOK,
23         Y_RANGE_TOK,
24         ORDER_TOK,
25         SHADE_TOK
26 } token;
27
28 struct datapoint {
29     int bucket;
30     floatish value;
31 };
32
33 struct chunk {
34     struct chunk *next;
35     short  nd;                          /* 0 .. N_CHUNK - 1 */
36     struct datapoint *d;
37 };
38
39
40 struct entry {
41     struct entry *next;
42     struct chunk *chk;
43     char   *name;
44 };
45
46 extern char *theident;
47 extern char *thestring;
48 extern int theinteger;
49 extern floatish thefloatish;
50 extern int ch;
51 extern token thetok;
52 extern int linenum; 
53 extern int endfile;
54
55 char *TokenToString PROTO((token));
56
57 extern struct entry** identtable;
58
59 extern floatish *samplemap;
60 extern floatish *markmap;
61
62 void GetHpFile PROTO((FILE *));
63 void StoreSample PROTO((struct entry *, intish, floatish));
64 struct entry *MakeEntry PROTO((char *));
65
66 token GetNumber PROTO((FILE *));
67 void  GetIdent  PROTO((FILE *));
68 void  GetString PROTO((FILE *));
69 boolish IsIdChar PROTO((int)); /* int is a "char" from getc */
70
71 extern char *jobstring;
72 extern char *datestring;
73  
74 extern char *sampleunitstring;
75 extern char *valueunitstring;
76
77 #endif /* HP_FILE_H */