summaryrefslogtreecommitdiff
path: root/utils/hp2ps/HpFile.h
blob: ff5a91632a8c51bf871abeed07d627f849e6ff1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once

typedef enum {
        /* These tokens are found in ".hp" files */ 
 
	EOF_TOK,
	INTEGER_TOK,
	FLOAT_TOK,
	IDENTIFIER_TOK,
	STRING_TOK,
	BEGIN_SAMPLE_TOK,
	END_SAMPLE_TOK,
	JOB_TOK, 
	DATE_TOK,
	SAMPLE_UNIT_TOK,
	VALUE_UNIT_TOK,
	MARK_TOK,
 
	/* These extra ones are found only in ".aux" files */ 
 
	X_RANGE_TOK,
	Y_RANGE_TOK,
	ORDER_TOK,
	SHADE_TOK
} token;

struct datapoint {
    int bucket;
    floatish value;
};

struct chunk {
    struct chunk *next;
    short  nd;                          /* 0 .. N_CHUNK - 1 */
    struct datapoint *d;
};


struct entry {
    struct entry *next;
    struct chunk *chk;
    char   *name;
};

extern char *theident;
extern int theinteger;
extern floatish thefloatish;
extern int ch;
extern token thetok;
extern int linenum; 
extern int endfile;

char *TokenToString PROTO((token));

extern struct entry** identtable;

extern floatish *samplemap;
extern floatish *markmap;

void GetHpFile PROTO((FILE *));
void StoreSample PROTO((struct entry *, intish, floatish));
struct entry *MakeEntry PROTO((char *));

token GetNumber PROTO((FILE *));
void  GetIdent  PROTO((FILE *));
boolish IsIdChar PROTO((int)); /* int is a "char" from getc */

extern char *jobstring;
extern char *datestring;
 
extern char *sampleunitstring;
extern char *valueunitstring;